This is a class designed to designate a single tile, however it is explicitly designed to do relatively little. Tiles store information about themselves -- such as the URL that they are related to, and their size - but do not add themselves to the layer div automatically, for example. Create a new tile with the OpenLayers.Tile constructor, or a subclass.
TBD 3.0 | remove reference to url in above paragraph |
OpenLayers.Tile | This is a class designed to designate a single tile, however it is explicitly designed to do relatively little. |
Properties | |
events | {OpenLayers.Events} An events object that handles all events on the tile. |
eventListeners | {Object} If set as an option at construction, the eventListeners object will be registered with OpenLayers.Events.on. |
bounds | {OpenLayers.Bounds} null |
Constructor | |
OpenLayers.Tile | Constructor for a new OpenLayers.Tile instance. |
Functions | |
destroy | Nullify references to prevent circular references and memory leaks. |
{OpenLayers.Events} An events object that handles all events on the tile.
tile.events.register(type, obj, listener);
beforedraw | Triggered before the tile is drawn. Used to defer drawing to an animation queue. To defer drawing, listeners need to return false, which will abort drawing. The queue handler needs to call <draw>(true) to actually draw the tile. |
loadstart | Triggered when tile loading starts. |
loadend | Triggered when tile loading ends. |
loaderror | Triggered before the loadend event (i.e. when the tile is still hidden) if the tile could not be loaded. |
reload | Triggered when an already loading tile is reloaded. |
unload | Triggered before a tile is unloaded. |
{Object} If set as an option at construction, the eventListeners object will be registered with OpenLayers.Events.on. Object structure must be a listeners object as shown in the example for the events.on method.
This options can be set in the ``tileOptions`` option from OpenLayers.Layer.Grid. For example, to be notified of the ``loadend`` event of each tiles:
new OpenLayers.Layer.OSM('osm', 'http://tile.openstreetmap.org/${z}/${x}/${y}.png', { tileOptions: { eventListeners: { 'loadend': function(evt) { // do something on loadend } } } });
{OpenLayers.Bounds} null
Constructor for a new OpenLayers.Tile instance.
layer | {OpenLayers.Layer} layer that the tile will go in. |
position | {OpenLayers.Pixel} |
bounds | {OpenLayers.Bounds} |
url | {String} |
size | {OpenLayers.Size} |
options | {Object} |
Convenience method for registering listeners with a common scope.
on: function( object )
Nullify references to prevent circular references and memory leaks.
destroy:function()