Get started

Edit an itinerary on the map props

The generated props of every element on Edit an itinerary on the map. The guide is where they are explained; this is the whole surface.

EditorMapView

ariaLabel

string

Names the map container as a labelled region landmark for assistive technology.

This package ships no i18n runtime, so the label is the caller's, in the reader's language. Omitted (a secondary mini-map inside a surface already labelled), the container carries no landmark role.

client

MountayaMapOptions["client"]

required

The SDK client the map fetches its own specifications through.

The credential, the retry policy and the Tile API base are the application's to compose, so it hands over the instance it already holds, as it hands over transformRequest.

A seed, read once as the map is built: a client whose session token is a function carries each rotation to every request the map makes, and a different client needs a new key.

initialBaseTerrain

BaseTerrainConfig

The base layer the map opens on, for an application that already holds the layers manifest.

A seed, read once as the map is built. Afterwards the base layer changes through MapClient.setBaseTerrain, never through this prop.

initialViewport

MapViewport

The camera the map opens on: a center as [longitude, latitude] and a zoom.

A seed, read once as the map is built. Afterwards the camera moves through the client. A #view hash in the address wins over it while withUrlHash is on, since that hash is a view somebody shared.

interactive

boolean

Whether the reader pans, zooms and rotates the map directly.

false hands the camera to the surface that owns the map (a mini-map beside a street-level view, for instance): it then moves only through the MapClient it reports. A seed, read once as the map is built.

markerIcons

IconProvider

The glyph set this map's markers draw from.

A seed, read once as the map is built. An application with two glyph families in play (a licensed set for its own surfaces and a plain one for an embedded map) names the one it wants here.

maxTileCacheSize

number

How many tiles MapLibre keeps in memory, as a whole number of tiles.

A surface that loads tiles ahead and then replays the same views, as a video recording does, passes a large value so those tiles are still held when the replay reaches them. A seed, read once as the map is built: MapLibre takes it at construction alone.

preserveDrawingBuffer

boolean

Whether the rendered frame stays readable after the browser has shown it.

true for a surface whose canvas is read back: a video recording, frame by frame, and a session recorder that samples the page. It costs a copy of the frame on every render, so a surface nothing reads leaves it off. A seed, read once as the map is built: MapLibre takes it at construction alone.

transformRequest

TileRequestTransform

Rewrites each request the map makes for a tile, a sprite, a glyph or a style, so it carries the application's own credential.

Whether the map takes one is decided at the mount: supplied then, it replaces the transform the map derives from client, and omitted then, the derived one stands for the map's life. The function itself is read at each request, so a transform rebuilt when a credential rotates reaches the next tile, and a render that omits the prop keeps the last one supplied.

video

(map: MountayaMap) => VideoSeam

Builds the recording subsystem this map records and previews through.

Absent, the map carries no video encoder and the client answers that recording is unsupported, which is what a map showing a route should cost. A surface that exports one supplies the seam, reading what it needs off the map it is handed: VideoRunEngine from @mountaya/elements/video takes the raw map and the shared event engine, both of which the map publishes.

A seed, read once as the map is built: the recorder attaches a render listener to the map it was built over, so a factory that changed identity later could not replace it.

withAttribution

boolean

Whether the map draws its own credit line: MapLibre's attribution control, holding the Mountaya credit beside what each tile source declares.

false only for a host that draws the same credits itself, which then answers for the tile licences: a map that shows tiles and credits nobody breaks them. A seed, read once as the map is built.

withUrlHash

boolean

Whether the map keeps its camera in the page's address, as #view=<zoom>/<lat>/<lng>/<bearing>/<pitch>, so a view is shared by its link and restored on load.

It writes location.hash at each camera move and replaces the history entry, so a page turns it on where it owns the address: one map per page, the one whose view a link shares. A seed, read once as the map is built.

ViewerMapView

ariaLabel

string

Names the map container as a labelled region landmark for assistive technology.

This package ships no i18n runtime, so the label is the caller's, in the reader's language. Omitted (a secondary mini-map inside a surface already labelled), the container carries no landmark role.

client

