I used Google API version 2 in my previous assignment. There I had used map.savePosition() to save the current position of map and map.returnToSavedPosition() to restore to the saved position. I have searched for the equivalent in api version 3 documentation but could not find relevant results. And if I use map.savePosition() now with api-3, javascript error tells “map.savePosition is not a function“.
Can someone please tell me what are the ways to save and restore the position of Google Map in API 3 ?
As said above, there’s no similar function in V3. It’s really easy to implement yourself.
Here’s one way:
… then just call it like:
Simple, huh?