A key assigned to the tile. This is used in conjunction with a source key
to determine if a cached version of this tile may be used by the renderer.
Protectedstate
state:any
tileCoord
tileCoord:TileCoord
Methods
addEventListener
addEventListener(type, listener): void
Parameters
type: string
Type.
listener: Listener
Listener.
Returns void
Protectedchanged
changed(): void
Protected
Returns void
dispatchEvent
dispatchEvent(event): undefined | boolean
Dispatches an event and calls all listeners listening for events
of this type. The event parameter can either be a string or an
Object with a type property.
Parameters
event: string | BaseEvent
Event object.
Returns undefined | boolean
false if anyone called preventDefault on the
event object or if any of the listeners returned false.
Get the listeners for a specified event type. Listeners are returned in the
order that they will be called in.
Parameters
type: string
Type.
Returns undefined | Listener[]
Listeners.
getState
getState(): any
Returns any
State.
getTileCoord
getTileCoord(): TileCoord
Get the tile coordinate for this tile.
Returns TileCoord
The tile coordinate.
Api
hasListener
hasListener(type?): boolean
Parameters
Optionaltype: string
Type. If not provided,
true will be returned if this event target has any listeners.
Returns boolean
Has listeners.
inTransition
inTransition(id): boolean
Determine if a tile is in an alpha transition. A tile is considered in
transition if tile.getAlpha() has not yet been called or has been called
and returned 1.
Parameters
id: string
An id for the renderer.
Returns boolean
The tile is in transition.
Abstractload
load(): void
Load the image or retry if loading previously failed.
Loading is taken care of by the tile queue, and calling this method is
only needed for preloading or for reloading in case of an error.
Returns void
Api
release
release(): void
Called by the tile cache when the tile is removed from the cache due to expiry
Returns void
removeEventListener
removeEventListener(type, listener): void
Parameters
type: string
Type.
listener: Listener
Listener.
Returns void
setImage
setImage(element): void
Sets an HTML image element for this tile (may be a Canvas or preloaded Image).
Sets the state of this tile. If you write your own module:ol/Tile~LoadFunction tileLoadFunction ,
it is important to set the state correctly to module:ol/TileState~ERROR
when the tile cannot be loaded. Otherwise the tile cannot be removed from
the tile queue and will block other requests.
Classdesc
Base class for tiles.