Class: Tile

ol.layer.Tile

For layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors.

new ol.layer.Tile(options)

Name Type Description
options

Tile layer options.

Name Type Description
opacity number | undefined

Opacity (0, 1). Default is 1.

preload number | undefined

Preload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading.

source ol.source.Source

Source for this layer.

visible boolean | undefined

Visibility. Default is true (visible).

extent ol.Extent | undefined

The bounding extent for layer rendering. The layer will not be rendered outside of this extent.

minResolution number | undefined

The minimum resolution (inclusive) at which this layer will be visible.

maxResolution number | undefined

The maximum resolution (exclusive) below which this layer will be visible.

useInterimTilesOnError boolean | undefined

Use interim tiles on error. Default is true.

Fires:

Extends

Observable Properties

Name Type Settable ol.ObjectEvent type Description
extent ol.Extent | undefined yes change:extent

The layer extent.

maxResolution number | undefined yes change:maxresolution

The maximum resolution of the layer.

minResolution number | undefined yes change:minresolution

The minimum resolution of the layer.

opacity number | undefined yes change:opacity

The opacity of the layer.

visible boolean | undefined yes change:visible

The visiblity of the layer.

Methods

Returns:
The layer extent.

getMaxResolution(){number|undefined} inherited

Returns:
The maximum resolution of the layer.

getMinResolution(){number|undefined} inherited

Returns:
The minimum resolution of the layer.

getOpacity(){number|undefined} inherited

Returns:
The opacity of the layer.
Returns:
Source.

getVisible(){boolean|undefined} inherited

Returns:
The visiblity of the layer.

on(type, listener, opt_this){goog.events.Key} inherited

Listen for a certain type of event.

Name Type Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object

The object to use as this in listener.

Returns:
Unique key for the listener.

once(type, listener, opt_this){goog.events.Key} inherited

Listen once for a certain type of event.

Name Type Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object

The object to use as this in listener.

Returns:
Unique key for the listener.

Set the extent at which the layer is visible. If undefined, the layer will be visible at all extents.

Name Type Description
extent ol.Extent | undefined

The extent of the layer.

setMaxResolution(maxResolution) inherited

Name Type Description
maxResolution number | undefined

The maximum resolution of the layer.

setMinResolution(minResolution) inherited

Name Type Description
minResolution number | undefined

The minimum resolution of the layer.

Name Type Description
opacity number | undefined

The opacity of the layer.

Name Type Description
visible boolean | undefined

The visiblity of the layer.

un(type, listener, opt_this) inherited

Unlisten for a certain type of event.

Name Type Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object

The object which was used as this by the listener.

Removes an event listener using the key returned by on() or once().

Name Type Description
key goog.events.Key

Key.