解决高德地图崩溃问题

位置:首页 / 技术中心 / 杂项

杂项 Admin 2026-04-27 15:33:13 33


vue代码

        destroyMap () {
            if (this.myMap) {
                try {
                    this.myMap.clearMap()
                    this.myMap.destroy()
                } catch (error) {
                    console.log("地图销毁出错:", error)
                }
                this.myMap = null
            }
            if (this.markers && this.markers.length > 0) {
                this.markers = []
            }
            if (this.polygons && this.polygons.length > 0) {
                this.polygons = []
            }
        },
18455111359 扫描二维码