troubleshooting Question

Javascript Error - Uncaught TypeError: Object [object global] has no method 'handleApiReady'

Avatar of seopti
seopti asked on
JavaScript
8 Comments1 Solution1469 ViewsLast Modified:
With the Google Maps async code below I'm seeing this error:
Uncaught TypeError: Object [object global] has no method 'handleApiReady'

The code runs fine but in the console I see this error.

<script src="http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=handleApiReady"></script>

 <script type="text/javascript">
   $LAB
  	       .script("//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js")	
				    .script("/js/poiaktuell.js")
		  .script("/js/grey.js")
   .script("/js/jquery.slidetabs.min.js")
   .script("/js/jquery.slidetabs.touch.min.js")
   .script("/js/jquery-litelighter.js")

    .wait(function(){

	function handleApiReady() {

	setupAddress();
	mapDiv = document.getElementById(mapDivID);
	var myLatlng = new google.maps.LatLng(0,0);
	var myOptions = {
		zoom: zoomLevel,
			 styles: gmapGreyStyle,
		scrollwheel: true,
		disableDoubleClickZoom: true,
		center: myLatlng,
		mapTypeControl: true,
		mapTypeControlOptions: {
		  style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
		  position: google.maps.ControlPosition.BOTTOM_LEFT
		},
		zoomControl: true,
		zoomControlOptions: {
		  style: google.maps.ZoomControlStyle.LARGE,
  		  position: google.maps.ControlPosition.TOP_LEFT
		},
		panControl: false,
		mapTypeId: google.maps.MapTypeId.ROADMAP,
		overviewMapControl: true,
		overviewMapControlOptions: {
			opened: false
			}
	};
	map = new google.maps.Map(mapDiv, myOptions);
	

	if(directionsMode == 'DRIVING') {
		travMode = google.maps.DirectionsTravelMode.DRIVING;
	} else {
		travMode = google.maps.DirectionsTravelMode.WALKING;
	}
	//streetview stuff
	var tempPanorama = map.getStreetView();

	google.maps.event.addListener(tempPanorama, 'visible_changed', function() {
	    if (tempPanorama.getVisible()) {
			controlToggle("hide");
		} else {
			controlToggle("show");
	    }
	});
	
	infoBox();

	var geocoder = new google.maps.Geocoder();
    var address = startAddress;
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
   		addressSet = 1;
		searchCenter = results[0].geometry.location;
        getCategories(1);
		createMarker(searchCenter, 0, markerHTML, "pin", "pin","");
//		var trafficLayer = new google.maps.TrafficLayer();
//		trafficLayer.setMap(map);
	    google.maps.event.addListener(map, "dragend", function () {
				controlToggle("show");
			    getCategories(0);
	    });
		mobileScroll(sidebarDivID);
		if (autoGeolocation === true) {
					geotarget();
		}
		if (mapExtra === true) {
			mapPost();
		}
		}
    });

}


	$(document).ready(function() {

		  handleApiReady();
		$('pre').litelighter({clone:false, style:'light', language:'js'});
						  		
		// Auto Height
		$('#auto-height').slidetabs({
			autoHeight      : true,
			touchSupport: true,
			contentAnim: 'fadeOutIn',
			contentAnimSpeed: 100,
			autoHeightSpeed : 900
			
			
		});
  	});		
		 });
</script>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros