LayerManager
Defined in: packages/core/src/renderer/layer-manager.ts:124
Manages map layers and their data sources
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LayerManager(
map,callbacks?):LayerManager
Defined in: packages/core/src/renderer/layer-manager.ts:141
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
map | maplibregl.Map |
callbacks? | LayerManagerCallbacks |
Returns
Section titled “Returns”LayerManager
Methods
Section titled “Methods”addLayer()
Section titled “addLayer()”addLayer(
layer):Promise<void>
Defined in: packages/core/src/renderer/layer-manager.ts:288
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layer | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<{ id: ZodString; layout: ZodOptional<ZodObject<{ }, "passthrough", ZodTypeAny, objectOutputType<{ }, ZodTypeAny, "passthrough">, objectInputType<{ }, ZodTypeAny, "passthrough">>>; metadata: ZodOptional<ZodRecord<ZodString, ZodAny>>; paint: ZodOptional<ZodObject<{ background-color: ZodOptional<ZodUnion<[ZodEffects<ZodString, string, string>, ZodType<…[], ZodTypeDef, …[]>]>>; background-opacity: ZodOptional<ZodUnion<[ZodNumber, ZodType<…[], ZodTypeDef, …[]>]>>; background-pattern: ZodOptional<ZodUnion<[ZodString, ZodType<…[], ZodTypeDef, …[]>]>>; }, "passthrough", ZodTypeAny, objectOutputType<{ background-color: ZodOptional<ZodUnion<[ZodEffects<…, …, …>, ZodType<…, …, …>]>>; background-opacity: ZodOptional<ZodUnion<[ZodNumber, ZodType<…, …, …>]>>; background-pattern: ZodOptional<ZodUnion<[ZodString, ZodType<…, …, …>]>>; }, ZodTypeAny, "passthrough">, objectInputType<{ background-color: ZodOptional<ZodUnion<[ZodEffects<…, …, …>, ZodType<…, …, …>]>>; background-opacity: ZodOptional<ZodUnion<[ZodNumber, ZodType<…, …, …>]>>; background-pattern: ZodOptional<ZodUnion<[ZodString, ZodType<…, …, …>]>>; }, ZodTypeAny, "passthrough">>>; type: ZodLiteral<"background">; }, ZodTypeAny, "passthrough"> |
Returns
Section titled “Returns”Promise<void>
destroy()
Section titled “destroy()”destroy():
void
Defined in: packages/core/src/renderer/layer-manager.ts:788
Returns
Section titled “Returns”void
disconnectStream()
Section titled “disconnectStream()”disconnectStream(
layerId):void
Defined in: packages/core/src/renderer/layer-manager.ts:735
Disconnect streaming connection for a layer
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layerId | string |
Returns
Section titled “Returns”void
getSourceData()
Section titled “getSourceData()”getSourceData(
sourceId):FeatureCollection<Geometry,GeoJsonProperties> |undefined
Defined in: packages/core/src/renderer/layer-manager.ts:236
The GeoJSON this manager last delivered to a fetched/refreshed source, by
source id — what fitTo (U14) frames once a url: source’s first fetch
lands. Undefined for sources whose data never passed through here.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sourceId | string |
Returns
Section titled “Returns”FeatureCollection<Geometry, GeoJsonProperties> | undefined
getSourceIdForLayer()
Section titled “getSourceIdForLayer()”getSourceIdForLayer(
layerId):string|undefined
Defined in: packages/core/src/renderer/layer-manager.ts:241
The MapLibre source a layer draws from.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layerId | string |
Returns
Section titled “Returns”string | undefined
isRefreshing()
Section titled “isRefreshing()”isRefreshing(
sourceId):boolean
Defined in: packages/core/src/renderer/layer-manager.ts:284
Whether a refresh/stream pipeline is running for a named source.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sourceId | string |
Returns
Section titled “Returns”boolean
pauseRefresh()
Section titled “pauseRefresh()”pauseRefresh(
layerId):void
Defined in: packages/core/src/renderer/layer-manager.ts:699
Pause data refresh for a layer (polling)
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layerId | string |
Returns
Section titled “Returns”void
refreshNow()
Section titled “refreshNow()”refreshNow(
layerId):Promise<void>
Defined in: packages/core/src/renderer/layer-manager.ts:713
Force immediate refresh for a layer (polling)
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layerId | string |
Returns
Section titled “Returns”Promise<void>
registerSources()
Section titled “registerSources()”registerSources(
sources):void
Defined in: packages/core/src/renderer/layer-manager.ts:166
Register the block’s named sources: with MapLibre.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sources | Record<string, unknown> |
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”Owned here rather than in MapRenderer, which used to call
map.addSource directly. That bypassed every piece of refresh machinery,
so a named source could declare refresh: and never poll, and it leaked
YAML-only keys straight into MapLibre. Registration is idempotent so a
re-render does not duplicate sources.
removeLayer()
Section titled “removeLayer()”removeLayer(
layerId):void
Defined in: packages/core/src/renderer/layer-manager.ts:739
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layerId | string |
Returns
Section titled “Returns”void
resumeRefresh()
Section titled “resumeRefresh()”resumeRefresh(
layerId):void
Defined in: packages/core/src/renderer/layer-manager.ts:706
Resume data refresh for a layer (polling)
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layerId | string |
Returns
Section titled “Returns”void
setVisibility()
Section titled “setVisibility()”setVisibility(
layerId,visible):void
Defined in: packages/core/src/renderer/layer-manager.ts:769
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layerId | string |
visible | boolean |
Returns
Section titled “Returns”void
updateData()
Section titled “updateData()”updateData(
layerId,data):void
Defined in: packages/core/src/renderer/layer-manager.ts:778
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
layerId | string |
data | GeoJSON |
Returns
Section titled “Returns”void