[英]Get latitude and longitude of a certain point by a click in Google Maps HTML
我想知道是否有什么办法,当我单击使用Google Maps API以HTML格式在Google Map中创建的地图时,可以得到该点的“纬度”和“经度”并使用这些值?
Simple example to attach an event handler on the click event to return the lat, lon... 一个简单的示例,将事件处理程序附加到click事件上,以返回经纬度...
google.maps.event.addListener(map, 'click', function( event ){
alert( "Latitude: "+event.latLng.lat()+" "+", longitude: "+event.latLng.lng() );
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.