MountayaMapOptions["client"]

required

The SDK client the map fetches its own specifications through.

The credential, the retry policy and the Tile API base are the application's to compose, so it hands over the instance it already holds, as it hands over transformRequest.

A seed, read once as the map is built: a client whose session token is a function carries each rotation to every request the map makes, and a different client needs a new key.

initialBaseTerrain

BaseTerrainConfig

The base layer the map opens on, for an application that already holds the layers manifest.

A seed, read once as the map is built. Afterwards the base layer changes through MapClient.setBaseTerrain, never through this prop.

initialViewport

MapViewport

The camera the map opens on: a center as [longitude, latitude] and a zoom.

A seed, read once as the map is built. Afterwards the camera moves through the client. A #view hash in the address wins over it while withUrlHash is on, since that hash is a view somebody shared.

interactive

boolean

Whether the reader pans, zooms and rotates the map directly.

false hands the camera to the surface that owns the map (a mini-map beside a street-level view, for instance): it then moves only through the MapClient it reports. A seed, read once as the map is built.

markerIcons

IconProvider

The glyph set this map's markers draw from.

A seed, read once as the map is built. An application with two glyph families in play (a licensed set for its own surfaces and a plain one for an embedded map) names the one it wants here.

maxTileCacheSize

number

How many tiles MapLibre keeps in memory, as a whole number of tiles.

A surface that loads tiles ahead and then replays the same views, as a video recording does, passes a large value so those tiles are still held when the replay reaches them. A seed, read once as the map is built: MapLibre takes it at construction alone.

preserveDrawingBuffer

boolean

Whether the rendered frame stays readable after the browser has shown it.

true for a surface whose canvas is read back: a video recording, frame by frame, and a session recorder that samples the page. It costs a copy of the frame on every render, so a surface nothing reads leaves it off. A seed, read once as the map is built: MapLibre takes it at construction alone.

transformRequest

TileRequestTransform

Rewrites each request the map makes for a tile, a sprite, a glyph or a style, so it carries the application's own credential.

Whether the map takes one is decided at the mount: supplied then, it replaces the transform the map derives from client, and omitted then, the derived one stands for the map's life. The function itself is read at each request, so a transform rebuilt when a credential rotates reaches the next tile, and a render that omits the prop keeps the last one supplied.

video

(map: MountayaMap) => VideoSeam

Builds the recording subsystem this map records and previews through.

Absent, the map carries no video encoder and the client answers that recording is unsupported, which is what a map showing a route should cost. A surface that exports one supplies the seam, reading what it needs off the map it is handed: VideoRunEngine from @mountaya/elements/video takes the raw map and the shared event engine, both of which the map publishes.

A seed, read once as the map is built: the recorder attaches a render listener to the map it was built over, so a factory that changed identity later could not replace it.

withAttribution

boolean

Whether the map draws its own credit line: MapLibre's attribution control, holding the Mountaya credit beside what each tile source declares.

false only for a host that draws the same credits itself, which then answers for the tile licences: a map that shows tiles and credits nobody breaks them. A seed, read once as the map is built.

withUrlHash

boolean

Whether the map keeps its camera in the page's address, as #view=<zoom>/<lat>/<lng>/<bearing>/<pitch>, so a view is shared by its link and restored on load.

It writes location.hash at each camera move and replaces the history entry, so a page turns it on where it owns the address: one map per page, the one whose view a link shares. A seed, read once as the map is built.

Handlers

An on* handler suppresses the element's own default. Left unset, the element acts; set, it becomes presentational and your handler decides. The two never both fire.

EditorMapView

onAccessRequired

(refusal: MountayaMapEvents["accessrequired"]) => void

Called when the API refuses one of the map's own requests with a 401, a 402 or a 403: a tile, a sprite, a glyph or a style.

The refusal carries the status and the address refused, so an application words a sign-in apart from a missing agreement. Attached as the map is built, like onError, and before any client is handed out: a base style the API refuses is refused before the style loads, which may keep onClientReady from ever being called, and MapClient.onTilesAccessRequired can only be subscribed on a client that was handed out. A refusal is never also reported to onError.

