diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue index 65ed57fd..0fb1db4d 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue +++ b/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, { resizeEnable: true, //是否监控地图容器尺寸变化 mapStyle: "amap://styles/blue", - zoom: 7, - center: [116.629514, 35.794168], + zoom: 9.5, + center: [116.629514, 35.805288], }); this.aMapIns.on("complete", () => { @@ -198,7 +198,8 @@ export default { }; }, }, - unmounted() { + // unmounted() { + destroyed(){ if (!this.aMapIns) return; this.aMapIns.destroyed(); }, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js index a9f8ef5f..92e0704f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js +++ b/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 ); - mapIns.setFitView([...markerCluster.U], false, [0, 0, 0, 0], 7); + mapIns.setFitView([...markerCluster.U], false, [0, 0, 0, 0], 10); return () => markerCluster.setMap(null); }