We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3a5427 commit 939bdd9Copy full SHA for 939bdd9
src/plugins/geoLocation/components/GeoLocation.ce.vue
@@ -44,7 +44,24 @@ const tooltipPosition = computed(() =>
44
)
45
46
watch(center, () => {
47
- if (position.value !== center.value) {
+ if (
48
+ !position.value.length ||
49
+ !center.value.length ||
50
+ position.value[0] === undefined ||
51
+ position.value[1] === undefined ||
52
+ center.value[0] === undefined ||
53
+ center.value[1] === undefined
54
+ ) {
55
+ return
56
+ }
57
+
58
+ const tolerance = 0.0001
59
+ const coordinateDifference = Math.sqrt(
60
+ Math.pow(position.value[0] - center.value[0], 2) +
61
+ Math.pow(position.value[1] - center.value[1], 2)
62
+ )
63
64
+ if (coordinateDifference > tolerance) {
65
mapHasBeenMovedByUser.value = true
66
}
67
})
0 commit comments