Map component for the Max Design System
Using geographic coordinates (latitude and longitude), display a location on a functional map with a map marker and address/location information.
``shell`
yarn add @berlitz/map
| Argument | Type | Required | Default | Description |
| -------------------- | ------ | -------- | --------------------------------- | ----------------------------------------------------------------------- |
| children | node | ✅ | | Children elements passed directly into the components output |
| location | object | ✅ | | latitude and longitude values for marker. See propTypes for the shape. |
| height | string | ✅ | | Specifies the height of the map e.g. 400px |
| showInfoWindowOnLoad | bool | ❌ | true | Specifies if the info window will be open or closed on initial map load |
| marker | string | ❌ | "./marker.png" | Path to marker image file |
| mapBoxStyle | string | | mapbox://styles/mapbox/streets-v9 | mapbox://styles/ACCOUNT_NAME/STYLE_ID |
| mapBoxAccessToken | string | | | |
| leaflet | bool | | false | |
`jsx``
import Map from '@berlitz/map'
const MyApp = () => (
showInfoWindowOnLoad={true}
location={{
lat,
lng,
}}
/>
)
This component is using LeafletJS as a JS mapping library and MapBox for custom map tile styles