openalayer在4528下加载天地图

import Tile from 'ol/layer/Tile'
import XYZ from 'ol/source/XYZ'

const OlSetting= {}
OlSetting.TDT_TYPES = {
  'VEC_C': 'vec_c',  //矢量经纬度
  'VEC_W': 'vec_w', //矢量球面墨卡托
  'CVA_C': 'cva_c',//矢量经纬度标注
  'CVA_W': 'cva_w',//矢量球面墨卡托标注
  'IMG_C': 'img_c',//影像经纬度
  'IMG_W': 'img_w',//影像球面墨卡托
  'CIA_C': 'cia_c',//影像经纬度标注
  'CIA_W': 'cia_w',//影像球面墨卡托标注
};


OlSetting.TDTLayerUtils = function (_type) {
  return new Tile({
    source: new XYZ({
      crossOrigin: 'anonymous',
      url: `http://t6.tianditu.gov.cn/DataServer?T=${_type}&X={x}&Y={y}&L={z}&tk=78123a257f55ebe2cd39b5eb080b8910`
    })
  })
}

 

posted @ 2021-01-27 19:11  昜木辰deブログ  阅读(157)  评论(0编辑  收藏  举报