如何在Google地图上的每次点击事件中获得x和y号码? [英] How can I get x and y number at every click event on Google Maps?

查看:138
本文介绍了如何在Google地图上的每次点击事件中获得x和y号码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Google地图上的每次点击事件中检索x / y坐标。



有人可以帮我吗?

预先感谢您。

解决方案

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

});

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



您也可以查看: http:/ /forums.gpsreview.net/viewtopic.php?t=3632


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

Could someone help me please?

Thank you in advance.

解决方案

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

这篇关于如何在Google地图上的每次点击事件中获得x和y号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