Number of registered layers.
Get all layer IDs in render order.
Get all layers in render order.
Number of registered sources.
Get all registered source names.
Add a rendering layer.
Layers reference a source by name. Multiple layers can reference the same source (e.g. a fill layer and a symbol layer over the same Feature Service).
Layer specification (must include id, source, type).
OptionalbeforeId: stringInsert this layer before the layer with this ID. If omitted, appends to the end.
Register a named data source.
Honua sources (honua-feature-service, honua-map-service,
honua-ogc-features) are resolved into SDK surface instances.
Native MapLibre sources (vector, raster, geojson) are stored
as-is and resolve to null.
Get a layer specification by ID.
Get all layers that reference a given source.
Get the resolved SDK surface for a source.
Returns null for native MapLibre sources (they should be handled
by MapLibre directly). Returns undefined if the source does not exist.
Get the raw specification for a source.
Subscribe to map structure changes. Returns a remove handle.
Produce a MapLibre-compatible style specification.
Honua sources are included with their original custom type values.
Use this to feed into a MapLibre map via map.setStyle(honuaMap.toStyle())
alongside a MapLibre source-type plugin that handles the Honua types.
Optionaloptions: { Optionalname?: stringPatch a layer specification by ID. The layer ID remains stable.
Replace a source specification while preserving layers that reference it.
This updates the resolved SDK surface for Honua custom source types and leaves render layers in place so callers can decide how to patch the renderer.
A protocol-aware map that separates data sources from rendering layers.
Example