I'm getting the following error (show with stack trace) after my code
completes:
1. Uncaught TypeError: Cannot read property 'type' of undefined
1.
Vcmain.js:7<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
2. (anonymous function)
3.
Ve.mainmain.js:40<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
4. (anonymous
function)main.js:25<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
5.
bmain.js:11<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
6. Se.(anonymous
function).kcmain.js:25<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
7.
Mmain.js:9<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
8. Se.(anonymous
function).kcmain.js:25<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
9. Re.(anonymous
function).Kdmain.js:24<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
10. Se.(anonymous
function).kcmain.js:25<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
11.
Wemain.js:25<https://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/16/main.js>
12. (anonymous
function)%7Bcommon,util,controls,places_impl%7D.js:1<https://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/7/9/%7Bcommon,util,controls,places_impl%7D.js>
Here's my js code (pretty straightforward):
$(function() {
var loc = new google.maps.LatLng($('#map_canvas').attr('lat'),
$('#map_canvas').attr('lng'));
var maxZoomService = new google.maps.MaxZoomService();
maxZoomService.getMaxZoomAtLatLng(loc, function(response) {
// zoom to maxZoom - 1 if we can determine it, 14 otherwise
var zoom = (response.status == google.maps.MaxZoomStatus.OK) ?
(response.zoom - 1) : 14;
var mapOptions = {
center: loc,
zoom: zoom,
mapTypeId: google.maps.MapTypeId.SATELLITE};
var myMap = new
google.maps.Map(document.getElementById("map_canvas"), mapOptions);
});
});
What makes this difficult to debug is that the TypeError happens deep
inside the google.maps.__gjsload__ code, long after my code has returned.
I can't figure out what state my code is creating that is causing the
google library code to choke.
Any ideas, or suggestions on how to debug?
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-maps-js-api-v3/-/NDVqO_jXaDcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.