This commit is contained in:
zengmingjie 2025-06-26 23:32:16 +08:00
parent 534baec75d
commit ce846cc58f
1 changed files with 16 additions and 13 deletions

View File

@ -70,6 +70,7 @@ export default {
watch: { watch: {
positionPoint: { positionPoint: {
handler(newVal) { handler(newVal) {
if (newVal) {
if (newVal && this.latitude && this.longitude && window.olMap) { if (newVal && this.latitude && this.longitude && window.olMap) {
const newLocation = fromLonLat( const newLocation = fromLonLat(
[this.longitude, this.latitude], [this.longitude, this.latitude],
@ -81,10 +82,12 @@ export default {
center: newLocation, center: newLocation,
zoom: 13 zoom: 13
}); });
this.$store.commit("SET_POSITIONPOINT", false); }
} else { if (this.latitude === "" && this.longitude === "") {
this.$message.error("定位失败,请稍后重试"); this.$message.error("定位失败,请稍后重试");
} }
this.$store.commit("SET_POSITIONPOINT", false);
}
}, },
deep: true deep: true
} }