Map #

Use this component to show a location using a package-based map (react-leaflet + OpenStreetMap tiles).

Best for #

  • Office/location pages
  • Event venue references
  • Contact pages with geographic context

Notes #

  • Uses react-leaflet and Leaflet for interactive map rendering.
  • Default tiles come from OpenStreetMap (tile.openstreetmap.org) and are free.
  • You can point tileUrl to your own local/self-hosted tile server for resilience/offline workflows.
  • In MDX pages, coordinates can be passed as strings (recommended in this project).

Props #

PropTypeRequiredDescription
titlestringNoCard heading above the map.
captionstringNoSupporting text under the title.
latnumber | stringNoLatitude coordinate.
lngnumber | stringNoLongitude coordinate.
zoomnumber | stringNoZoom level from 1 to 19.
heightnumber | stringNoMap frame height in pixels.
tileUrlstringNoTile URL template. Defaults to OpenStreetMap tiles.
attributionstringNoTile attribution HTML/text shown by Leaflet.
markerLabelstringNoPopup label shown at the marker point.
classNamestringNoWrapper classes.

Live example #

Tokyo Office

Shibuya area

Another example #

NYC Meetup

Midtown Manhattan

Code #

mdx
<Map
title="Tokyo Office"
caption="Shibuya area"
lat="35.6762"
lng="139.6503"
zoom="12"
height="340"
markerLabel="Tokyo Office"
/>
<Map
title="NYC Meetup"
caption="Midtown Manhattan"
lat="40.7549"
lng="-73.9840"
zoom="13"
height="300"
markerLabel="NYC Meetup"
/>