OpenLayers.Tile - OpenLayers

# 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.0 | remove reference to url in above paragraph

Summary

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.

### 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

{OpenLayers.Bounds} null

### size

{OpenLayers.Size} null

### position

{OpenLayers.Pixel} Top Left pixel of the tile

### isLoading

{Boolean} Is the tile loading?

### Functions

### unload

> unload: function()

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. Will only fire an event if the tile is still loading.

### destroy

> destroy:function()

Nullify references to prevent circular references and memory leaks.

### clone

> clone: function ( | obj | )

#### Parameters

obj | {OpenLayers.Tile} The tile to be cloned

#### Returns

{OpenLayers.Tile} An exact clone of this OpenLayers.Tile

### 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. To be implemented by subclasses.

### 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}

### showTile

> showTile: function()

Show the tile only if it should be drawn.

### show

> show: function()

Show the tile. To be implemented by subclasses.

### hide

> hide: function()

Hide the tile. To be implemented by subclasses.

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

> unload: function()

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:function()

Nullify references to prevent circular references and memory leaks.

> clone: function ( | obj | )

> 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.

> showTile: function()

Show the tile only if it should be drawn.

> show: function()

Show the tile.

> hide: function()

Hide the tile.
This is a class designed to designate a single tile, however it is explicitly designed to do relatively little.
Close