|
|
|
|
@ -333,7 +333,7 @@ export default {
|
|
|
|
|
table: [],
|
|
|
|
|
list: [],
|
|
|
|
|
mapHeight: 0,
|
|
|
|
|
center: [120.283692, 31.614211],
|
|
|
|
|
center: [121.160530, 31.299468],
|
|
|
|
|
isShowInfoWindow: false,
|
|
|
|
|
openData: {},
|
|
|
|
|
infoWindow: null,
|
|
|
|
|
@ -342,13 +342,11 @@ export default {
|
|
|
|
|
polygons: [],
|
|
|
|
|
markerList: [],
|
|
|
|
|
wxAreas: [
|
|
|
|
|
"宜兴市",
|
|
|
|
|
"惠山区",
|
|
|
|
|
"新吴区",
|
|
|
|
|
"梁溪区",
|
|
|
|
|
"江阴市",
|
|
|
|
|
"滨湖区",
|
|
|
|
|
"锡山区",
|
|
|
|
|
"姑苏区",
|
|
|
|
|
"虎丘区",
|
|
|
|
|
"吴中区",
|
|
|
|
|
"相城区",
|
|
|
|
|
"吴江区",
|
|
|
|
|
],
|
|
|
|
|
units: new Map([
|
|
|
|
|
["dengjimianji", "m²"],
|
|
|
|
|
@ -493,7 +491,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
this.addCluster();
|
|
|
|
|
},
|
|
|
|
|
init(adcode = ["320200"]) {
|
|
|
|
|
init(adcode = ["320500","510500"]) {
|
|
|
|
|
let winHeight = document
|
|
|
|
|
.querySelector("#app")
|
|
|
|
|
?.getBoundingClientRect()?.height;
|
|
|
|
|
@ -531,31 +529,33 @@ export default {
|
|
|
|
|
let district = new AMap.DistrictSearch(opts);
|
|
|
|
|
district.setLevel("district");
|
|
|
|
|
// 行政区查询
|
|
|
|
|
district.search(`${adcode}`, (status, result) => {
|
|
|
|
|
//清空
|
|
|
|
|
this.map.remove(this.polygons);
|
|
|
|
|
this.polygons = [];
|
|
|
|
|
// 获取边界信息
|
|
|
|
|
let bounds = result.districtList[0]?.boundaries;
|
|
|
|
|
if (bounds) {
|
|
|
|
|
for (let i = 0, l = bounds.length; i < l; i++) {
|
|
|
|
|
// 生成行政区划polygon
|
|
|
|
|
let polygon = new AMap.Polygon({
|
|
|
|
|
map: this.map,
|
|
|
|
|
strokeWeight: 1,
|
|
|
|
|
path: bounds[i],
|
|
|
|
|
fillOpacity: 0.2,
|
|
|
|
|
fillColor: "#3579c788",
|
|
|
|
|
strokeColor: "#3579c7",
|
|
|
|
|
});
|
|
|
|
|
polygon.on('click',e => {
|
|
|
|
|
console.log('polygon',e)
|
|
|
|
|
})
|
|
|
|
|
this.polygons.push(polygon);
|
|
|
|
|
this.map.setFitView(polygon);
|
|
|
|
|
//清空
|
|
|
|
|
this.map.remove(this.polygons);
|
|
|
|
|
this.polygons = [];
|
|
|
|
|
adcode.forEach(i => {
|
|
|
|
|
district.search(`${i}`, (status, result) => {
|
|
|
|
|
// 获取边界信息
|
|
|
|
|
let bounds = result.districtList[0]?.boundaries;
|
|
|
|
|
if (bounds) {
|
|
|
|
|
for (let i = 0, l = bounds.length; i < l; i++) {
|
|
|
|
|
// 生成行政区划polygon
|
|
|
|
|
let polygon = new AMap.Polygon({
|
|
|
|
|
map: this.map,
|
|
|
|
|
strokeWeight: 1,
|
|
|
|
|
path: bounds[i],
|
|
|
|
|
fillOpacity: 0.2,
|
|
|
|
|
fillColor: "#3579c788",
|
|
|
|
|
strokeColor: "#3579c7",
|
|
|
|
|
});
|
|
|
|
|
polygon.on('click',e => {
|
|
|
|
|
console.log('polygon',e)
|
|
|
|
|
})
|
|
|
|
|
this.polygons.push(polygon);
|
|
|
|
|
this.map.setFitView(polygon);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|