【Leaflet】鼠標提取坐標


    map.on('mousemove', function (e) {
        document.getElementById('info').innerHTML = /* innerHTML 屬性設置或返回表格行的開始和結束標簽之間的 HTML  */
            // e.point is the x, y coordinates of the mousemove event relative
            // to the top-left corner of the map
            JSON.stringify(e.containerPoint) + '<br />' +
            // e.lngLat is the longitude, latitude geographical position of the event
            JSON.stringify(e.latlng); /* JSON.stringify() 方法可以將任意的 JavaScript 值序列化成 JSON 字符串 */
    });

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM