I've got a map that is drawn when the page loads. There is a single
marker on it. If a user clicks a button somewhere else on the page, I
want to move the map to show the new place. (It's not the typical
list control, it's a single button that rotates through a list of map
coordinates/types/zoom settings.)
This is my code to reposition the existing map (which is stored in the
global variable map_view):
function map_view_reposition(map) {
if (map.lat) {
if (map_view == null) { map_view_initialize(); }
var point = new google.maps.LatLng(map.lat, map.lng);
map_view.setCenter(point, parseInt(map.zoom));
marker_view = new google.maps.Marker(point, {draggable:
false});
map_view.addOverlay(marker_view);
if (map.maptype) {
map_view.setMapType(map_view.getMapTypes()
[parseInt(maptype)]);
}
else {
map_view.setMapType(G_SATELLITE_MAP);
}
}
}
it is crashing when I get to the "map_view.setCenter()" call with:
d is undefined
http://localhost:4343/js/ui.js/eval/5fD0JXbELszSa%2Fmw%2BLKkqA%3D%3D
Line 4294964889
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
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-API?hl=en
-~----------~----~----~----~------~----~------~--~---