diff --git a/docs/Globe.ts.html b/docs/Globe.ts.html index ca2894ef..d69e3e23 100644 --- a/docs/Globe.ts.html +++ b/docs/Globe.ts.html @@ -343,7 +343,7 @@ this._canvas.style.opacity = "0"; } - public attachTo(target: HTMLElement | string) { + public attachTo(target: HTMLElement | string, isFirst?: boolean) { this.detach(); @@ -356,7 +356,11 @@ if (t) { this.$target = t as HTMLElement; - t.appendChild(this.$inner); + if (isFirst && this.$target.firstChild) { + this.$target.insertBefore(this.$inner, this.$target.firstChild); + } else { + t.appendChild(this.$inner); + } } } diff --git a/docs/KML.html b/docs/KML.html index 135a531c..179e855e 100644 --- a/docs/KML.html +++ b/docs/KML.html @@ -1,3 +1,3 @@ Class: KML
On this page

KML

Layer to render KMLs files

Constructor

new KML(name, optionsopt)

Parameters:
NameTypeAttributesDescription
namestring
options*<optional>

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) _convertCoordonatesIntoEntities(coordonates, color) → {any}

Creates billboards or polylines from array of lonlat.

Parameters:
NameTypeDescription
coordonatesArray
colorstring
Returns:
Type: 
any

(protected) _correctFullExtent()

Special correction of the whole globe extent.

_createEntityCollectionsTree()

(protected) _getXmlContent() → {Document}

Returns:
Type: 
Document

(protected) _parseKMLcoordinates()

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

Overrides
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

(async) addKmlFromFiles(kmls, coloropt, billboardopt) → {Promise.<{entities: Array.<Entity>, extent: Extent}>}

Parameters:
NameTypeAttributesDescription
kmlsArray.<File>
colorstring<optional>
billboardBillboard<optional>
Returns:
Type: 
Promise.<{entities: Array.<Entity>, extent: Extent}>

(async) addKmlFromUrl(url, coloropt, billboardopt) → {Promise.<{entities: Array.<Entity>, extent: Extent}>}

Parameters:
NameTypeAttributesDescription
urlstring

Url of the KML to display. './myFile.kml' or 'http://mySite/myFile.kml' for example.

colorstring<optional>
billboardBillboard<optional>
Returns:
Type: 
Promise.<{entities: Array.<Entity>, extent: Extent}>

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
Overrides

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.

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

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

setColor(color)

Parameters:
NameTypeDescription
colorstring

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.

OpenGlobus
\ No newline at end of file +
On this page

KML

Layer to render KMLs files

Constructor

new KML(name, optionsopt)

Parameters:
NameTypeAttributesDescription
namestring
options*<optional>

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) _convertCoordonatesIntoEntities(coordonates, color) → {any}

Creates billboards or polylines from array of lonlat.

Parameters:
NameTypeDescription
coordonatesArray
colorstring
Returns:
Type: 
any

(protected) _correctFullExtent()

Special correction of the whole globe extent.

_createEntityCollectionsTree()

(protected) _getXmlContent() → {Document}

Returns:
Type: 
Document

(protected) _parseKMLcoordinates()

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

Overrides
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

(async) addKmlFromFiles(kmls, coloropt, billboardopt) → {Promise.<{entities: Array.<Entity>, extent: Extent}>}

Parameters:
NameTypeAttributesDescription
kmlsArray.<File>
colorstring<optional>
billboardBillboard<optional>
Returns:
Type: 
Promise.<{entities: Array.<Entity>, extent: Extent}>

(async) addKmlFromUrl(url, coloropt, billboardopt) → {Promise.<{entities: Array.<Entity>, extent: Extent}>}

Parameters:
NameTypeAttributesDescription
urlstring

Url of the KML to display. './myFile.kml' or 'http://mySite/myFile.kml' for example.

colorstring<optional>
billboardBillboard<optional>
Returns:
Type: 
Promise.<{entities: Array.<Entity>, extent: Extent}>

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
Overrides

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.

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

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

setColor(color)

Parameters:
NameTypeDescription
colorstring

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.

OpenGlobus
\ No newline at end of file diff --git a/docs/Vector.html b/docs/Vector.html index caf57588..73916cfc 100644 --- a/docs/Vector.html +++ b/docs/Vector.html @@ -1,3 +1,3 @@ Class: Vector
On this page

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.

OpenGlobus
\ No newline at end of file +
On this page

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.

OpenGlobus
\ No newline at end of file diff --git a/docs/entity_GeometryHandler.ts.html b/docs/entity_GeometryHandler.ts.html index 670c058d..9f145a1b 100644 --- a/docs/entity_GeometryHandler.ts.html +++ b/docs/entity_GeometryHandler.ts.html @@ -3,7 +3,7 @@
On this page

entity_GeometryHandler.ts

import * as mercator from "../mercator";
 import * as quadTree from "../quadTree/quadTree";
 import {Extent} from "../Extent";
