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

Glib GIOChannel -

jsp - java.sql.SQLException: [Microsoft][ODBC Microsoft Access > Driver] Too few parameters. Expected 1 -

python - Obscure curses error message when creating a sub window -