fix(map): 修复Cesium地图选择器在禁用状态下仍获取位置的问题

master
LiuJiaNan 2026-03-16 15:42:00 +08:00
parent ef395ceab1
commit 38f7594cf7
1 changed files with 9 additions and 7 deletions

View File

@ -86,13 +86,15 @@ const MapSelector = (props) => {
if (longitude && latitude) { if (longitude && latitude) {
addMarkPoint({ longitude, latitude }); addMarkPoint({ longitude, latitude });
} }
getLongitudeAndLatitude((error, coords) => { if (!disable) {
if (error) getLongitudeAndLatitude((error, coords) => {
return; if (error)
const { longitude, latitude } = coords; return;
setCurrentLatitude(latitude); const { longitude, latitude } = coords;
setCurrentLongitude(longitude); setCurrentLatitude(latitude);
}); setCurrentLongitude(longitude);
});
}
}; };
// 初始化地图 // 初始化地图