@berlitz/map

Map component for the Max Design System

Usage no npm install needed!

<script type="module">
  import berlitzMap from 'https://cdn.skypack.dev/@berlitz/map';
</script>

README

Map npm version

Using geographic coordinates (latitude and longitude), display a location on a functional map with a map marker and address/location information.

Installation

yarn add @berlitz/map

Props

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

Usage

import Map from '@berlitz/map'
const MyApp = () => (
  <Map
    showInfoWindowOnLoad={true}
    location={{
      lat,
      lng,
    }}
  />
)

Notes

This component is using LeafletJS as a JS mapping library and MapBox for custom map tile styles