Google maps panTo AND setCenter

By default, panTo only fits to the edge of the screen.
I like setCenter, but I would like to jump to this point. Any ideas are welcome

   map.setCenter(mymarker.getPoint());

   GEvent.trigger(mymarker,"click"); //open the info window
+5
source share
1 answer

Fixed code . First select pan to center, then close the window after 2 seconds.

   map.panTo(mymarker.getPosition());

   window.setTimeout(function(){GEvent.trigger(mymarker,"click");},2000);
+7
source

All Articles