jeudi 22 octobre 2015

Google Maps Api :set the center of map to different coordinates after rendering

I want to change the center of google map after some time interval so that it can focus on certain areas of the whole continent having markers showing restaurants branches. I have successfully rendered the map with markers. What i am having problem is changing the center looping through a list of latitude and longitude. I am trying to do something like this.

var lat[];
        var lang[];

            function moveToLocation(){
                var center = new google.maps.LatLng(lat, lng);
                map.panTo(center);
            }

             setInterval(moveToLocation, 3000);  




Aucun commentaire:

Enregistrer un commentaire