|
@@ -81,6 +81,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div id="map-container"></div>
|
|
|
+ <!-- 距离刻度 -->
|
|
|
+ <div class="map-m">
|
|
|
+ <span class="map-num" @click="refershMap(200)" :class="addClass(200)">200m</span>
|
|
|
+ <span class="map-num" @click="refershMap(500)" :class="addClass(500)">500m</span>
|
|
|
+ <span class="map-num" @click="refershMap(1000)" :class="addClass(1000)">1000m</span>
|
|
|
+ </div>
|
|
|
<!-- 信息弹窗 -->
|
|
|
<div class="info-window" ref="infoWindow" v-if="firePoint">
|
|
|
<div class="info-content">
|
|
@@ -122,10 +128,10 @@ import mapIconSfsc from "../assets/images/map-icon-xfsc.png"; // 消防水池
|
|
|
import { getZy } from "@/api/map.js";
|
|
|
export default {
|
|
|
name: "MapContainer",
|
|
|
- components: { },
|
|
|
+ components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- radius: 300,
|
|
|
+ radius: 200,
|
|
|
center: [],
|
|
|
markers: [],
|
|
|
originMarkers: [],
|
|
@@ -186,18 +192,18 @@ export default {
|
|
|
showType: ["currentJzKey"],
|
|
|
loading: false,
|
|
|
markerCache: {
|
|
|
- "currentJzKey": [],
|
|
|
- "xfscKey": [],
|
|
|
- "trsyKey": [],
|
|
|
- "xhsKey": [],
|
|
|
- "szxhsKey": [],
|
|
|
- "jzKey": [],
|
|
|
- "xfzKey": [],
|
|
|
- "jgKey": [],
|
|
|
- "xfcKey": []
|
|
|
+ currentJzKey: [],
|
|
|
+ xfscKey: [],
|
|
|
+ trsyKey: [],
|
|
|
+ xhsKey: [],
|
|
|
+ szxhsKey: [],
|
|
|
+ jzKey: [],
|
|
|
+ xfzKey: [],
|
|
|
+ jgKey: [],
|
|
|
+ xfcKey: [],
|
|
|
},
|
|
|
legendWindow: null,
|
|
|
- infoWindow: null
|
|
|
+ infoWindow: null,
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -237,17 +243,17 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
let showType = JSON.parse(JSON.stringify(this.showType));
|
|
|
- console.log(this.markerCache)
|
|
|
+ console.log(this.markerCache);
|
|
|
if (showType.indexOf(type) >= 0) {
|
|
|
showType = showType.filter((p) => p !== type);
|
|
|
- this.markerCache[type].forEach(marker => {
|
|
|
- this.map.remove(marker)
|
|
|
- })
|
|
|
+ this.markerCache[type].forEach((marker) => {
|
|
|
+ this.map.remove(marker);
|
|
|
+ });
|
|
|
} else {
|
|
|
showType.push(type);
|
|
|
- this.markerCache[type]?.forEach(marker => {
|
|
|
- this.map.add(marker)
|
|
|
- })
|
|
|
+ this.markerCache[type]?.forEach((marker) => {
|
|
|
+ this.map.add(marker);
|
|
|
+ });
|
|
|
}
|
|
|
this.showType = showType;
|
|
|
},
|
|
@@ -292,7 +298,7 @@ export default {
|
|
|
|
|
|
// console.log(res.data);
|
|
|
if (res.data) {
|
|
|
- res.data.forEach((p, i) => {
|
|
|
+ res.data?.forEach((p, i) => {
|
|
|
if (this.showType.indexOf(p.type) >= 0 && p.lon && p.lat) {
|
|
|
markers.push({
|
|
|
icon: p.type,
|
|
@@ -306,25 +312,37 @@ export default {
|
|
|
this.markers = markers;
|
|
|
this.initMap().then(() => {
|
|
|
if (this.showType.length === 1 && this.showType[0] === "currentJzKey") {
|
|
|
- const p = this.markerCache['currentJzKey'][0]
|
|
|
- this.addLegendWindow(p._position)
|
|
|
- p.on("click", (v) => {
|
|
|
- this.openLegendWindow(p._position)
|
|
|
+ const p = this.markerCache["currentJzKey"][0];
|
|
|
+ this.addLegendWindow(p._position);
|
|
|
+ p.on("click", (v) => {
|
|
|
+ this.openLegendWindow(p._position);
|
|
|
});
|
|
|
- this.map.remove(p)
|
|
|
- this.map.add(p)
|
|
|
+ this.map.remove(p);
|
|
|
+ this.map.add(p);
|
|
|
|
|
|
// 缓存所有的节点数据
|
|
|
- this.cacheAllMarkers(res.data.filter(p => p.type !== 'currentJzKey' || p.type !== 'jzKey').map(p => ({
|
|
|
- icon: p.type,
|
|
|
- position: [p.lon, p.lat],
|
|
|
- anchor: "bottom-center",
|
|
|
- data: JSON.parse(p.data),
|
|
|
- })))
|
|
|
-
|
|
|
+ this.cacheAllMarkers(
|
|
|
+ res.data
|
|
|
+ .filter((p) => p.type !== "currentJzKey" || p.type !== "jzKey")
|
|
|
+ .map((p) => ({
|
|
|
+ icon: p.type,
|
|
|
+ position: [p.lon, p.lat],
|
|
|
+ anchor: "bottom-center",
|
|
|
+ data: JSON.parse(p.data),
|
|
|
+ }))
|
|
|
+ );
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //刷新地图
|
|
|
+ refershMap(val){
|
|
|
+ if(this.radius==val) return
|
|
|
+ this.radius=val
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ addClass(item){
|
|
|
+ return this.radius==item?'map-num active':'map-num '
|
|
|
+ },
|
|
|
async initMap() {
|
|
|
await AMapLoader.load({
|
|
|
key: "4776c927b5ebe35e9e33e5b14ec78b8f", // 申请好的Web端开发者Key,首次调用 load 时必填
|
|
@@ -403,8 +421,6 @@ export default {
|
|
|
offset: new AMap.Pixel(0, -70),
|
|
|
});
|
|
|
|
|
|
-
|
|
|
-
|
|
|
marker.on("mouseover", (e) => {
|
|
|
infoWindow.open(this.map, p.position); //后面的参数指的是经纬度,在此显示窗口
|
|
|
});
|
|
@@ -413,7 +429,7 @@ export default {
|
|
|
infoWindow.close();
|
|
|
});
|
|
|
this.markerCache[type].push(marker);
|
|
|
-
|
|
|
+
|
|
|
markers.push(marker);
|
|
|
});
|
|
|
this.map.add(markers);
|
|
@@ -441,18 +457,22 @@ export default {
|
|
|
position: this.firePoint.position,
|
|
|
anchor: "center",
|
|
|
});
|
|
|
- markerFire.on("click", (v) => {
|
|
|
- this.openLegendWindow(this.firePoint.position)
|
|
|
+ markerFire.on("click", (v) => {
|
|
|
+ this.openLegendWindow(this.firePoint.position);
|
|
|
});
|
|
|
- markerFire.on("mouseout", (v) => {
|
|
|
- this.infoWindow && this.infoWindow.close()
|
|
|
+ markerFire.on("mouseout", (v) => {
|
|
|
+ this.infoWindow && this.infoWindow.close();
|
|
|
});
|
|
|
- markerFire.on("mouseover", (v) => {
|
|
|
+ markerFire.on("mouseover", (v) => {
|
|
|
// console.log()
|
|
|
- this.infoWindow && this.infoWindow.open(
|
|
|
- this.map,
|
|
|
- new AMap.LngLat(this.firePoint.position[0], this.firePoint.position[1])
|
|
|
- );
|
|
|
+ this.infoWindow &&
|
|
|
+ this.infoWindow.open(
|
|
|
+ this.map,
|
|
|
+ new AMap.LngLat(
|
|
|
+ this.firePoint.position[0],
|
|
|
+ this.firePoint.position[1]
|
|
|
+ )
|
|
|
+ );
|
|
|
});
|
|
|
this.map.add(markerFire);
|
|
|
|
|
@@ -470,8 +490,8 @@ export default {
|
|
|
fillOpacity: 0.08, // 填充透明度
|
|
|
});
|
|
|
this.map.add(circle);
|
|
|
- this.addLegendWindow(this.firePoint.position)
|
|
|
- this.addInfoWindow()
|
|
|
+ this.addLegendWindow(this.firePoint.position);
|
|
|
+ this.addInfoWindow();
|
|
|
},
|
|
|
addInfoWindow() {
|
|
|
if (!this.firePoint) {
|
|
@@ -490,17 +510,65 @@ export default {
|
|
|
// );
|
|
|
},
|
|
|
addLegendWindow(position) {
|
|
|
- console.log(position)
|
|
|
+ console.log(position);
|
|
|
const legend = [
|
|
|
- { name: '消防车', key: 'xfcKey', icon: mapIconCar, width: '47.24px', height: '31px' },
|
|
|
- { name: '微型消防站', key: 'xfzKey', icon: mapIconMicstation, width: '27.54px', height: '34px' },
|
|
|
- { name: '消防站', key: 'jgKey', icon: mapIconStation, width: '25.2px', height: '31px' },
|
|
|
- { name: '高层建筑', key: 'jzKey', icon: mapIconBuild, width: '25px', height: '34px' },
|
|
|
- { name: '市政消火栓', key: 'szxhsKey', icon: mapIconSzxhs, width: '25px', height: '32px' },
|
|
|
- { name: '天然水源', key: 'trsyKey', icon: mapIconTrsy, width: '25px', height: '34px' },
|
|
|
- { name: '消防水池', key: 'xfscKey', icon: mapIconSfsc, width: '25px', height: '32px' },
|
|
|
- { name: '室外消火栓', key: 'xhsKey', icon: mapIconSwxhs, width: '29px', height: '39px' }
|
|
|
- ]
|
|
|
+ {
|
|
|
+ name: "消防车",
|
|
|
+ key: "xfcKey",
|
|
|
+ icon: mapIconCar,
|
|
|
+ width: "47.24px",
|
|
|
+ height: "31px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "微型消防站",
|
|
|
+ key: "xfzKey",
|
|
|
+ icon: mapIconMicstation,
|
|
|
+ width: "27.54px",
|
|
|
+ height: "34px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "消防站",
|
|
|
+ key: "jgKey",
|
|
|
+ icon: mapIconStation,
|
|
|
+ width: "25.2px",
|
|
|
+ height: "31px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "高层建筑",
|
|
|
+ key: "jzKey",
|
|
|
+ icon: mapIconBuild,
|
|
|
+ width: "25px",
|
|
|
+ height: "34px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "市政消火栓",
|
|
|
+ key: "szxhsKey",
|
|
|
+ icon: mapIconSzxhs,
|
|
|
+ width: "25px",
|
|
|
+ height: "32px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "天然水源",
|
|
|
+ key: "trsyKey",
|
|
|
+ icon: mapIconTrsy,
|
|
|
+ width: "25px",
|
|
|
+ height: "34px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "消防水池",
|
|
|
+ key: "xfscKey",
|
|
|
+ icon: mapIconSfsc,
|
|
|
+ width: "25px",
|
|
|
+ height: "32px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "室外消火栓",
|
|
|
+ key: "xhsKey",
|
|
|
+ icon: mapIconSwxhs,
|
|
|
+ width: "29px",
|
|
|
+ height: "39px",
|
|
|
+ },
|
|
|
+ ];
|
|
|
// 信息窗口
|
|
|
// this.addInfoWindow();
|
|
|
|
|
@@ -508,129 +576,145 @@ export default {
|
|
|
isCustom: true,
|
|
|
content: `<div id="legendContainer" class='legend-container show-box'>
|
|
|
<div class="legend-list">
|
|
|
- ${legend.map((item,idx) => {
|
|
|
- const rotate = 360 / legend.length * idx;
|
|
|
- return (`
|
|
|
- <div class='legend-item show ${ this.showType.indexOf(item.key) > 0 ? "active": ""}' index='${idx}'
|
|
|
- onclick='onClickLegendItem(${JSON.stringify({item, idx}).toString()})' style="--rotate: ${rotate}deg;" >
|
|
|
+ ${legend
|
|
|
+ .map((item, idx) => {
|
|
|
+ const rotate = (360 / legend.length) * idx;
|
|
|
+ return `
|
|
|
+ <div class='legend-item show ${
|
|
|
+ this.showType.indexOf(item.key) > 0 ? "active" : ""
|
|
|
+ }' index='${idx}'
|
|
|
+ onclick='onClickLegendItem(${JSON.stringify({
|
|
|
+ item,
|
|
|
+ idx,
|
|
|
+ }).toString()})' style="--rotate: ${rotate}deg;" >
|
|
|
<div class='legend-content' style="transform: rotate(-${rotate}deg)">
|
|
|
- <img src="${item.icon}" width="${item.width}" height="${item.height}"/>
|
|
|
+ <img src="${item.icon}" width="${item.width}" height="${
|
|
|
+ item.height
|
|
|
+ }"/>
|
|
|
<div>${item.name}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- `)
|
|
|
- }).join('')}
|
|
|
+ `;
|
|
|
+ })
|
|
|
+ .join("")}
|
|
|
</div>
|
|
|
<div onclick="closeMapLegend()" class="center-pointer"></div>
|
|
|
</div>`,
|
|
|
center: new AMap.LngLat(position[0], position[1]),
|
|
|
});
|
|
|
window.closeMapLegend = (e) => {
|
|
|
- document.querySelector('#legendContainer').className = document.querySelector('#legendContainer').className.replace('show-box','close-box')
|
|
|
- document.querySelectorAll('#legendContainer .legend-item').forEach(ele => {
|
|
|
- ele.className = ele.className.replace('show','close')
|
|
|
- })
|
|
|
+ document.querySelector("#legendContainer").className = document
|
|
|
+ .querySelector("#legendContainer")
|
|
|
+ .className.replace("show-box", "close-box");
|
|
|
+ document
|
|
|
+ .querySelectorAll("#legendContainer .legend-item")
|
|
|
+ .forEach((ele) => {
|
|
|
+ ele.className = ele.className.replace("show", "close");
|
|
|
+ });
|
|
|
setTimeout(() => {
|
|
|
- this.legendWindow.close()
|
|
|
- }, 650)
|
|
|
- }
|
|
|
+ this.legendWindow.close();
|
|
|
+ }, 650);
|
|
|
+ };
|
|
|
window.onClickLegendItem = (e) => {
|
|
|
- const ele = this.legendWindow.dom.querySelector(`div.legend-item[index="${e.idx}"]`)
|
|
|
+ const ele = this.legendWindow.dom.querySelector(
|
|
|
+ `div.legend-item[index="${e.idx}"]`
|
|
|
+ );
|
|
|
if (ele.className.indexOf("active") >= 0) {
|
|
|
- ele.className = ele.className.replace('active', '')
|
|
|
+ ele.className = ele.className.replace("active", "");
|
|
|
} else {
|
|
|
- ele.className += ' active'
|
|
|
+ ele.className += " active";
|
|
|
}
|
|
|
- this.changeType(e.item.key)
|
|
|
- }
|
|
|
+ this.changeType(e.item.key);
|
|
|
+ };
|
|
|
},
|
|
|
openLegendWindow(position) {
|
|
|
- if (!this.legendWindow) return
|
|
|
+ if (!this.legendWindow) return;
|
|
|
this.legendWindow.open(
|
|
|
this.map,
|
|
|
new AMap.LngLat(position[0], position[1])
|
|
|
);
|
|
|
- document.querySelector('#legendContainer').className = document.querySelector('#legendContainer').className.replace('close-box', 'show-box')
|
|
|
- document.querySelectorAll('#legendContainer .legend-item').forEach(ele => {
|
|
|
- ele.className = ele.className.replace('close', 'show')
|
|
|
- })
|
|
|
+ document.querySelector("#legendContainer").className = document
|
|
|
+ .querySelector("#legendContainer")
|
|
|
+ .className.replace("close-box", "show-box");
|
|
|
+ document
|
|
|
+ .querySelectorAll("#legendContainer .legend-item")
|
|
|
+ .forEach((ele) => {
|
|
|
+ ele.className = ele.className.replace("close", "show");
|
|
|
+ });
|
|
|
},
|
|
|
cacheAllMarkers(markerInfos) {
|
|
|
if (markerInfos && markerInfos.length > 0) {
|
|
|
- const markers = [];
|
|
|
- markerInfos.forEach((p, i) => {
|
|
|
- const type = p.icon;
|
|
|
- let infoContent = [];
|
|
|
- if (type === "jzKey" || type === "currentJzKey") {
|
|
|
- infoContent.push(p.data.gcjzmc);
|
|
|
- infoContent.push(p.data.xxdz);
|
|
|
- infoContent.push(p.data.jzdx);
|
|
|
- infoContent.push("建筑高度:" + p.data.gd + "m");
|
|
|
- infoContent.push("建成年代:" + p.data.jcnd + "年");
|
|
|
- } else if (type === "xhsKey") {
|
|
|
- infoContent.push(p.data.code);
|
|
|
- infoContent.push(p.data.sylx);
|
|
|
- infoContent.push(p.data.address);
|
|
|
- } else if (type === "szxhsKey") {
|
|
|
- infoContent.push(p.data.code);
|
|
|
- infoContent.push(p.data.sylx);
|
|
|
- infoContent.push(p.data.address);
|
|
|
- } else if (type === "trsyKey") {
|
|
|
- infoContent.push(p.data.code);
|
|
|
- infoContent.push(p.data.sylx);
|
|
|
- infoContent.push(p.data.address);
|
|
|
- } else if (type === "xfscKey") {
|
|
|
- infoContent.push(p.data.code);
|
|
|
- infoContent.push(p.data.sylx);
|
|
|
- infoContent.push(p.data.address);
|
|
|
- } else if (type === "xfcKey") {
|
|
|
- infoContent.push(p.data.cph);
|
|
|
- infoContent.push(p.data.speed + "公里/小时");
|
|
|
- } else if (type === "lldKey") {
|
|
|
- infoContent.push(p.data.deviceName);
|
|
|
- infoContent.push(p.data.cameraType);
|
|
|
- } else if (type === "xfzKey") {
|
|
|
- infoContent.push(p.data.mc);
|
|
|
- infoContent.push("消防站(队站)");
|
|
|
- infoContent.push(p.data.fzr + " " + p.data.fzrLxdh);
|
|
|
- } else if (type === "jgKey") {
|
|
|
- infoContent.push(p.data.dwmc);
|
|
|
- infoContent.push("微型消防站");
|
|
|
- infoContent.push(p.data.lxr + " " + p.data.lxdh);
|
|
|
- }
|
|
|
+ const markers = [];
|
|
|
+ markerInfos.forEach((p, i) => {
|
|
|
+ const type = p.icon;
|
|
|
+ let infoContent = [];
|
|
|
+ if (type === "jzKey" || type === "currentJzKey") {
|
|
|
+ infoContent.push(p.data.gcjzmc);
|
|
|
+ infoContent.push(p.data.xxdz);
|
|
|
+ infoContent.push(p.data.jzdx);
|
|
|
+ infoContent.push("建筑高度:" + p.data.gd + "m");
|
|
|
+ infoContent.push("建成年代:" + p.data.jcnd + "年");
|
|
|
+ } else if (type === "xhsKey") {
|
|
|
+ infoContent.push(p.data.code);
|
|
|
+ infoContent.push(p.data.sylx);
|
|
|
+ infoContent.push(p.data.address);
|
|
|
+ } else if (type === "szxhsKey") {
|
|
|
+ infoContent.push(p.data.code);
|
|
|
+ infoContent.push(p.data.sylx);
|
|
|
+ infoContent.push(p.data.address);
|
|
|
+ } else if (type === "trsyKey") {
|
|
|
+ infoContent.push(p.data.code);
|
|
|
+ infoContent.push(p.data.sylx);
|
|
|
+ infoContent.push(p.data.address);
|
|
|
+ } else if (type === "xfscKey") {
|
|
|
+ infoContent.push(p.data.code);
|
|
|
+ infoContent.push(p.data.sylx);
|
|
|
+ infoContent.push(p.data.address);
|
|
|
+ } else if (type === "xfcKey") {
|
|
|
+ infoContent.push(p.data.cph);
|
|
|
+ infoContent.push(p.data.speed + "公里/小时");
|
|
|
+ } else if (type === "lldKey") {
|
|
|
+ infoContent.push(p.data.deviceName);
|
|
|
+ infoContent.push(p.data.cameraType);
|
|
|
+ } else if (type === "xfzKey") {
|
|
|
+ infoContent.push(p.data.mc);
|
|
|
+ infoContent.push("消防站(队站)");
|
|
|
+ infoContent.push(p.data.fzr + " " + p.data.fzrLxdh);
|
|
|
+ } else if (type === "jgKey") {
|
|
|
+ infoContent.push(p.data.dwmc);
|
|
|
+ infoContent.push("微型消防站");
|
|
|
+ infoContent.push(p.data.lxr + " " + p.data.lxdh);
|
|
|
+ }
|
|
|
|
|
|
- const icon = JSON.parse(JSON.stringify(this.icons[p.icon]));
|
|
|
- icon.size = new AMap.Size(icon.size[0], icon.size[1]);
|
|
|
- icon.imageSize = new AMap.Size(
|
|
|
- icon.imageSize[0],
|
|
|
- icon.imageSize[1]
|
|
|
- );
|
|
|
- p.icon = new AMap.Icon(icon);
|
|
|
- var marker = new AMap.Marker(p);
|
|
|
- // // this.map.add(marker);
|
|
|
- let content = [
|
|
|
- "<div class='info_box_contant' style=\"line-height: 30px;min-width: 250px; padding: 20px; font-size: 20px; color: #7ea2ff; font-family: 'Abel'; background: rgba(0, 0, 0, 0.82);\">" +
|
|
|
- infoContent.join("<br />") +
|
|
|
- " </div>",
|
|
|
- ];
|
|
|
- const infoWindow = new AMap.InfoWindow({
|
|
|
- isCustom: true, //使用自定义窗体
|
|
|
- content: content.join("<br>"),
|
|
|
- offset: new AMap.Pixel(0, -70),
|
|
|
- });
|
|
|
+ const icon = JSON.parse(JSON.stringify(this.icons[p.icon]));
|
|
|
+ icon.size = new AMap.Size(icon.size[0], icon.size[1]);
|
|
|
+ icon.imageSize = new AMap.Size(icon.imageSize[0], icon.imageSize[1]);
|
|
|
+ p.icon = new AMap.Icon(icon);
|
|
|
+ var marker = new AMap.Marker(p);
|
|
|
+ // // this.map.add(marker);
|
|
|
+ let content = [
|
|
|
+ "<div class='info_box_contant' style=\"line-height: 30px;min-width: 250px; padding: 20px; font-size: 20px; color: #7ea2ff; font-family: 'Abel'; background: rgba(0, 0, 0, 0.82);\">" +
|
|
|
+ infoContent.join("<br />") +
|
|
|
+ " </div>",
|
|
|
+ ];
|
|
|
+ const infoWindow = new AMap.InfoWindow({
|
|
|
+ isCustom: true, //使用自定义窗体
|
|
|
+ content: content.join("<br>"),
|
|
|
+ offset: new AMap.Pixel(0, -70),
|
|
|
+ });
|
|
|
|
|
|
- marker.on("mouseover", (e) => {
|
|
|
- infoWindow.open(this.map, p.position); //后面的参数指的是经纬度,在此显示窗口
|
|
|
- });
|
|
|
+ marker.on("mouseover", (e) => {
|
|
|
+ infoWindow.open(this.map, p.position); //后面的参数指的是经纬度,在此显示窗口
|
|
|
+ });
|
|
|
|
|
|
- marker.on("mouseout", (e) => {
|
|
|
- infoWindow.close();
|
|
|
- });
|
|
|
- this.markerCache[type].push(marker)
|
|
|
- markers.push(marker);
|
|
|
- });
|
|
|
- return markers;
|
|
|
- }
|
|
|
+ marker.on("mouseout", (e) => {
|
|
|
+ infoWindow.close();
|
|
|
+ });
|
|
|
+ this.markerCache[type].push(marker);
|
|
|
+ markers.push(marker);
|
|
|
+ });
|
|
|
+ return markers;
|
|
|
+ }
|
|
|
},
|
|
|
closeInfoWindow() {
|
|
|
this.map.clearInfoWindow();
|
|
@@ -693,7 +777,32 @@ export default {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ .map-m {
|
|
|
+ width: 355px;
|
|
|
+ height: 13px;
|
|
|
+ background: url("../assets/images/Vector (4).png") no-repeat;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 30px;
|
|
|
+ left: 26%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .map-num{
|
|
|
+ display: inline-block;
|
|
|
+ margin-top: -15px;
|
|
|
+ margin-left: 22px;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #45a4ab;
|
|
|
+ }
|
|
|
+ .map-num:last-child{
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ .last-num{
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
#map-container {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
@@ -845,7 +954,6 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
-
|
|
|
<style lang="less">
|
|
|
@keyframes show-layer {
|
|
|
from {
|
|
@@ -864,7 +972,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-@keyframes show-box {
|
|
|
+@keyframes show-box {
|
|
|
from {
|
|
|
transform: translate(-50%, -50%) scale(0);
|
|
|
opacity: 0;
|
|
@@ -874,7 +982,7 @@ export default {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
}
|
|
|
-@keyframes close-box {
|
|
|
+@keyframes close-box {
|
|
|
from {
|
|
|
transform: translate(-50%, -50%) scale(1);
|
|
|
opacity: 1;
|
|
@@ -886,17 +994,17 @@ export default {
|
|
|
}
|
|
|
|
|
|
.show-box {
|
|
|
- animation: .8s linear show-box;
|
|
|
+ animation: 0.8s linear show-box;
|
|
|
}
|
|
|
.close-box {
|
|
|
- animation: .8s linear close-box;
|
|
|
+ animation: 0.8s linear close-box;
|
|
|
}
|
|
|
|
|
|
.show {
|
|
|
- animation: .8s linear show-layer;
|
|
|
+ animation: 0.8s linear show-layer;
|
|
|
}
|
|
|
.close {
|
|
|
- animation: .8s linear close-layer;
|
|
|
+ animation: 0.8s linear close-layer;
|
|
|
}
|
|
|
|
|
|
.center-pointer {
|
|
@@ -913,7 +1021,7 @@ export default {
|
|
|
position: fixed;
|
|
|
width: 507px;
|
|
|
height: 336px;
|
|
|
- background: url('@/assets/images/legend-bg.png') no-repeat;
|
|
|
+ background: url("@/assets/images/legend-bg.png") no-repeat;
|
|
|
transform: translate(-50%, -50%);
|
|
|
}
|
|
|
.legend-list {
|
|
@@ -940,13 +1048,13 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
- transition: all .8s;
|
|
|
+ transition: all 0.8s;
|
|
|
/*改变旋转基点*/
|
|
|
transform-origin: 150px 150px;
|
|
|
/*最开始让小菜单隐藏*/
|
|
|
transform: scale(0);
|
|
|
border-radius: 50%;
|
|
|
- background: url('@/assets/images/legend-icon-bg.png') no-repeat;
|
|
|
+ background: url("@/assets/images/legend-icon-bg.png") no-repeat;
|
|
|
opacity: 1;
|
|
|
cursor: pointer;
|
|
|
transform: rotate(var(--rotate));
|
|
@@ -954,6 +1062,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
.legend-item.active {
|
|
|
- background: url('@/assets/images/legend-active-bg.png') no-repeat;
|
|
|
+ background: url("@/assets/images/legend-active-bg.png") no-repeat;
|
|
|
}
|
|
|
</style>
|