Layer

Base class; normally only used for creating subclasses and not instantiated in apps. A visual representation of raster or vector map data well known as a layer.

Constructor

new Layer(nameopt, optionsopt)

Parameters:
NameTypeAttributesDefaultDescription
namestring | null<optional>
"noname"

Layer name.

optionsILayerParams<optional>
{}

Layer options.

Properties
NameTypeAttributesDefaultDescription
properties*<optional>
{}

Custom user properties.

labelMaxLettersnumber<optional>

Label max letters (reserved for specific layer implementations).

hideInLayerSwitcherboolean<optional>
false

Presence in LayerSwitcher control.

opacitynumber<optional>
1.0

Layer opacity.

minZoomnumber<optional>
0

Minimal visibility zoom level.

maxZoomnumber<optional>
50

Maximal visibility zoom level.

attributionstring<optional>
""

Layer attribution shown in the attribution area.

zIndexnumber<optional>
0

Layer z-index.

isBaseLayerboolean<optional>
false

Base layer flag.

defaultTexturesArray.<IDefaultTextureParams><optional>
[null, null]

Default textures.

visibilityboolean<optional>
true

Layer visibility.

fadingboolean<optional>
false

Enables fade-in/fade-out opacity transitions.

heightnumber<optional>
0

Height over the ground.

textureFilterstring<optional>
"mipmap"

Image texture filter. Available values: "nearest", "linear", "mipmap" and "anisotropic".

colorSpacestring | number<optional>
"srgb"

Layer color space. Available values: "linear", "srgb", 0, 1.

pickingEnabledboolean<optional>
true

Enables layer picking.

preLoadZoomLevelsArray.<number><optional>
[0, 1]

Zoom levels to preload when layer becomes visible.

extentExtent | Array.<Array.<number>><optional>
[[-180.0, -90.0], [180.0, 90.0]]

Visible extent.

ambientstring | NumberArray3 | Vec3<optional>

Ambient color.

diffusestring | NumberArray3 | Vec3<optional>

Diffuse color.

specularstring | NumberArray3 | Vec3<optional>

Specular color.

shininessnumber<optional>
20.0

Specular shininess coefficient.

nightTextureCoefficientnumber<optional>
1.0

Night texture blending coefficient.

iconSrcstring | null<optional>
null

Icon for LayerSwitcher.

waitForParentMaterialboolean<optional>
true

Wait for parent material while loading current tile material.

Members

_id

(protected) _pickingColor :Vec3

Layer picking color. Assign when added to the planet.

Type:

planet

Returns planet instance.

Methods

(abstract, protected) _assignPlanet(planet)

Assign the planet.

Parameters:
NameTypeDescription
planetPlanet

Planet render node.

(abstract, protected) _bindPicking()

Assign picking color to the layer.

(protected) _correctFullExtent()

Special correction of the whole globe extent.

addTo(planet)

Adds layer to the planet.

Parameters:
NameTypeDescription
planetPlanet

Adds layer to the planet.

bringToFront()

Sets z-index to the maximum value relative to other layers on the planet.

(abstract) clear()

Clears layer material.

flyExtent()

Fly extent.

getAttribution() → {string}

Gets layer attribution.

Returns:

Layer attribution.

Type: 
string

getExtent() → {Extent}

Gets layer extent.

Returns:

Layer geodetic extent.

Type: 
Extent

getExtentMerc() → {Extent}

Gets layer web-mercator extent.

Returns:

Layer extent.

Type: 
Extent

getHeight() → {number}

Gets layer height.

Returns:
Type: 
number

getID() → {number}

Gets layer identifier.

Returns:

Layer object id.

Type: 
number

getVisibility() → {boolean}

Gets layer visibility.

Returns:

Layer visibility.

Type: 
boolean

getZIndex() → {number}

Gets z-index.

Returns:
Type: 
number

(abstract) hasImageryTiles() → {boolean}

Returns true if a layer has imagery tiles.

Returns:

Imagery tiles flag.

Type: 
boolean

isBaseLayer() → {boolean}

Returns true if the layer is a base.

Returns:

Base layer flag.

Type: 
boolean

isEqual(layer) → {boolean}

Compares layers instances.

Parameters:
NameTypeDescription
layerLayer

Layer instance to compare.

Returns:

Returns true if the layer is the same instance as the input.

Type: 
boolean

remove() → {Layer}

Removes from a planet.

Returns:

This layer.

Type: 
Layer

setAttribution(html)

Sets layer attribution text.

Parameters:
NameTypeDescription
htmlstring

HTML string that represents layer attribution.

setBaseLayer(isBaseLayer)

Sets base layer type flag.

Parameters:
NameTypeDescription
isBaseLayerboolean

setExtent(extent)

Sets visible geographical extent.

Parameters:
NameTypeDescription
extentExtent

Layer visible geographical extent.

setHeight(height)

Sets height over the ground.

Parameters:
NameTypeDescription
heightnumber

Layer height.

(abstract) setVisibility(visibility)

Sets layer visibility.

Parameters:
NameTypeDescription
visibilityboolean

Layer visibility.

setZIndex(zIndex)

Sets z-index.

Parameters:
NameTypeDescription
zIndexnumber

Layer z-index.

viewExtent()

View extent.