Class: GOVectorLayer

GOVectorLayer

This class is used for create vector layers.

new GOVectorLayer(layerOpts, topicId)

Layers/GoVectorLayer/index.ts, line 31
Name Type Description
layerOpts module:types~layerOptions

The layer options.

topicId string

The topic id.

Extends

Methods

_initLayer(){CancelablePromise.<module:Layers/GoVectorLayer/index.ts~GOVectorLayer>}

Layers/GoVectorLayer/index.ts, line 67

Initializes the vector layer with options and configuration.

Returns:
Type Description
CancelablePromise.<module:Layers/GoVectorLayer/index.ts~GOVectorLayer> A promise that resolves with the initialized vector layer.

inherited addFilterNoCQL(filter){void}

Layers/GoStyledLayer/index.ts, line 194

Adds a filter to the layer without using CQL.

Name Type Description
filter types.filterNoCQL

The filter to add.

Returns:
Type Description
void

inherited addInteractions(interactions){GoLayerInteractions}

Layers/GoLayer/index.ts, line 184

Adds interactions to the layer.

Name Type Description
interactions LayerInteractions

The interactions to be added to the layer.

Returns:
Type Description
GoLayerInteractions The interactions object associated with the layer.

inherited addStyleFunction(styleFunction){void}

Layers/GoStyledLayer/index.ts, line 233

Adds a style function to the layer.

Name Type Description
styleFunction types.styleFunction

The style function to add.

Returns:
Type Description
void

canFilter(){boolean}

Layers/GoVectorLayer/index.ts, line 225

Checks if the layer supports filtering.

Returns:
Type Description
boolean true if filtering is supported, otherwise false.

inherited changeLayerOpacity(opacity){void}

Layers/GoLayer/index.ts, line 167

Changes the opacity of the layer.

Name Type Description
opacity number

The new opacity value (0-100).

Returns:
Type Description
void

changeStyle(style){void}

Layers/GoVectorLayer/index.ts, line 155

Changes the style of the layer based on the provided style information.

Name Type Description
style types.styleFromUser

The style information to apply to the layer.

Returns:
Type Description
void

inherited changeStyleConditional(style, clear){void}

Layers/GoStyledLayer/index.ts, line 133

Changes the style of the layer based on style conditions.

Name Type Default Description
style types.styleGeojson | types.styleSVG

The style information.

clear boolean false optional

Whether to clear existing styles.

Returns:
Type Description
void

inherited changeStyleFromJSON(style){Style}

Layers/GoStyledLayer/index.ts, line 147

This function allow to change the style of the layer from a JSON

Name Type Description
style types.styleGeojson

Style Styles to apply over the layer

Returns:
Type Description
Style
  • Return Style

inherited clasificationEnumTypeCQLGeometry(f, field, type, value){string}

Layers/GoStyledLayer/index.ts, line 252

This function allow to clasify the CQL filters of the type Geometry

Name Type Description
f any

The feature

field string

The field of the condition

type string

The type of the condition

value Array.<any>

The value of the condition

Returns:
Type Description
string Return the CQL filter type Geometry.

clearAllIntervals(intervals){void}

Layers/GoVectorLayer/index.ts, line 503

This function allow to clear all the intervalls.

Name Type Description
intervals Array.<any>

The intervals.

Returns:
Type Description
void Return nothing

inherited createStyleFunction(mapUnits){function}

Layers/GoStyledLayer/index.ts, line 323

This function allow to create the styles of the layer

Name Type Description
mapUnits boolean

The units of the map

Returns:
Type Description
function A function that can be set as an OpenLayers style function.

inherited emit(eventName, args){void}

Layers/GoLayer/index.ts, line 227

Emits an event to all registered listeners for the specified event.

Name Type Description
eventName string

The name of the event to emit.

args Array.<any> repeatable

Additional arguments to pass to the event listeners.

Returns:
Type Description
void

exportGeoJsonFormatFeatures(){string|null}

Layers/GoVectorLayer/index.ts, line 241

Exports the features of the layer in GeoJSON format.

Returns:
Type Description
string | null The GeoJSON string representation of the layer's features, or null if there are no features.

