Class: Layer

og/layer/Layer~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.

new Layer(name, options)

Name Type Default Description
name String "noname" optional Layer name.
options Object optional Layer options:
Name Type Default Description
opacity number 1.0 optional Layer opacity.
minZoom number 0 optional Minimal visibility zoom level.
maxZoom number 0 optional Maximal visibility zoom level.
attribution string optional Layer attribution that displayed in the attribution area on the screen.
isBaseLayer boolean false optional This is a base layer.
visibility boolean true optional Layer visibility.
isSRGB boolean false optional Layer image webgl nternal format.
extent Extent [[-180.0, -90.0], [180.0, 90.0]] optional Visible extent.
textureFilter string "anisotropic" optional Image texture filter. Available values: "nearest", "linear", "mipmap" and "anisotropic".
Fires:
  • - Triggered when layer visibilty chanched.
  • - Triggered when layer has added to the planet.
  • - Triggered when layer has removed from the planet.

Members

static,constantmodule:og/layer/Layer~Layer.MAX_REQUESTSnumber

Maximum loading queries at one time.

protected_attributionstring

Layer attribution.

protected_extentExtent

Visible degrees extent.

protected_extentMercExtent

Visible mercator extent.

protected_heightnumber

Height over the ground.

protected_idnumber

Unic identifier.

protected_isBaseLayerboolean

Base layer type flag.

_opacitynumber

Layer global opacity.

protected_pickingColorVec3

Layer picking color. Assign when added to the planet.

protected_planetPlanet

Planet node.

protected_visibilityboolean

Layer visibility.

protected_zIndexnumber

Layer z-index.

eventsEvents

Events handler.

maxZoomnumber

Maximal zoom level when layer is visibile.

minZoomnumber

Minimal zoom level when layer is visibile.

namestring

Layer user name.

abstractplanet

Returns planet instance.

Methods

abstract,protected_assignPlanet(planet)

Assign the planet.
Name Type Description
planet Planet 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.
Name Type Description
planet Planet Adds layer to the planet.

bringToFront()

Set zIndex to the maximal value depend on other layers on the planet.

abstractclear()

Clears layer material.

getExtent(){Extent}

Gets layer extent.
Returns:
Type Description
Extent - Layer geodetic extent.

getHeight(){number}

Gets layer height.
Returns:
Type Description
number -

getID(){string}

Gets layer identifier.
Returns:
Type Description
string - Layer object id.

getVisibility(){boolean}

Gets layer visibility.
Returns:
Type Description
boolean - Layer visibility.

getZIndex(){number}

Gets z-index.
Returns:
Type Description
number -

abstracthasImageryTiles(){boolean}

Returns true if a layer has imagery tiles.
Returns:
Type Description
boolean - Imagery tiles flag.

isBaseLayer(){boolean}

Returns true if the layer is a base.
Returns:
Type Description
boolean - Base layer flag.

isEqual(layer){boolean}

Compares layers instances.
Name Type Description
layer Layer Layer instance to compare.
Returns:
Type Description
boolean - Returns true if the layers is the same instance of the input.

remove(){Layer}

Removes from planet.
Returns:
Type Description
Layer -This layer.

setAttribution(html)

Sets layer attribution text.
Name Type Description
html string HTML code that represents layer attribution, it could be just a text.

setBaseLayer(flag)

Sets base layer type true.
Name Type Description
flag boolean Base layer flag.

setExtent(extent)

Sets visible geographical extent.
Name Type Description
extent Extent Layer visible geographical extent.

setHeight(height)

Sets height over the ground.
Name Type Description
height number Layer height.

abstractsetVisibility(visibility)

Sets layer visibility.
Name Type Description
visibility boolean Layer visibility.

setZIndex(zIndex)

Sets z-index.
Name Type Description
zIndex number Layer z-index.