Arcs

Render curved lines between points with hover state support.

<MapArc data={flightRoutes} />

Installation

pnpm add @notion-kit/map

API Reference

MapArc

Builds curved LineString features between coordinate pairs and renders them as a MapLibre line layer with an invisible hit layer for interactions.

PropTypeDefaultDescription
data*MapArcDatum[]-Arcs with id, from, and to coordinates.
idstring-Optional source and layer id prefix.
curvaturenumber0.2How far each arc bows from a straight line.
samplesnumber64Number of samples used for the curve.
paintLineLayerSpecification["paint"]-MapLibre paint properties for the arc layer.
layoutLineLayerSpecification["layout"]-MapLibre layout properties for the arc layer.
hoverPaintLineLayerSpecification["paint"]-Paint applied to the currently hovered arc.
onClick(event: MapArcEvent) => void-Called when an arc is clicked.
onHover(event: MapArcEvent | null) => void-Called when the hovered arc changes.
interactivebooleantrueEnables arc mouse events.
beforeIdstring-Layer id to insert before for z-order control.

MapArcDatum

Describes one arc rendered by MapArc.

PropTypeDefaultDescription
id*string | number-Unique arc id used for events/hover state.
from*[number, number]-Start coordinate as [longitude, latitude].
to*[number, number]-End coordinate as [longitude, latitude].

MapArcEvent

Payload passed to onClick and onHover callbacks.

PropTypeDefaultDescription
arc*MapArcDatum-The arc datum under the pointer.
longitude*number-Pointer longitude.
latitude*number-Pointer latitude.
originalEvent*MapMouseEvent-The original MapLibre mouse event.