zqq:遥感影像页绘制矩形
This commit is contained in:
parent
5f025a2c8e
commit
c587d3218a
|
@ -21,6 +21,8 @@ const map = ref()
|
|||
let homeMap = null
|
||||
let featureLayerG_area = null
|
||||
let featureLayerG_point = null
|
||||
let layerRectangle = null
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
homeMap = L.map(map.value, {
|
||||
|
@ -374,9 +376,24 @@ const mapOperations = {
|
|||
else {
|
||||
console.log('error')
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
drawRectangle: () => {
|
||||
if (layerRectangle != null) {
|
||||
homeMap.removeLayer(layerRectangle)
|
||||
layerRectangle = null
|
||||
}
|
||||
homeMap.pm.enableDraw('Rectangle', {
|
||||
snappable: true,
|
||||
snapDistance: 20,
|
||||
});
|
||||
homeMap.on('pm:create', (e) => {
|
||||
L.PM.reInitLayer(e.layer);
|
||||
layerRectangle = e.layer
|
||||
});
|
||||
},
|
||||
deleteRectangle: () => {
|
||||
homeMap.removeLayer(layerRectangle)
|
||||
}
|
||||
}
|
||||
//omnivore.wkt.parse('POINT(-80 0)').addTo(homeMap);
|
||||
|
||||
|
|
Loading…
Reference in New Issue