I wanted to retain the user's zoom when I update the markers on a map.
I found other posts and used the following code snippets:
//to get what the user clicked
GEvent.addListener(map, 'zoomend', function(){
var center = map.getCenter();
var zoom = map.getZoom();
alert([center.lat(), center.lng(), zoom].join(','));
});
//to set the zoom/pan level based on the user clicks
//I used the following for default
//and updated this with the user setting (not shown)
map.setCenter(new GLatLng(37.0, -120.0), 6)
This works fine. The issue with this is that when I refresh my
markers I want to show the zoomed level but when the user clicks on
the pan/hand button, I want the map to revert to the default set
center above (a map of CA). I can set the center to the default to
make the hand go to the map of CA, but how do I retain the map view
that the user was at? Any help/insights would be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---