开发者

Looking for script to get coords from a google map

I have bee开发者_开发问答n looking for a script which lets you search a map for a location and lets you click the map to put the clicked coordinates into a form. So far I have had no luck!

Any ideas? Thanks!


using v3 api to click on the map and get the lat/lng of the location:

google.maps.event.addListener(map, 'click', function(e){
    alert('lat: ' + e.latLng.lat() + ' lng: ' + e.latLng.lng());
})

see example http://jsfiddle.net/6aGf7/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