简体   繁体   中英

How to draw graphics on Google Map from Web Mercator Meters/Feet

I used to draw graphics on Google Map from decimal degrees (latlng), but recently I found a server that only provide Web Mercator meters (or feet perhaps). Then I found the function to draw decimal degrees does not apply to Web Mercator meters:

        //this works well
        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(40, -100),
            map: MAP
        });
        //this does not work
        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(-9076798, 3012626),
            map: MAP
        });

Please help me solve this problem. I know there is no simple equation to convert decimal degrees to state plane meters/feet. Thanks.

解决了,只需添加ESRI API并使用其功能即可: https : //developers.arcgis.com/javascript/jsapi/esri.geometry.webmercatorutils-amd.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM