2021-05-18 14:53:42 +00:00
|
|
|
import React from "react"
|
|
|
|
import Style from "./BoxMap.module.css"
|
|
|
|
import BoxFull from "./BoxFull"
|
|
|
|
import { MapContainer, TileLayer } from "react-leaflet"
|
|
|
|
|
|
|
|
|
2021-05-18 14:54:44 +00:00
|
|
|
export default function BoxMap({ header, setMap, startingPosition, startingZoom, button, children, additions, ...props }) {
|
2021-05-18 14:53:42 +00:00
|
|
|
return (
|
|
|
|
<BoxFull
|
|
|
|
header={header}
|
|
|
|
childrenClassName={Style.BoxMapContents}
|
|
|
|
{...props}
|
|
|
|
>
|
|
|
|
<MapContainer
|
|
|
|
center={startingPosition}
|
|
|
|
zoom={startingZoom}
|
|
|
|
className={Style.MapContainer}
|
|
|
|
whenCreated={setMap}
|
|
|
|
>
|
|
|
|
<TileLayer
|
|
|
|
attribution='(c) <a href="https://osm.org/copyright">OpenStreetMap contributors</a>'
|
|
|
|
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
|
|
/>
|
2021-05-18 14:54:44 +00:00
|
|
|
{additions}
|
2021-05-18 14:53:42 +00:00
|
|
|
<div className={"leaflet-top leaflet-right"}>
|
|
|
|
<div className={"leaflet-control"}>
|
|
|
|
{button}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</MapContainer>
|
|
|
|
</BoxFull>
|
|
|
|
)
|
|
|
|
}
|