Hwf 6 місяців тому
батько
коміт
4220c54fbb

+ 9 - 5
src/components/Map/YztMap/index.vue

@@ -44,22 +44,26 @@ watch(
     }
   }
 );
-
+const mapList = reactive({
+  satellite2: ['YZT1715739306532', 'YZT1695608158269'],
+  satellite3: ['YZT1708679726700', 'YZT1695608158269'],
+  imageMap: ['YZT1640925052482', 'YZT1695608158269'],
+  imageMap2: ['YZT1640925052482', 'YZT1695608158269']
+});
 // 监听地图类型变化
 watch(
   () => props.activeMap,
   () => {
     if (!map) return;
-    const id = props.activeMap === 'imageMap' ? ['YZT1640925052482', 'YZT1695608158269'] : ['YZT1708679726700', 'YZT1695608158269'];
-    map.replaceLayers(id);
+    map.replaceLayers(mapList[props.activeMap]);
+    map.createVecByJson(mmJson, '茂名市');
   }
 );
 
 const init = () => {
-  const id = props.activeMap === 'imageMap' ? ['YZT1640925052482', 'YZT1695608158269'] : ['YZT1708679726700', 'YZT1695608158269'];
   map = new olMap({
     dom: mapRef.value,
-    id: id,
+    id: mapList[props.activeMap],
     center: mapState.center,
     zoom: mapState.zoom,
     minZoom: mapState.minZoom,

+ 2 - 1
src/views/globalMap/LeftMenu.vue

@@ -61,7 +61,8 @@
               >
                 <div class="text1" :title="item.name" @click="handleShowDialog(item)">{{ item.name }}</div>
                 <div class="tags">
-                  <div v-for="(item2, index2) in item.tags" :key="index2" class="tag">{{ item2.name }}</div>
+                  <div class="tag">{{ item.dict_label }}</div>
+                  <!--                  <div v-for="(item2, index2) in item.tags" :key="index2" class="tag">{{ item2.name }}</div>-->
                 </div>
               </div>
               <div v-show="searchState.showList && searchState.videoList.length === 0" style="text-align: center">无数据</div>

+ 10 - 8
src/views/globalMap/SwitchMapTool.vue

@@ -28,11 +28,12 @@ const props = withDefaults(defineProps<Props>(), {});
 
 const emits = defineEmits(['switchMap']);
 const mapData = ref([
-  // { name: '逻辑地图', key: 'logical' },
-  { name: '卫星地图', key: 'satellite' },
-  { name: '矢量地图', key: 'vectorgraph' },
-  // { name: '影像图', key: 'imageMap' }
-  // { name: '粤政图2', key: 'satellite3' }
+  { name: '卫星图', key: 'satellite' },
+  { name: '业务图', key: 'vectorgraph' },
+  { name: '地形图', key: 'satellite3' },
+  { name: '流域图', key: 'satellite2' },
+  { name: '影像图', key: 'imageMap' },
+  { name: '简版图', key: 'imageMap2' }
 ]);
 let open = ref(false);
 const selectItem = (key) => {
@@ -105,9 +106,6 @@ const handleExpand = () => {
     justify-content: center;
     align-items: center;
     margin: 0 12px;
-    &:nth-child(2) {
-      margin-left: 24px;
-    }
   }
   .item-bg1 {
     position: relative;
@@ -132,6 +130,10 @@ const handleExpand = () => {
     background: url('@/assets/images/map/satellite2.png') no-repeat;
     background-size: 100% 100%;
   }
+  .imageMap2 {
+    background: url('@/assets/images/map/satellite3.png') no-repeat;
+    background-size: 100% 100%;
+  }
   .satellite2 {
     background: url('@/assets/images/map/satellite2.png') no-repeat;
     background-size: 100% 100%;

+ 6 - 1
src/views/globalMap/index.vue

@@ -2,7 +2,12 @@
   <div id="globalMap">
     <div class="global-map">
       <MapLogical v-if="activeMap === 'logical'" :map-data="mapData" />
-      <YztMap v-else-if="['imageMap'].includes(activeMap)" ref="map2Ref" :active-map="activeMap" :point-type="pointType" />
+      <YztMap
+        v-else-if="['satellite2', 'satellite3', 'imageMap', 'imageMap2'].includes(activeMap)"
+        ref="map2Ref"
+        :active-map="activeMap"
+        :point-type="pointType"
+      />
       <Map
         v-else
         ref="mapRef"