瀏覽代碼

卫星图逻辑调整

Hwf 7 月之前
父節點
當前提交
a6c5843293
共有 2 個文件被更改,包括 3 次插入4 次删除
  1. 0 1
      src/components/Map/index.vue
  2. 3 3
      src/hooks/AMap/useAMap.ts

+ 0 - 1
src/components/Map/index.vue

@@ -82,7 +82,6 @@ const mapUtils = useAMap({
     AMap = getAMap();
     map = getMap();
     scale = getScale();
-    debugger
     if (!['logical', 'vectorgraph'].includes(props.activeMap)) {
       switchMap(props.activeMap);
     } else {

+ 3 - 3
src/hooks/AMap/useAMap.ts

@@ -75,7 +75,7 @@ export function useAMap(options) {
     if (type === 'vectorgraph') {
       map.removeLayer(nowLayer);
     } else if (type === 'satellite') {
-      const wms = new AMap.TileLayer.WMTS({
+      const satellite = new AMap.TileLayer.WMTS({
         // url: 'http://t0.tianditu.gov.cn/img_c/wmts',
         url: 'http://t4.tianditu.gov.cn/img_w/wmts',
         blend: false,
@@ -89,10 +89,10 @@ export function useAMap(options) {
           tk: 'a8df87f1695d224d2679aa805c1268d9' // 申请的天地图开发者key
         }
       });
-      wms.setMap(map);
+      satellite.setMap(map);
       // const satellite = new AMap.TileLayer.Satellite();
       // map.addLayer(satellite);
-      // nowLayer = satellite;
+      nowLayer = satellite;
     }
   };
   // 添加搜索的标记的