KML

Extends: Vector

Source: KML.ts:22

Layer to render KML files.


Constructor

new KML(name: string, options?: IKMLParams): KML

Parameters

  • name (string) — Layer name.
  • options (IKMLParams, optional) — KML layer options.

Instance Methods

_parseKMLcoordinates(): Array.<Array.<number>>

protected
KML.ts:67

Returns

  • Array.<Array.<number>> — Array of [longitude, latitude, altitude?].

_convertCoordonatesIntoEntities( coordinates: Array.<Array.<Array.<Array.<number>>>>, color: string, billboard?: IBillboardParams, ): Object

protected
KML.ts:211

Creates billboards or polylines from array of lonlat.

Parameters

  • coordinates (Array.<Array.<Array.<Array.<number>>>>) — Coordinates grouped by files and paths.
  • color (string) — Polyline color.
  • billboard (IBillboardParams, optional) — Billboard options.

Returns

  • Object

_getXmlContent(): Promise.<XMLDocument>

protected
KML.ts:253

Returns

  • Promise.<XMLDocument>

addKmlFromFiles( kmls: Array.<Blob>, color?: string, billboard?: IBillboardParams, ): Promise.<{entities: Array.<Entity>, extent: Extent}>

Parameters

  • kmls (Array.<Blob>) — KML files.
  • color (string, optional) — Polyline color.
  • billboard (IBillboardParams, optional) — Billboard options.

Returns

setColor(color: string)

Parameters

  • color (string) — Layer color.

addKmlFromUrl( url: string, color?: string, billboard?: Billboard | IBillboardParams, ): Promise.<{entities: Array.<Entity>, extent: Extent}>

Parameters

  • url (string) — URL of the KML to display. For example: './myFile.kml' or 'http://mySite/myFile.kml'.
  • color (string, optional) — Polyline color.
  • billboard (Billboard | IBillboardParams, optional) — Billboard options.

Returns

addTo(planet: Planet)

Inherited from Vector#addTo

Overrides: Vector#addTo

Adds layer to the planet.

Parameters

  • planet (Planet) — Planet scene object.

getEntities(): Array.<Entity>

Inherited from Vector#getEntities

Overrides: Vector#getEntities

Returns stored entities.

Returns

  • Array.<Entity> — Stored entities.

add(entity: Entity): Vector

Inherited from Vector#add

Overrides: Vector#add

Adds entity to the layer.

Parameters

Returns

insert(entity: Entity, index: Number): Vector

Inherited from Vector#insert

Overrides: Vector#insert

Adds entity to the layer in the index position.

Parameters

  • entity (Entity) — Entity.
  • index (Number) — Index position.

Returns

addEntities(entities: Array.<Entity>): Vector

Inherited from Vector#addEntities

Overrides: Vector#addEntities

Adds entity array to the layer.

Parameters

  • entities (Array.<Entity>) — Entities array.

Returns

removeEntity(entity: Entity): Vector

Inherited from Vector#removeEntity

Overrides: Vector#removeEntity

Remove entity from layer. TODO: memory leaks.

Parameters

  • entity (Entity) — Entity to remove.

Returns

_reindexEntitiesArray(startIndex: number)

protected
Vector.ts:619

Inherited from Vector#_reindexEntitiesArray

Overrides: Vector#_reindexEntitiesArray

Refresh collected entities indexes from startIndex entities collection array position.

Parameters

  • startIndex (number) — Entity array index.

removeEntities(entities: Array.<Entity>): Vector

Inherited from Vector#removeEntities

Overrides: Vector#removeEntities

Removes entities from layer.

Parameters

  • entities (Array.<Entity>) — Entity array.

Returns

clear()

Inherited from Vector#clear

Overrides: Vector#clear

Clear the layer.

each(callback: function)

Inherited from Vector#each

Overrides: Vector#each

Safety entities loop.

Parameters

  • callback (function) — Entity callback.

setEntities(entities: Array.<Entity>): Vector

Inherited from Vector#setEntities

Overrides: Vector#setEntities

Removes current entities from layer and adds new entities.

Parameters

  • entities (Array.<Entity>) — New entity array.

Returns

_bindEventsDefault(entityCollection)

Inherited from Vector#_bindEventsDefault

Overrides: Vector#_bindEventsDefault

Parameters

  • entityCollection
  • TODO:
    • (refactoring) could be used in something like bindEntityCollectionQuad(...)

loadMaterial(material: Material)

Inherited from Vector#loadMaterial

Overrides: Vector#loadMaterial

Start to load tile material.

Parameters

  • material (Material) — Current material.

abortMaterialLoading(material: Material)

Inherited from Vector#abortMaterialLoading

Abort exact material loading.

Parameters

  • material (Material) — Segment material.

hasImageryTiles(): boolean

abstract
Layer.ts:471

Inherited from Layer#hasImageryTiles

Overrides: Vector#hasImageryTiles

Returns true if a layer has imagery tiles.

Returns

  • boolean — Imagery tiles flag.

getID(): number

Inherited from Layer#getID

Overrides: Vector#getID

Gets layer identifier.

Returns

  • number — Layer object id.

