Browse Source

切换底图组件

shuhao 1 month ago
parent
commit
39b561ca00

+ 2 - 2
src/components/static_map_change/Layers.js

@@ -53,7 +53,7 @@ class StaticMapLayers {
                     that.layerData[key] = {legend:item.legend, layer:that.addStaticImgLayer(map, item)}
                 }
             }
-            that.autoTest()
+            // that.autoTest()
         })
     }
     show(key,isFit = false){
@@ -121,7 +121,7 @@ class StaticMapLayers {
         }
         let index = 0
         setTimeout(() => {
-            that.show("作物种类",true)
+            that.show("长势等级0",true)
             index = (index + 1) % keys.length
 
         }, 2000);

+ 11 - 14
src/components/static_map_change/legend.vue

@@ -4,21 +4,18 @@
       <div class="color-bar-big" v-if="background" :style="{ background: background }"></div>
     </div>
     <div class="legend">
-      <img v-if="legendImg" :src="legendImg" />
-      <template v-else>
-        <div class="color-bar" v-if="background" :style="{ background: background }"></div>
-        <div class="labels">
-          <div
-              class="level"
-              v-for="(level, index) in levels"
-              :key="index"
-              :style="{ left: `${(index / (levels.length - 1)) * 100}%` }"
-          >
-            <div class="tick"></div> <!-- 添加刻度 -->
-            <div class="label">{{ level }}</div> <!-- 将标签内容放入一个新的div中 -->
-          </div>
+      <div class="color-bar" v-if="background" :style="{ background: background }"></div>
+      <div class="labels">
+        <div
+            class="level"
+            v-for="(level, index) in levels"
+            :key="index"
+            :style="{ left: `${(index / (levels.length - 1)) * 100}%` }"
+        >
+          <div class="tick"></div> <!-- 添加刻度 -->
+          <div class="label">{{ level }}</div> <!-- 将标签内容放入一个新的div中 -->
         </div>
-      </template>
+      </div>
     </div>
   </div>
 </template>