import useMapStore from '@/store/modules/maps';

function addLayers(type) {
  let imageryLayers = useMapStore().$state.viewer.imageryLayers;
  let Cesium = useMapStore().$state.cesium;
  switch (type) {
    case "tianditu": {
      let tiditu = new Cesium.WebMapTileServiceImageryProvider({
        url: "http://t0.tianditu.gov.cn/img_w/wmts?tk=b94d96402557b0d5d2e17c5eb93610dc",
        layer: "img",
        style: "default",
        tileMatrixSetID: "w",
        format: "tiles",
        maximumLevel: 18,
        credit: '天地图'
      });
      imageryLayers.addImageryProvider(tiditu);
      break
    };
    case "google":{
      new Cesium.UrlTemplateImageryProvider({
        url: "https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s,m&gl=CN&x={x}&y={y}&z={z}",
        credit: "谷歌影像"
      })
    }
  }
}



