Vector

Vector layer represents alternative entities store. Used for geospatial data rendering like points, lines, polygons, geometry objects etc.

Constructor

new Vector(nameopt, optionsopt)

Parameters:
NameTypeAttributesDefaultDescription
namestring<optional>
"noname"

Layer name.

optionsIVectorParams<optional>

Layer options:

Properties
NameTypeAttributesDefaultDescription
minZoomnumber<optional>
0

Minimal visible zoom. 0 is default

maxZoomnumber<optional>
50

Maximal visible zoom. 50 is default.

attributionstring<optional>

Layer attribution.

zIndexstring<optional>
0

Layer Z-order index. 0 is default.

visibilityboolean<optional>
true

Layer visibility. True is default.

isBaseLayerboolean<optional>
false

Layer base layer. False is default.

entitiesArray.<Entity><optional>

Entities array.

scaleByDistanceArray.<number><optional>

Scale by distance parameters. (exactly 3 entries) 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. Use [1.0, 1.0, 1.0] for real sized objects

nodeCapacitynumber<optional>
30

Maximum entities quantity in the tree node. Rendering optimization parameter. 30 is default.

asyncboolean<optional>
true

Asynchronous vector data handling before rendering. True for optimization huge data.

clampToGroundboolean<optional>
false

Clamp vector data to the ground.

relativeToGroundboolean<optional>
false

Place vector data relative to the ground relief.

polygonOffsetUnitsNumber<optional>
0.0

The multiplier by which an implementation-specific value is multiplied with to create a constant depth offset.

//@fires EventsHandler#entitymove

Fires:

Extends

Members

_id

Overrides

(protected) _pickingColor :Vec3

Layer picking color. Assign when added to the planet.

Type:

pickingEnabled

Set layer picking events active.

planet

Returns planet instance.

Overrides

Methods

(abstract, protected) _assignPlanet(planet)

Assign the planet.

Parameters:
NameTypeDescription
planetPlanet

Planet render node.

_bindEventsDefault(entityCollection)

Parameters:
NameTypeDescription
entityCollection
To Do
  • (refactoring) could be used in somethig like bindEntityCollectionQuad(...)

(abstract, protected) _bindPicking()

Assign picking color to the layer.

(protected) _correctFullExtent()

Special correction of the whole globe extent.

_createEntityCollectionsTree()

(protected) _reindexEntitiesArray(startIndex)

Refresh collected entities indexes from startIndex entities collection array position.

Parameters:
NameTypeDescription
startIndexnumber

Entity array index.

abortMaterialLoading(material)

Abort exact material loading.

Parameters:
NameTypeDescription
materialMaterial

Segment material.

add(entity, rightNowopt) → {Vector}

Adds entity to the layer.

Parameters:
NameTypeAttributesDefaultDescription
entityEntity

Entity.

rightNowboolean<optional>
false

Entity insertion option. False is default.

Returns:
  • Returns this layer.
Type: 
Vector

addEntities(entities, rightNowopt) → {Vector}

Adds entity array to the layer.

Parameters:
NameTypeAttributesDefaultDescription
entitiesArray.<Entity>

Entities array.

rightNowboolean<optional>
false

Entity insertion option. False is default.

Returns:
  • Returns this layer.
Type: 
Vector

addTo(planet) → {Vector}

Adds layer to the planet.

Parameters:
NameTypeDescription
planetPlanet

Planet scene object.

Overrides
Returns:
Type: 
Vector

bringToFront()

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

clear()

TODO: Clear the layer.

Overrides

each(callback)

Safety entities loop.

Parameters:
NameTypeDescription
callback

flyExtent()

Fly extent.

getAttribution() → {string}

Gets layer attribution.

Returns:

Layer attribution

Type: 
string

getEntities() → {Array.<Entity>}

Returns stored entities.

Returns:
Type: 
Array.<Entity>

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() → {string}

Gets layer identifier.

Overrides
Returns:
  • Layer object id.
Type: 
string

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

insert(entity, index, rightNowopt) → {Vector}

Adds entity to the layer in the index position.

Parameters:
NameTypeAttributesDefaultDescription
entityEntity

Entity.

indexNumber

Index position.

rightNowboolean<optional>
false

Entity insertion option. False is default.

Returns:
  • Returns this layer.
Type: 
Vector

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.

Overrides
Returns:
  • Returns true if the layers is the same instance of the input.
Type: 
boolean

(abstract) loadMaterial(material)

Start to load tile material.

Parameters:
NameTypeDescription
materialMaterial

Current material.

remove() → {Layer}

Removes from planet.

Overrides
Returns:

-This layer.

Type: 
Layer

removeEntities(entities) → {Vector}

Removes entities from layer.

Parameters:
NameTypeDescription
entitiesArray.<Entity>

Entity array.

Returns:
  • Returns this layer.
Type: 
Vector

removeEntity(entity) → {Vector}

Remove entity from layer. TODO: memory leaks.

Parameters:
NameTypeDescription
entityEntity

Entity to remove.

Returns:
  • Returns this layer.
Type: 
Vector

setAttribution(html)

Sets layer attribution text.

Parameters:
NameTypeDescription
htmlstring

HTML code that represents layer attribution, it could be just a text.

setBaseLayer(isBaseLayer)

Sets base layer type true.

Parameters:
NameTypeDescription
isBaseLayerboolean

setEntities(entities) → {Vector}

Removes current entities from layer and adds new entities.

Parameters:
NameTypeDescription
entitiesArray.<Entity>

New entity array.

Returns:
  • Returns layer instance.
Type: 
Vector

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.