Class: XYZ

og/layer/XYZ~XYZ

Represents an imagery tiles source provider.

new XYZ(name, options:)

Name Type Default Description
name string Layer name.
options: Object
options.opacity number 1.0 optional Layer opacity.
options.subdomains Array.<string> ['a','b','c'] optional Subdomains of the tile service.
options.minZoom number 0 optional Minimal visibility zoom level.
options.maxZoom number 0 optional Maximal visibility zoom level.
options.minNativeZoom number 0 optional Minimal available zoom level.
options.maxNativeZoom number 19 optional Maximal available zoom level.
options.attribution string optional Layer attribution that displayed in the attribution area on the screen.
options.isBaseLayer boolean false optional Base layer flag.
options.visibility boolean true optional Layer visibility.
options.crossOrigin string true optional If true, all tiles will have their crossOrigin attribute set to ''.
options.url string Tile url source template(see example below).
options.textureFilter string texture gl filter. NEAREST, LINEAR, MIPMAP, ANISOTROPHIC.
options.urlRewrite layer.XYZ~_urlRewriteCallback Url rewrite function.
Fires:
  • - Triggered when current tile image has loaded before rendereing.
  • - Triggered when all tiles have loaded or loading has stopped.
Example

Creates OpenStreetMap base tile layer

new og.layer.XYZ("OpenStreetMap", {
    isBaseLayer: true,
    url: "http://b.tile.openstreetmap.org/{z}/{x}/{y}.png",
    visibility: true,
    attribution: 'Data @ OpenStreetMap contributors, ODbL'
});

Extends

  • Layer

Members

protected_crossOrigin

protected_s

maxNativeZoomnumber

Maximal native zoom level when tiles are available.

minNativeZoomnumber

Minimal native zoom level when tiles are available.

urlstring

Tile url source template.

Methods

protected_correctFullExtent()

abstract,protected_createUrl(segment){String}

Creates query url.
Name Type Description
segment Segment Creates specific url for current segment.
Returns:
Type Description
String - Returns url string.

protected_getHTTPRequestString(segment){string}

Returns actual url query string.
Name Type Description
segment Segment Segment that loads image data.
Returns:
Type Description
string - Url string.

abortLoading()

Abort loading tiles.

abstractloadMaterial(material)

Start to load tile material.
Name Type Description
material Material Loads current material.

setUrl(url)

Sets imagery tiles url source template.
Name Type Description
url string Url template.
Example
http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
where {z}, {x} and {y} - replaces by current tile values, {s} - random domen.

setUrlRewriteCallback(ur)

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

setVisibility(visibility)

Sets layer visibility.
Name Type Description
visibility boolean Layer visibility.