ConstInitialise the module GeoJSON.
Options accepted by GeoJSONCore.init().
Optionalmap?: unknownMap instance or adapter. Falls back to GeoLeaf.Core.getMap() when absent.
OptionaldefaultStyle?: Record<string, unknown> | GeoJSONStyleOptionaldefaultPointStyle?: Record<string, unknown>OptionalonEachFeature?: (feature: GeoJSONFeature, layer: unknown) => voidOptionalpointToLayer?: (feature: GeoJSONFeature, latlng: unknown) => unknownOptionalfitBoundsOnLoad?: booleanOptionalmaxZoomOnFit?: numberReturns a loaded layer's authored config object (the layer definition
stored on its runtime entry), or null when the layer is unknown.
Runtime read seam for capability plugins (e.g. @geoleaf-plugins/feature-info)
that need per-layer config at click/hover time. This is config passthrough
(plumbing), not rendering: the kernel exposes the already-loaded config,
the plugin interprets it. Reads the shared state directly (same source as
the POI config resolution) so it works regardless of layer-manager wiring.
GeoLeaf layer id.
Replaces the GeoJSON data of an existing layer in real time.
Updates both the MapLibre source (source.setData()) and the in-memory
state so that subsequent getLayerData() calls return the fresh data.
Announces geoleaf:layer:updated, once per call, for a layer the store holds: an open
table and an active filter follow it, as they follow GeoLeaf.Layers.setData. Since
3.15.0 — the write was silent before.
On a layer that draws icons (showIconsOnMap), each point of the collection is given
the symbolId its taxonomy resolves, as at the first load — written into the features
passed in — and the images it names are registered. Since 3.16.0: a layer created empty
and filled through this method drew bare discs before.
ID of the layer to update.
GeoJSON FeatureCollection (or any valid GeoJSON) to set.
Sets the URL of the GeoJSON Web Worker script; null restores the default.
The default is geojson-worker.js in the directory of the LAST <script src> of the page
whose URL names a geoleaf…js file, without that script's query string — looked up once,
when the bundle loads. A bundle loaded by a <script type="module"> whose src names
geoleaf.esm.js thus finds its own directory — unless another such tag, from another directory, comes after
it in the page: a plugin's geoleaf-*.plugin.js, say. A bundle imported from an inline
<script type="module"> has no such tag: the default then resolves against the PAGE, or
against a plugin's directory if one is loaded by <script src>. A bundler build depends
on the scripts it emits. This member is how those hosts point at the
worker at all — and how a host that serves its files under a content token (?v=…) with a
long cache lifetime keeps a new version of the library from running against a cached worker
from the previous one.
GeoLeaf.boot() to cover the first
worker. A URL set later applies to the next worker built: a running worker keeps its
script until it is torn down — after an idle delay, by dispose(), or by an error.new Worker() does, and it must be
same-origin: a browser refuses a cross-origin worker script, and GeoJSON is then fetched
on the main thread instead.null — also clears an earlier worker failure, which otherwise
sends every later load to the main thread for the rest of the session.Any other value than a non-blank string or null throws a TypeError — raised by the
worker manager this member delegates to.
A non-blank URL, or null for the default.
Filters the features of every GeoJSON layer. Shows only features that pass the predicate.
The predicate runs in JS (so arbitrary logic — substring search, distance,
nested fields — is supported), but the resulting visible set is applied on
the GPU via map.setFilter on feature ids (no source re-tiling) for
non-clustered layers with unique properties.id; clustered / id-less
layers fall back to re-feeding the filtered data (RM-P1).
Every geometry is filtered alike, lines included. options.geometryType narrows
the pass to one family (point, line, polygon), and a layer joins it under any
spelling its profile may declare (polyline, multipolygon, …). A vector-tile
layer keeps no feature in memory and is left unfiltered.
Fonction (feature, layerId) => boolean
Optionaloptions: { layerIds?: string | string[]; geometryType?: string } = {}
Additional options
Resets the feature filter (shows all).
Optionaloptions: { layerIds?: string | string[]; geometryType?: string } = {}
Same options as filterFeatures
Returns all loaded features. Reads directly from state.layers (no separate feature cache).
Optionaloptions: { geometryTypes?: string[]; layerIds?: string[] } = {}features GeoJSON enrichies de { _layerId }
Getters for direct state access (compatibility)