diff --git a/components/Home/Home.vue b/components/Home/Home.vue index 8d33d60b..277ca095 100644 --- a/components/Home/Home.vue +++ b/components/Home/Home.vue @@ -284,7 +284,10 @@ watch(isModeFavorites, async (isEnabled) => { // // Methods // -function goToSelectedFeature() { +function goToSelectedFeature(feature?: ApiPoi) { + if (feature) + mapStore.setSelectedFeature(feature) + if (mapFeaturesRef.value) mapFeaturesRef.value.goToSelectedFeature() } @@ -553,11 +556,11 @@ function handlePoiCardClose() { > () -const emit = defineEmits(['toggleFavoriteMode', 'toggleNoteBookMode']) +const emit = defineEmits<{ + (e: 'exploreClick', poi: ApiPoi): void + (e: 'favoriteClick', poi: ApiPoi): void + (e: 'toggleFavoriteMode'): void + (e: 'toggleNoteBookMode'): void + (e: 'zoomClick', poi: ApiPoi): void +}>() const device = useDevice() const notebookModal = ref(false) @@ -24,9 +28,9 @@ const mapStore = useMapStore() const { isModeFavorites } = storeToRefs(mapStore) const { favoriteCount } = storeToRefs(useFavoriteStore()) -function explore(poi: ApiPoi) { +function onExploreClick(poi: ApiPoi) { notebookModal.value = false - props.exploreAroundSelectedPoi(poi) + emit('exploreClick', poi) } function onClose() { @@ -35,13 +39,8 @@ function onClose() { } function onZoomClick(poi: ApiPoi) { - mapStore.setSelectedFeature(poi) notebookModal.value = false - props.goToSelectedPoi(poi) -} - -function handleFavorite(poi: ApiPoi) { - props.toggleFavorite(poi) + emit('zoomClick', poi) } const { $tracking } = useNuxtApp() @@ -107,8 +106,8 @@ async function toggleNoteBookMode() { max-width="80rem" >