提交 e200fa05 authored 作者: 孙梓洋's avatar 孙梓洋

feat: 调整识别展示

上级 c6d36d62
......@@ -16,7 +16,7 @@
"core-js": "^3.6.5",
"echarts": "^5.4.3",
"gm-crypt": "^0.0.2",
"gt-maputils": "^0.1.12",
"gt-maputils": "^0.1.13",
"less": "^4.2.0",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.0",
......
......@@ -259,7 +259,7 @@
</main>
</template>
<script setup>
import { LayerUtils, MapUtils, ViewUtils, MeasureUtils, DrawUtils } from 'gt-maputils'
import { LayerUtils, MapUtils, ViewUtils, MeasureUtils, DrawUtils, GeojsonUtils } from 'gt-maputils'
import { getList } from '@/api/module/main'
/**
......@@ -412,7 +412,15 @@ function startDraw () {
})
}
let identifyResults = []
function identify () {
if (identifyResults.length) {
for (const layer of identifyResults) {
$map.removeLayer(layer)
}
identifyResults = []
return
}
DrawUtils.startDraw($map, 'CircleMarker', {
callback: function (result) {
DrawUtils.stopDraw($map)
......@@ -436,6 +444,9 @@ function identify () {
}
Promise.all(promises).then((allResult) => {
layer.msg('识别完成')
for (const result of allResult) {
identifyResults.push(GeojsonUtils.addGeojsonLayer($map, result))
}
console.log('属性识别结果', allResult)
})
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论