RgbTerrain

new RgbTerrain(nameopt, optionsopt)

Parameters:
NameTypeAttributesDefaultDescription
namestring<optional>
"RgbTerrain"

Terrain provider name.

optionsIRgbTerrainParams<optional>

Provider options:

Properties
NameTypeAttributesDefaultDescription
equalizeNormalsboolean<optional>
true

Enables normal equalization on tile edges.

keystring<optional>
""

API key.

imageSizenumber<optional>
256

Source image size.

minHeightnumber<optional>
-10000

Minimal height for RGB-to-height conversion.

resolutionnumber<optional>
0.1

RGB-to-height conversion resolution.

Extends

Methods

(protected) _applyElevationsData()

_createHeights() → {Array.<number>|TypedArray}

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

Returns:

Column-major elevation data array in meters.

Type: 
Array.<number> | TypedArray

(protected) _createUrl(segment) → {string}

Creates default query url string.

Parameters:
NameTypeDescription
segmentSegment

Segment to create URL for.

Returns:

URL string.

Type: 
string

(protected) _getHTTPRequestString(segment) → {string}

Returns actual url query string.

Parameters:
NameTypeDescription
segmentSegment

Segment that loads terrain data.

Returns:

URL string.

Type: 
string

abortLoading()

Stop loading.

handleSegmentTerrain(segment)

Loads or creates segment elevation data.

Parameters:
NameTypeDescription
segmentSegment

Segment to create elevation data.

loadTerrain(segment, forceLoadingopt)

Starts to load segment elevation data.

Parameters:
NameTypeAttributesDefaultDescription
segmentSegment

Segment that requests terrain data.

forceLoadingboolean<optional>
false

Forces loading even if default filter would skip it.

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>:
"https://{s}.srtm3.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.