inherited fixIconPaths(styleName, origin){void}

Layers/GoStyledLayer/index.ts, line 339

This function allow to fix the paths of the icons

Name Type Description
styleName string

The name of the style

origin string

The origin of the icon

Returns:
Type Description
void Return nothing

get(){void}

Layers/GoVectorLayer/index.ts, line 515

This method is a placeholder and currently not implemented. It triggers an error event indicating that the method is not implemented.

Returns:
Type Description
void

inherited getAlias(){string}

Layers/GoLayer/index.ts, line 416

Gets the alias of the layer.

Returns:
Type Description
string The alias of the layer.

inherited getEventHandlers(eventName){Array.<function()>}

Layers/GoLayer/index.ts, line 246

Gets the event handlers for the specified event.

Name Type Description
eventName string

The name of the event to retrieve handlers for.

Returns:
Type Description
Array.<function()> An array of event handler functions.

inherited getExtent(){Array.<number>|null}

Layers/GoLayer/index.ts, line 547

Gets the geographical extent of the layer.

Returns:
Type Description
Array.<number> | null The extent as an array of numbers or null if the extent is not defined.

getFeatureType(){string}

Layers/GoVectorLayer/index.ts, line 691

Retrieves the geometry type of the features in the layer.

Returns:
Type Description
string The geometry type of the features.

getFilter(){string}

Layers/GoVectorLayer/index.ts, line 576

Retrieves the filter applied to the layer.

Returns:
Type Description
string The filter string or an empty string if no filter is applied.

asyncgetGeometryName(){Promise.<string>}

Layers/GoVectorLayer/index.ts, line 543

Retrieves the geometry name of the layer.

Returns:
Type Description
Promise.<string> A promise that resolves with the geometry name of the layer.

getGeometryType(layerGeomType){GOGeometryType}

Layers/GoVectorLayer/index.ts, line 642

Converts the layer's geometry type to a GOGeometryType.

Name Type Description
layerGeomType string

The geometry type of the layer as a string.

Throws:

Throws an error if the geometry type is not recognized.

Type
Error
Returns:
Type Description
GOGeometryType The corresponding GOGeometryType.

inherited getId(){string}

Layers/GoLayer/index.ts, line 424

Gets the unique identifier of the layer.

Returns:
Type Description
string The layer ID.

inherited getInitialStyle(keyStyle){Style}

Layers/GoStyledLayer/index.ts, line 546

Retrieves the initial style based on the provided key style.

Name Type Description
keyStyle string

The key to determine the type of style to retrieve ("json" or "svg").

Throws:

Throws an error if the keyStyle is not recognized or if an error occurs while processing the style.

Type
Error
Returns:
Type Description
Style The initial style based on the key style provided.

inherited getLabelField(){string}

Layers/GoStyledLayer/index.ts, line 380

Retrieves the label field from the style's text symbolizer.

Throws:

Throws an error if the text symbolizer is not found or if label type is not "expression".

Type
Error
Returns:
Type Description
string The label field value.

getLayer(){VectorLayer.<VectorSource>}

Layers/GoVectorLayer/index.ts, line 527

Retrieves the OpenLayers vector layer associated with this instance.

Returns:
Type Description
VectorLayer.<VectorSource> The vector layer.

getLayerDescription(){CancelablePromise.<string>}

Layers/GoVectorLayer/index.ts, line 711

Retrieves the description of the layer's feature type.

Returns:
Type Description
CancelablePromise.<string> A promise that resolves with the geometry field name or rejects with an error.

getLayerName(){string}

Layers/GoVectorLayer/index.ts, line 535

Retrieves the name of the layer.

Returns:
Type Description
string The name of the layer.

inherited getLayerOpts(){types.layerOptions}

Layers/GoLayer/index.ts, line 408

Gets the options used to configure the layer.

Returns:
Type Description
types.layerOptions The layer configuration options.

getLayerProjection(){string}

Layers/GoVectorLayer/index.ts, line 552

Retrieves the projection code of the layer.

Returns:
Type Description
string The projection code of the layer.

inherited getLayerStyle(){GoStyle}

