diff --git a/src/project/xicheng/AppMerchantManage/ChooseAddess.vue b/src/project/xicheng/AppMerchantManage/ChooseAddess.vue
index 66f2cb34..b2cf2c5a 100644
--- a/src/project/xicheng/AppMerchantManage/ChooseAddess.vue
+++ b/src/project/xicheng/AppMerchantManage/ChooseAddess.vue
@@ -14,7 +14,7 @@
diff --git a/src/project/xicheng/AppMerchantMap/AppMerchantMap.vue b/src/project/xicheng/AppMerchantMap/AppMerchantMap.vue
index 53fd2d09..21d78689 100644
--- a/src/project/xicheng/AppMerchantMap/AppMerchantMap.vue
+++ b/src/project/xicheng/AppMerchantMap/AppMerchantMap.vue
@@ -32,7 +32,8 @@
polygons: [],
labels: [],
businessName: '',
- ops: {},
+ ops: {
+ },
markers: [],
isShow: false,
MarkerCluster: null,
@@ -154,7 +155,7 @@
}
}
- this.config.latlng && map.setCenter(this.config.latlng)
+ // this.config.latlng && map.setCenter(this.config.latlng)
this.MarkerCluster = new TMap.MarkerCluster({
map, gridSize: 60,
@@ -167,6 +168,10 @@
})) || [],
zoomOnClick: true
})
+ this.setCenter(points.map(e => {
+ return new TMap.LatLng(e.lat, e.lng)
+ }))
+
let cls = []
this.MarkerCluster.on('cluster_changed', () => {
if (this.markers.length) {
@@ -226,6 +231,19 @@
}
}
})
+ },
+
+ setCenter (arr) {
+ var bounds = new TMap.LatLngBounds()
+ arr.forEach(function(item){
+ if (bounds.isEmpty() || !bounds.contains(item)){
+ bounds.extend(item)
+ }
+ })
+
+ this.map.fitBounds(bounds, {
+ padding: 100
+ })
}
}
}