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.
{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
Constructor for a new OpenLayers.Tile instance.
nullify references to prevent circular references and memory leaks
Clear out existing tile, and return whether to draw or not.
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.

Properties

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

Functions

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}

destroy

destroy:function()

nullify references to prevent circular references and memory leaks

draw

draw:function()

Clear out existing tile, and return whether to draw or not.  Should be called as first line of all subclasses.

Return

{Boolean} Whether the tile should be drawn or not.  If the tile is outside the maxextent, for example, will return false.

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}

Return

bounds{OpenLayers.Bounds}
Instances of this class represent bounding boxes.
Instances of this class represent a width/height pair
Constructor for a new OpenLayers.Tile instance.
destroy:function()
nullify references to prevent circular references and memory leaks
draw:function()
Clear out existing tile, and return whether to draw or not.
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.
This class represents a screen coordinate, in x and y coordinates