bug
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="address-search">
|
||||
<div class="address-search__wrapper">
|
||||
<!-- <image src="./images/search.png" /> -->
|
||||
<image :src="$cdn + 'xincheng/search.png'" />
|
||||
<input placeholder-style="color: #98A6B6" placeholder="搜索地点" v-model="address" @input="onChange">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user