ConstThe MapLibre map; a falsy value logs an error and returns false.
Optionaloptions: LegendInitOptionsPosition, title and collapsed state, overriding the profile config.
true when the control was mounted.
Loads and renders one layer's legend entries.
Normally driven by the GeoJSON module as layers come up; calling it directly is the advanced path, for a legend that must be refreshed outside the usual load.
Layer whose legend is being loaded.
Style whose legend file to read, e.g. "default".
The layer's config, source of the legend file location.
Shows or hides one layer's block within the legend.
⚠️ This is a legend-display concern only: it does not touch the map layer itself. Use the layer manager to change what is actually drawn.
Layer whose legend block is toggled.
true to show the block.
Hides the legend control, keeping it mounted and its state intact.
The reversible counterpart of LegendModule.removeLegend.
Removes the legend control from the map entirely.
⚠️ Unlike LegendModule.hideLegend, this tears the control down — LegendModule.init must run again to bring it back.
Covers the legend with a loading overlay while entries are being rebuilt.
Always pair it with LegendModule.hideLoadingOverlay — nothing clears the overlay on its own, including a failed load.
Clears the overlay put up by LegendModule.showLoadingOverlay.
Full teardown for module destroy / lifecycle recreate. Unlike the public
removeLegend() (which only drops the control), this clears the three pending
timers (debounced rebuild, sprite retry, and the overlay's auto-hide deadline via
resetOverlay()), empties the layer map and releases the map / profile / taxonomy
references so a subsequent init() starts from a clean slate.
Mounts the legend control on a map.
Options are layered: the defaults from
modules.legendin the profile, then anything passed here — explicit options always win. Without a coreConfigon the namespace (a standalone or embedded boot) the defaults are used directly.