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.
transparentColor Array.<number, number, number> [-1,-1,-1] optional RGB color that defines transparent color.
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.
extent og.Extent [[-180.0, -90.0], [180.0, 90.0]] optional Visible extent.
ambient og.Vec3 [0.1, 0.1, 0.21] optional Ambient RGB color.
diffuse og.Vec3 [1.0, 1.0, 1.0] optional Diffuse RGB color.
specular og.Vec3 [0.00025, 0.00015, 0.0001] optional Specular RGB color.
shininess Number 100 optional Shininess.
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_extentog.Extent

Visible degrees extent.

protected_extentMercog.Extent

Visible mercator extent.

protected_heightnumber

Height over the ground.

protected_idnumber

Unic identifier.

protected_isBaseLayerboolean

Base layer type flag.

_opacitynumber

Layer global opacity.

protected_pickingColorog.Vec3

Layer picking color. Assign when added to the planet.

protected_planetog.scene.Planet

Planet node.

protected_visibilityboolean

Layer visibility.

protected_zIndexnumber

Layer z-index.

ambientObject

Layer light material parameters.

eventsog.Events

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.

transparentColorArray.<number, number, number>

Transparent RGB color mask.

Methods

abstract,protected_assignPlanet(planet)

Assign the planet.
Name Type Description
planet og.scene.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 og.scene.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(){og.Extent}

Gets layer extent.
Returns:
Type Description
og.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 og.Layer Layer instance to compare.
Returns:
Type Description
boolean - Returns true if the layers is the same instance of the input.
Removes from planet.
Returns:
Type Description
og.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 og.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.