Constructor#
new XYZ(name, options:)#
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name | string | Layer name. | ||
options: | IXYZParams | |||
options.opacity | number | <optional> | 1.0 | Layer opacity. |
options.subdomains | Array.<string> | <optional> | ['a','b','c'] | Subdomains of the tile service. |
options.minZoom | number | <optional> | 0 | Minimal visibility zoom level. |
options.maxZoom | number | <optional> | 0 | Maximal visibility zoom level. |
options.minNativeZoom | number | <optional> | 0 | Minimal available zoom level. |
options.maxNativeZoom | number | <optional> | 19 | Maximal available zoom level. |
options.attribution | string | <optional> | Layer attribution that displayed in the attribution area on the screen. | |
options.isBaseLayer | boolean | <optional> | false | Base layer flag. |
options.visibility | boolean | <optional> | true | Layer visibility. |
options.crossOrigin | string | <optional> | true | 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, ANISOTROPIC. | ||
options.urlRewrite | function | Url rewrite function. |
- Source
- EventsHandler
#event:load - EventsHandler
#event:loadend
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 @ <a href="http://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="http://www.openstreetmap.org/copyright">ODbL</a>' });
Extends#
Members#
_id#
- Overrides
- Source
(protected) _pickingColor :Vec3#
Layer picking color. Assign when added to the planet.
- Overrides
- Source
isIdle#
- Source
planet#
Returns planet instance.
- Overrides
- Source
Methods#
(abstract, protected) _assignPlanet(planet)#
Assign the planet.
Name | Type | Description |
---|---|---|
planet | Planet | Planet render node. |
- Overrides
- Source
(abstract, protected) _bindPicking()#
Assign picking color to the layer.
- Overrides
- Source
(protected) _correctFullExtent()#
- Overrides
- Source
(abstract, protected) _createUrl(segment) → {string}#
Creates query url.
Name | Type | Description |
---|---|---|
segment | Segment | Creates specific url for current segment. |
- Source
- Returns url string.
- Type:
- string
(protected) _getHTTPRequestString(segment) → {string}#
Returns actual url query string.
Name | Type | Description |
---|---|---|
segment | Segment | Segment that loads image data. |
- Source
- Url string.
- Type:
- string
abortLoading()#
Abort loading tiles.
- Source
addTo(planet)#
Adds layer to the planet.
Name | Type | Description |
---|---|---|
planet | Planet | Adds layer to the planet. |
- Overrides
- Source
bringToFront()#
Set zIndex to the maximal value depend on other layers on the planet.
- Overrides
- Source
(abstract) clear()#
Clears layer material.
- Overrides
- Source
flyExtent()#
Fly extent.
- Overrides
- Source
getAttribution() → {string}#
Gets layer attribution.
- Overrides
- Source
Layer attribution
- Type:
- string
getExtent() → {Extent}#
Gets layer extent.
- Overrides
- Source
- Layer geodetic extent.
- Type:
- Extent
getExtentMerc() → {Extent}#
Gets layer web-mercator extent.
- Overrides
- Source
- Layer extent.
- Type:
- Extent
getHeight() → {number}#
Gets layer height.
- Overrides
- Source
- Type:
- number
getID() → {string}#
Gets layer identifier.
- Overrides
- Source
- Layer object id.
- Type:
- string
getVisibility() → {boolean}#
Gets layer visibility.
- Overrides
- Source
- Layer visibility.
- Type:
- boolean
getZIndex() → {number}#
Gets z-index.
- Overrides
- Source
- Type:
- number
(abstract) hasImageryTiles() → {boolean}#
Returns true if a layer has imagery tiles.
- Overrides
- Source
- Imagery tiles flag.
- Type:
- boolean
isBaseLayer() → {boolean}#
Returns true if the layer is a base.
- Overrides
- Source
- Base layer flag.
- Type:
- boolean
isEqual(layer) → {boolean}#
Compares layers instances.
Name | Type | Description |
---|---|---|
layer | Layer | Layer instance to compare. |
- Overrides
- Source
- Returns true if the layers is the same instance of the input.
- Type:
- boolean
(abstract) loadMaterial(material, forceLoadingopt)#
Start to load tile material.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
material | Material | Loads current material. | ||
forceLoading | boolean | <optional> | false |
- Source
remove() → {Layer}#
Removes from planet.
- Overrides
- Source
-This layer.
- Type:
- Layer
setAttribution(html)#
Sets layer attribution text.
Name | Type | Description |
---|---|---|
html | string | HTML code that represents layer attribution, it could be just a text. |
- Overrides
- Source
setBaseLayer(isBaseLayer)#
Sets base layer type true.
Name | Type | Description |
---|---|---|
isBaseLayer | boolean |
- Overrides
- Source
setExtent(extent)#
Sets visible geographical extent.
Name | Type | Description |
---|---|---|
extent | Extent | Layer visible geographical extent. |
- Overrides
- Source
setHeight(height)#
Sets height over the ground.
Name | Type | Description |
---|---|---|
height | number | Layer height. |
- Overrides
- Source
setUrl(url)#
Sets imagery tiles url source template.
Name | Type | Description |
---|---|---|
url | string | Url template. |
- Source
http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png where {z}, {x} and {y} - replaces by current tile values, {s} - random domain.
setUrlRewriteCallback(ur)#
Sets url rewrite callback, used for custom url rewriting for every tile loading.
Name | Type | Description |
---|---|---|
ur | function | The callback that returns tile custom created url. |
- Source
setVisibility(visibility)#
Sets layer visibility.
Name | Type | Description |
---|---|---|
visibility | boolean | Layer visibility. |
- Overrides
- Source
setZIndex(zIndex)#
Sets z-index.
Name | Type | Description |
---|---|---|
zIndex | number | Layer z-index. |
- Overrides
- Source
viewExtent()#
View extent.
- Overrides
- Source