javascript - Auto center the marker on google maps -


i have marker on google maps on website. want marker @ center of map whether zoom in or zoom out.

in sense, lets marker @ boston , zoom level of map in such way can see whole massachusetts state, no matter @ part of state zoom into, boston should @ center of map newer zoomed level, same thing should happen when zoom out.

from google docs

 google.maps.event.addlistener(map, 'center_changed', function() { // 3 seconds after center of map has changed, pan // marker. window.settimeout(function() {   map.panto(marker.getposition()); }, 3000); 

});

you can use center map on event map.setcenter(marker.getposition());


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -