1.area 选择的时候只有sentinel与landsat 否则选择其余的,2在切换成多边点位的时候依然显示坐标点

This commit is contained in:
yyhouc 2023-06-09 17:04:40 +08:00
parent 6b0bf3ef80
commit 923d4ea2ab
1 changed files with 35 additions and 3 deletions

View File

@ -201,7 +201,9 @@ const state = reactive({
lon: '', lon: '',
disLat: '', disLat: '',
disLon: '', disLon: '',
data: {} data: {},
data2:[],
geometry: null,
}) })
// //
onMounted(() => { onMounted(() => {
@ -209,7 +211,17 @@ onMounted(() => {
let data = res.map(item=>{ let data = res.map(item=>{
return {value:item.dictValue,label:item.dictValue} return {value:item.dictValue,label:item.dictValue}
}) })
state.sensor = data; state.data2=data;
//state.switchtrue landsatSentinel
if(state.switch){
state.sensor=state.data2.filter(item=>{
return item.value=='landsat'||item.value=='sentinel'
})
}else{
state.sensor=state.data2.filter(item=>{
return item.value!='landsat'&&item.value!='sentinel'
})
}
state.dictData = res; state.dictData = res;
}) })
}) })
@ -282,9 +294,12 @@ const addCoordinate = () => {
document.getElementsByClassName('coordinateBtn')[0].innerText = 'Add coordinates'; document.getElementsByClassName('coordinateBtn')[0].innerText = 'Add coordinates';
} }
}else{ }else{
map.value.mapOperations.drawCreated()
map.value.mapOperations.off("click", onMapClick) map.value.mapOperations.off("click", onMapClick)
map.value.mapOperations.drawPolygon() map.value.mapOperations.drawPolygon()
map.value.mapOperations.drawCreated() map.value.mapOperations.wktParseToMap(state.geometry)
} }
} }
@ -400,10 +415,27 @@ watch(
}, },
{ immediate: true } { immediate: true }
) )
//state.switch
watch(
() => state.switch,
(newValue, oldValue) => {
if(newValue){
state.sensor=state.data2.filter(item=>{
return item.value=='landsat'||item.value=='sentinel'
})
}else{
state.sensor=state.data2.filter(item=>{
return item.value!='landsat'&&item.value!='sentinel'
})
}
},
{ immediate: true }
)
const setData = (row) => { const setData = (row) => {
state.data = row; state.data = row;
state.selectID = row.disasterId state.selectID = row.disasterId
map.value.mapOperations.wktParseToMap(row.geometry) map.value.mapOperations.wktParseToMap(row.geometry)
state.geometry = row.geometry;
} }
defineExpose({ defineExpose({
setData setData