IFrame.js

Summary
IFrame.js
Constants
OpenLayers.Tile.Image.IFrameMixin for tiles that use form-encoded POST requests to get images from remote services.
Properties
useIFrame{Boolean} true if we are currently using an IFrame to render POST responses, false if we are using an img element to render GET responses.
Functions
drawSet useIFrame in the instance, and operate the image/iframe switch.
getImageCreates the content for the frame on the tile.
createRequestFormCreate the html <form> element with width, height, bbox and all parameters specified in the layer params.
setImgSrcSets the source for the tile image
onImageLoadHandler for the image onload event
createBackBufferOverride createBackBuffer to do nothing when we use an iframe.

Constants

OpenLayers.Tile.Image.IFrame

Mixin for tiles that use form-encoded POST requests to get images from remote services.  Images will be loaded using HTTP-POST into an IFrame.

This mixin will be applied to OpenLayers.Tile.Image instances configured with OpenLayers.Tile.Image.maxGetUrlLength set.

Properties

useIFrame

{Boolean} true if we are currently using an IFrame to render POST responses, false if we are using an img element to render GET responses.

Functions

draw

draw: function()

Set useIFrame in the instance, and operate the image/iframe switch.  Then call Tile.Image.draw.

Returns

{Boolean}

getImage

getImage: function()

Creates the content for the frame on the tile.

createRequestForm

createRequestForm: function()

Create the html <form> element with width, height, bbox and all parameters specified in the layer params.

Returns

{DOMElement} The form element which sends the HTTP-POST request to the WMS.

setImgSrc

setImgSrc: function(url)

Sets the source for the tile image

Parameters

url{String}

onImageLoad

onImageLoad: function()

Handler for the image onload event

createBackBuffer

createBackBuffer: function()

Override createBackBuffer to do nothing when we use an iframe.  Moving an iframe from one element to another makes it necessary to reload the iframe because its content is lost.  So we just give up.

Returns

{DOMElement}

draw: function()
Set useIFrame in the instance, and operate the image/iframe switch.
getImage: function()
Creates the content for the frame on the tile.
createRequestForm: function()
Create the html form element with width, height, bbox and all parameters specified in the layer params.
setImgSrc: function(url)
Sets the source for the tile image
onImageLoad: function()
Handler for the image onload event
createBackBuffer: function()
Override createBackBuffer to do nothing when we use an iframe.
Instances of OpenLayers.Tile.Image are used to manage the image tiles used by various layers.
{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.
Close