地图默认中心点埋点

This commit is contained in:
aixianling
2021-12-27 10:07:15 +08:00
parent 638a84ca0e
commit 2cb95465e8
3 changed files with 41 additions and 44 deletions

View File

@@ -26,8 +26,7 @@
<img src="./img/build-icon.png" alt=""> 楼栋<br/>列表
</div>
<div class="map-content">
<AiTMap v-if="user.areaId" :areaId="user.areaId" :map.sync="map" :lib.sync="lib" :ops="ops"
:libraries="['service', 'tools']"/>
<AiTMap :map.sync="map" :lib.sync="lib" :ops="ops" :libraries="['service', 'tools']"/>
</div>
<u-popup v-model="showPop" mode="bottom" border-radius="14">
<div class="popup">
@@ -111,7 +110,6 @@ import {mapState} from 'vuex'
export default {
data() {
return {
latLngCenter: {},
ops: {},
lib: null,
map: null,
@@ -133,9 +131,9 @@ export default {
buildPopup: false
}
},
computed: {...mapState(['user'])},
computed: {...mapState(['user', 'config'])},
mounted() {
this.getCenterLatLng().then(points => {
this.getCommunityList().then(points => {
this.getMarkerCluster(points)
})
},
@@ -146,14 +144,6 @@ export default {
this.$dict.load("communityBuildingType")
},
methods: {
getCenterLatLng() {
return this.$http.post(`/app/appdvcpconfig/getCorpLocation`).then(res => {
if (res?.data) {
this.latLngCenter = res.data
return this.getCommunityList()
}
})
},
getCommunityList() {
return this.$http.post('/app/appcommunitybuildinginfo/listByBuilding', null, {
params: {
@@ -178,7 +168,7 @@ export default {
getMarkerCluster(points, count = 0) {
let {lib: TMap, map} = this
if (map) {
map.setCenter(this.latLngCenter)
map.setCenter(this.config.latlng)
let MarkerCluster = new TMap.MarkerCluster({
map, gridSize: 60,
enableDefaultStyle: false, // 关闭默认样式