MapterhornTerrain

Mapterhorn Web Mercator RGB terrain (512px WebP tiles, Terrarium encoding).

Constructor

new MapterhornTerrain()

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.