leaflet-nextjs-ts-starter
leaflet-nextjs-ts-starter copied to clipboard
add global view state handling
firestarter: https://github.com/richard-unterberg/leaflet-nextjs-ts-starter/issues/24
- add zustand
- create map store slice
- implement only viewState
interface ViewState {
boundingBox: BoundingBox
center: LatLnLike
zoom: number
}
- implement in header
- edit examples using new slice
additional resources:
- add simple viewState check: https://github.com/richard-unterberg/leaflet-nextjs-ts-starter/commit/0ac904d36aa8d94a0e3755d61d43933941036c15
- https://github.com/richard-unterberg/maplibre-nextjs-ts-starter/blob/main/src/zustand/useMapStore.ts