diff --git a/src/components/top-matter/MapSplitMatter.vue b/src/components/top-matter/MapSplitMatter.vue index 41cbac66..77d657b3 100644 --- a/src/components/top-matter/MapSplitMatter.vue +++ b/src/components/top-matter/MapSplitMatter.vue @@ -13,6 +13,7 @@ v-for="cluster in clusters" :key="cluster.center.toString()" :lat-lng="cluster.center" + @click="zoomTo(cluster.center)" >
@@ -112,6 +113,12 @@ export default defineComponent({ clusterPreviewUrl(cluster: IMarkerCluster) { return API.MAP_CLUSTER_PREVIEW(cluster.id); }, + + zoomTo(center: [number, number]) { + const map = this.$refs.map as LMap; + const zoom = Math.max(map.mapObject.getZoom() + 2, 14); + map.mapObject.setView(center, zoom, { animate: true }); + }, }, }); @@ -146,6 +153,7 @@ export default defineComponent({ height: 100%; object-fit: cover; border-radius: 5px; + cursor: pointer; } .count {