This commit is contained in:
yanran200730
2023-04-07 11:19:59 +08:00

View File

@@ -65,6 +65,7 @@ export default {
document.body.appendChild(script);
},
initTMap() {
const TMap = window?.TMap
this.mapLib = TMap
this.tmap = new TMap.Map(this.$refs.tmap, {
zoom: 11,
@@ -76,7 +77,7 @@ export default {
this.areaId && this.getMapArea()
},
getMapArea() {
let {mapLib, areaId, tmap: map} = this, keyword = areaId.substring(0, 6)
let {mapLib: TMap, areaId, tmap: map} = this, keyword = areaId.substring(0, 6)
const fitBounds = (latLngList) => {
// 由多边形顶点坐标数组计算能完整呈现该多边形的最小矩形范围
if (latLngList.length === 0) {
@@ -98,7 +99,7 @@ export default {
);
}
let polygons = new TMap.MultiPolygon({map, geometries: []});
new mapLib.service.District({
new TMap.service.District({
polygon: 2,
maxOffset: 100
}).search({keyword}).then(res => {