智慧农业绘制地图
guoshilong
2022-09-03 b47e4c935112f10f60ea31e009c00a32597f5ce2
绘制地图后重定位
2 files modified
6 ■■■■■ changed files
src/components/leafletDraw.vue 2 ●●●●● patch | view | raw | blame | history
src/components/revampDraw.vue 4 ●●●● patch | view | raw | blame | history
src/components/leafletDraw.vue
@@ -315,6 +315,8 @@
                window.parent.postMessage(area,"*")
                this.map.flyToBounds(this.rectangleLayer.getBounds());
            })
        },
src/components/revampDraw.vue
@@ -160,6 +160,8 @@
                // 添加顶点
                console.log(e, '添加顶点')
            })
            // this.map.flyToBounds(this.rectangleLayer.getBounds());
        },
        addPolygon (position) {
@@ -461,6 +463,8 @@
                let area = this.$turf.area(this.$turf.polygon([arr]))
                window.parent.postMessage(area,"*")
                this.map.flyToBounds(this.rectangleLayer.getBounds());
            })
        },