Explorar o código

更改雨量站点击效果

chc hai 1 ano
pai
achega
7459cfbf39
Modificáronse 4 ficheiros con 66 adicións e 71 borrados
  1. BIN=BIN
      public/static/img/siteimg/yuliang2.png
  2. 6 1
      src/utils/TFMapUitl.ts
  3. 59 70
      src/views/map/Map.vue
  4. 1 0
      src/views/map/toolBox.vue

BIN=BIN
public/static/img/siteimg/yuliang2.png


+ 6 - 1
src/utils/TFMapUitl.ts

@@ -263,11 +263,14 @@ class TFMapUitl {
    */
   clearPointLocation_list(map) {
     if(window.breathMarker){
+      window.breathMarker.update()
       window.breathMarker.breathe()
       window.breathMarker=null
     }
     window.impointFlag=true
-    window.getImportSites()
+    if(!window.isThematicMap){
+      window.getImportSites()
+    } 
     this.active();
     map.viewer.entities.removeById(this.PointLocation_listId);
     map.removeOverlay(this.bwClass);
@@ -767,10 +770,12 @@ class TFMapUitl {
  */
   setSTMarkerPopup(e) {
     if(window.breathMarker){
+      window.breathMarker.update()
       window.breathMarker.breathe()
       window.breathMarker=null
     }
     if (e && e.graphic && e.graphic.overlay) {
+        e.graphic.overlay.update()
         e.graphic.overlay.breathe(0,0)
         window.breathMarker=e.graphic.overlay
     }

+ 59 - 70
src/views/map/Map.vue

@@ -291,11 +291,13 @@ export default defineComponent({
           // console.log(marker.info, 74);
           marker.addListener(map, (e) => {
             if(window.breathMarker){
+                window.breathMarker.update()
                 window.breathMarker.breathe()
                 window.breathMarker=null
               }
               if (e && e.graphic && e.graphic.overlay) {
-                  e.graphic.breathe(0,0.3)
+                e.graphic.overlay.update()
+                e.graphic.overlay.breathe(-0.3,0.3)
                   window.breathMarker=e.graphic.overlay
               }
             var i = e.graphic.overlay.info
@@ -379,11 +381,12 @@ export default defineComponent({
           // console.log(marker.info, 74);
           marker.addListener(map, (e) => {
             if(window.breathMarker){
+                window.breathMarker.update()
                 window.breathMarker.breathe()
                 window.breathMarker=null
               }
               if (e && e.graphic && e.graphic.overlay) {
-                  e.graphic.overlay.breathe(0,0.3)
+                  e.graphic.overlay.breathe(-0.3,0.3)
                   window.breathMarker=e.graphic.overlay
               }
             var i = e.graphic.overlay.info
@@ -510,7 +513,11 @@ export default defineComponent({
                 console.log(i,887)
                     // siteDetail(i);
                     // 高亮点
-                    window.breathMarker&& window.breathMarker.breathe();window.breathMarker=null
+                    if(window.breathMarker){
+                  window.breathMarker.update()
+                  window.breathMarker.breathe();
+                  window.breathMarker=null
+                }
                     window.breathMarker=map.findOverlay(`gcd&${i.stcd}`)
                     window.breathMarker.breathe(0,0.3)
               }
@@ -562,11 +569,17 @@ export default defineComponent({
               () => {
                 // siteDetail(i);
                 // 高亮点
-                window.breathMarker&& window.breathMarker.breathe();window.breathMarker=null
+                if(window.breathMarker){
+                  window.breathMarker.update()
+                  window.breathMarker.breathe();
+                  window.breathMarker=null
+                }
                 window.breathMarker=map.findOverlay(`gcd&${i.stcd}`)
                 if(i.st_type == 1||i.st_type==2||i.st_type==4){
+                  window.breathMarker.update()
                   window.breathMarker.breathe(0,0.3)
                 }else{
+                  window.breathMarker.update()
                   window.breathMarker.breathe()
                 }
                 
@@ -1738,10 +1751,12 @@ export default defineComponent({
             marker.info = i;
             marker.addListener(map, e => {
               if(window.breathMarker){
+                window.breathMarker.update()
                 window.breathMarker.breathe()
                 window.breathMarker=null
               }
               if (e && e.graphic && e.graphic.overlay) {
+                  e.graphic.overlay.update()
                   e.graphic.overlay.breathe(0,0.3)
                   window.breathMarker=e.graphic.overlay
               }
@@ -1771,10 +1786,12 @@ export default defineComponent({
             marker.info = i;
             marker.addListener(map, e =>{
               if(window.breathMarker){
+                window.breathMarker.update()
                 window.breathMarker.breathe()
                 window.breathMarker=null
               }
               if (e && e.graphic && e.graphic.overlay) {
+                  e.graphic.overlay.update()
                   e.graphic.overlay.breathe(0,0.3)
                   window.breathMarker=e.graphic.overlay
               }
@@ -1789,38 +1806,39 @@ export default defineComponent({
         } else if (i.st_type == 4) {
           i.typeName = '雨量站';
           if (i.lat && i.lng) {
-            let canvas = document.createElement('canvas');
-            let context = canvas.getContext('2d');
-            let textWidth = 14;
-            canvas.width = 20;
-            canvas.height = 20;
-            let x = 0.8;
-            let y = 0.8;
-            let w = canvas.width;
-            let h = canvas.height;
-            let r = 5;
-            // 缩放
-            context.scale(0.8, 0.8);
-            // context.fillStyle = 'rgba(0,0,0,0.5)'
-            context.fillStyle = '#e7e7e7';
-            // context.fillStyle = 'rgba(231, 231, 231,0.9)'
-            // 阴影
-            context.shadowOffsetX = 5;
-            context.shadowOffsetY = 5;
-            context.shadowBlur = 2;
-            context.shadowColor = 'rgba(0,0,0,0.5)';
-            // 绘制圆角矩形
-            context.beginPath();
-            context.arc(w, h, r, 0, 2 * Math.PI);
-            context.closePath();
-            context.fill();
-
-            var marker = new TFMap.Marker({ x: i.lng, y: i.lat, z: i.high }, canvas, {
+            // let canvas = document.createElement('canvas');
+            // let context = canvas.getContext('2d');
+            // let textWidth = 14;
+            // canvas.width = 20;
+            // canvas.height = 20;
+            // let x = 0.8;
+            // let y = 0.8;
+            // let w = canvas.width;
+            // let h = canvas.height;
+            // let r = 5;
+            // // 缩放
+            // context.scale(0.8, 0.8);
+            // // context.fillStyle = 'rgba(0,0,0,0.5)'
+            // context.fillStyle = '#e7e7e7';
+            // // context.fillStyle = 'rgba(231, 231, 231,0.9)'
+            // // 阴影
+            // context.shadowOffsetX = 5;
+            // context.shadowOffsetY = 5;
+            // context.shadowBlur = 2;
+            // context.shadowColor = 'rgba(0,0,0,0.5)';
+            // // 绘制圆角矩形
+            // context.beginPath();
+            // context.arc(w, h, r, 0, 2 * Math.PI);
+            // context.closePath();
+            // context.fill();
+
+            var marker = new TFMap.Marker({ x: i.lng, y: i.lat, z: i.high }, './static/img/siteimg/yuliang.png', {
               scale: 1.2,
             })
-              // .action('./static/img/gc2.png')
+              .action('./static/img/siteimg/yuliang2.png')
               .init()
               .pierce();
+
             marker.setId('gcd&' + i.stcd);
             const tempClass = TFMapUitl.getId('gcd', i.stcd) + '*' + ',' + TFMapUitl.specialControl.yuliangzhan;
             marker.setClassify(tempClass);
@@ -1829,10 +1847,12 @@ export default defineComponent({
             marker.info = i;
             marker.addListener(map, e => {
               if(window.breathMarker){
+                window.breathMarker.update()
                 window.breathMarker.breathe()
                 window.breathMarker=null
               }
               if (e && e.graphic && e.graphic.overlay) {
+                  e.graphic.overlay.update()
                   e.graphic.overlay.breathe(0,0.3)
                   window.breathMarker=e.graphic.overlay
               }
@@ -1879,10 +1899,12 @@ export default defineComponent({
             marker.info = i;
             marker.addListener(map, e => {
               if(window.breathMarker){
+                window.breathMarker.update()
                 window.breathMarker.breathe()
                 window.breathMarker=null
               }
               if (e && e.graphic && e.graphic.overlay) {
+                  e.graphic.overlay.update()
                   e.graphic.overlay.breathe(0,0.3)
                   window.breathMarker=e.graphic.overlay
               }
@@ -1911,10 +1933,12 @@ export default defineComponent({
             marker.info = i;
             marker.addListener(map, e => {
               if(window.breathMarker){
+                window.breathMarker.update()
                 window.breathMarker.breathe()
                 window.breathMarker=null
               }
               if (e && e.graphic && e.graphic.overlay) {
+                  e.graphic.overlay.update()
                   e.graphic.overlay.breathe(0,0)
                   window.breathMarker=e.graphic.overlay
               }
@@ -2074,6 +2098,8 @@ export default defineComponent({
       window.getImportSites=function (){
         window.impointInterval&&clearInterval(window.impointInterval)
         window.impointFlowInterval&&clearInterval(window.impointFlowInterval)
+        window.impointDataLength=0
+        window.impointDataLengthNow=0
         if(window.impointFlag&&!window.impointNotShow){
           getImportPoint().then(res=>{
                   if(res.code==200&&res.data){
@@ -2226,43 +2252,7 @@ export default defineComponent({
                         }
                       })
                     })
-                    // 单独记录每一个的指标数量和当前滚动位置
-                    // window.indexNumInfo=[]
-                    // window.impoint&&window.impoint.forEach(i=>{
-                    //           // console.log(i,'8383')
-                    //           window.indexNumInfo.push({
-                    //             impointDataLengthNow:0,
-                    //             impointDataLength:i.info.sensor.length?i.info.sensor.length:0
-                    //           })
-                    //         })
-                        // 指标滚动
-                        window.impointFlowInterval=
-                          setInterval(()=>{
-                            // window.indexNumInfo&&window.indexNumInfo.forEach((i,index)=>{
-                            //     if(i.impointDataLengthNow<i.impointDataLength-1){
-                            //     i.impointDataLengthNow++
-                            //   }else{
-                            //     i.impointDataLengthNow=0
-                            //   }
-                            //   jquery(`.impopup`).eq(index).children().css({'margin-top':`-${52*i.impointDataLengthNow}px`})
-                            // })
-                            if(window.impointDataLength){
-                              if(window.impointDataLengthNow<window.impointDataLength-1){
-                                window.impointDataLengthNow++
-                              }else{
-                                window.impointDataLengthNow=0
-                              }
-                                jquery('.impopup-content').css({'margin-top':`-${52*window.impointDataLengthNow}px`})
-                                 // 隐藏空白
-                                 window.impoint.forEach(i=>{
-                                if(i.info.data_real.length-1<window.impointDataLengthNow){
-                                    document.getElementById(i.id).style.display='none'
-                                  }else{
-                                    document.getElementById(i.id).style.display='block'
-                                  }
-                                })
-                              }                              
-                            },5000)  
+
                   }
                 })
              }
@@ -2287,7 +2277,6 @@ export default defineComponent({
                 })
                 window.impoint=[]
               }
-        
       }
       // 
       // 获取测站并更新测站高程

+ 1 - 0
src/views/map/toolBox.vue

@@ -489,6 +489,7 @@ export default defineComponent({
       } else if (i == 0) {
         this.flyHome();
         if(window.breathMarker){
+                window.breathMarker.update()
                 window.breathMarker.breathe()
                 window.breathMarker=null
               }