|
@@ -166,9 +166,36 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getCommunityByDeptId(id){
|
|
|
+ let that = this;
|
|
|
getCommunityByDeptId(id).then(req => {
|
|
|
- this.botIndex=id
|
|
|
- this.communityList = req.data;
|
|
|
+ that.botIndex=id
|
|
|
+ that.communityList = req.data;
|
|
|
+ const markersList = []
|
|
|
+ if (req.data != null && req.data.length > 0) {
|
|
|
+ for (let i = 0; i < req.data.length; i++) {
|
|
|
+ let markersMap = {
|
|
|
+ lng: 124.59,
|
|
|
+ lat: 43.02,
|
|
|
+ icon: 'area',
|
|
|
+ bindPopupHtml: '',
|
|
|
+ click: 'openDetails',
|
|
|
+ parameter: req.data[i],
|
|
|
+ keepBindPopup: false,
|
|
|
+ isAggregation: false
|
|
|
+ }
|
|
|
+ markersMap.lng = req.data[i].longitude
|
|
|
+ markersMap.lat = req.data[i].latitude
|
|
|
+ markersList.push(markersMap);
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ that.$parent.$refs.supermap.clearM()
|
|
|
+ that.$parent.$refs.supermap.setMarkers(markersList)
|
|
|
+ }, 1000)
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
+ that.$parent.$refs.supermap.clearM()
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
dropLocation(lat, lng) {
|