1

how can it be done like in here :

http://www.360cities.net/map#lat=-25.87899&lng=-42.45117&zoom=4

Every time we move and zoom in the map, the url dynamically updates .

Thanks

1 Answer 1

2

It's not difficult, observe the bounds_changed-event of the map and when it fires retrieve the map-properties and assign them to the hash-property of the location-object:

    google.maps.event.addListener(map, 'bounds_changed',function(){
      location.hash='lat='+this.getCenter().lat().toFixed(6)+
                    '&lng='+this.getCenter().lng().toFixed(6)+
                    '&zoom='+this.getZoom();

    });
1
  • Fantastic ! That´s it! Eternal gratitude :)
    – Filipe
    Apr 15, 2013 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.