diff --git a/app/components/layout/ListMapLayout.vue b/app/components/layout/ListMapLayout.vue deleted file mode 100644 index 446ecd9..0000000 --- a/app/components/layout/ListMapLayout.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - diff --git a/app/components/page/CatalogPage.vue b/app/components/page/CatalogPage.vue index 7a80206..0e0e54e 100644 --- a/app/components/page/CatalogPage.vue +++ b/app/components/page/CatalogPage.vue @@ -19,6 +19,7 @@
+ @@ -27,6 +28,8 @@ :key="item.uuid" :class="{ 'ring-2 ring-primary rounded-lg': item.uuid === selectedId }" @click="onItemClick(item)" + @mouseenter="emit('update:hoveredId', item.uuid)" + @mouseleave="emit('update:hoveredId', undefined)" >
@@ -42,17 +45,19 @@ - -
- - - + +
+
+ + + +
@@ -60,6 +65,7 @@
+ @@ -68,6 +74,8 @@ :key="item.uuid" :class="{ 'ring-2 ring-primary rounded-lg': item.uuid === selectedId }" @click="onItemClick(item)" + @mouseenter="emit('update:hoveredId', item.uuid)" + @mouseleave="emit('update:hoveredId', undefined)" >
@@ -120,6 +128,7 @@
+ @@ -162,6 +171,7 @@ const props = withDefaults(defineProps<{ mapId?: string pointColor?: string selectedId?: string + hoveredId?: string }>(), { loading: false, withMap: true, @@ -172,6 +182,7 @@ const props = withDefaults(defineProps<{ const emit = defineEmits<{ 'select': [item: MapItem] 'update:selectedId': [uuid: string] + 'update:hoveredId': [uuid: string | undefined] }>() // Filter items with valid coordinates for map @@ -229,6 +240,17 @@ watch(() => props.selectedId, (uuid) => { } }) +// Watch hoveredId and fly to it +watch(() => props.hoveredId, (uuid) => { + if (uuid && props.withMap) { + const item = itemsWithCoords.value.find(i => i.uuid === uuid) + if (item) { + mapRef.value?.flyTo(item.latitude, item.longitude, 8) + mobileMapRef.value?.flyTo(item.latitude, item.longitude, 8) + } + } +}) + // Expose flyTo for external use const flyTo = (lat: number, lng: number, zoom = 8) => { mapRef.value?.flyTo(lat, lng, zoom) diff --git a/app/pages/catalog/hubs/index.vue b/app/pages/catalog/hubs/index.vue index 482ce2b..3cb579a 100644 --- a/app/pages/catalog/hubs/index.vue +++ b/app/pages/catalog/hubs/index.vue @@ -5,6 +5,7 @@ map-id="hubs-map" point-color="#10b981" :selected-id="selectedHubId" + v-model:hovered-id="hoveredHubId" @select="onSelectHub" >