@berlitz/map

4.2.1 • Public • Published

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

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @berlitz/map

Weekly Downloads

2,404

Version

4.2.1

License

MIT

Unpacked Size

26.9 kB

Total Files

9

Last publish

Collaborators

  • berlitz