Reference
Complete reference for all map components and their props.
Component Anatomy
All components you can use and combine to build your map.
<Map>
{/* Markers */}
<MapMarker coordinates={[lng, lat]}>
<MarkerContent>
<MarkerLabel />
<MarkerAvatar src="..." />
<MarkerAvatarPin src="..." />
</MarkerContent>
<MarkerPopup />
<MarkerTooltip />
</MapMarker>
<MapMarkerAnimated id="animated" path={[[lng, lat], ...]} />
{/* Popup */}
<MapPopup coordinates={[lng, lat]} />
{/* Controls */}
<MapControls position="bottom-right">
<MapZoom />
<MapOrientation />
<MapGeolocate />
<MapFullscreen />
</MapControls>
<MapCompass />
{/* Features */}
<MapMiniMap />
<MapLine coordinates={[[lng, lat], ...]} />
<MapPolygon coordinates={[[lng, lat], ...]} />
<MapCircle center={[lng, lat]} radius={1000} />
<MapAnimatedCircle id="zone" center={[lng, lat]} radius={1000} />
<MapLineAnimated id="route" path={[[lng, lat], ...]} />
<MapLineRadial id="radial" origin={[lng, lat]} destinations={[[lng, lat], ...]} />
<MapArcAnimated id="arc" origin={[lng, lat]} destination={[lng, lat]} />
<MapCameraFollow path={[[lng, lat], ...]} />
<MapAnimatedPolygon id="zone" coordinates={[[lng, lat], ...]} />
<MapCircleCluster data={geoJsonData} />
<MapChoropleth data={geoJsonData} valueProperty="density" colorScale={colorScale} />
<MapAnimatedPulse id="pulse" size={100} coordinates={[lng, lat]} />
<MapImage id="overlay" url="..." coordinates={[...]} />
<MapRasterVideo id="video" urls={[...]} coordinates={[...]} />
<MapBlurArea coordinates={[[lng, lat], ...]} />
<MapTargetingReticle coordinates={[lng, lat]} />
<MapRain />
<MapSnow />
<MapSandstorm />
{/* Effects */}
<MapFire id="fire" coordinates={[lng, lat]} />
<MapExplosion id="explosion" coordinates={[lng, lat]} />
<MapCyclone id="cyclone" coordinates={[lng, lat]} />
<MapMeteor id="meteor" target={[lng, lat]} />
<MapLightning id="lightning" coordinates={[lng, lat]} />
<MapSteam id="steam" coordinates={[lng, lat]} />
<MapTsunami id="tsunami" origin={[lng, lat]} target={[lng, lat]} />
{/* Overlays */}
<MapMusicDisc coordinates={[lng, lat]} />
<MapAnimatedFootprint path={[[lng, lat], ...]} />
<MapGrid />
<MapRadar id="radar" coordinates={[lng, lat]} />
<MapWatermark>TEXT</MapWatermark>
</Map>Map
The root container that initializes the map and provides context to all child components. Supports both Mapbox GL JS and MapLibre GL JS. Automatically handles theme switching between light and dark modes.
Extends MapOptions from Mapbox GL (excluding container and style).
| Prop | Type | Description |
|---|---|---|
accessToken | string | Mapbox access token. Required. |
children | ReactNode | Child components (markers, popups, controls, features). |
center | [number, number] | Initial map center [longitude, latitude]. |
zoom | number | Initial zoom level. |
bearing | number | Map bearing (rotation) in degrees. |
pitch | number | Map pitch (tilt) in degrees. |
projection | string | Map projection: mercator, globe, albers, equalEarth, equirectangular, lambertConformalConic, naturalEarth, winkelTripel. |
style | string | Map style URL (e.g., 'mapbox://styles/mapbox/streets-v12'). Overrides theme-based styles. |
styles | MapThemeStyles | Theme-aware styles object. Use presets: defaultMapStyles, standardMapStyles, streetsMapStyles, outdoorsMapStyles, satelliteMapStyles, navigationMapStyles. |
minZoom | number | Minimum zoom level constraint. |
maxZoom | number | Maximum zoom level constraint. |
maxBounds | [[number, number], [number, number]] | Restrict map panning to a geographic area [southwest, northeast]. |
loader | ReactNode | Custom loading component shown while map initializes. |
showLoader | boolean | Controls loader visibility. When true, forces loader. When false, hides. When undefined, uses internal loading state. |
autoRotate | boolean | Enables automatic rotation. Only works with projection="globe". |
rotateSpeed | number | Rotation speed in degrees per second when autoRotate is enabled. |
MapControls
Container for map control components. Accepts composable control components as children (MapZoom, MapOrientation, MapGeolocate, MapFullscreen). Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
position | "top-left" | "top-right" | "bottom-left" | "bottom-right" | Position of the controls on the map. |
children | ReactNode | Control components (MapZoom, MapOrientation, MapGeolocate, MapFullscreen). |
className | string | Additional CSS classes for the controls container. |
MapZoom
Zoom in and zoom out control buttons. Must be used inside MapControls.
No props required.
MapOrientation
Compass control that shows map orientation and resets bearing to north when clicked. Must be used inside MapControls.
No props required.
MapGeolocate
Geolocate control to find and fly to user's current location. Must be used inside MapControls.
| Prop | Type | Description |
|---|---|---|
onLocate | (coords: { longitude: number; latitude: number }) => void | Callback with user coordinates when located. |
MapFullscreen
Fullscreen toggle control. Must be used inside MapControls.
No props required.
MapCompass
Interactive compass with drag-to-rotate functionality. Dragging the compass rotates the map bearing. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
size | "sm" | "md" | "lg" | "xl" | number | Compass size. T-shirt sizes map to 48, 64, 80, 96 pixels respectively. |
position | "top-left" | "top-right" | "bottom-left" | "bottom-right" | Position of the compass on the map. |
showCardinals | boolean | Show N, S, E, W cardinal direction labels. |
showRing | boolean | Show outer ring with degree tick marks. |
showBearing | boolean | Display current bearing in degrees below the compass. |
autoRotate | boolean | Enable automatic rotation of the compass. |
autoRotateSpeed | number | Speed of auto rotation in degrees per frame. |
className | string | Additional CSS classes for the wrapper element. |
MapMarker
A container for marker-related components. Provides context for its children and handles marker positioning.
Extends MarkerOptions from Mapbox GL (excluding element).
| Prop | Type | Description |
|---|---|---|
coordinates | [number, number] | Coordinates [longitude, latitude] for marker position. |
children | ReactNode | Marker subcomponents (MarkerContent, MarkerPopup, etc). |
onClick | (e: MouseEvent) => void | Callback when marker is clicked. |
onMouseEnter | (e: MouseEvent) => void | Callback when mouse enters marker. |
onMouseLeave | (e: MouseEvent) => void | Callback when mouse leaves marker. |
onDragStart | (lngLat: LngLatCoordinates) => void | Callback when marker drag starts (requires draggable: true). |
onDrag | (lngLat: LngLatCoordinates) => void | Callback during marker drag (requires draggable: true). |
onDragEnd | (lngLat: LngLatCoordinates) => void | Callback when marker drag ends (requires draggable: true). |
MarkerContent
Renders the visual content of a marker. Must be used inside MapMarker. If no children provided, renders a default blue dot marker.
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Custom marker content. Defaults to a blue dot. |
className | string | Additional CSS classes for the marker container. |
MarkerPopup
Renders a popup attached to the marker that opens on click. Must be used inside MapMarker.
Extends PopupOptions from Mapbox GL (excluding className and closeButton).
className and closeButton from Mapbox's PopupOptions are excluded to prevent style conflicts. Use the component's own props to style the popup. Mapbox's default popup styles are reset via CSS.| Prop | Type | Description |
|---|---|---|
children | ReactNode | Popup content. |
className | string | Additional CSS classes for the popup container. |
closeButton | boolean | Show a close button in the popup. |
MarkerTooltip
Renders a tooltip that appears on hover. Must be used inside MapMarker.
Extends PopupOptions from Mapbox GL (excluding className, closeButton, and closeOnClick as tooltips auto-dismiss on hover out).
className from Mapbox's PopupOptions is excluded to prevent style conflicts. Use the component's own className prop to style the tooltip content. Mapbox's default popup styles are reset via CSS.| Prop | Type | Description |
|---|---|---|
children | ReactNode | Tooltip content. |
className | string | Additional CSS classes for the tooltip container. |
MarkerLabel
Renders a text label above or below the marker. Must be used inside MarkerContent.
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Label text content. |
className | string | Additional CSS classes for the label. |
position | "top" | "bottom" | Position of the label relative to the marker. |
MapPopup
A standalone popup component that can be placed anywhere on the map without a marker. Must be used inside Map.
Extends PopupOptions from Mapbox GL (excluding className and closeButton).
className and closeButton from Mapbox's PopupOptions are excluded to prevent style conflicts. Use the component's own props to style the popup. Mapbox's default popup styles are reset via CSS.| Prop | Type | Description |
|---|---|---|
coordinates | [number, number] | Coordinates [longitude, latitude] for popup position. |
onClose | () => void | Callback when popup is closed. |
children | ReactNode | Popup content. |
className | string | Additional CSS classes for the popup container. |
closeButton | boolean | Show a close button in the popup. |
MapMarkerAnimated
Renders an animated marker that moves along a path. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the animated marker. |
coordinates | [number, number][] | Array of [longitude, latitude] pairs defining the path. |
color | string | Marker color. |
size | number | Marker radius in pixels. |
duration | number | Animation duration in milliseconds. |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop animation continuously. |
showPath | boolean | Show the path/route line. |
pathColor | string | Path line color. |
pathWidth | number | Path line width in pixels. |
onComplete | () => void | Callback when animation completes. |
MapLine
Renders a line on the map connecting coordinate points. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
coordinates | [number, number][] | Array of [longitude, latitude] coordinate pairs. |
color | string | Line color (CSS color value). |
width | number | Line width in pixels. |
opacity | number | Line opacity (0 to 1). |
dashArray | [number, number] | Dash pattern [dash length, gap length] for dashed lines. |
MapPolygon
Renders a filled polygon on the map. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
coordinates | [number, number][] | Array of [longitude, latitude] coordinate pairs defining the polygon vertices. |
fillColor | string | Fill color of the polygon. |
fillOpacity | number | Fill opacity (0 to 1). |
strokeColor | string | Stroke/outline color. |
strokeWidth | number | Stroke width in pixels. |
strokeOpacity | number | Stroke opacity (0 to 1). |
dashArray | [number, number] | Dash pattern [dash length, gap length] for dashed strokes. |
MapCircle
Renders a geographic circle on the map with a center point and radius in meters. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
center | [number, number] | Center point [longitude, latitude] of the circle. |
radius | number | Radius of the circle in meters. |
fillColor | string | Fill color of the circle. |
fillOpacity | number | Fill opacity (0 to 1). |
strokeColor | string | Stroke/outline color. |
strokeWidth | number | Stroke width in pixels. |
strokeOpacity | number | Stroke opacity (0 to 1). |
dashArray | [number, number] | Dash pattern [dash length, gap length] for dashed strokes. |
segments | number | Number of segments for circle smoothness. |
draggable | boolean | Enable dragging to reposition the circle. |
cursor | string | Cursor style when hovering over draggable circle. |
onDragStart | (center: [number, number]) => void | Callback when drag begins. |
onDrag | (center: [number, number]) => void | Callback during drag with new center coordinates. |
onDragEnd | (center: [number, number]) => void | Callback when drag ends with final center coordinates. |
MapAnimatedCircle
Renders an animated circle with drawing outline and fill effects. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the animated circle. |
center | [number, number] | Center point [longitude, latitude] of the circle. |
radius | number | Radius of the circle in meters. |
strokeColor | string | Color of the circle outline. |
strokeWidth | number | Width of the circle outline in pixels. |
strokeOpacity | number | Opacity of the circle outline (0-1). |
strokeDashArray | number[] | Dash pattern [dash, gap] for dashed outline effect. |
fillColor | string | Color of the circle fill. |
fillOpacity | number | Target opacity of the circle fill (0-1). |
duration | number | Duration of outline drawing animation in milliseconds. |
fillDuration | number | Duration of fill animation in milliseconds. |
animationMode | "draw" | "fill" | Animation mode: outline only or outline then fill. |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop the animation continuously. |
loopDelay | number | Delay before restarting loop in milliseconds. |
segments | number | Number of segments for circle smoothness. |
onDrawComplete | () => void | Callback when outline drawing completes. |
onFillComplete | () => void | Callback when fill animation completes. |
onComplete | () => void | Callback when entire animation completes. |
MapCircleCluster
Renders clustered point data using Mapbox GL's native clustering. Automatically groups nearby points into clusters that expand on click. Must be used inside Map. Supports a generic type parameter for typed feature properties: MapCircleCluster<MyProperties>.
| Prop | Type | Description |
|---|---|---|
data | string | GeoJSON.FeatureCollection | GeoJSON FeatureCollection data or URL to fetch GeoJSON from. |
clusterMaxZoom | number | Maximum zoom level to cluster points on. |
clusterRadius | number | Radius of each cluster when clustering points (in pixels). |
clusterColors | [string, string, string] | Colors for cluster circles: [small, medium, large] based on point count. |
clusterThresholds | [number, number] | Point count thresholds for color/size steps: [medium, large]. |
pointColor | string | Color for unclustered individual points. |
onPointClick | (feature: GeoJSON.Feature, coordinates: [number, number]) => void | Callback when an unclustered point is clicked. |
onClusterClick | (clusterId: number, coordinates: [number, number], pointCount: number) => void | Callback when a cluster is clicked. If not provided, zooms into the cluster. |
MapChoropleth
Colors geographic regions based on data values. Supports GeoJSON data with Polygon or MultiPolygon features. Must be used inside Map. Supports a generic type parameter for typed feature properties: MapChoropleth<MyProperties>.
| Prop | Type | Description |
|---|---|---|
data | string | GeoJSON.FeatureCollection | GeoJSON URL or FeatureCollection with Polygon/MultiPolygon features. |
valueProperty | string | Property name in feature.properties to use for coloring. |
colorScale | ChoroplethColorScale | Color scale configuration: { stops: [{ value, color }], interpolation?: 'linear' | 'step', nullColor? }. |
fillOpacity | number | Fill opacity (0-1). |
strokeColor | string | Border color between regions. |
strokeWidth | number | Border width in pixels. |
strokeOpacity | number | Border opacity (0-1). |
hoverEnabled | boolean | Enable hover highlighting effect. |
hoverFillOpacity | number | Fill opacity when hovered. |
hoverStrokeColor | string | Border color when hovered. |
hoverStrokeWidth | number | Border width when hovered. |
onClick | (event: ChoroplethClickEvent) => void | Callback when a region is clicked. Event includes feature, value, and coordinates. |
onHover | (event: ChoroplethHoverEvent) => void | Callback when hovering over regions. Event includes feature, value, and coordinates. |
MapAnimatedPulse
Renders an animated pulsing dot at specified coordinates. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the pulse animation. |
size | number | Pulse size in pixels. |
coordinates | [number, number] | Coordinates [longitude, latitude] for pulse position. |
color | string | Inner circle color. |
pulseColor | string | Outer pulsing circle color. |
duration | number | Animation duration in milliseconds. |
MapAnimatedPolygon
Renders an animated polygon with drawing outline and fill effects. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the polygon. |
coordinates | [number, number][] | Array of [longitude, latitude] pairs defining polygon vertices. |
strokeColor | string | Color of the polygon outline. |
strokeWidth | number | Width of the polygon outline in pixels. |
strokeOpacity | number | Opacity of the polygon outline (0-1). |
fillColor | string | Color of the polygon fill. |
fillOpacity | number | Target opacity of the polygon fill (0-1). |
duration | number | Duration of outline drawing animation in milliseconds. |
fillDuration | number | Duration of fill animation in milliseconds. |
animationMode | "draw" | "fill" | "draw-then-fill" | Animation sequence mode. |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop the animation continuously. |
loopDelay | number | Delay before restarting loop in milliseconds. |
onDrawComplete | () => void | Callback when outline drawing completes. |
onFillComplete | () => void | Callback when fill animation completes. |
onComplete | () => void | Callback when entire animation completes. |
MapMiniMap
Displays an overview minimap showing the current viewport context. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
position | "top-left" | "top-right" | "bottom-left" | "bottom-right" | Position of the minimap on the map. |
width | number | Minimap width in pixels. |
height | number | Minimap height in pixels. |
zoomOffset | number | Zoom offset relative to main map. |
style | string | Custom map style URL for the minimap. Overrides theme-based styles. |
styles | MapThemeStyles | Theme-aware styles object with light/dark variants. Automatically switches based on theme. |
boxColor | string | Color of the viewport box outline. |
boxBorderWidth | number | Width of the viewport box border. |
rounded | number | "full" | "none" | Border radius in pixels, "full" for circular, or "none". |
draggable | boolean | Allow users to drag the minimap anywhere within the map. |
MapBlurArea
Renders blur effect overlays on specified areas of the map. Supports single or multiple areas. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
coordinates | [number, number][] | Array of [longitude, latitude] coordinate pairs defining a single blur area. |
areas | BlurAreaConfig[] | Array of blur area configs for multiple regions. Each config: { coordinates, blur?, backgroundColor?, rounded? }. |
blur | number | Default blur intensity in pixels. |
backgroundColor | string | Default background color overlay (e.g., "rgba(0,0,0,0.3)"). |
rounded | number | "full" | Default border radius in pixels or "full" for circular. |
blockInteraction | boolean | Prevent map interactions on blur areas. |
MapTargetingReticle
Renders a targeting reticle overlay with corner brackets that can track and lock onto targets. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
coordinates | [number, number] | Current reticle position [longitude, latitude]. |
target | [number, number] | Target coordinates to track towards. |
size | number | Reticle size in pixels. |
bracketLength | number | Length of corner brackets in pixels. |
bracketThickness | number | Thickness of corner brackets in pixels. |
gap | number | Gap between brackets and reticle edge in pixels. |
color | string | Default reticle color. |
lockedColor | string | Color when locked on target. |
locked | boolean | Whether the reticle is locked on target. |
trackingSpeed | number | Speed of tracking interpolation (0-1). |
showCrosshair | boolean | Show crosshair lines in the center. |
showCoordinates | boolean | Display coordinates below the reticle. |
onLocked | () => void | Callback when reticle locks onto target. |
MapLineAnimated
Renders an animated line that draws progressively along the route. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the animated line. |
path | Array<[number, number]> | Array of [longitude, latitude] coordinate pairs. |
color | string | Line color. |
width | number | Line width in pixels. |
opacity | number | Line opacity (0 to 1). |
dashArray | [number, number] | Dash pattern [dash length, gap length] for dashed lines. |
duration | number | Animation duration in milliseconds. |
showMarker | boolean | Whether to show a marker moving along the line. |
markerColor | string | Marker color. |
markerIcon | ReactNode | Custom marker icon (React component). |
markerBorderless | boolean | Remove border/outline from marker. |
autoStart | boolean | Auto-start animation on mount. |
loop | boolean | Loop animation continuously. |
onComplete | () => void | Callback when animation completes. |
MapLineRadial
Renders animated curved lines spreading from a central origin to multiple destinations. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the radial lines. |
origin | [number, number] | Origin coordinates [longitude, latitude]. |
destinations | RadialDestination[] | Array of destinations. Each can be [lng, lat] or { coordinates, color?, label? }. |
color | string | Default line color. |
width | number | Line width in pixels. |
opacity | number | Line opacity (0 to 1). |
dashArray | [number, number] | Dash pattern [dash length, gap length] for dashed lines. |
curvature | number | "auto" | Curve intensity (0-1) or "auto" to calculate based on distance. |
curveSegments | number | Number of segments for smooth curves. |
duration | number | Animation duration per line in milliseconds. |
staggerDelay | number | Delay between starting each line animation. |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop the animation continuously. |
loopDelay | number | Delay before restarting loop in milliseconds. |
showOriginMarker | boolean | Show marker at origin point. |
originMarkerColor | string | Origin marker color. |
originMarkerIcon | ReactNode | Custom origin marker icon. |
originMarkerPulse | boolean | Show pulse animation on origin marker. |
showDestinationMarkers | boolean | Show markers at destination points. |
destinationMarkerColor | string | Destination marker color (defaults to line color). |
destinationMarkerIcon | ReactNode | Custom destination marker icon. |
showTravelingMarker | boolean | Show marker traveling along the active line. |
travelingMarkerColor | string | Traveling marker color (defaults to line color). |
travelingMarkerIcon | ReactNode | Custom traveling marker icon. |
onLineComplete | (index: number, destination: [number, number]) => void | Callback when a line animation completes. |
onComplete | () => void | Callback when all line animations complete. |
MapArcAnimated
Renders an animated curved arc between two points. Useful for visualizing flights, deliveries, and point-to-point connections. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the arc. |
origin | [number, number] | Starting point coordinates [longitude, latitude]. |
destination | [number, number] | Ending point coordinates [longitude, latitude]. |
color | string | Arc line color. |
width | number | Line width in pixels. |
opacity | number | Line opacity (0 to 1). |
dashArray | [number, number] | Dash pattern [dash length, gap length] for dashed arcs. |
height | number | Curve height multiplier (0 = straight line, higher = more curved). |
segments | number | Number of segments for curve smoothness. |
duration | number | Animation duration in milliseconds. |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop the animation continuously. |
loopDelay | number | Delay before restarting loop in milliseconds. |
headType | "none" | "circle" | "square" | "arrow" | Shape of the traveling marker at the arc tip. |
headSize | number | Size of the head marker in pixels. |
showOriginMarker | boolean | Show marker at the origin point. |
originMarkerColor | string | Origin marker color (defaults to arc color). |
showDestinationMarker | boolean | Show marker at destination when animation completes. |
destinationMarkerColor | string | Destination marker color (defaults to arc color). |
onComplete | () => void | Callback when animation completes. |
MapCameraFollow
Animates the camera along a path of coordinates for immersive fly-through experiences. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
path | [number, number][] | Array of [longitude, latitude] coordinates for the camera to follow. Required. |
duration | number | Animation duration in milliseconds. |
zoom | number | Camera zoom level during flight. |
pitch | number | Camera tilt angle (0-85 degrees). |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop the animation continuously. |
loopDelay | number | Delay before restarting loop in milliseconds. |
onComplete | () => void | Callback when animation completes. |
marker | boolean | ReactNode | Navigation marker. Use true for default arrow, or pass a custom React element. |
markerSize | number | Size of the default navigation marker in pixels. |
MapCompare
Displays two maps side-by-side for visual comparison. This component creates its own map instances and does not require a parent Map component.
| Prop | Type | Description |
|---|---|---|
accessToken | string | Mapbox access token. Required. |
beforeStyle | string | Map style for the before (left/top) map. |
afterStyle | string | Map style for the after (right/bottom) map. |
center | [number, number] | Initial map center [longitude, latitude]. |
zoom | number | Initial zoom level. |
bearing | number | Map bearing (rotation) in degrees. |
pitch | number | Map pitch (tilt) in degrees. |
projection | "globe" | "mercator" | "naturalEarth" | "equalEarth" | "winkelTripel" | Map projection type. |
defaultSize | number | Initial split position as percentage (0-100). |
orientation | "horizontal" | "vertical" | Compare layout direction. Horizontal shows left/right, vertical shows top/bottom. |
showLabels | boolean | Show Before/After or Top/Bottom labels on each map panel. |
loader | ReactNode | Custom loading component. |
MapSync
Displays 2 or 4 synchronized maps where panning, zooming, or rotating one map updates all others in real-time. This component creates its own map instances and does not require a parent Map component.
| Prop | Type | Description |
|---|---|---|
accessToken | string | Mapbox access token. Required. |
maps | MapConfig[] | Array of 2 or 4 map configurations. Each config: { style?, styles?, label? }. |
layout | "horizontal" | "vertical" | "grid" | Layout arrangement. Grid requires 4 maps for a 2x2 layout. |
center | [number, number] | Initial map center [longitude, latitude]. |
zoom | number | Initial zoom level. |
bearing | number | Map bearing (rotation) in degrees. |
pitch | number | Map pitch (tilt) in degrees. |
projection | "globe" | "mercator" | "naturalEarth" | "equalEarth" | "winkelTripel" | Map projection type. |
showLabels | boolean | Show labels on each map panel. |
loader | ReactNode | Custom loading component. |
MapImage
Overlays an image on the map at specified coordinates. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the image layer. |
url | string | Image URL to display. |
coordinates | [[number, number], [number, number], [number, number], [number, number]] | Four corner coordinates [topLeft, topRight, bottomRight, bottomLeft] as [lng, lat] pairs. |
opacity | number | Image opacity (0 to 1). |
MapRasterVideo
Overlays video content on the map at specified coordinates. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the video layer. |
urls | string[] | Array of video URLs (provide multiple formats for browser compatibility). |
coordinates | [[number, number], [number, number], [number, number], [number, number]] | Four corner coordinates [topLeft, topRight, bottomRight, bottomLeft] as [lng, lat] pairs. |
opacity | number | Video opacity (0 to 1). |
autoplay | boolean | Auto-play video on load. |
loop | boolean | Loop video playback. |
muted | boolean | Mute video audio. |
MapRain
Adds an animated rain weather effect overlay to the map. Requires Mapbox GL JS v3.9 or higher. Must be used inside Map.
createZoomInterpolation helper to create zoom-based effects.| Prop | Type | Description |
|---|---|---|
density | number | any[] | Rain density (0-1) or Mapbox expression for zoom-based density. |
intensity | number | Rain intensity (0-1). |
color | string | Rain droplet color. |
opacity | number | Rain opacity (0-1). |
vignette | number | any[] | Vignette effect strength (0-1) or Mapbox expression. |
vignetteColor | string | Vignette color. |
direction | [number, number] | Wind direction [x, y]. |
dropletSize | [number, number] | Droplet size range [min, max]. |
distortionStrength | number | Distortion strength (0-1). |
centerThinning | number | Center thinning effect (0 = full screen). |
MapSnow
Adds an animated snowfall weather effect overlay to the map. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
intensity | number | Snowfall intensity multiplier. |
particleCount | number | Number of snowflake particles. |
color | string | Snowflake color. |
windSpeed | number | Horizontal wind speed affecting drift. |
windDirection | number | Wind direction in degrees. |
fallSpeed | number | Vertical fall speed multiplier. |
autoStart | boolean | Start animation automatically on mount. |
MapSandstorm
Adds an atmospheric sandstorm effect with horizontal particle movement and reduced visibility. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
intensity | number | Sandstorm intensity multiplier. |
particleCount | number | Number of sand particles. |
color | string | Sand particle color. |
windSpeed | number | Horizontal wind speed. |
windDirection | number | Wind direction in degrees. |
visibility | number | Visibility level (0 = no visibility, 1 = clear). |
turbulence | number | Turbulence amount affecting particle movement. |
autoStart | boolean | Start animation automatically on mount. |
MapFire
Renders a realistic animated fire effect with particle simulation at map coordinates. Must be used inside Map. Use useFireControl hook to control programmatically.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the fire effect. |
coordinates | [number, number] | Coordinates [longitude, latitude] for the fire position. |
size | number | Fire canvas size in pixels. |
intensity | number | Fire intensity multiplier. |
particleCount | number | Number of fire particles. |
baseColor | string | Base flame color. |
tipColor | string | Flame tip color. |
spread | boolean | Enable fire spreading to nearby points. |
spreadSpeed | number | Time between spread points in milliseconds. |
spreadRadius | number | Maximum spread radius as fraction of canvas size. |
maxSpreadPoints | number | Maximum number of fire spread sources. |
autoStart | boolean | Start animation automatically on mount. |
MapExplosion
Renders an animated explosion burst effect with radial particles and flash. Supports burst and nuclear types. Must be used inside Map. Use useExplosionControl hook to trigger programmatically.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the explosion. |
coordinates | [number, number] | Coordinates [longitude, latitude] for the explosion. |
type | "burst" | "nuclear" | Explosion type. Nuclear creates a mushroom cloud effect. |
size | number | Explosion canvas size in pixels. |
particleCount | number | Number of explosion particles. |
duration | number | Explosion duration in milliseconds. |
coreColor | string | Core flash color. |
outerColor | string | Outer explosion color. |
autoStart | boolean | Trigger explosion automatically on mount. |
loop | boolean | Loop the explosion animation. |
loopDelay | number | Delay before restarting loop in milliseconds. |
MapCyclone
Renders an animated cyclone funnel with swirling particles and debris. Supports movement along a path. Must be used inside Map. Use useCycloneControl hook to control programmatically.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the cyclone. |
coordinates | [number, number] | Coordinates [longitude, latitude] for the cyclone position. |
path | [number, number][] | Optional path for the cyclone to travel along. |
duration | number | Duration of path movement in milliseconds. |
loop | boolean | Loop the path movement. |
size | number | Cyclone canvas size in pixels. |
intensity | number | Cyclone intensity multiplier. |
scale | number | Cyclone visual scale (0.2 to 2). |
particleCount | number | Number of swirling particles. |
funnelColor | string | Funnel particle color. |
debrisColor | string | Debris particle color. |
rotationSpeed | number | Rotation speed multiplier. |
autoStart | boolean | Start animation automatically on mount. |
MapMeteor
Renders animated meteors falling from sky with fiery trail and impact effect. Supports single or shower mode. Must be used inside Map. Use useMeteorControl hook to control programmatically.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the meteor. |
target | [number, number] | Impact coordinates [longitude, latitude]. |
size | number | Effect canvas size in pixels. |
angle | number | Meteor entry angle in degrees. |
speed | number | Fall duration in milliseconds. |
intensity | number | Effect intensity multiplier. |
meteorColor | string | Meteor body color. |
trailColor | string | Meteor trail color. |
impactColor | string | Impact flash color. |
tailLength | number | Tail length as fraction of canvas size. |
meteorSize | number | Meteor head radius in pixels. |
impactSize | number | Impact radius as fraction of canvas size. |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop the meteor animation. |
loopDelay | number | Delay before restarting loop in milliseconds. |
shower | boolean | Enable meteor shower mode with multiple meteors. |
showerCount | number | Number of meteors in shower mode. |
MapLightning
Renders animated lightning bolt strikes with branching and flash effects. Must be used inside Map. Use useLightningControl hook to trigger strikes programmatically.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the lightning. |
coordinates | [number, number] | Coordinates [longitude, latitude] for the lightning strike zone. |
size | number | Lightning canvas size in pixels. |
boltColor | string | Lightning bolt color. |
flashColor | string | Flash illumination color. |
flashIntensity | number | Flash brightness (0-1). |
autoStrike | boolean | Enable automatic periodic strikes. |
strikeInterval | number | Interval between auto-strikes in milliseconds. |
boltWidth | number | Main bolt width in pixels. |
branchProbability | number | Probability of branching at each segment (0-1). |
MapSteam
Renders a rising steam effect with wispy particle animation. Must be used inside Map. Use useSteamControl hook to control programmatically.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the steam effect. |
coordinates | [number, number] | Coordinates [longitude, latitude] for the steam position. |
size | number | Steam canvas size in pixels. |
intensity | number | Steam intensity multiplier. |
particleCount | number | Number of steam particles. |
color | string | Steam particle color. |
drift | number | Horizontal drift amount. |
riseSpeed | number | Vertical rise speed multiplier. |
autoStart | boolean | Start animation automatically on mount. |
MapTsunami
Renders an animated tsunami wave effect with incoming wave, crashing foam, and debris. Must be used inside Map. Use useTsunamiControl hook to control programmatically.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the tsunami. |
origin | [number, number] | Wave origin coordinates [longitude, latitude]. |
target | [number, number] | Wave target/impact coordinates [longitude, latitude]. |
size | number | Tsunami canvas size in pixels. |
waveHeight | number | Wave height as fraction of canvas size. |
waveWidth | number | Wave width as fraction of canvas size. |
speed | number | Wave approach duration in milliseconds. |
waterColor | string | Wave water color. |
foamColor | string | Wave foam/crest color. |
particleCount | number | Number of foam and debris particles on crash. |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop the tsunami animation. |
loopDelay | number | Delay before restarting loop in milliseconds. |
MapMusicDisc
Renders a rotating vinyl disc with floating music notes at map coordinates. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
coordinates | [number, number] | Coordinates [longitude, latitude] for disc position. |
size | number | Disc diameter in pixels. |
image | string | Album cover image URL for the disc center. |
spinning | boolean | Enable disc rotation animation. |
spinDuration | number | Full rotation duration in milliseconds. |
showNotes | boolean | Show floating music note animations. |
noteColor | string | Music note color. |
discColor | string | Disc background color. |
centerColor | string | Disc center/label area color. |
pitchAlignment | "map" | "viewport" | "auto" | How the disc aligns with the map pitch. |
className | string | Additional CSS classes for the disc container. |
MapAnimatedFootprint
Renders animated footprint steps that walk along a path on the map. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
path | [number, number][] | Array of [longitude, latitude] pairs defining the walking path. |
color | string | Footprint icon color. |
size | number | Footprint icon size in pixels. |
stepSpacing | number | Distance between steps in meters. |
staggerDelay | number | Delay between revealing each step in milliseconds. |
duration | number | Fade-in duration per step in milliseconds. |
autoStart | boolean | Start animation automatically on mount. |
loop | boolean | Loop the walking animation. |
className | string | Additional CSS classes for each footprint element. |
MapGrid
Renders a coordinate grid overlay with latitude/longitude lines and labels. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier prefix for grid sources and layers. |
latitudeInterval | number | Degrees between latitude lines. |
longitudeInterval | number | Degrees between longitude lines. |
lineColor | string | Grid line color. |
lineOpacity | number | Grid line opacity (0-1). |
lineWidth | number | Grid line width in pixels. |
showLabels | boolean | Show coordinate labels at line intersections. |
labelColor | string | Label text color. |
labelSize | number | Label font size in pixels. |
labelBackground | string | Label background color. |
MapRadar
Renders an animated radar sweep signal overlay at map coordinates. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
id | string | Unique identifier for the radar. |
coordinates | [number, number] | Coordinates [longitude, latitude] for the radar position. |
size | number | Radar display size in pixels. |
color | string | Sweep and ring color. |
gridColor | string | Grid line color. |
backgroundColor | string | Radar background color. |
duration | number | Full sweep rotation duration in milliseconds. |
rings | number | Number of concentric range rings. |
showCrosshairs | boolean | Show crosshair lines through the center. |
MapWatermark
Renders a text watermark overlay on the map with configurable position. Must be used inside Map.
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Watermark content (typically text). |
position | "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top" | "bottom" | "left" | "right" | Watermark position on the map. |
className | string | CSS classes for styling. Defaults to large translucent text. |
MarkerAvatar
Renders an avatar image with optional status indicator. Must be used inside MarkerContent.
| Prop | Type | Description |
|---|---|---|
src | string | Image source URL. |
alt | string | Alt text for the image. |
size | number | Size of the avatar in pixels. |
online | boolean | Show online status indicator. |
statusColor | "green" | "red" | "yellow" | "blue" | Status indicator color. |
className | string | Additional CSS classes for the avatar container. |
MarkerAvatarPin
Renders an avatar inside a teardrop/pin shape that points to the exact location. Must be used inside MarkerContent.
| Prop | Type | Description |
|---|---|---|
src | string | Image source URL. |
alt | string | Alt text for the image. |
size | number | Diameter of the circular avatar in pixels. |
borderWidth | number | Border thickness in pixels. |
className | string | Additional CSS classes for the pin container. |
Helper Functions
createZoomInterpolation
Creates a Mapbox zoom-based interpolation expression for dynamic effects. Useful for rain density and vignette that scale with zoom level.
import { Map, MapRain, createZoomInterpolation } from "@/registry/map";
export function RainMapExample() {
// Gradually increase rain density from zoom 11 to 13
const density = createZoomInterpolation(0.8, 11, 13);
const vignette = createZoomInterpolation(0.5, 11, 13);
return (
<Map
accessToken={process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN!}
center={[-74.006, 40.7128]}
zoom={12}
>
<MapRain
density={density}
vignette={vignette}
intensity={1.0}
color="#a8adbc"
/>
</Map>
);
}