Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps panTo AND setCenter

Tags:

google-maps

The default panTo only pans to the edge of the screen.
I like setCenter but would like to pan to that point. Any ideas welcome

   map.setCenter(mymarker.getPoint());

   GEvent.trigger(mymarker,"click"); //open the info window
like image 763
Harry Avatar asked Jun 05 '10 15:06

Harry


1 Answers

Fixed Code - First pan to center then open infowindow after 2 seconds

   map.panTo(mymarker.getPosition());

   window.setTimeout(function(){GEvent.trigger(mymarker,"click");},2000);
like image 63
Harry Avatar answered Oct 02 '22 14:10

Harry