Browse Source

修改地图缩放级别

wangqin
刘朋 1 year ago
parent
commit
e0b6a4b5bc
  1. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue
  2. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

7
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue

@ -46,8 +46,8 @@ export default {
this.aMapIns = new this.AMap.Map(this.$refs.mapContainerRef, { this.aMapIns = new this.AMap.Map(this.$refs.mapContainerRef, {
resizeEnable: true, // resizeEnable: true, //
mapStyle: "amap://styles/blue", mapStyle: "amap://styles/blue",
zoom: 7, zoom: 9.5,
center: [116.629514, 35.794168], center: [116.629514, 35.805288],
}); });
this.aMapIns.on("complete", () => { this.aMapIns.on("complete", () => {
@ -198,7 +198,8 @@ export default {
}; };
}, },
}, },
unmounted() { // unmounted() {
destroyed(){
if (!this.aMapIns) return; if (!this.aMapIns) return;
this.aMapIns.destroyed(); this.aMapIns.destroyed();
}, },

2
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -153,7 +153,7 @@ export async function setMarkToMap(item, data, _markerClick, content) {
markerClick markerClick
); );
mapIns.setFitView([...markerCluster.U], false, [0, 0, 0, 0], 7); mapIns.setFitView([...markerCluster.U], false, [0, 0, 0, 0], 10);
return () => markerCluster.setMap(null); return () => markerCluster.setMap(null);
} }

Loading…
Cancel
Save