diff --git a/ui/packages/tools/AiTMap.vue b/ui/packages/tools/AiTMap.vue index 9591fe80..95db0d39 100644 --- a/ui/packages/tools/AiTMap.vue +++ b/ui/packages/tools/AiTMap.vue @@ -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 => {