OpenLayers.Tile

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.0remove reference to url in above paragraph
Summary
This is a class designed to designate a single tile, however it is explicitly designed to do relatively little.
{Array(String)} Supported application event types
{OpenLayers.Events} An events object that handles all events on the tile.
{String} null
{OpenLayers.Layer} layer the tile is attached to
{String} url of the request.
{OpenLayers.Pixel} Top Left pixel of the tile
{Boolean} false
{Boolean} Is the tile loading?
Constructor for a new OpenLayers.Tile instance.
Nullify references to prevent circular references and memory leaks.
Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.
Reposition the tile.
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
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.

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.

TBD 3.0 Deprecated.  The base tile class does not need an url.  This should be handled in subclasses.  Does not belong here.

bounds

size

position

{OpenLayers.Pixel} Top Left pixel of the tile

drawn

{Boolean} false

isLoading

{Boolean} Is the tile loading?

Constructor

OpenLayers.Tile

Constructor for a new OpenLayers.Tile instance.

Parameters

layer{OpenLayers.Layer} layer that the tile will go in.
position{OpenLayers.Pixel}
bounds{OpenLayers.Bounds}
url{<String>}
size{OpenLayers.Size}

Functions

destroy

destroy:function()

Nullify references to prevent circular references and memory leaks.

draw

draw: function()

Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.

Returns

{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

moveTo: function (bounds,
position,
redraw)

Reposition the tile.

Parameters

bounds{OpenLayers.Bounds}
position{OpenLayers.Pixel}
redraw{Boolean} Call draw method on tile after moving.  Default is true

clear

clear: function()

Clear the tile of any bounds/position-related data so that it can be reused in a new location.

getBoundsFromBaseLayer

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.

Parameters

position{OpenLayers.Pixel}

Returns

bounds{OpenLayers.Bounds}
Instances of this class represent bounding boxes.
Instances of this class represent a width/height pair
This class represents a screen coordinate, in x and y coordinates
Constructor for a new OpenLayers.Tile instance.
destroy:function()
Nullify references to prevent circular references and memory leaks.
draw: function()
Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.
moveTo: function (bounds,
position,
redraw)
Reposition the tile.
clear: function()
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
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.