Layers/GoLayer/index.ts, line 575

Gets the style associated with the layer.

Returns:
Type Description
GoStyle The style of the layer.

inherited getLayerType(){string}

Layers/GoLayer/index.ts, line 448

Gets the type of the layer.

Returns:
Type Description
string The layer type.

inherited getLayerUrl()

Layers/GoLayer/index.ts, line 107

get layerUrl

asyncgetLegend(layerOptsLegend){Promise.<(string|null)>}

Layers/GoVectorLayer/index.ts, line 588

Retrieves the legend graphic for the layer.

Name Type Description
layerOptsLegend string optional

Optional legend options to include in the request.

Returns:
Type Description
Promise.<(string|null)> A promise that resolves with the legend graphic as a data URL string.

inherited getMapStyle(idStyle){Map}

Layers/GoStyledLayer/index.ts, line 465

Retrieves the map style associated with the specified style ID. If no ID is provided, retrieves the initial style.

Name Type Description
idStyle string optional

The ID of the style to retrieve.

Returns:
Type Description
Map The map of styles associated with the specified ID or initial style.

inherited getMaxResolution(){number}

Layers/GoLayer/index.ts, line 464

Gets the maximum resolution at which the layer is visible.

Returns:
Type Description
number The maximum resolution.

inherited getMinResolution(){number}

Layers/GoLayer/index.ts, line 472

Gets the minimum resolution at which the layer is visible.

Returns:
Type Description
number The minimum resolution.

inherited getOlMap(){OlMap}

Layers/GoLayer/index.ts, line 400

Gets the OpenLayers map instance associated with the layer.

Returns:
Type Description
OlMap The OpenLayers map instance.

inherited getOptions(){layerOptions}

Layers/GoLayer/index.ts, line 567

Gets the options used to configure the layer.

Returns:
Type Description
layerOptions The layer configuration options.

inherited getSLD(sldStyle, idLayer){CancelablePromise.<types.sldConfiguration>}

Layers/GoStyledLayer/index.ts, line 434

Retrieves the SLD (Styled Layer Descriptor) configuration based on the provided style options and layer ID.

Name Type Description
sldStyle types.styleOptions

The style options containing the URL for the SLD.

idLayer string

The ID of the layer for which the SLD configuration is requested.

Returns:
Type Description
CancelablePromise.<types.sldConfiguration> A promise that resolves to the SLD configuration.

inherited getStyleFromSLD(sldStyle){CancelablePromise.<types.sldStyleFunction>}

Layers/GoStyledLayer/index.ts, line 393

Retrieves the SLD (Styled Layer Descriptor) configuration based on the provided style options.

Name Type Description
sldStyle types.styleOptions

The style options containing the URL for the SLD.

Returns:
Type Description
CancelablePromise.<types.sldStyleFunction> A promise that resolves to the SLD style function.

inherited getStyleFunction(){types.sldStyleFunction}

Layers/GoStyledLayer/index.ts, line 371

Retrieves the style function associated with the layer.

Returns:
Type Description
types.sldStyleFunction The style function for the layer.

inherited getURLDownload(formatOutput){Array.<string>}

Layers/GoStyledLayer/index.ts, line 502

This function allow to get the URL to download any layer stored in Geoserver.

Name Type Description
formatOutput string

Format of the output file

Returns:
Type Description
Array.<string> Return an array of string [idLayer, formatOutput, url]

getUrl(){string}

Layers/GoVectorLayer/index.ts, line 560

Retrieves the URL of the layer's service.

Returns:
Type Description
string The URL of the layer's service.

getVisibility(){boolean}

Layers/GoVectorLayer/index.ts, line 568

Checks if the layer is visible.

Returns:
Type Description
boolean True if the layer is visible, otherwise false.

inherited getZIndex(){number}

Layers/GoLayer/index.ts, line 456

Gets the z-index of the layer.

Returns:
Type Description
number The z-index value.

inherited goMap(){void}

Layers/GoLayer/index.ts, line 130

This function allow to get the map.

Returns:
Type Description
void Return GOStagingMap

inherited hasEvent(eventName){boolean}

Layers/GoLayer/index.ts, line 237

