Class: Vector

og.layer.Vector

new og.layer.Vector(name, options)

Vector layer represents alternative entities store. Used for geospatial data rendering like points, lines, polygons, geometry objects etc.
Name Type Default Description
name string "noname" optional Layer name.
options Object optional Layer options:
Name Type Default Description
minZoom number 0 optional Minimal visible zoom. 0 is default
maxZoom number 50 optional Maximal visible zoom. 50 is default.
attribution string optional Layer attribution.
zIndex string 0 optional Layer Z-order index. 0 is default.
visibility boolean true optional Layer visibility. True is default.
isBaseLayer boolean false optional Layer base layer. False is default.
entities Array.<og.Entity> optional Entities array.
scaleByDistance Array.<number, number, number> optional Scale by distance parameters. First index - near distance to the entity, after entity becomes full scale. Second index - far distance to the entity, when entity becomes zero scale. Third index - far distance to the entity, when entity becomes invisible.
nodeCapacity number 30 optional Maximum entities quantity in the tree node. Rendering optimization parameter. 30 is default.
async boolean true optional Asynchronous vector data handling before rendering. True for optimization huge data.
groundAlign boolean false optional Vector data align to the ground relief. Like points with zero altitude lay on the ground.
Fires:

Extends

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.

asyncboolean

Asynchronous data handling before rendering.

eventsog.Events

Events handler.

groundAlignboolean

Vector data ground align flag.

maxZoomnumber

Maximal zoom level when layer is visibile.

minZoomnumber

Minimal zoom level when layer is visibile.

namestring

Layer user name.

opacitynumber

Layer global opacity.

scaleByDistanceArray.<number, number, number>

First index - near distance to the entity, after that entity becomes full scale. Second index - far distance to the entity, when entity becomes zero scale. Third index - far distance to the entity, when entity becomes invisible.

transparentColorArray.<number, number, number>

Transparent RGB color mask.

Methods

staticog.layer.Vector._entitiesConstructor(entities){Array.<og.Entity>}

Creates entity instance array.
Name Type Description
entities
Returns:
Type Description
Array.<og.Entity> - Entity object array.

inherited abstract,protected_assignPlanet(planet-)

Assign the planet.
Name Type Description
planet- og.scene.Planet Planet render node.

inherited abstract,protected_bindPicking()

Assign picking color to the layer.

inherited protected_correctFullExtent()

Special correction of the whole globe extent.

_reindexEntitiesArray(startIndex)

Refresh collected entities indexes from startIndex entitytes collection array position.
Name Type Description
startIndex number Entity array index.

abortMaterialLoading(material)

Abort exact material loading.
Name Type Description
material og.planetSegment.Material Segment material.

add(entity, rightNow){og.layer.Vector}

Adds entity to the layer.
Name Type Description
entity og.Entity Entity.
rightNow boolean optional Entity insertion option. False is deafult.
Returns:
Type Description
og.layer.Vector - Returns this layer.

addEntities(entities, rightNow){og.layer.Vector}

Adds entity array to the layer.
Name Type Description
entities Array.<og.Entity> Entities array.
rightNow boolean optional Entity insertion option. False is deafult.
Returns:
Type Description
og.layer.Vector - Returns this layer.
Adds layer to the planet.
TODO: Clear the layer.

each(callback)

Safety entities loop.
Name Type Description
callback callback Entity callback.

getEntities(){Array.<og.Entity>}

Returns stored entities.
Returns:
Type Description
Array.<og.Entity>
Gets layer extent.
Returns:
Type Description
og.Extent

inherited getHeight(){number}

Gets layer height.
Returns:
Type Description
number
Gets layer identifier.
Returns:
Type Description
string

inherited getVisibility(){boolean}

Gets layer visibility.
Returns:
Type Description
boolean

inherited getZIndex(){number}

Gets z-index.
Returns:
Type Description
number

abstracthasImageryTiles(){boolean}

Returns true if a layer has rasterized vector data like polygons.
Returns:
Type Description
boolean

inherited isBaseLayer(){boolean}

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

inherited 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.

abstractloadMaterial(mateial)

Start to load tile material.
Name Type Description
mateial og.planetSegment.Material
Removes from planet.

removeEntities(entities){og.layer.Vector}

Removes entities from layer.
Name Type Description
entities Array.<og.Entity> Entity array.
Returns:
Type Description
og.layer.Vector - Returns this layer.
Remove entity from layer. TODO: memory leaks.
Name Type Description
entity og.Entity Entity to remove.
Returns:
Type Description
og.layer.Vector - Returns this layer.

inherited setAttribution(html)

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

inherited setBaseLayer(flag)

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

setEntities(entities)

Removes current entities from layer and adds new entities.
Name Type Description
entities Array.<og.Entity> New entity array.

inherited setExtent(extent)

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

inherited setHeight(height)

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

setPickingEnabled(enable)

Set layer picking events active.
Name Type Description
enable number

setScaleByDistance(near, far, farInvisible)

Sets scale by distance parameters.
Name Type Description
near number Full scale entity distance.
far number Zerol scale entity distance.
farInvisible number optional Entity visibility distance.

inherited abstractsetVisibility(visibility)

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

inherited 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.
Triggered when layer begin draw.
Triggered when entity has moved.
Triggered when new entity added to the layer.
Triggered when entity removes from the collection.
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 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.
Triggered when layer visibilty chanched.