温红权 3 жил өмнө
parent
commit
99ad228ee1

+ 4 - 0
ruoyi-ui/src/components/map/index.vue

@@ -844,6 +844,10 @@ export default {
                     image: new Icon({
                         color: "#eee",
                         rotation:rotation,
+                        anchor:[0.5,0.5],
+                        rotateWithView:true,
+                        // color:"red",
+                        // size:[60,20],
                         crossOrigin: "anonymous",
                         src: require("../../assets/images/icon/" + img) //本地的样式
                     })

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

@@ -202,11 +202,13 @@ 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.98602]], 'type': 1,"head":0},
+        // {"name": "二号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":60},
+        {"name": "三号船", "locations": [[118.639711, 31.96622]], 'type': 1,"head":90},
+        {"name": "三号船", "locations": [[118.639711, 31.93662]], 'type': 1,"head":180},
+        // {"name": "四号船", "locations": [[118.639711, 31.96602]], 'type': 3,"head":180},
+        // {"name": "五号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":270},
+        // {"name": "五号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":360},
       ]
     }
   }, mounted() {
@@ -313,7 +315,7 @@ export default {
         } else if (obj.type == 3) {
           img = 'wg.png'
         }
-        this.$refs.mapv.addpoint(obj.locations, obj, img, 'ship',360-index*20);
+        this.$refs.mapv.addpoint(obj.locations, obj, img, 'ship', ((obj.head==null?0:parseFloat(obj.head))-90)*Math.PI/180);
       }
     },
     getSo2Time() {