Checks if there are listeners registered for the specified event.

Name Type Description
eventName string

The name of the event to check for listeners.

Returns:
Type Description
boolean True if there are listeners for the event, false otherwise.

hasFilter(){boolean}

Layers/GoVectorLayer/index.ts, line 217

Checks if the layer has a filter applied.

Returns:
Type Description
boolean true if a filter is applied, otherwise false.

inherited hasLabelStyle(){boolean}

Layers/GoStyledLayer/index.ts, line 84

Determines if the layer has a label style.

Returns:
Type Description
boolean True if label style exists, otherwise false.

inherited isBaseLayer(){boolean}

Layers/GoLayer/index.ts, line 158

Checks if the layer is a base layer.

Returns:
Type Description
boolean True if the layer is a base layer, false otherwise.

isGeometryType(type){boolean}

Layers/GoVectorLayer/index.ts, line 261

Checks if a given string represents a valid geometry type.

Name Type Description
type string

The geometry type to check.

Returns:
Type Description
boolean true if the type is a valid geometry type, otherwise false.

isLoadedData(timeInterval, limit){CancelablePromise.<boolean>}

Layers/GoVectorLayer/index.ts, line 118

Checks if the data has been loaded within a specified time interval.

Name Type Default Description
timeInterval number 1000 optional

The time interval in milliseconds between checks.

limit number 0 optional

The maximum number of intervals before giving up.

Returns:
Type Description
CancelablePromise.<boolean> A promise that resolves with true if data is loaded, otherwise false.

layerRenderListener(event){void}

Layers/GoVectorLayer/index.ts, line 485

This function is used for render the layer in the map.

Name Type Description
event any

The event of the layer.

Returns:
Type Description
void Return nothing

asyncloader(extent){Promise.<any>}

Layers/GoVectorLayer/index.ts, line 271

Loads features from the server within the specified extent and updates the layer.

Name Type Description
extent Extent

The extent within which to load features.

Throws:

Throws an error if the request fails or if the response indicates a problem.

Type
Error
Returns:
Type Description
Promise.<any> A promise that resolves with the response data from the server.

inherited mapStyleConditionGeometry(f, geometryFilter){string}

Layers/GoStyledLayer/index.ts, line 97

Maps style conditions based on geometry filter.

Name Type Description
f Feature.<Geometry>

The feature.

geometryFilter Object

The geometry filter.

Name Type Description
field string

The field of the condition.

type string

The type of the condition.

condition Array.<any>

The condition values.

Returns:
Type Description
string The CQL filter for geometry.

inherited mapStyleConditionSVG(style, clear){CancelablePromise.<Map.<string, Style>>}

Layers/GoStyledLayer/index.ts, line 111

Maps style conditions based on SVG styles.

Name Type Default Description
style Array.<types.styleConditionSVG>

Array of SVG style conditions.

clear boolean false optional

Whether to clear existing conditions.

Returns:
Type Description
CancelablePromise.<Map.<string, Style>> A promise that resolves to a map of style conditions.

inherited off(eventName, callback){void}

Layers/GoLayer/index.ts, line 217

Removes an event listener for the specified event.

Name Type Description
eventName string optional

The name of the event to remove the listener from.

callback function optional

The callback function to remove.

Returns:
Type Description
void

inherited on(eventName, callback){void}

Layers/GoLayer/index.ts, line 197

Registers an event listener for the specified event.

Name Type Description
eventName string

The name of the event to listen for.

callback function

The callback function to invoke when the event is fired.

Returns:
Type Description
void

inherited onLayerLoaded(){Promise.<unknown>}

Layers/GoLayer/index.ts, line 175

Returns a promise that resolves when the layer is fully loaded.

Returns:
Type Description
Promise.<unknown> A promise that resolves when the layer is loaded.

inherited onPropChange(obj, prop, callback){void}

Layers/GoLayer/index.ts, line 258

Monitors changes to a specific property of an object and fires an event when the property changes.

Name Type Description
obj Object

The object containing the property to monitor.

prop string

The name of the property to monitor.

callback function

The callback function to invoke when the property changes.

Returns:
Type Description
void

