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. |
Constants | |
EVENT_TYPES | {Array(String)} Supported application event types |
Properties | |
events | {OpenLayers.Events} An events object that handles all events on the tile. |
id | {String} null |
layer | {OpenLayers.Layer} layer the tile is attached to |
url | {String} url of the request. |
bounds | {OpenLayers.Bounds} null |
size | {OpenLayers.Size} null |
position | {OpenLayers.Pixel} Top Left pixel of the tile |
isLoading | {Boolean} Is the tile loading? |
Functions | |
unload | Call immediately before destroying if you are listening to tile events, so that counters are properly handled if tile is still loading at destroy-time. |
destroy | Nullify references to prevent circular references and memory leaks. |
clone | |
draw | Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn. |
moveTo | Reposition the tile. |
clear | Clear the tile of any bounds/position-related data so that it can be reused in a new location. |
getBoundsFromBaseLayer | Take the pixel locations of the corner of the tile, and pass them to the base layer and ask for the location of those pixels, so that displaying tiles over Google works fine. |
showTile | Show the tile only if it should be drawn. |
show | Show the tile. |
hide | Hide the tile. |
{OpenLayers.Events} An events object that handles all events on the tile.
{OpenLayers.Layer} layer the tile is attached to
{OpenLayers.Bounds} null
{OpenLayers.Size} null
{OpenLayers.Pixel} Top Left pixel of the tile
clone: function ( obj )
obj | {OpenLayers.Tile} The tile to be cloned |
{OpenLayers.Tile} An exact clone of this OpenLayers.Tile
draw: function()
Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.
{Boolean} Whether or not the tile should actually be drawn. Note that this is not really the best way of doing things, but such is the way the code has been developed. Subclasses call this and depend on the return to know if they should draw or not.
moveTo: function ( bounds, position, redraw )
Reposition the tile.
bounds | {OpenLayers.Bounds} |
position | {OpenLayers.Pixel} |
redraw | {Boolean} Call draw method on tile after moving. Default is true |
getBoundsFromBaseLayer: function( position )
Take the pixel locations of the corner of the tile, and pass them to the base layer and ask for the location of those pixels, so that displaying tiles over Google works fine.
position | {OpenLayers.Pixel} |
bounds | {OpenLayers.Bounds} |
Call immediately before destroying if you are listening to tile events, so that counters are properly handled if tile is still loading at destroy-time.
unload: function()
Nullify references to prevent circular references and memory leaks.
destroy:function()
clone: function ( obj )
Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.
draw: function()
Reposition the tile.
moveTo: function ( bounds, position, redraw )
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
clear: function()
Take the pixel locations of the corner of the tile, and pass them to the base layer and ask for the location of those pixels, so that displaying tiles over Google works fine.
getBoundsFromBaseLayer: function( position )
Show the tile only if it should be drawn.
showTile: function()
Show the tile.
show: function()
Hide the tile.
hide: function()