|
|
@@ -133,6 +133,7 @@
|
|
|
const searchMarker = ref({ lat: 0, lng: 0 });
|
|
|
const searchMarkerShow = ref(false);
|
|
|
const searchMarkerRef = ref();
|
|
|
+ const isCanClick = ref(false);
|
|
|
const googleKey = computed(() => import.meta.env.VITE_GOOGLE_KEY);
|
|
|
|
|
|
const lang = computed(() => localeStore.getLocale);
|
|
|
@@ -177,7 +178,7 @@
|
|
|
// @ts-ignore
|
|
|
const autocomplete = new google.maps.places.Autocomplete(input, options);
|
|
|
// debugger;
|
|
|
-
|
|
|
+ isCanClick.value = true;
|
|
|
console.log('map', map);
|
|
|
autocomplete.bindTo('bounds', map);
|
|
|
autocomplete.addListener('place_changed', () => {
|
|
|
@@ -203,7 +204,7 @@
|
|
|
searchMarkerRef.value.marker.position = searchMarker.value;
|
|
|
}
|
|
|
});
|
|
|
- }, 1000);
|
|
|
+ }, 600);
|
|
|
}
|
|
|
if (ready && currentLatLng?.lat && currentLatLng?.lng) {
|
|
|
// debugger;
|
|
|
@@ -218,7 +219,7 @@
|
|
|
|
|
|
map.setCenter(searchMarker.value);
|
|
|
map.setZoom(17);
|
|
|
- }, 1000);
|
|
|
+ }, 600);
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -247,6 +248,9 @@
|
|
|
}
|
|
|
};
|
|
|
const handleMapClick = async (event) => {
|
|
|
+ if (!isCanClick.value) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
const { lat, lng } = event.latLng;
|
|
|
searchMarker.value.lat = lat();
|
|
|
searchMarker.value.lng = lng();
|