GlobusTerrain

new GlobusTerrain(nameopt, optionsopt, gridSizeByZoomopt, heightFactoropt)

Parameters:
NameTypeAttributesDefaultDescription
namestring<optional>
""

Terrain provider name.

optionsIGlobusTerrainParams<optional>

Provider options:

Properties
NameTypeAttributesDefaultDescription
minZoomnumber<optional>
3

Minimal visible zoom index when terrain handler works.

minZoomnumber<optional>
14

Maximal visible zoom index when terrain handler works.

minNativeZoomnumber<optional>
14

Maximal available terrain zoom level.

urlstring<optional>
"//openglobus.org/heights/srtm3/{z}/{y}/{x}.ddm"

Terrain source path url template. Default is openglobus ddm elevation file.

gridSizeByZoomArray.<number><optional>

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

plainGridSizenumber<optional>
32

Elevation grid size. Default is 32x32. Must be power of two.

responseTypestring<optional>
"arraybuffer"

Response type.

MAX_LOADING_TILESnumber<optional>

Maximum at one time loading tiles.

gridSizeByZoomArray.<number><optional>

Array of values, where each value corresponds to the size of a tile(or segment) on the globe. Each value must be power of two.

heightFactornumber<optional>
1

Elevation height multiplier.

Deprecated
  • Use GlobusRgbTerrain Class that loads segment elevation data, converts it to the array and passes it to the planet segment.
Fires:
  • GlobusTerrainEvents#event:load
  • GlobusTerrainEvents#event:loadend

Extends

Methods

(protected) _applyElevationsData()

_createHeights() → {Array.<number>}

Converts loaded data to segment elevation data type(column major elevation data array in meters)

Returns:
Type: 
Array.<number>

(protected) _createUrl(segment) → {string}

Creates default query url string.

Parameters:
NameTypeDescription
segmentSegment
Returns:
Type: 
string

(protected) _getHTTPRequestString(segment) → {string}

Returns actual url query string.

Parameters:
NameTypeDescription
segmentSegment

Segment that loads image data.

Returns:
  • Url string.
Type: 
string

abortLoading()

Stop loading.

loadTerrain(segment, forceLoadingopt)

Starts to load segment elevation data.

Parameters:
NameTypeAttributesDefaultDescription
segmentSegment

Segment that wants a terrain data.

forceLoadingboolean<optional>
false

setName(name)

Sets provider name.

Parameters:
NameTypeDescription
namestring

Name.

setUrl(url)

Sets terrain data url template.

Parameters:
NameTypeDescription
urlstring

Url template.

Example
<caption>Default openglobus url template:</caption>:
"http://earth3.openglobus.org/{z}/{y}/{x}.ddm"

setUrlRewriteCallback(ur)

Sets url rewrite callback, used for custom url rewriting for every tile loading.

Parameters:
NameTypeDescription
urUrlRewriteFunc

The callback that returns tile custom created url.