Map

Map component supporting background, static, and interactive display modes with OpenStreetMap tiles and multiple marker points via MapPoint children

Required Props: idSupports Children: MapPoint

Structure

All styling goes in props.className as a single Tailwind utility string. Non-class props (text, src, alt, etc.) stay on their own keys. root.animation for scroll effects.

Properties

PropertyTypeDescriptionExamples
latnumber
Center latitude coordinate
Default: 51.505
40.7128
lngnumber
Center longitude coordinate
Default: -0.09
-74.006
zoomnumber
Zoom level (1=world, 10=city, 15=streets, 18=buildings)
Default: 13
14
typestring
background | static | interactive
Display type: background (static tile image), static (tile with marker dots), interactive (full Leaflet map with pan/zoom)
Default: "interactive"
-
tileStylestring
osm | cartodb-positron | cartodb-dark | cartodb-voyager
Map tile visual style
Default: "osm"
-
grayscalebooleanstring
Apply grayscale CSS filter to the map
Default: false
-
titlestring
Map title for accessibility (aria-label)
-
canDeleteboolean
-
Default: true
-
canEditNameboolean
-
Default: true
-
customobject
-
-
classNamestring
Tailwind utility classes string. Mobile-first: unprefixed = base, md: = 768px+, sm: = 640px+, lg: = 1024px+. Includes layout, spacing, surface design, and typography.
flex flex-col gap-space-sm py-space-lg px-container-x md:flex-rowbg-primary text-primary-content rounded-box py-3.5 px-6 font-semibold
urlstring
-
-
urlTargetstring
-
-
rolestring
-
-
aria-labelstring
-
-
aria-hiddenstring
-
-
aria-describedbystring
-
-
aria-livestring
polite | assertive | off
-
-
rootobject
-
-

Examples

Interactive Map with Two Locations

{
  "lat": 40.7128,
  "lng": -74.006,
  "zoom": 12,
  "type": "interactive",
  "tileStyle": "osm",
  "title": "Our Store Locations",
  "className": "aspect-video"
}

Grayscale Background Map

{
  "lat": 51.505,
  "lng": -0.09,
  "zoom": 13,
  "type": "background",
  "tileStyle": "cartodb-positron",
  "grayscale": true,
  "className": "aspect-video"
}