inherited once(eventName, callback){void}

Layers/GoLayer/index.ts, line 207

Registers a one-time event listener for the specified event.

Name Type Description
eventName string

The name of the event to listen for once.

callback function

The callback function to invoke when the event is fired.

Returns:
Type Description
void

refresh(){void}

Layers/GoVectorLayer/index.ts, line 146

Refreshes the layer source.

Returns:
Type Description
void

inherited removeFilter(){void}

Layers/GoLayer/index.ts, line 355

Removes the filter applied to the layer, resetting it to the default state. Forces the layer to refresh after removing the filter.

Returns:
Type Description
void

inherited removeFilterNoCQL(filter){void}

Layers/GoStyledLayer/index.ts, line 215

Removes a filter from the layer without using CQL.

Name Type Description
filter types.filterNoCQL

The filter to remove.

Returns:
Type Description
void

restoreLayer(){void}

Layers/GoVectorLayer/index.ts, line 197

Restores the layer to its default state by clearing filters and refreshing the layer.

Returns:
Type Description
void

selectChboxToc(options){void}

Layers/GoVectorLayer/index.ts, line 462

Selects the checkbox in the Table of Contents (TOC) for the layer if it is created and the layer should be visible.

Name Type Description
options object

The options for the layer.

Name Type Description
defaultVisibility boolean optional

The default visibility of the layer.

Returns:
Type Description
void This method does not return anything.

setDefaultAnnotations(){void}

Layers/GoVectorLayer/index.ts, line 737

Sets default annotations for the layer based on the layer options.

Returns:
Type Description
void

setIcons(){CancelablePromise.<styleSVG>}

Layers/GoVectorLayer/index.ts, line 724

Sets the SVG icons for the layer.

Returns:
Type Description
CancelablePromise.<styleSVG> A promise that resolves with the SVG style or rejects with an error.

inherited setLayerStyle(style){void|Promise}

Layers/GoLayer/index.ts, line 629

Sets the style of the layer and optionally adds annotations if applicable.

Name Type Description
style Array.<GoGlobalStyle> | GoGlobalStyle optional

The style or array of styles to apply.

Returns:
Type Description
void | Promise
  • Returns nothing or a promise depending on the type of style applied.

inherited setMaxResolution(maxResolution){void}

Layers/GoLayer/index.ts, line 611

Sets the maximum resolution at which the layer is visible.

Name Type Description
maxResolution number

The maximum resolution value.

Returns:
Type Description
void

inherited setMinResolution(minResolution){void}

Layers/GoLayer/index.ts, line 620

Sets the minimum resolution at which the layer is visible.

Name Type Description
minResolution number

The minimum resolution value.

Returns:
Type Description
void

inherited setStyleValues(styleInfoSVG, clear){CancelablePromise.<Map.<string, Style>>}

Layers/GoStyledLayer/index.ts, line 579

Sets style values based on the provided SVG style information and optionally clears existing styles.

Name Type Description
styleInfoSVG any

The SVG style information to set.

clear boolean optional

Optional flag to clear existing styles before applying the new ones.

Returns:
Type Description
CancelablePromise.<Map.<string, Style>> A promise that resolves to a map of style values.

inherited setVisibility(visibility){void}

Layers/GoLayer/index.ts, line 593

Sets the visibility of the layer.

Name Type Description
visibility boolean

True to make the layer visible, false to hide it.

Returns:
Type Description
void

inherited setZIndex(zIndex){void}

Layers/GoLayer/index.ts, line 602

Sets the z-index of the layer.

Name Type Description
zIndex number

The z-index value to set.

Returns:
Type Description
void

type(){string}

Layers/GoVectorLayer/index.ts, line 233

Returns the type of the layer.

Returns:
Type Description
string The layer type.

inherited unmount(){void}

Layers/GoLayer/index.ts, line 88

Unmount function

Returns:
Type Description
void

inherited validateLayerConfig(layerOpts){void}

Layers/GoLayer/index.ts, line 116

Validates the layer configuration and sets default values if necessary.

Name Type Description
layerOpts types.layerOptions

The layer options to validate.

Returns:
Type Description
void