legend

Available for:Map Panel

Managing legend

Methods

Name Summary
add

Adds new legend items to the map.

addQuery

Adds new legend item to the map from query.

find

Finds legend items.

Methods • Details

add(config, callback, errback) → {void}

Available for:Map Panel

Adds new legend items to the map.

Parameters

Name Type Description
config Object
{
 "ids": Array.<String>,
 "id": String,
 "url": String,
 "names": Array.<String>,
 "name": String,
 "geometryFieldName": String,
 "definitionName": String,
 "imageFormat": String,
 "alternativeHostNames": Array.<String>,
 "attribution": String,
 "configurationUrl": String,
 "serviceMetadata": Object,
 "serviceMetadata.serviceTitle": String,
 "serviceMetadata.version": String,
 "serviceMetadata.type": String,
 "bboxCrs": String,
 "supportedCrses": String,
 "serviceMetadata.operationsMetadata": Object,
 "serviceMetadata.rootLayer": String|Object,
 "serviceMetadata.tileMatrixSets": Array.<Object>,
 "style": Object,
 "style.vector": Object,
 "style.vector.icon": Object,
 "style.vector.icon.image": String,
 "style.vector.icon.size": Array.<Number>,
 "style.vector.icon.anchor": Array.<Number>,
 "style.vector.icon.opacity": Number,
 "style.vector.fill": Object,
 "style.vector.fill.color": String,
 "style.vector.fill.opacity": Number,
 "style.vector.stroke": Object,
 "style.vector.stroke.color": String,
 "style.vector.stroke.width": Number,
 "style.vector.stroke.opacity": Number,
 "style.vector.stroke.pattern": String,
 "style.vector.radius": Number,
 "bbox": Array.<Number>,
 "baseUrl": String,
 "blob": String,
 "minlevel": Number,
 "maxlevel": Number,
 "opacity": Number,
 "capabilitiesUrl": Object,
 "omitCrsDetection": Boolean,
 "transparent": Boolean,
 "application": String,
 "legendentries": Array,
 "singleTile": Boolean,
 "heightBounds": Object,
 "heightBounds.lowerBound": Number,
 "heightBounds.upperBound": Number,
 "featurePrefix": String,
 "featureClassId": String,
 "pssId": String
}

Configuration options.

ids

IDs

id

Single ID. For WMS layerName, for WFS typeName

url optional

URL

names optional

Names

name optional

Single name

geometryFieldName optional

Geometry field name for WFS feature class item

definitionName

Service type (WFS, WMS, WMTS, WMPS, OSM, Objects, SmartTiles, GeoJsonData, PSS)

imageFormat optional

Default value: "image/png".

Image format

alternativeHostNames optional

Alternative host names (ex. subdomains) for omitting browser's parallel connections limit to the same host (WMTS, OSM, WMS)

attribution optional

Service attribution displayed on map

configurationUrl optional

URL of configuration file (Objects, SmartTiles)

serviceMetadata optional

Service metadata object. Mandatary when there is no remote backend specified.

serviceMetadata.serviceTitle

Service title

serviceMetadata.version optional

Version

serviceMetadata.type optional

Type

bboxCrs optional

CRS code of config.bbox

supportedCrses optional

supported CRS codes

serviceMetadata.operationsMetadata

Operations metadata object

serviceMetadata.rootLayer

Root layer

serviceMetadata.tileMatrixSets optional

Array of tile matrix sets

style optional

Legend entry style for WFS

style.vector optional

Vector style object

style.vector.icon optional

Vector icon style object

style.vector.icon.image optional

URL to the image

style.vector.icon.size optional

Size of the icon image in pixels

style.vector.icon.anchor optional

Coordinates of the \"tip\" of the icon (relative to its top left corner)

style.vector.icon.opacity optional

Defines opacity of the image (it must be in range 0 to 1)

style.vector.fill optional

Vector fill style object

style.vector.fill.color optional

Defines vector feature fill color in CSS-format

style.vector.fill.opacity optional

Defines opacity of the fill color (it must be in range 0 to 1)

style.vector.stroke optional

Vector stroke style object

style.vector.stroke.color optional

Defines vector feature stroke color in CSS-format

style.vector.stroke.width optional

Defines vector feature stroke width in pixels

style.vector.stroke.opacity optional

Defines opacity of the stroke color (it must be in range 0 to 1)

style.vector.stroke.pattern optional

Defines a dash pattern for the stroke

style.vector.radius optional

Defines the radius of a circle marker

