How can I get x and y number at every click event on Google Maps?

孤人 提交于 2020-01-01 11:26:19

问题


I want to retrieve x/y coordinates at every click-event on Google Maps.

Could someone help me please?


回答1:


google.maps.event.addListener(map, "click", function (e) {
        document.form1.waypointLog.value = e.latLng.lat().toFixed(6)
        + ' |' + e.latLng.lng().toFixed(6);

}); 

Source: https://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/3f4329e3a20e7b0b

You can also check: http://forums.gpsreview.net/viewtopic.php?t=3632



来源:https://stackoverflow.com/questions/8766116/how-can-i-get-x-and-y-number-at-every-click-event-on-google-maps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!