diff --git a/src/project/weiyang/AppBuilding/components/searchMap.vue b/src/project/weiyang/AppBuilding/components/searchMap.vue index 8b4653c..67da0e8 100644 --- a/src/project/weiyang/AppBuilding/components/searchMap.vue +++ b/src/project/weiyang/AppBuilding/components/searchMap.vue @@ -131,11 +131,10 @@ export default { retryMapCount: 0, building: {}, buildPopup: false, - - latitude: 30.606355, - longitude: 114.429633, - // latitude: 23.099994, - // longitude: 113.324520, + // latitude: 30.606355, + // longitude: 114.429633, + latitude: '', + longitude: '', _mapContext: null, markList: [], statusBarHeight: uni.getSystemInfoSync().statusBarHeight, @@ -143,13 +142,13 @@ export default { }, computed: {...mapState(['user'])}, mounted() { - // uni.getLocation({ - // type: 'wgs84', - // success: (res) => { - // this.latitude = res.latitude - // this.longitude = res.longitude - // } - // }); + uni.getLocation({ + type: 'wgs84', + success: (res) => { + this.latitude = res.latitude + this.longitude = res.longitude + } + }); this._mapContext = uni.createMapContext("map", this); // 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {}) this._mapContext.initMarkerCluster({ diff --git a/src/project/weiyang/AppBuilding/list.vue b/src/project/weiyang/AppBuilding/list.vue index 26f7932..1e51524 100644 --- a/src/project/weiyang/AppBuilding/list.vue +++ b/src/project/weiyang/AppBuilding/list.vue @@ -18,12 +18,12 @@ - + @@ -92,8 +92,8 @@ export default { toDetail(id) { uni.navigateTo({url: `./detail?id=${id}`}) }, - toMap(id, areaId) { - uni.navigateTo({url: `./map?id=${id}&areaId=${areaId}`}) + toMap(id, lat, lng) { + uni.navigateTo({url: `./map?id=${id}&lat=${lat}&lng=${lng}`}) } }, diff --git a/src/project/weiyang/AppBuilding/map.vue b/src/project/weiyang/AppBuilding/map.vue index 127d3de..f5e44c3 100644 --- a/src/project/weiyang/AppBuilding/map.vue +++ b/src/project/weiyang/AppBuilding/map.vue @@ -1,10 +1,13 @@