【问题标题】:How to convert the coordinates of the mouse on the page to map google coordinates如何将鼠标在页面上的坐标转换为地图google坐标
【发布时间】:2016-07-08 07:45:11
【问题描述】:

如何将鼠标在页面上的坐标转换为google地图坐标(latlng对象)

【问题讨论】:

    标签: javascript google-maps


    【解决方案1】:

    用户mousemoveevent.latLng检测坐标:http://jsfiddle.net/shagabutdinov/voz2n65a/1/

    【讨论】:

      【解决方案2】:

      你可以使用这个例子:

          google.maps.event.addListener(map, "rightclick", function(event) {
            var lat = event.latLng.lat();
            var lng = event.latLng.lng();
            // populate yor box/field with lat, lng
            alert("Lat=" + lat + "; Lng=" + lng);
          });
      

      但你使用“鼠标悬停”事件 (https://developers.google.com/maps/documentation/javascript/events)

      【讨论】:

        猜你喜欢
        • 2019-11-04
        • 2012-09-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-06
        相关资源
        最近更新 更多