温红权 před 3 roky
rodič
revize
0cc7fd3ff1

+ 3 - 1
ruoyi-ui/src/components/map/index.vue

@@ -826,7 +826,7 @@ export default {
 
         },
 
-        addpoint: function(addrArry, data, img, type) {
+        addpoint: function(addrArry, data, img, type,rotation=0) {
             var lnglat = this.transpoints(addrArry, 0)[0];
 
             let tamarker = new Feature({
@@ -836,12 +836,14 @@ export default {
                     data: data,
                     type: type
                 }, //这里是用来传值用的,在接下来的一章里(事件)中我会讲到。
+
                 geometry: new Point(lnglat) //这里是点坐标的位置,这里要注意fromLonLat
             });
             tamarker.setStyle(
                 new Style({
                     image: new Icon({
                         color: "#eee",
+                        rotation:rotation,
                         crossOrigin: "anonymous",
                         src: require("../../assets/images/icon/" + img) //本地的样式
                     })

+ 8 - 8
ruoyi-ui/src/views/components/table/homeTable.vue

@@ -202,11 +202,11 @@ export default {
         {"name": "润扬大桥光谱2", "locations": [[119.369724, 32.204459]]},
       ],
       ship: [
-        // {"name": "一号船", "locations": [[118.639711, 31.96602]], 'type': 1},
-        // {"name": "二号船", "locations": [[118.649839, 31.970352]], 'type': 2},
-        // {"name": "三号船", "locations": [[118.638466, 31.970716]], 'type': 1},
-        // {"name": "四号船", "locations": [[118.643402, 31.961505]], 'type': 3},
-        // {"name": "五号船", "locations": [[118.64941, 31.973519]], 'type': 2},
+        {"name": "一号船", "locations": [[118.639711, 31.96602]], 'type': 1},
+        {"name": "二号船", "locations": [[118.649839, 31.970352]], 'type': 2},
+        {"name": "三号船", "locations": [[118.638466, 31.970716]], 'type': 1},
+        {"name": "四号船", "locations": [[118.643402, 31.961505]], 'type': 3},
+        {"name": "五号船", "locations": [[118.64941, 31.973519]], 'type': 2},
       ]
     }
   }, mounted() {
@@ -231,7 +231,7 @@ export default {
                 var obj = response.rows[index];
                 var points ='['+obj.configValue+']';
                 console.log(JSON.parse(points));
-                this.$refs.mapv.addline(JSON.parse(points));          
+                this.$refs.mapv.addline(JSON.parse(points));
            }
       });
     },
@@ -279,7 +279,7 @@ export default {
           ship["type"] = ship.illegalStatus;
           shipdatalist.push(ship);
         }
-        this.ship = shipdatalist;
+        // this.ship = shipdatalist;
         this.addshipPoint();
       });
 
@@ -313,7 +313,7 @@ export default {
         } else if (obj.type == 3) {
           img = 'wg.png'
         }
-        this.$refs.mapv.addpoint(obj.locations, obj, img, 'ship');
+        this.$refs.mapv.addpoint(obj.locations, obj, img, 'ship',360-index*20);
       }
     },
     getSo2Time() {