OpenLayers JavaScript Mapping Library |
OpenLayers. Layer.GridBase class for layers that use a lattice of tiles. Create a new grid layer with the OpenLayers.Layer.Grid constructor. Inherits fromSummary
grid{Array(Array(OpenLayers.Tile))} This is an array of rows, each row is an array of tiles. clone
Create a clone of this layer Parameters
Returns{OpenLayers.Layer.Grid} An exact clone of this OpenLayers.Layer.Grid moveTo
This function is called whenever the map is moved. All the moving of actual ‘tiles’ is done by the map, but moveTo’s role is to accept a bounds and make sure the data that that bounds requires is pre-loaded. Parameters
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). Parameters
getGridBounds
Deprecated. This function will be removed in 3.0. Please use getTilesBounds() instead. Returns{OpenLayers.Bounds} A Bounds object representing the bounds of all the currently loaded tiles (including those partially or not at all seen onscreen) getTilesBounds
Return the bounds of the tile grid. Returns{OpenLayers.Bounds} A Bounds object representing the bounds of all the currently loaded tiles (including those partially or not at all seen onscreen). spiralTileLoad
Starts at the top right corner of the grid and proceeds in a spiral towards the center, adding tiles one at a time to the beginning of a queue. Once all the grid’s tiles have been added to the queue, we go back and iterate through the queue (thus reversing the spiral order from outside-in to inside-out), calling draw() on each tile. addTile
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} Returns{OpenLayers.Tile} The added OpenLayers.Tile addTileMonitoringHooks
This function takes a tile as input and adds the appropriate hooks to the tile so that the layer can keep track of the loading tiles. Parameters
removeTileMonitoringHooks
This function takes a tile as input and removes the tile hooks that were added in addTileMonitoringHooks() Parameters
getTileBounds
Returns The tile bounds for a layer given a pixel location. Parameters
Returns{OpenLayers.Bounds} Bounds of the tile at the given pixel location. |
Deconstruct the layer and clear the grid.
destroy: function()
Go through and remove all tiles from the grid, calling destroy() on each of them to kill circular references
clearGrid:function()
Create a clone of this layer
clone: function ( obj )
This function is called whenever the map is moved.
moveTo:function( bounds, zoomChanged, dragging )
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 )
Deprecated.
getGridBounds: function()
Return the bounds of the tile grid.
getTilesBounds: function()
initSingleTile: function( bounds )
initGriddedTiles:function( bounds )
Starts at the top right corner of the grid and proceeds in a spiral towards the center, adding tiles one at a time to the beginning of a queue.
spiralTileLoad: function()
Gives subclasses of Grid the opportunity to create an OpenLayer.Tile of their choosing.
addTile:function( bounds, position )
This function takes a tile as input and adds the appropriate hooks to the tile so that the layer can keep track of the loading tiles.
addTileMonitoringHooks: function( tile )
This function takes a tile as input and removes the tile hooks that were added in addTileMonitoringHooks()
removeTileMonitoringHooks: function( tile )
moveGriddedTiles: function( bounds )
Shifty grid work
shiftRow:function( prepend )
Shift grid work in the other dimension
shiftColumn: function( prepend )
When the size of the map or the buffer changes, we may need to remove some excess rows and columns.
removeExcessTiles: function( rows, columns )
For singleTile layers, this will replace the tile with the a new one with updated tileSize and extent.
onMapResize: function()
Returns The tile bounds for a layer given a pixel location.
getTileBounds: function( viewPortPx )