开发者

Looking for script to get coords from a google map

开发者 https://www.devze.com 2023-02-26 00:34 出处:网络
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!

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

精彩评论

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