chc 1 anno fa
parent
commit
786cf6c11b
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      src/views/map/changeMap.vue

+ 3 - 2
src/views/map/changeMap.vue

@@ -187,12 +187,13 @@ eventBus.on('rainLegend2', (e) => {
       let maxIndex=0
       colors.forEach((i,index)=>{
         if(e.min<i.max&&e.min>=i.min){
-          minIndex=index
+          maxIndex=index
         }
         if(e.max<i.max&&e.max>=i.min){
-          maxIndex=index
+          minIndex=index
         }
       })
+      debugger
       rainLegendNow2.value = colors.slice(minIndex, maxIndex + 1);
   // if (Number(e.max) > 0.5) {
   //   let level1 = Number(((e.max - 0.5) / 3 + 0.5).toFixed(2))