bbox optional

Bounding box (required for Objects or SmartTiles if no configurationUrl specified)

baseUrl optional

Base URL for 3D layers (required for Objects or SmartTiles if no configurationUrl specified)

blob optional

URL of BLOB file for 3D layers (required for Objects if no configurationUrl specified)

minlevel optional

Lowest LOD level available for this data source (required for SmartTiles if no configurationUrl specified)

maxlevel optional

Highest LOD level available for this data source (required for SmartTiles if no configurationUrl specified)

opacity optional

Number in [0..1] range defining opacity level of added legend item

capabilitiesUrl optional

URL of capabilities document (WMTS)

omitCrsDetection optional

If true then crs compatibility detection will be omitted (WMS)

transparent optional

Default value: true.

Transparent property (WMS)

application optional

WMPS application name (WMPS)

legendentries optional

Array of WMPS objects with Id and LegendId properties (WMPS)

singleTile optional

Default value: false.

If true one full-map tile will be downloaded instad of multiple small tiles (WMS, WMPS )

heightBounds optional

Legend entry height bounds

heightBounds.lowerBound optional

Lower height bound

heightBounds.upperBound optional

Upper height bound

featurePrefix optional

Feature class prefix (WFS)

featureClassId optional

Feature class id in format: {namespace}localName. Used only for WFS and PSS. If not provided config.id is used

pssId optional

unique identifier of an in memory feature storage

callback optional

Callback executed if operation succeeds

errback optional

Callback executed if operation fails

Returns

TypeDescription
void

addQuery(query, config, callback, errback) → {void}

Available for:Map Panel

Adds new legend item to the map from query.

Parameters

Name Type Description
query Query

Query object or array of query objects

config Object
{
 "style": Object,
 "style.style.vector": Object,
 "style.style.vector.icon": Object,
 "style.style.vector.icon.image": String,
 "style.style.vector.icon.size": Array.<Number>,
 "style.style.vector.icon.anchor": Array.<Number>,
 "style.style.vector.icon.opacity": Number,
 "style.style.vector.fill": Object,
 "style.style.vector.fill.color": String,
 "style.style.vector.fill.opacity": Number,
 "style.style.vector.stroke": Object,
 "style.style.vector.stroke.color": String,
 "style.style.vector.stroke.width": Number,
 "style.style.vector.stroke.opacity": Number,
 "style.style.vector.stroke.pattern": String,
 "style.style.vector.radius": Number,
 "heightBounds": Object,
 "heightBounds.lowerBound": Number,
 "heightBounds.upperBound": Number
}

Configuration options

style

Legend entry style object or array of objects

style.style.vector optional

undefined

style.style.vector.icon optional

undefined

style.style.vector.icon.image optional

URL to the image

style.style.vector.icon.size optional

Size of the icon image in pixels

style.style.vector.icon.anchor optional

Coordinates of the \"tip\" of the icon (relative to its top left corner)

style.style.vector.icon.opacity optional

Defines opacity of the image (it must be in range 0 to 1)

style.style.vector.fill optional

undefined

style.style.vector.fill.color optional

Defines vector feature fill color in CSS-format

style.style.vector.fill.opacity optional

Defines opacity of the fill color (it must be in range 0 to 1)

style.style.vector.stroke optional

undefined

style.style.vector.stroke.color optional

Defines vector feature stroke color in CSS-format

style.style.vector.stroke.width optional

Defines vector feature stroke width in pixels

style.style.vector.stroke.opacity optional

Defines opacity of the stroke color (it must be in range 0 to 1)

style.style.vector.stroke.pattern optional

Defines a dash pattern for the stroke

style.style.vector.radius optional

Defines the radius of a circle marker

heightBounds optional

Query height bounds

heightBounds.lowerBound

Lower height bound

heightBounds.upperBound

Upper height bound

callback optional

Callback executed if operation succeeds

errback optional

Callback executed if operation fails

Returns

TypeDescription
void

find(config, callback, errback) → {void}

Available for:Map Panel

Finds legend items.

Parameters

Name Type Description
config Object
{
 "id": String|Array,
 "name": String|Array,
 "successOnEmpty": Boolean
}

Search configuration, finds all when null or empty

id optional

Finds only legend items with specified ID(s)

name optional

Finds only legend items with specified name(s)

successOnEmpty optional

Default value: false.

Compatibility flag for calling success callback insted of errback when result list is empty

callback optional

Callback on success

errback optional

Errback on failure

Returns

TypeDescription
void