Explorar o código

添加百度地图路线图标

bihuisong hai 1 ano
pai
achega
6d27234551
Modificáronse 1 ficheiros con 15 adicións e 35 borrados
  1. 15 35
      songhua-ui/src/views/index/index.vue

+ 15 - 35
songhua-ui/src/views/index/index.vue

@@ -115,11 +115,12 @@
                            :center="{lng: 126.91531, lat: 43.610448}" :zoom="11" :scroll-wheel-zoom="true">
                   <bm-polyline v-for="item in dataSource" :path="item.polylinePath" :stroke-color="item.color"
                                :stroke-opacity="0.5" :stroke-weight="10"
-                               :editing="false" @click="clickMap(item.shipName)">
+                               :editing="false">
                   </bm-polyline>
-                  <bm-marker v-for="item in dataSource" :position="item.polylinePath.length - 1" :dragging="false">
-                    <bm-label :content="item.shipName" :labelStyle="{color: 'red', fontSize : '10px'}"
-                              :offset="{width: -35, height: 30}"/>
+                  <bm-marker v-for="item in dataSource"
+                             :position="item.polylinePath[0]" :dragging="false"
+                             animation="BMAP_ANIMATION_BOUNCE">
+                    <bm-label :content="item.shipName" :labelStyle="{color: 'red', fontSize : '12px'}" :offset="{width: -35, height: 30}"/>
                   </bm-marker>
                 </baidu-map>
               </div>
@@ -256,33 +257,16 @@ export default {
   name: "songhuaIndex",
   data() {
     return {
+      form: {},
       moreMeunSmalLeft_1: false,
       moreMeunSmalLeft_2: false,
       moreMeunSmalLeft_3: false,
       regionInShowOne: false,
       regionInShowTwo: true,
+      show: false,
       money: 15389740,
       peopleNum: 234856,
-      dataSource: [
-        {
-          shipName: "泰坦尼克号",
-          color: "ivory",
-          polylinePath: [
-            {lng: 126.91531, lat: 43.610448},
-            {lng: 128.91531, lat: 45.610448},
-            {lng: 130.91531, lat: 46.610448}
-          ],
-        },
-        {
-          shipName: "威尼斯",
-          color: "#003399",
-          polylinePath: [
-            {lng: 146.91531, lat: 53.610448},
-            {lng: 138.91531, lat: 25.610448},
-            {lng: 140.91531, lat: 16.610448}
-          ],
-        }
-      ],
+      dataSource: [],
     }
   },
   mounted() {
@@ -312,18 +296,14 @@ export default {
     this.selectShipRoute()
   },
   methods: {
-    clickMap(e) {
-      alert(e)
-    },
     selectShipRoute() {
-      // getShipRoute().then(res => {
-      //   if (res.code == 200) {
-      //     this.dataSource = res.data
-      //     console.log("this.dataSource", this.dataSource)
-      //   } else {
-      //     this.$modal.msgError("查询失败");
-      //   }
-      // })
+      getShipRoute().then(res => {
+        if (res.code == 200) {
+          this.dataSource = res.data
+        } else {
+          this.$modal.msgError("查询失败");
+        }
+      })
     },
 //https://echarts.apache.org/examples/zh/editor.html?c=line-stack
     chartRankOneMonthGet() {