Instances of OpenLayers.Tile.Image are used to manage the image tiles used by various layers. Create a new image tile with the OpenLayers.Tile.Image constructor.
OpenLayers. | Instances of OpenLayers.Tile.Image are used to manage the image tiles used by various layers. |
Properties | |
url | {String} The URL of the image being requested. |
imgDiv | {DOMElement} The div element which wraps the image. |
frame | {DOMElement} The image element is appended to the frame. |
layerAlphaHack | {Boolean} True if the png alpha hack needs to be applied on the layer’s div. |
isBackBuffer | {Boolean} Is this tile a back buffer tile? |
isFirstDraw | {Boolean} Is this the first time the tile is being drawn? |
backBufferTile | {OpenLayers.Tile} A clone of the tile used to create transition effects when the tile is moved or changes resolution. |
maxGetUrlLength | {Number} If set, requests that would result in GET urls with more characters than the number provided will be made using form-encoded HTTP POST. |
Functions | |
destroy | nullify references to prevent circular references and memory leaks |
clone | |
draw | Check that a tile should be drawn, and draw it. |
resetBackBuffer | Triggered by two different events, layer loadend, and tile loadend. |
renderTile | Internal function to actually initialize the image tile, position it correctly, and set its url. |
positionImage | Using the properties currenty set on the layer, position the tile correctly. |
clear | Clear the tile of any bounds/position-related data so that it can be reused in a new location. |
initImgDiv | Creates the imgDiv property on the tile. |
removeImgDiv | Removes the imgDiv from the DOM and stops listening to events on it. |
checkImgURL | Make sure that the image that just loaded is the one this tile is meant to display, since panning/zooming might have changed the tile’s URL in the meantime. |
startTransition | This method is invoked on tiles that are backBuffers for tiles in the grid. |
show | Show the tile by showing its frame. |
hide | Hide the tile by hiding its frame. |
{Boolean} Is this the first time the tile is being drawn? This is used to force resetBackBuffer to synchronize the backBufferTile with the foreground tile the first time the foreground tile loads so that if the user zooms before the layer has fully loaded, the backBufferTile for tiles that have been loaded can be used.
{OpenLayers.Tile} A clone of the tile used to create transition effects when the tile is moved or changes resolution.
{Number} If set, requests that would result in GET urls with more characters than the number provided will be made using form-encoded HTTP POST. It is good practice to avoid urls that are longer than 2048 characters.
Older versions of Gecko based browsers (e.g. Firefox < 3.5) and Opera < 10.0 do not fully support this option.
Do not use this option for layers that have a transitionEffect configured - IFrame tiles from POST requests can not be resized.
clone: function ( obj )
obj | {OpenLayers.Tile.Image} The tile to be cloned |
{OpenLayers.Tile.Image} An exact clone of this OpenLayers.Tile.Image
resetBackBuffer: function()
Triggered by two different events, layer loadend, and tile loadend. In any of these cases, we check to see if we can hide the backBufferTile yet and update its parameters to match the foreground tile.
checkImgURL: function ()
Make sure that the image that just loaded is the one this tile is meant to display, since panning/zooming might have changed the tile’s URL in the meantime. If the tile URL did change before the image loaded, set the imgDiv display to ‘none’, as either (a) it will be reset to visible when the new URL loads in the image, or (b) we don’t want to display this tile after all because its new bounds are outside our maxExtent.
This function should no longer be neccesary with the improvements to Grid.js in OpenLayers 2.3. The lack of a good isEquivilantURL function caused problems in 2.2, but it’s possible that with the improved isEquivilant URL function, this might be neccesary at some point.
See discussion in the thread at http://openlayers.org
nullify references to prevent circular references and memory leaks
destroy: function()
clone: function ( obj )
Check that a tile should be drawn, and draw it.
draw: function()
Triggered by two different events, layer loadend, and tile loadend.
resetBackBuffer: function()
Internal function to actually initialize the image tile, position it correctly, and set its url.
renderTile: function()
Using the properties currenty set on the layer, position the tile correctly.
positionImage: function()
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
clear: function()
Creates the imgDiv property on the tile.
initImgDiv: function()
Removes the imgDiv from the DOM and stops listening to events on it.
removeImgDiv: function()
Make sure that the image that just loaded is the one this tile is meant to display, since panning/zooming might have changed the tile’s URL in the meantime.
checkImgURL: function ()
This method is invoked on tiles that are backBuffers for tiles in the grid.
startTransition: function()
Show the tile by showing its frame.
show: function()
Hide the tile by hiding its frame.
hide: function()