zoukankan      html  css  js  c++  java
  • WebMercator和geographic互相转换

    方法1:esri的sdk中包含的方法:esri.geometry.geographicToWebMercator()

    方法2:自己转换

    //经纬度转Web墨卡托
    function lonLat2WebMercator(wx,wy){
        var x = wx *20037508.34/180;
        var y = Math.log(Math.tan((90+wy)*Math.PI/360))/(Math.PI/180);
        y = y * 20037508.34/180;
        return {x:x,y:y};
    }
    //Web墨卡托转经纬度
    function WebMercator2lonLat(cx,cy){
        var x = cx/20037508.34*180;
        var y = cy/20037508.34*180;
        y = 180/Math.PI*(2*(Math.exp(y*Math.PI/180))-Math.PI/2);
        return {x:x,y:y};
    }
  • 相关阅读:
    【学习笔记】最小表示法
    bzoj1912【Apio2010】patrol 巡逻
    hdu1057
    hdu1056
    hdu1055
    hdu1054
    hdu1053
    hdu1052
    hdu1051
    hdu1050
  • 原文地址:https://www.cnblogs.com/tiandi/p/10902341.html
Copyright © 2011-2022 走看看