zoukankan      html  css  js  c++  java
  • 常用的坐标系定义方法

    import proj4 from "proj4";
    import {register} from "ol/proj/proj4";
    import {Projection} from "ol/proj";
    
    
    function  definedProjection  (_epsg) {
      let projection;
      switch (_epsg) {
        case 'EPSG:4528':
          proj4.defs("EPSG:4528", "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs");
          register(proj4);
          projection = new Projection({
            code: 'EPSG:4528',
            extent: [37520456.55526686, 1773540.5950746932, 43213597.20383039, 5379752.8534023315],
            units: 'm'
          });
          break;
        case 'EPSG:4490':
          proj4.defs("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs");
          register(proj4);
          projection = new Projection({
            code: 'EPSG:4490',
            extent: [-180, -90, 180, 90],
            units: 'degree'
          });
          break;
        case 'EPSG:4326':
          proj4.defs("EPSG:4326", "+proj=longlat +datum=WGS84 +no_defs");
          register(proj4);
          projection = new Projection({
            code: 'EPSG:4326',
            extent: [-180, -90, 180, 90],
            units: 'degree'
          });
          break;
        case 'EPSG:3857':
          proj4.defs("EPSG:3857", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs");
          register(proj4);
          projection = new Projection({
            code: 'EPSG:3857',
            extent: [-20026376.39 - 20048966.10, 20026376.39, 20048966.10],
            units: 'm'
          });
          break;
      }
      return projection;
    }
  • 相关阅读:
    DNS bind9安装
    DHCP服务器
    RAID
    LVM
    box-pack
    display:flex和display:box布局浏览器兼容性分析
    Flex布局
    几种常见的浏览器以及内核
    display 垂直居中
    font-family 定义的最后为什么要加一句sans-serif
  • 原文地址:https://www.cnblogs.com/yangzhengier/p/14336512.html
Copyright © 2011-2022 走看看