Class: Layer

og.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 og.layer.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.math.Vector3 [0.1, 0.1, 0.21] optional Ambient RGB color.
diffuse og.math.Vector3 [1.0, 1.0, 1.0] optional Diffuse RGB color.
specular og.math.Vector3 [0.00025, 0.00015, 0.0001] optional Specular RGB color.
shininess Number 100 optional Shininess.
Fires:

Members

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.

protected_pickingColorog.math.Vector3

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.

opacitynumber

Layer global opacity.

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

abstractclear()

Clears layer material.
Gets layer extent.
Returns:
Type Description
og.Extent

getHeight(){number}

Gets layer height.
Returns:
Type Description
number

getID(){string}

Gets layer identifier.
Returns:
Type Description
string

getVisibility(){boolean}

Gets layer visibility.
Returns:
Type Description
boolean

getZIndex(){number}

Gets z-index.
Returns:
Type Description
number

abstracthasImageryTiles(){boolean}

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

isBaseLayer(){boolean}

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

isEqual(layer){boolean}

Compares layers instances.
Name Type Description
layer og.layer.Layer
Returns:
Type Description
boolean - Returns true if the layers is the same instance of the input.
Removes from planet.

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.

Events

Triggered when layer has added to the planet.
Triggered layer has double touched.
Mouse left button clicked.
Mouse left button double click.
Mouse left button is just pressed down(start pressing).
Mouse left button is pressing.
Mouse left button up(stop pressing).
Mouse right button clicked.
Mouse middle button double click.
Mouse middle button is just pressed down(start pressing).
Mouse middle button is pressing.
Triggered when mouse leaves the layer.
Triggered when mouse has entered over the layer.
Triggered when mouse moves over the layer.
Mouse wheel is rotated.
Mouse middle button up(stop pressing).
Mouse right button clicked.
Mouse right button double click.
Mouse right button is just pressed down(start pressing).
Triggered when layer has removed from the planet.
Mouse right button is pressing.
Mouse right button up(stop pressing).
Triggered when layer has finished touching.
Triggered when touch enters over the layer.
Triggered when touching leaves layer borders.
Triggered when touching moves over the layer.
Triggered when layer begins to touch.

visibilitychange

Triggered when layer visibilty chanched.