Browse Source

地图落点

wangzhe 1 year ago
parent
commit
2ee60d01f1

File diff suppressed because it is too large
+ 11891 - 85
package-lock.json


+ 1 - 0
src/api/components/supermap.js

@@ -1,3 +1,4 @@
 
 export const iconList = {
+    'sj-icon-map-event-point': require('@/assets/images/event_fire/event_point.png'),
 }

BIN
src/assets/images/event_fire/camera_tower.png


BIN
src/assets/images/event_fire/event_point.png


+ 111 - 1
src/views/index.vue

@@ -1,6 +1,7 @@
 <template>
     <div>
-      <div class="map" @click="abc()">
+      <!--<div class="map" @click="abc()">-->
+      <div class="map">
           <!--<img src="../assets/images/yj-mapbg.png"/>-->
           <!--<img src="../assets/images/cjms_camera/water_1.jpg"/>-->
           <!-- 地图 -->
@@ -46,7 +47,116 @@
             Jsmsdialog,
             supermap
         },
+        created() {
+            this.eventPoints("event_point");
+        },
         methods: {
+            //事件落点
+            eventPoints(type){
+                let pointList = [];
+                pointList.push({
+                    name:"朝阳火情",
+                    contacts:"张洁玲",
+                    phone:"13500805931",
+                    longitude:129.33,
+                    latitude:43.02
+                });
+                pointList.push({
+                    name:"延吉河火情",
+                    contacts:"王建军",
+                    phone:"13664407655",
+                    longitude:129.46,
+                    latitude:43.028
+                });
+                pointList.push({
+                    name:"石人村火情",
+                    contacts:"蔡雨虹",
+                    phone:"15754320117",
+                    longitude:129.418,
+                    latitude:43.038
+                });
+                pointList.push({
+                    name:"依兰火情",
+                    contacts:"吕国琴",
+                    phone:"15044076332",
+                    longitude:129.4394,
+                    latitude:43.089
+                });
+                pointList.push({
+                    name:"明月火情",
+                    contacts:"吴明月",
+                    phone:"15044076332",
+                    longitude:128.99,
+                    latitude:43.21
+                });
+
+                var markersList = []
+                for (let i = 0; i < pointList.length; i++) {
+                    let markersMap = {
+                        lng: 124.59,
+                        lat: 43.02,
+                        icon: 'marker',
+                        bindPopupHtml: '',
+                        click: 'abc',
+                        parameter: '',
+                        keepBindPopup: false,
+                        isAggregation: true
+                    }
+                    markersMap.icon = 'sj-icon-map-' + type.replaceAll("_", "-");
+                    markersMap.lng = pointList[i].longitude;
+                    markersMap.lat = pointList[i].latitude;
+                    markersMap.bindPopupHtml = '<div class="map-tip">' +
+                        '<span>' +
+                        '                  <div class="d-l-con">' +
+                        '                  <div class="d-l-l-text">' +
+                        '                  <h4>资源名称:' + pointList[i].name + '</h4>' +
+                        '                </div>' +
+                        '                </div>' +
+                        '                </span>' +
+                        '<span>' +
+                        '                  <div class="d-l-con">' +
+                        '                  <div class="d-l-l-text">' +
+                        '                  <h4>经纬度:' + pointList[i].longitude +','+ pointList[i].latitude + '</h4>' +
+                        '                </div>' +
+                        '                </div>' +
+                        '                </span>' +
+                        '<span>' +
+                        '                  <div class="d-l-con">' +
+                        '                  <div class="d-l-l-text">' +
+                        '                  <h4>联系人:' + (pointList[i].contacts  ? pointList[i].contacts : "")  + '</h4>' +
+                        '                </div>' +
+                        '                </div>' +
+                        '                </span>' +
+                        '<span>' +
+                        '                  <div class="d-l-con">' +
+                        '                  <div class="d-l-l-text">' +
+                        '                  <h4>电话:' +  (pointList[i].phone ? pointList[i].phone : "") + '</h4>' +
+                        '                </div>' +
+                        '                </div>' +
+                        '                </span>' +
+                        '</div>'
+                    markersList.push(markersMap)
+                    // let icon = new window.L.Icon({
+                    //     iconUrl: iconList[markersList[i].icon],
+                    //     iconSize: [48, 48],
+                    //     iconAnchor: [24, 40],
+                    //     popupAnchor: [-3, -40],
+                    //     shadowSize: [41, 41]
+                    // })
+                    // let markerClick = window.L.marker([markersList[i].lat, markersList[i].lng], {
+                    //     icon: markersMap.icon
+                    // })
+                    // markerClick.on('click', function() {
+                    //     let clickName = markersList[i].click
+                    //     this.$emit(clickName, markersList[i].parameter)
+                    // })
+                }
+                setTimeout(() => {
+                    this.$refs.supermap.setMarkersByType(markersList, type);
+                }, 3000)
+            },
+
+
             /** 预览按钮操作 */
             preview(cameraParam) {
                 this.showTVWall(cameraParam.code, cameraParam.name);