|
|
@ -3,7 +3,7 @@ |
|
|
|
<div id="map"></div> |
|
|
|
<div class="btn" v-if="mapStyleType == 'light'" v-show="false" @click="shiftMapStyle('dark')">切换深色模式</div> |
|
|
|
<div class="btn" v-show="false" v-else @click="shiftMapStyle('light')">切换浅色模式</div> |
|
|
|
|
|
|
|
<!-- :style="{ transform: `scale(${zoom})` }" --> |
|
|
|
<cpt-popup ref="popup" @clickListItem="handleClickDotListItem" @operate="handleClickDotBtn" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -39,7 +39,7 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
mapType, |
|
|
|
|
|
|
|
zoom: 0, |
|
|
|
mapStyleType: localStorage.getItem("mapStyle") || "dark", |
|
|
|
// srcGridData: {}, |
|
|
|
darkStyle: { |
|
|
@ -264,9 +264,25 @@ export default { |
|
|
|
dotList2(val, oldValue) { |
|
|
|
this.updateDot(); |
|
|
|
}, |
|
|
|
// "$store.state.chooseArea.realScale"(n, v) { |
|
|
|
// this.setStartScale(n); |
|
|
|
// }, |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
// const scale = this.$store.state.chooseArea.realScale; |
|
|
|
// console.log(scale); |
|
|
|
// if (scale) { |
|
|
|
// this.setStartScale(scale); |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// setStartScale(n) { |
|
|
|
// const scale = 1 / n; |
|
|
|
// this.zoom = scale; |
|
|
|
// }, |
|
|
|
|
|
|
|
iniMap() { |
|
|
|
const { darkStyle, lightStyle, srcGridData } = this; |
|
|
|
if (!srcGridData) return false; |
|
|
@ -493,7 +509,7 @@ export default { |
|
|
|
.active(true); |
|
|
|
scene.addLayer(textLayer); |
|
|
|
|
|
|
|
polygonLayer.on("mouseenter", (e) => { |
|
|
|
polygonLayer.on("mousemove", (e) => { |
|
|
|
// console.log("e", e); |
|
|
|
// const { lng, lat } = e.lngLat; |
|
|
|
// const popup = new Popup({ |
|
|
@ -515,11 +531,11 @@ export default { |
|
|
|
scene.addPopup(popup); |
|
|
|
}); |
|
|
|
|
|
|
|
polygonLayer.on("mousemove", (e) => { |
|
|
|
polygonLayer.style({ |
|
|
|
raisingHeight: 0, |
|
|
|
}); |
|
|
|
}); |
|
|
|
// polygonLayer.on("mousemove", (e) => { |
|
|
|
// polygonLayer.style({ |
|
|
|
// raisingHeight: 0, |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
polygonLayer.on("click", (e) => { |
|
|
|
console.log("e", e); |
|
|
|
this.$emit("clickAgency", e.feature.properties); |
|
|
|