Routes

Render line routes from coordinate arrays.

<MapRoute coordinates={coordinates} color="#ef4444" width={5} />

Installation

pnpm add @notion-kit/map

API Reference

MapRoute

Renders a LineString GeoJSON source and a MapLibre line layer from an array of coordinates.

PropTypeDefaultDescription
idstring-Optional route layer id.
coordinates*[number, number][]-Route coordinates as lng/lat pairs.
colorstring"#4285F4"Line color.
widthnumber3Line width in pixels.
opacitynumber0.8Line opacity.
dashArray[number, number]-Dash pattern for dashed lines.
interactivebooleantrueEnables route mouse events and cursor.
onClick() => void-Called when the route is clicked.
onMouseEnter() => void-Called when the cursor enters the route.
onMouseLeave() => void-Called when the cursor leaves the route.