Read at each report, so a new handler takes effect without rebuilding the map.

onClientDestroy

() => void

Called as the surface unmounts, just before the client it handed out through onClientReady is disposed, so the application releases its reference to it.

Paired with onClientReady: a surface torn down before its style loaded handed out no client, so it is torn down without this being called. React StrictMode builds and tears down such a surface on every development mount.

Read as the surface unmounts, so a new handler takes effect without rebuilding the map.

onClientReady

(client: MapClient) => void

required

Called once with the MapClient this map is driven through, when its style can take sources and layers.

Never called for a surface that unmounts before then, and never for a map whose base style was refused or failed: onAccessRequired and onError say why such a map stays blank. The client is disposed as the surface unmounts, after onClientDestroy, so a reference kept past that point drives nothing.

Read when the map reports ready, so a handler written inline rebuilds nothing and the one of the latest render is the one called.

onError

(error: Error) => void

Called with each failure the map reports that no call of yours could reject: an error MapLibre raised, such as a style that does not parse or a tile the server failed on.

Attached as the map is built, before it makes its first request, so a failure that lands before onClientReady is heard, and so is one that keeps it from ever being called. It reports and replaces nothing. A refusal of access goes to onAccessRequired instead, and a map that cannot be built at all (no WebGL context) throws to the nearest error boundary, which is React's own contract for a failure while mounting.

Read at each report, so a new handler takes effect without rebuilding the map.

onMapReady

(map: MountayaMap) => void

Called with the MountayaMap the client wraps, beside onClientReady and from the same readiness, so the two land together.

The elements read the map (MountayaElementsProvider takes it and every control drives it) where an application's own surfaces read the MapClient, so a surface that mounts both takes both from here.

Read when the map reports ready, as onClientReady is.

ViewerMapView

onAccessRequired

(refusal: MountayaMapEvents["accessrequired"]) => void

Called when the API refuses one of the map's own requests with a 401, a 402 or a 403: a tile, a sprite, a glyph or a style.

The refusal carries the status and the address refused, so an application words a sign-in apart from a missing agreement. Attached as the map is built, like onError, and before any client is handed out: a base style the API refuses is refused before the style loads, which may keep onClientReady from ever being called, and MapClient.onTilesAccessRequired can only be subscribed on a client that was handed out. A refusal is never also reported to onError.

Read at each report, so a new handler takes effect without rebuilding the map.

onClientDestroy

() => void

Called as the surface unmounts, just before the client it handed out through onClientReady is disposed, so the application releases its reference to it.

Paired with onClientReady: a surface torn down before its style loaded handed out no client, so it is torn down without this being called. React StrictMode builds and tears down such a surface on every development mount.

Read as the surface unmounts, so a new handler takes effect without rebuilding the map.

onClientReady

(client: MapClient) => void

required

Called once with the MapClient this map is driven through, when its style can take sources and layers.

Never called for a surface that unmounts before then, and never for a map whose base style was refused or failed: onAccessRequired and onError say why such a map stays blank. The client is disposed as the surface unmounts, after onClientDestroy, so a reference kept past that point drives nothing.

Read when the map reports ready, so a handler written inline rebuilds nothing and the one of the latest render is the one called.

onError

(error: Error) => void

Called with each failure the map reports that no call of yours could reject: an error MapLibre raised, such as a style that does not parse or a tile the server failed on.

Attached as the map is built, before it makes its first request, so a failure that lands before onClientReady is heard, and so is one that keeps it from ever being called. It reports and replaces nothing. A refusal of access goes to onAccessRequired instead, and a map that cannot be built at all (no WebGL context) throws to the nearest error boundary, which is React's own contract for a failure while mounting.

Read at each report, so a new handler takes effect without rebuilding the map.

onMapReady

(map: MountayaMap) => void

Called with the MountayaMap the client wraps, beside onClientReady and from the same readiness, so the two land together.

The elements read the map (MountayaElementsProvider takes it and every control drives it) where an application's own surfaces read the MapClient, so a surface that mounts both takes both from here.

Read when the map reports ready, as onClientReady is.