-import {Handler} from "../webgl/Handler";
+import {Handler, WebGLBufferExt} from "../webgl/Handler";
 import {doubleToTwoFloatsV2} from "../math/coder";
 import {Vector} from "../layer/Vector";
 import {NumberArray2, Vec2} from "../math/Vec2";
@@ -13,14 +13,14 @@
 import {
     CoordinatesType,
     Geometry,
-    IMultiLineStringCoordinates,
+    GeometryTypeEnum,
     ILineStringCoordinates,
+    IMultiLineStringCoordinates,
     IMultiPolygonCoordinates,
-    IPolygonCoordinates, GeometryTypeEnum
+    IPolygonCoordinates
 } from "./Geometry";
 
 import {earcut, flatten} from "../utils/earcut";
-import {WebGLBufferExt} from "../webgl/Handler";
 
 const POLYVERTICES_BUFFER = 0;
 const POLYINDEXES_BUFFER = 1;
@@ -1178,6 +1178,77 @@
             this._lineStrokeColors.length / 4
         );
     }
+
+    public clear() {
+        this._geometries = [];
+        this._polyVerticesHighMerc = [];
+        this._polyVerticesLowMerc = [];
+        this._polyIndexes = [];
+        this._polyColors = [];
+        this._polyPickingColors = [];
+
+        this._lineVerticesHighMerc = [];
+        this._lineVerticesLowMerc = [];
+        this._lineOrders = [];
+        this._lineIndexes = [];
+        this._lineColors = [];
+        this._linePickingColors = [];
+        this._lineThickness = [];
+        this._lineStrokeColors = [];
+        this._lineStrokes = [];
+
+        this._deleteBuffers();
+
+        this._polyVerticesHighBufferMerc = null;
+        this._polyVerticesLowBufferMerc = null;
+        this._polyIndexesBuffer = null;
+        this._polyColorsBuffer = null;
+        this._polyPickingColorsBuffer = null;
+
+        this._lineVerticesHighBufferMerc = null;
+        this._lineVerticesLowBufferMerc = null;
+        this._lineIndexesBuffer = null;
+        this._lineOrdersBuffer = null;
+        this._lineColorsBuffer = null;
+        this._linePickingColorsBuffer = null;
+        this._lineThicknessBuffer = null;
+        this._lineStrokeColorsBuffer = null;
+        this._lineStrokesBuffer = null;
+
+        this._updatedGeometryArr = [];
+        this._updatedGeometry = {};
+
+        this._removeGeometryExtentArr = [];
+        this._removeGeometryExtents = {};
+
+        this.refresh();
+    }
+
+    public _deleteBuffers() {
+        if (this._layer._planet && this._layer._planet.renderer) {
+
+            let h = this._layer._planet.renderer.handler,
+                gl = h.gl!;
+
+            gl.deleteBuffer(this._polyVerticesHighBufferMerc!);
+            gl.deleteBuffer(this._polyVerticesLowBufferMerc!);
+            gl.deleteBuffer(this._polyIndexesBuffer!);
+            gl.deleteBuffer(this._polyColorsBuffer!);
+            gl.deleteBuffer(this._polyPickingColorsBuffer!);
+
+            gl.deleteBuffer(this._lineVerticesHighBufferMerc);
+            gl.deleteBuffer(this._lineVerticesLowBufferMerc);
+            gl.deleteBuffer(this._lineIndexesBuffer);
+            gl.deleteBuffer(this._lineOrdersBuffer);
+            gl.deleteBuffer(this._lineColorsBuffer);
+            gl.deleteBuffer(this._linePickingColorsBuffer);
+            gl.deleteBuffer(this._lineThicknessBuffer);
+            gl.deleteBuffer(this._lineStrokeColorsBuffer);
+            gl.deleteBuffer(this._lineStrokesBuffer);
+
+
+        }
+    }
 }
 
 export {GeometryHandler};
diff --git a/docs/layer_Vector.ts.html b/docs/layer_Vector.ts.html
index a409b0e5..0b68df10 100644
--- a/docs/layer_Vector.ts.html
+++ b/docs/layer_Vector.ts.html
@@ -579,6 +579,7 @@
      * @public
      */
     public override clear() {
+        super.clear();
         let temp: Entity[] = new Array(this._entities.length);
 
         for (let i = 0; i < temp.length; i++) {
@@ -599,6 +600,7 @@
         this._entityCollectionsTree = null;
         this._entityCollectionsTreeNorth = null;
         this._entityCollectionsTreeSouth = null;
+        this._geometryHandler.clear()
     }
 
     /**
@@ -981,7 +983,7 @@
 
     protected _execDeferredNode(node: EntityCollectionNode) {
         this._counter++;
-        setTimeout(() => {
+        requestAnimationFrame(() => {
             node.applyCollection();
             this._counter--;
             if (this._deferredEntitiesPendingQueue.length && this._counter < 1) {
@@ -994,7 +996,7 @@
                     }
                 }
             }
-        }, 0);
+        });
     }
 
     /**