isEqual(layer: Layer): boolean

Inherited from Layer#isEqual

Overrides: Vector#isEqual

Compares layers instances.

Parameters

  • layer (Layer) — Layer instance to compare.

Returns

  • boolean — Returns true if the layer is the same instance as the input.

_assignPlanet(planet: Planet)

protectedabstract
Layer.ts:511

Inherited from Layer#_assignPlanet

Overrides: Vector#_assignPlanet

Assign the planet.

Parameters

  • planet (Planet) — Planet render node.

_bindPicking()

protectedabstract
Layer.ts:551

Inherited from Layer#_bindPicking

Overrides: Vector#_bindPicking

Assign picking color to the layer.

remove(): Layer

Inherited from Layer#remove

Overrides: Vector#remove

Removes from a planet.

Returns

setAttribution(html: string)

Inherited from Layer#setAttribution

Overrides: Vector#setAttribution

Sets layer attribution text.

Parameters

  • html (string) — HTML string that represents layer attribution.

getAttribution(): string

Inherited from Layer#getAttribution

Overrides: Vector#getAttribution

Gets layer attribution.

Returns

  • string — Layer attribution.

setHeight(height: number)

Inherited from Layer#setHeight

Overrides: Vector#setHeight

Sets height over the ground.

Parameters

  • height (number) — Layer height.

getHeight(): number

Inherited from Layer#getHeight

Overrides: Vector#getHeight

Gets layer height.

Returns

  • number

setZIndex(zIndex: number)

Inherited from Layer#setZIndex

Overrides: Vector#setZIndex

Sets z-index.

Parameters

  • zIndex (number) — Layer z-index.

getZIndex(): number

Inherited from Layer#getZIndex

Overrides: Vector#getZIndex

Gets z-index.

Returns

  • number

bringToFront()

Inherited from Layer#bringToFront

Overrides: Vector#bringToFront

Sets z-index to the maximum value relative to other layers on the planet.

isBaseLayer(): boolean

Inherited from Layer#isBaseLayer

Overrides: Vector#isBaseLayer

Returns true if the layer is a base.

Returns

  • boolean — Base layer flag.

setBaseLayer(isBaseLayer: boolean)

Inherited from Layer#setBaseLayer

Overrides: Vector#setBaseLayer

Sets base layer type flag.

Parameters

  • isBaseLayer (boolean)

setVisibility(visibility: boolean)

abstract
Layer.ts:718

Inherited from Layer#setVisibility

Overrides: Vector#setVisibility

Sets layer visibility.

Parameters

  • visibility (boolean) — Layer visibility.

getVisibility(): boolean

Inherited from Layer#getVisibility

Overrides: Vector#getVisibility

Gets layer visibility.

Returns

  • boolean — Layer visibility.

setExtent(extent: Extent)

Inherited from Layer#setExtent

Overrides: Vector#setExtent

Sets visible geographical extent.

Parameters

  • extent (Extent) — Layer visible geographical extent.

getExtent(): Extent

Inherited from Layer#getExtent

Overrides: Vector#getExtent

Gets layer extent.

Returns

  • Extent — Layer geodetic extent.

getExtentMerc(): Extent

Inherited from Layer#getExtentMerc

Overrides: Vector#getExtentMerc

Gets layer web-mercator extent.

Returns

flyExtent()

Inherited from Layer#flyExtent

Overrides: Vector#flyExtent

Fly extent.

viewExtent()

Inherited from Layer#viewExtent

Overrides: Vector#viewExtent

View extent.

_correctFullExtent()

protected
Layer.ts:861

Inherited from Layer#_correctFullExtent

Overrides: Vector#_correctFullExtent

Special correction of the whole globe extent.

abortMaterialLoading(material: Material)

Inherited from Vector#abortMaterialLoading

Abort exact material loading.

Parameters

  • material (Material) — Segment material.

Instance Fields

receiveProjectors

Inherited from Vector#receiveProjectors

Overrides: Vector#receiveProjectors

Gets projector effect reception state for this vector layer entities.

Returns

  • boolean

receiveFrameTransparency

Inherited from Vector#receiveFrameTransparency

Overrides: Vector#receiveFrameTransparency

Gets frame transparency reception state for this vector layer entities.

Returns

  • boolean

receiveShadows

Inherited from Vector#receiveShadows

Overrides: Vector#receiveShadows

Gets shadow map reception state for this vector layer entities.

Returns

  • boolean

pickingEnabled

Inherited from Vector#pickingEnabled

Overrides: Vector#pickingEnabled

Sets layer picking events active.

Parameters

  • picking (boolean) — Picking enable flag.

_pickingColor: Vec3

protected
Layer.ts:322

Inherited from Layer#_pickingColor

Overrides: Vector#_pickingColor

Layer picking color. Assign when added to the planet.

nightTextureCoefficient: number

Inherited from Layer#nightTextureCoefficient

Overrides: Vector#nightTextureCoefficient

Night texture blending coefficient.

_id

Inherited from Layer#_id

Overrides: Vector#_id

planet

Inherited from Layer#planet

Overrides: Vector#planet

Returns planet instance.