Skip to content

Commit

Permalink
MapView: Set default zoom level to 15 for Point type (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Jul 30, 2024
1 parent ab35d6b commit 411299e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/client/components/MapView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
defineProps({
const props = defineProps({
location: Object,
})
Expand All @@ -8,6 +8,9 @@ import { LMap, LTileLayer, LGeoJson } from "@vue-leaflet/vue-leaflet"
const geojsonLayerReady = (layer) => {
layer._map?.fitBounds(layer.getBounds())
if (props.location.type === "Point") {
layer._map?.setZoom(15)
}
}
</script>
Expand Down

0 comments on commit 411299e

Please sign in to comment.