Base class for layers that use a lattice of tiles. Create a new grid layer with the OpenLayers.Layer.Grid constructor.
OpenLayers. Layer.Grid | Base class for layers that use a lattice of tiles. |
Properties | |
tileSize | {OpenLayers.Size} |
singleTile | {Boolean} Moves the layer into single-tile mode, meaning that one tile will be loaded. |
ratio | {Float} Used only when in single-tile mode, this specifies the ratio of the size of the single tile to the size of the map. |
buffer | {Integer} Used only when in gridded mode, this specifies the number of extra rows and colums of tiles on each side which will surround the minimum grid tiles to cover the map. |
numLoadingTiles | {Integer} How many tiles are still loading? |
Constructor | |
OpenLayers. Layer.Grid | Create a new grid layer |
Functions | |
destroy | Deconstruct the layer and clear the grid. |
clone | Create a clone of this layer |
setTileSize | Check if we are in singleTile mode and if so, set the size as a ratio of the map size (as specified by the layer’s ‘ratio’ property). |
getTilesBounds | Return the bounds of the tile grid. |
addTile | Gives subclasses of Grid the opportunity to create an OpenLayer.Tile of their choosing. |
getTileBounds | Returns The tile bounds for a layer given a pixel location. |
clone: function ( obj )
Create a clone of this layer
obj | {Object} Is this ever used? |
{OpenLayers.Layer.Grid} An exact clone of this OpenLayers.Layer.Grid
setTileSize: function( size )
Check if we are in singleTile mode and if so, set the size as a ratio of the map size (as specified by the layer’s ‘ratio’ property).
size | {OpenLayers.Size} |
getTilesBounds: function()
Return the bounds of the tile grid.
{OpenLayers.Bounds} A Bounds object representing the bounds of all the currently loaded tiles (including those partially or not at all seen onscreen).
addTile:function( bounds, position )
Gives subclasses of Grid the opportunity to create an OpenLayer.Tile of their choosing. The implementer should initialize the new tile and take whatever steps necessary to display it.
Parameters bounds - {OpenLayers.Bounds} position - {OpenLayers.Pixel}
{OpenLayers.Tile} The added OpenLayers.Tile
getTileBounds: function( viewPortPx )
Returns The tile bounds for a layer given a pixel location.
viewPortPx | {OpenLayers.Pixel} The location in the viewport. |
{OpenLayers.Bounds} Bounds of the tile at the given pixel location.
Deconstruct the layer and clear the grid.
destroy: function()
Create a clone of this layer
clone: function ( obj )
Check if we are in singleTile mode and if so, set the size as a ratio of the map size (as specified by the layer’s ‘ratio’ property).
setTileSize: function( size )
Return the bounds of the tile grid.
getTilesBounds: function()
Gives subclasses of Grid the opportunity to create an OpenLayer.Tile of their choosing.
addTile:function( bounds, position )
Returns The tile bounds for a layer given a pixel location.
getTileBounds: function( viewPortPx )