Class: TerrainProvider

og.terrainProvider.TerrainProvider

new og.terrainProvider.TerrainProvider(name, options)

Class that loads segment elevation data, converts it to the array and passes it to the planet segment.
Name Type Default Description
name string "" optional Terrain provider name.
options Object optional Provider options:
Name Type Default Description
minZoom number 3 optional Minimal visible zoom index when terrain handler works.
minZoom number 14 optional Maximal visible zoom index when terrain handler works.
url string "http://earth3.openglobus.org/{z}/{y}/{x}.ddm" optional Terrain source path url template. Default is openglobus ddm elevation file.
gridSizeByZoom Array.<number> optional Array of segment triangulation grid sizes where array index agreed to the segment zoom index.
fileGridSize number 32 optional Elevation tile grid size. Default is 32x32.
responseType string "arraybuffer" optional Ajax responce type.
MAX_LOADING_TILES number optional Maximum at one time loading tiles.
Fires:

Extends

Members

protected_counternumber

Current loadings counter.

protected_pendingsQueueArray.<og.planetSegment.Segment>

Loading pending queue.

protected_planetog.scene.Planet

Planet node.

eventsog.Events

Events handler.

fileGridSizenumber

Elevation tile grid size.

gridSizeByZoomArray.<number>

Array of segment triangulation grid sizes where array index agreed to the segment zoom index.

MAX_LOADING_TILES

Maximum at one time loading tiles.

maxZoomnumber

Maximal visible zoom index when terrain handler works.

minZoomnumber

Minimal visible zoom index when terrain handler works.

namestring

Provider name.

responseTypestring

Ajax elevation data tile query responce type.

urlstring

Terrain source path url template.

Methods

protected_applyElevationsData(segment, data)

Name Type Description
segment og.planetSegment.Segment
data *

abstract,protected_createUrl(segment)

Creates query url.
Name Type Description
segment og.planetSegment.Segment
Loads elevation data and apply it to the planet segment.
Name Type Description
material og.planetSegment.Material Loads material image.

protected_getHTTPRequestString(segment){string}

Returns actual url query string.
Name Type Description
segment og.planetSegment.Segment Segment that loads elevation data.
Returns:
Type Description
string
Stop loading.

abstractgetElevations(data){Array.<number>}

Method that converts loaded elevation data to segment elevation data type(columr major elevation data array in meters)
Name Type Description
data * Loaded elevation data.
Returns:
Type Description
Array.<number>

abstracthandleSegmentTerrain(segment)

Starts to load segment data.
Name Type Description
segment og.planetSegment.Segment Segment that wants a terrain data.
Sets provider name.
Name Type Description
name string Name.
Sets terrain data url template.
Name Type Description
url string Url template.
Example

Default openglobus url template:

:
"http://earth3.openglobus.org/{z}/{y}/{x}.ddm"

setUrlRewriteCallback(ur)

Sets url rewrite callback, used for custom url rewriting for every tile laoding.
Name Type Description
ur og.terrainProvider.TerrainProvider~_urlRewriteCallback The callback that returns tile custom created url.

Events

Triggered when current elevation tile has loaded but before rendereing.
Triggered when all elevation tiles have loaded or loading has stopped.