M/Layer~LayerBase


import LayerBase from 'M/Layer';

Represents the root of all other types of Layers. It is not meant to be instanced, but extended.

new LayerBase(userParameters)

facade/js/layer/Layer.js, line 35
Name Type Description
userParameters string | Mx.parameters.Layer

parameters provided by the user

Extends

  • M.facade.Base

Members

module:M/Layer~LayerBase.LEGEND_DEFAULT{string}

Image PNG for default legend

module:M/Layer~LayerBase.LEGEND_ERROR{string}

Image PNG for error legend

id

ID Layer

legend{string}

Non - identifying, readable name of layer, to use in toc

userMaxExtent{Array.<Number>}

MaxExtent provided by the user

Methods

calculateMaxExtent(){Promise}

facade/js/layer/Layer.js, line 295

Async version of getMaxExtent. Calculates the current maxExtent of this layer:

  1. Checks if there is an assigned maxExtent for this layer
  2. If not, checks if there is an assigned maxExtent for the map
  3. If not, gets the maxExtent of the map projection
Returns:
  • Promise object represents the maxExtent of the layer

getID(){Number}

facade/js/layer/Layer.js, line 164

Returns the ID

Returns:
The legend of the layer.

getLayerGroup(){M.LayerGroup}

facade/js/layer/Layer.js, line 361

Returns the Layer Group of this layer, if any.

Returns:
The Layer Group where this layer is in

getLegend(){string}

facade/js/layer/Layer.js, line 145

Returns the legend, a non - identifying, readable name of the layer, to use in toc, etc.

Returns:
The legend of the layer.

getLegendURL(){string}

facade/js/layer/Layer.js, line 468

Gets the url for the legend image of the layer.

Returns:
The url that returns the legend

getMaxExtent(){Array.<Number>}

facade/js/layer/Layer.js, line 273

Gets the current maxExtent of this layer:

  1. Checks if there is an assigned maxExtent for this layer
  2. If not, checks if there is an assigned maxExtent for the map
  3. If not, gets the maxExtent of the map projection
Returns:
  • The maxExtent of the layer, as [xmin, ymin, xmax, ymax]

getMaxScale()

facade/js/layer/Layer.js, line 537

This function gets the max-scale for this layer

getMinScale()

facade/js/layer/Layer.js, line 516

This function gets the min-scale for this layer

getOpacity(){Number}

facade/js/layer/Layer.js, line 559

This function gets the opacity of this layer

Returns:
0 to 1, where 0 is fully transparent and 1 opaque

getZIndex(){Number}

facade/js/layer/Layer.js, line 494

Gets the z-index of the layer

Returns:
Z-index of the layer

inRange(){boolean}

facade/js/layer/Layer.js, line 452

Indicates if the layer is in range, that is, if the current map resolution is between the min and max resolutions of the layer.

Returns:
true if in range, false otherwise

isQueryable(){boolean}

facade/js/layer/Layer.js, line 402

Returns whether the layer is queryable or not.

Returns:
true if queryable, false otherwise

isVisible(){boolean}

facade/js/layer/Layer.js, line 385

Returns whether the layer is visible or not.

Returns:
true if visible, false otherwise

refresh()

facade/js/layer/Layer.js, line 582

This function refreshes the state of this layer

resetMaxExtent()

facade/js/layer/Layer.js, line 331

Resets the max extent of the layer.

setLayerGroup(layerGroup)

facade/js/layer/Layer.js, line 373

Puts the layer inside a LayerGroup. A layer can only be inside one LayerGroup at a time.

Name Type Description
layerGroup M.LayerGroup

The Layer Group to put this layer in

setLegendURL(legendUr)

facade/js/layer/Layer.js, line 479

Sets the url of the legend image of this layer.

Name Type Description
legendUr string

The url that returns the image to use as legend

setMap(map)

facade/js/layer/Layer.js, line 349

Sets the facade map instace

Name Type Description
map M.Map

Facade map instance

setMaxExtent(maxExtent)

facade/js/layer/Layer.js, line 307

Sets a max extent for the layer.

Name Type Description
maxExtent Array.<number> | Mx.Extent

maxExtent to set

setMaxScale()

facade/js/layer/Layer.js, line 547

This function sets the max-scale for this layer

setMinScale()

facade/js/layer/Layer.js, line 526

This function sets the min-scale for this layer

setOpacity(opacity)

facade/js/layer/Layer.js, line 570

Sets the opacity of this layer

Name Type Description
opacity Number

0 to 1, where 0 is fully transparent and 1 opaque

setVisible(visibility)

facade/js/layer/Layer.js, line 419

Sets the visibility of this layer. A non-visible layer is not drawn.

Name Type Description
visibility boolean

true if visible, false otherwise

setZIndex(zIndex)

facade/js/layer/Layer.js, line 505

Sets the z-index for this layer

Name Type Description
zIndex Number

Z-index to apply