Class: GlobusTerrain

og/terrainProvider/GlobusTerrain~GlobusTerrain

Class that loads segment elevation data, converts it to the array and passes it to the planet segment.

new GlobusTerrain(name, options)

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:
  • - Triggered when current elevation tile has loaded but before rendereing.
  • - Triggered when all elevation tiles have loaded or loading has stopped.

Extends

  • og.terrain.EmptyTerrain

Members

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.

maxZoomnumber

Maximal visible zoom index when terrain handler works.

minZoomnumber

Minimal visible zoom index when terrain handler works.

namestring

Provider name.

urlstring

Terrain source path url template.

Methods

protected_applyElevationsData(segment, data)

Name Type Description
segment og.planetSegment.Segment -
data * -

abstract,protected_createUrl(segment){string}

Creates query url.
Name Type Description
segment og.planetSegment.Segment -
Returns:
Type Description
string -

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>}

Converts loaded 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> -

abstractloadTerrain(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.terrain.GlobusTerrain~_urlRewriteCallback The callback that returns tile custom created url.