Skip to content

Commit

Permalink
Panden selection: dynamic zoom
Browse files Browse the repository at this point in the history
Adjust map zoom to area size.
  • Loading branch information
Erikvv committed Dec 17, 2024
1 parent 3b097dd commit 2c3b0bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/panden-select/panden-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {BuurtFeatureCollection, getBuurtCenter} from "../services/wijkenbuurten/
import {Bag2DPand} from "../services/bag2d"
import {GeoJSON, MapContainer, TileLayer} from "react-leaflet"
import {featureCollection} from "@turf/helpers"
import {geoJsonPositionToLeaflet} from "../services/geometry"
import {geoJsonPositionToLeaflet, geometryToBoundingBox} from "../services/geometry"
import center from "@turf/center"
import {LeafletMouseEventHandlerFn} from "leaflet"
import {PandID} from "zero-zummon"
Expand Down Expand Up @@ -52,7 +52,7 @@ export const PandenSelect: FunctionComponent<{
return (
<MapContainer
center={buurtCenter}
zoom={15}
bounds={geometryToBoundingBox(buurten)}
scrollWheelZoom={true}
style={{
minHeight: "30rem",
Expand All @@ -77,4 +77,4 @@ export const PandenSelect: FunctionComponent<{
eventHandlers={{click: removePand}} />
</MapContainer>
)
}
}

0 comments on commit 2c3b0bb

Please sign in to comment.