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 | {HTMLImageElement} The image for this tile. |
| frame | {DOMElement} The image element is appended to the frame. |
| imageReloadAttempts | {Integer} Attempts to load the image. |
| layerAlphaHack | {Boolean} True if the png alpha hack needs to be applied on the layer’s div. |
| asyncRequestId | {Integer} ID of an request to see if request is still valid. |
| blankImageUrl | {String} Using a data scheme url is not supported by all browsers, but we don’t care because we either set it as css backgroundImage, or the image’s display style is set to “none” when we use it. |
| 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 |
| draw | Check that a tile should be drawn, and draw it. |
| renderTile | Internal function to actually initialize the image tile, position it correctly, and set its url. |
| positionTile | Using the properties currenty set on the layer, position the tile correctly. |
| clear | Remove the tile from the DOM, clear it of any image related data so that it can be reused in a new location. |
| getImage | Returns or creates and returns the tile image. |
| initImage | Creates the content for the frame on the tile. |
| setImgSrc | Sets the source for the tile image |
| getTile | Get the tile’s markup. |
| createBackBuffer | Create a backbuffer for this tile. |
| onImageLoad | Handler for the image onload event |
| onImageError | Handler for the image onerror event |
{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 most Opera versions do not fully support this option. On all browsers, transition effects are not supported if POST requests are used.
createBackBuffer: function()
Create a backbuffer for this tile. A backbuffer isn’t exactly a clone of the tile’s markup, because we want to avoid the reloading of the image. So we clone the frame, and steal the image from the tile.
{DOMElement} The markup, or undefined if the tile has no image or if it’s currently loading.
nullify references to prevent circular references and memory leaks
destroy: function()
Check that a tile should be drawn, and draw it.
draw: 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.
positionTile: function()
Remove the tile from the DOM, clear it of any image related data so that it can be reused in a new location.
clear: function()
Returns or creates and returns the tile image.
getImage: function()
Creates the content for the frame on the tile.
initImage: function()
Sets the source for the tile image
setImgSrc: function( url )
Get the tile’s markup.
getTile: function()
Create a backbuffer for this tile.
createBackBuffer: function()
Handler for the image onload event
onImageLoad: function()
Handler for the image onerror event
onImageError: function()