diff --git a/ts/components/MapLocator.vue b/ts/components/MapLocator.vue index 0a0aa37e..573cf0e1 100644 --- a/ts/components/MapLocator.vue +++ b/ts/components/MapLocator.vue @@ -191,7 +191,6 @@ const props = withDefaults(defineProps(), { const emit = defineEmits(); // Refs -const clickTimeout = ref(null); const isLoaded = ref(false); const map: Ref = shallowRef(null); const mapContainer = ref(null); @@ -301,21 +300,14 @@ function initializeMap() { return; } - // Use timeout to distinguish between click and drag - if (clickTimeout.value) { - clearTimeout(clickTimeout.value); - } - - clickTimeout.value = window.setTimeout(() => { - emit("click", { - location: { - latitude: e.lngLat.lat, - longitude: e.lngLat.lng, - }, - map: _map, - point: e.point, - }); - }, 100); + emit("click", { + location: { + latitude: e.lngLat.lat, + longitude: e.lngLat.lng, + }, + map: _map, + point: e.point, + }); }); _map.on("load", () => { @@ -545,10 +537,6 @@ onMounted(() => { }); onUnmounted(() => { - if (clickTimeout.value) { - clearTimeout(clickTimeout.value); - } - // Remove all markers mapMarkers.value.forEach((marker) => marker.remove()); mapMarkers.value.clear();