开发者

Google maps panTo

I'm a web designer and working on my new portfolio site, come across a problem.

Using gowallas api to pull in my latest checked in spots. I have got them put onto a google map, but for some reason when you click on the links below i want the map to do a panTo, ca开发者_运维百科n someone help?

The page is here: http://test.phawk.co.uk/mail/

Need any more info don't hesitate to ask.

Cheers, Pete


Assuming you're using the latest v3 API:

var myLatlng = new google.maps.LatLng(-34.397, 150.644);
map.panTo(myLatlng);

EDIT: actually change this in your code:

$('li.marker a').click(function () {
    var nLtLg = $(this).attr('rel');
    arrLatLng = nLtLg.split(',');

    var newlatlng = new google.maps.LatLng(arrLatLng[0], arrLatLng[1]);
    map.panTo(newlatlng);
    return false;
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