new GOStagingMap(map, view, ownToc)
Main staging map class that handles OpenLayers map management with additional features such as layer management, theming, interactions, and localization support.
| Name | Type | Description |
|---|---|---|
map |
OlMap |
OpenLayers map instance |
view |
GoView |
Custom view wrapper for map view management |
ownToc |
GoOwnToc |
optional
Table of contents component for layer management |
Methods
-
addFilter(idLayer, filter, bbox){void}
Map/GoStagingMap.ts, line 461 -
Adds a spatial or attribute filter to a specific vector layer. Only vector layers support filtering. The filter will be applied to the layer's features and can optionally use bounding box optimization for spatial queries.
Name Type Description idLayerstring The unique identifier of the layer to filter
filterstring The filter expression (CQL, OGC Filter, or custom format)
bboxboolean Whether to use bounding box optimization for spatial filtering
Returns:
Type Description void Return nothing -
addLayer(idLayer, layer){void}
Map/GoStagingMap.ts, line 188 -
This function allow to add a layer to the map.
Name Type Description idLayerstring The id of the layer.
layermodule:types~GOLayer The layer to add.
Returns:
Type Description void Return nothing -
addOrUpdateTranslations(translation)
Map/GoStagingMap.ts, line 638 -
Adds or updates a single translation entry in the local map instance configuration. If the key already exists for a language, it preserves existing translations for other languages. This method ensures that translation updates are isolated to this specific map instance.
Name Type Description translationRecord.<string, Record.<SupportedLangs, string>> Object containing the key and its translations by language
-
getId(){string}
Map/GoStagingMap.ts, line 169 -
This function allow to get the id of the map. It is used to identify the map.
Returns:
Type Description string Return the id of the map. -
getInteractions(){GoInteractions}
Map/GoStagingMap.ts, line 539 -
Gets the map-level interactions manager for this map instance. Provides access to zoom, rotation, and other map-wide interactive behaviors.
Returns:
Type Description GoInteractions The interactions manager instance -
Retrieves a specific layer from the map by its unique identifier. Validates that the layer ID is provided and handles errors appropriately.
Name Type Description idLayerstring The unique identifier of the layer to retrieve
Returns:
Type Description GOLayer | BaseLayer | undefined The requested layer instance -
getLayers(){module:types~GOLayer}
Map/GoStagingMap.ts, line 438 -
This function allow to get all the layers in the map.
Returns:
Type Description module:types~GOLayer Return all the layers in the map. -
getMap(){OlMap}
Map/GoStagingMap.ts, line 236 -
Gets the underlying OpenLayers map instance. Provides access to the core map functionality and OpenLayers API.
Returns:
Type Description OlMap The OpenLayers map instance -
getMapImage(format, fileName){string|void}
Map/GoStagingMap.ts, line 552 -
Generates an image export of the current map view by compositing all visible layer canvases. Supports both PNG download and base64 string output for different use cases. This method preserves layer opacity, transformations, and background colors.
Name Type Description formatstring Export format: "base64" returns data URL, anything else triggers PNG download
fileNamestring optional Optional filename for download (without extension)
Returns:
Type Description string | void Returns base64 data URL if format is "base64", otherwise initiates download -
getMapLayerPreviewer(){MapLayerPreviewer|undefined}
Map/GoStagingMap.ts, line 391 -
Gets the map layer previewer component associated with this map. Returns undefined if no previewer has been set.
Returns:
Type Description MapLayerPreviewer | undefined The layer previewer component instance -
getNumLayers(){number}
Map/GoStagingMap.ts, line 447 -
This function allow to get the number of layers in the map.
Returns:
Type Description number Return the number of layers in the map. -
getOwnToc(){module:types~GoOwnToc}
Map/GoStagingMap.ts, line 293 -
This function allow to get the Own toc of the map.
Returns:
Type Description module:types~GoOwnToc Return the Own toc of the map. -
getTheme()
Map/GoStagingMap.ts, line 177 -
This function return the theme of this map
-
getUIDisplay(){UIDisplay|undefined}
Map/GoStagingMap.ts, line 401 -
Gets the UI display component associated with this map. The UI display manages map controls, overlays, and user interface elements.
Returns:
Type Description UIDisplay | undefined The UI display component instance -
getView(){GoView}
Map/GoStagingMap.ts, line 226 -
Gets the GoView instance associated with this map. The view controls the map's center, zoom level, rotation, and projection.
Returns:
Type Description GoView The map's view instance for controlling viewport -
removeFilter(idLayer){void}
Map/GoStagingMap.ts, line 488 -
Removes an existing filter from a specific vector layer. This will restore the layer to show all features without filtering.
Name Type Description idLayerstring The unique identifier of the layer to remove filter from
Returns:
Type Description void Return nothing -
removeLayer(idLayer){void}
Map/GoStagingMap.ts, line 209 -
Removes a layer from both the map's layer collection and the OpenLayers map instance. This will make the layer invisible and remove it from rendering.
Name Type Description idLayerstring The unique identifier of the layer to remove
Returns:
Type Description void Return nothing -
setInteractions(interactionsOptions)
Map/GoStagingMap.ts, line 515 -
Configures layer-specific interactions such as hover effects for specified layers. This method sets up interactive behaviors that respond to user input on map layers. Only creates hover interactions if they are specified in the options.
Name Type Description interactionsOptionsLayerInteractions Configuration object defining interaction behaviors
-
setMapLayerPreviewer(mapLayerPreviewer){void}
Map/GoStagingMap.ts, line 381 -
Sets the map layer previewer component for this map. The previewer allows users to preview layers before adding them to the map.
Name Type Description mapLayerPreviewerMapLayerPreviewer The layer previewer component instance
Returns:
Type Description void Return nothing -
setOwnToc(ownToc){void}
Map/GoStagingMap.ts, line 247 -
Sets the table of contents (TOC) component for this map. The TOC manages layer visibility, ordering, and provides layer controls.
Name Type Description ownTocGoOwnToc The table of contents component instance
Returns:
Type Description void Return nothing -
setTheme(theme)
Map/GoStagingMap.ts, line 256 -
This function allow to set the theme of the map.
Name Type Description themethemes The theme of the map
-
setUIDisplay(uiDisplay){void}
Map/GoStagingMap.ts, line 412 -
Sets the UI display component for this map. The UI display manages map controls, overlays, and user interface elements.
Name Type Description uiDisplayUIDisplay The UI display component instance
Returns:
Type Description void Return nothing -
unmount()
Map/GoStagingMap.ts, line 87 -
Completely unmounts and cleans up the map instance to prevent memory leaks. This method performs comprehensive cleanup of all map components, layers, interactions, and event listeners. Should be called when the map is no longer needed.
