IlvView

IlvObject
  |
  +--IlvEmptyView
       |
       +--IlvResizableView
            |
            +--IlvAbstractView
                 |
                 +--IlvView
Category:
Graphics Framework component
JavaScript File:
IlvView.js
Description:
IlvView is a component that displays an image obtained from a server. The server component must be an instance of IlvManagerServlet. This component can be connected to several components that allow you to manipulate it: A legend tool (IlvLegend), an overview (IlvOverview), and tools to zoom (IlvZoomTool) and pan (IlvPanTool).

The IlvInteractor class allows you to implement interaction with the view.


Constructor Summary
IlvView(left, top, width, height, namespace)

Method Summary
addCapabilitiesOnLoadListener(listener)
Adds a listener to be called when the capabilities have been loaded.
addErrorListener(listener)
Adds a listener to be called when an error occurs for the current request.
addImageOnLoadListener(listener)
Adds a listener to be called when the view has loaded a new image.
addInteractorListener(listener)
Adds a listener to be called when an interactor has changed on the view.
addTimeoutErrorListener(listener)
Adds a listener to be called when a timeout has been reached for the current request.
centerAt(x, y)
Queries a new image centered at the specified point.
createCapabilitiesRequestURL()
Creates the HTTP request for capabilities.
createImageMapRequestURL(qx, qy, qw, qh, width, height, layers)
Creates the URL for generating an image map.
createRequestURL(qx, qy, qw, qh, width, height, layers)
Creates the URL for the image request.
dispose()
Releases the cookie holding the current image request.
getBlendTransform()
Indicates if the new images will be revealed by fading the previous image.
getCurrentZoomLevel()
Returns the current zoom level of the view.
getImageBackgroundColor()
Returns the background color of the generated image or null if not specified.
getImageFormat()
Returns the format of the images generated from the server.
getInteractor()
Returns the interactor of the view.
getLayers()
Returns an array of strings of available layers on the server.
getManagerBBox()
Returns the bounding box of the manager on the server side.
getMaxZoomLevel()
Returns the maximum zoom level available on the server side.
getMessagePanel()
Returns the message panel where the messages will be displayed.
getMinZoomLevel()
Returns the maximum zoom level available on the server side.
getOverviewLayers()
Returns an array of string of all the layers that will be displayed on the overview window.
getPanFactor()
Returns the factor used to pan.
getPopupMenu()
Returns the popup menu on set this view.
getRectangle()
Returns the IlvRectangle object that can be used to draw a rectangle on the view.
getRequestURL()
Returns the URL to be used to create the request as set using setRequestURL.
getTimeoutErrorInterval()
Returns the timeout interval for requests to the server, in seconds.
getUpdateInterval()
Returns the automatic update interval of the view.
getViewBBox()
Returns the current visible area of the manager.
getVisibleLayers()
Returns an array of strings of available layers on the server.
getWaitingImage()
Returns the URL of the image used to show that the component is waiting for a server response.
getZoomFactor()
Returns the factor used when calling the zoomIn and zoomOut methods if the zoom is free.
getZoomLevels()
Retrieves the zoom levels as an array of double.
hideImageMap()
Hides the image map layer.
init()
Initializes the view.
isAutoUpdateCapabilities()
Indicates if the automatic update will also update the capabilities.
isCapabilitiesLoaded()
Indicates if the capabilities have been loaded from the server.
isConstrainedOnContents()
Returns whether the view is constrained to the manager content bounds or not.
isDeletingCookieOnDispose()
Tells if the view is deleting its cookies on dispose.
isFitToContent()
Returns whether view bounding box equals the manager bounding box.
isGenerateImageMap()
Indicates whether the component is generating an image map in addition to the image.
isLayerVisible(layer)
Indicates if a layer is currently visible.
moveTo(x, y)
Queries a new image with the specified value for the top-left corner.
panEast()
Pans the image to the east.
panNorth()
Pans the image to the north.
panNorthEast()
Pans the image to the northeast.
panNorthWest()
Pans the image to the northwest.
panSouth()
Pans the image to the south.
panSouthEast()
Pans the image to the southeast.
panSouthWest()
Pans the image to the southwest.
panWest()
Pans the image to the west.
performAction(actionName, params, capabilities, capabilitiesParams)
Performs an action on the server side.
readAdditionalCapabilities(context)
Allows you to read additional information generated by the capabilities request.
removeCapabilitiesOnLoadListener(listener)
Removes a listener installed with addCapabilitiesOnLoadListener.
removeErrorListener(listener)
Removes a listener installed with addErrorListener.
removeImageOnLoadListener(listener)
Removes a listener installed with addImageOnLoadListener.
removeInteractorListener(listener)
Removes a listener installed with addInteractorListener.
removeTimeoutErrorListener(listener)
Removes a listener installed with addTimeoutErrorListener.
resetSessionExpirationTimer()
Resets the timer that will invoke the session expiration handler.
setAdditionalParameters(key, value)
Installs an additional request parameter that will be added to all requests.
setAutoUpdateCapabilities(set)
When set to true the automatic update will also update the capabilities.
setBlendTransform(set)
Indicates if the new images will be revealed by fading the previous image.
setConstrainedOnContents(constrainedOnContents)
Defines whether the view is constrained to the manager content bounds or not.
setDeletingCookieOnDispose(del)
Tells the view it should delete its cookie when the dispose function is called.
setImageFormat(format)
Sets the format of the images generated by the server.
setInteractor(inter)
Changes the interactor of the view.
setLayerVisible(layer, visible, update)
Hides or shows a layer by querying a new image from the server.
setMessagePanel(ilvHTMLPanel)
Sets the message panel where the message will be displayed.
setPanFactor(factor)
Sets the factor used to pan.
setPopupMenu(popupMenu)
Sets the popup menu on this view.
setRequestURL(requestURL)
Sets the URL to be used to create the request.
setSessionExpirationHandler(handler)
Sets a listener that will be called when the HTTP session is about to be invalidated.
setTimeoutErrorInterval(interval)
Sets the timeout interval for requests to the server.
setUpdateInterval(rate)
Changes the automatic update interval of the view.
setViewBBox(x, y, w, h)
Queries a new image showing the specified rectangle.
setWaitingImage(image)
Sets the image to display when the component is waiting for a server response.
setZoomFactor(factor)
Changes the factor used when zooming.
showAll()
Queries a new image showing all the area available from the server.
showImageMap()
Shows the image map layer.
updateAll(showAll, keepLayerVisibility)
Queries new capabilities and a new image from the server.
updateImage()
Queries a new image from the server.
zoomBy(z)
Zooms the view to a specified factor by querying a new image from the server.
zoomIn()
Zooms the view in by querying a new image from the server.
zoomOut()
Zooms the view out by querying a new image from the server.
zoomToIdentity(nearZoomLevelAllowed)
Sets the identity transformer on the view.
.

Constructor Detail

IlvView

IlvView(left, top, width, height, namespace)
Creates an instance of IlvView.

Method Detail

addCapabilitiesOnLoadListener

addCapabilitiesOnLoadListener(listener)
Adds a listener to be called when the capabilities have been loaded.
Parameters:
listener - The listener function, which must have the following parameter:
  1. view: The IlvView.

addErrorListener

addErrorListener(listener)
Adds a listener to be called when an error occurs for the current request.
Parameters:
listener - The listener function, which must have the following parameter:
  1. view: The IlvView.

addImageOnLoadListener

addImageOnLoadListener(listener)
Adds a listener to be called when the view has loaded a new image.
Parameters:
listener - The listener function, which must have the following parameter:
  1. view: The IlvView.

addInteractorListener

addInteractorListener(listener)
Adds a listener to be called when an interactor has changed on the view.
Parameters:
listener - The listener function, which must have the following parameters:
  1. view: The IlvView.
  2. oldInteractor: The old interactor (IlvInteractor).
  3. newInteractor: The new interactor (IlvInteractor).

addTimeoutErrorListener

addTimeoutErrorListener(listener)
Adds a listener to be called when a timeout has been reached for the current request.
Parameters:
listener - The listener function, which must have the following parameter:
  1. view: The IlvView.

centerAt

centerAt(x, y)
Queries a new image centered at the specified point. The coordinates are expressed in the server coordinate system.

createCapabilitiesRequestURL

createCapabilitiesRequestURL()
Creates the HTTP request for capabilities.

createImageMapRequestURL

createImageMapRequestURL(qx, qy, qw, qh, width, height, layers)
Creates the URL for generating an image map.

createRequestURL

createRequestURL(qx, qy, qw, qh, width, height, layers)
Creates the URL for the image request.
Parameters:
qx - The abscissa of the top-left corner requested in the manager's coordinate system.
qy - The ordinate of the top-left corner requested in the manager's coordinate system.
qw - The width requested in the manager's coordinate system.
qh - The height requested in the manager's coordinate system.
width - The width of the requested image.
height - The height of the requested image.
layers - Array of the layer names requested.

dispose

dispose()
Releases the cookie holding the current image request.

getBlendTransform

getBlendTransform()
Indicates if the new images will be revealed by fading the previous image.

getCurrentZoomLevel

getCurrentZoomLevel()
Returns the current zoom level of the view.

Since:
JViews 8.0


getImageBackgroundColor

getImageBackgroundColor()
Returns the background color of the generated image or null if not specified.

getImageFormat

getImageFormat()
Returns the format of the images generated from the server. The default value is "JPEG".

getInteractor

getInteractor()
Returns the interactor of the view.

getLayers

getLayers()
Returns an array of strings of available layers on the server. The value is valid only when the capabilities have been loaded from the server.

getManagerBBox

getManagerBBox()
Returns the bounding box of the manager on the server side. This method returns an object with four properties: left, top, width, and height. These properties define the manager's bounding box as floating point values. This value is valid only when the capabilities have been loaded.

getMaxZoomLevel

getMaxZoomLevel()
Returns the maximum zoom level available on the server side. The value is valid only when the capabilities of the server have been loaded.

The -1 value means no limit.


getMessagePanel

getMessagePanel()
Returns the message panel where the messages will be displayed.

getMinZoomLevel

getMinZoomLevel()
Returns the maximum zoom level available on the server side. The value is valid only when the capabilities of the server have been loaded.

The -1 value means no limit.


getOverviewLayers

getOverviewLayers()
Returns an array of string of all the layers that will be displayed on the overview window. The value is valid only when the capabilities have been loaded from the server.

getPanFactor

getPanFactor()
Returns the factor used to pan. This factor is used in the methods panEast, panWest, panNorth, panNorthEast, panNorthWest, panSouth, panSouthEast, and panSouthWest.

getPopupMenu

getPopupMenu()
Returns the popup menu on set this view.
Returns:
the popup menu.

Since:
JViews 7.5


getRectangle

getRectangle()
Returns the IlvRectangle object that can be used to draw a rectangle on the view. This method is especially useful for interactors that can display the interaction using this rectangle.

getRequestURL

getRequestURL()
Returns the URL to be used to create the request as set using setRequestURL.

getTimeoutErrorInterval

getTimeoutErrorInterval()
Returns the timeout interval for requests to the server, in seconds. The default value is 600 or 10 minutes.

getUpdateInterval

getUpdateInterval()
Returns the automatic update interval of the view.

getViewBBox

getViewBBox()
Returns the current visible area of the manager. This method returns an object with four properties: left, top, width, and height. These properties define the visible area as floating point values.

getVisibleLayers

getVisibleLayers()
Returns an array of strings of available layers on the server. The value is valid only when the capabilities have been loaded from the server.

getWaitingImage

getWaitingImage()
Returns the URL of the image used to show that the component is waiting for a server response.

getZoomFactor

getZoomFactor()
Returns the factor used when calling the zoomIn and zoomOut methods if the zoom is free.

getZoomLevels

getZoomLevels()
Retrieves the zoom levels as an array of double. This array is set by the capability request.
Returns:
The array of zoom levels or null if none has been set by the capability request.

Since:
JViews 8.0


hideImageMap

hideImageMap()
Hides the image map layer.

init

init()
Initializes the view. This method must be called on the onLoad event of the page containing the view.

isAutoUpdateCapabilities

isAutoUpdateCapabilities()
Indicates if the automatic update will also update the capabilities.

isCapabilitiesLoaded

isCapabilitiesLoaded()
Indicates if the capabilities have been loaded from the server.

isConstrainedOnContents

isConstrainedOnContents()
Returns whether the view is constrained to the manager content bounds or not. The default value is true.

Note that zoom levels (set by minZoomLevel or zoomLevels) lower than 1 will not be allowed if this property is set to true.

Returns:
Returns whether the view is constrained or not.

Since:
JViews 8.1


isDeletingCookieOnDispose

isDeletingCookieOnDispose()
Tells if the view is deleting its cookies on dispose.

Since:
JViews 6.0


isFitToContent

isFitToContent()
Returns whether view bounding box equals the manager bounding box. If this is the case all the objects of manager are displayed by the view.

Since:
JViews 8.1


isGenerateImageMap

isGenerateImageMap()
Indicates whether the component is generating an image map in addition to the image.

isLayerVisible

isLayerVisible(layer)
Indicates if a layer is currently visible.
Parameters:
layer - The name of the layer.

moveTo

moveTo(x, y)
Queries a new image with the specified value for the top-left corner.
Parameters:
x - New value for the left in the server coordinate system.
y - New value for the top in the server coordinate system.

panEast

panEast()
Pans the image to the east.

panNorth

panNorth()
Pans the image to the north.

panNorthEast

panNorthEast()
Pans the image to the northeast.

panNorthWest

panNorthWest()
Pans the image to the northwest.

panSouth

panSouth()
Pans the image to the south.

panSouthEast

panSouthEast()
Pans the image to the southeast.

panSouthWest

panSouthWest()
Pans the image to the southwest.

panWest

panWest()
Pans the image to the west.

performAction

performAction(actionName, params, capabilities, capabilitiesParams)
Performs an action on the server side. This method requests a new image from the client. Additional parameters are sent in the image request so that an action can be performed on the server side before the image is generated. This allows you to define a new type of interaction on the image. To implement the action on the server side, you must implement an action listener (ServerActionListener) on the server side. The action is defined by a name and a list of parameters.
Parameters:
actionName - The name of the action.
params - The parameters of the action as an array of strings.
capabilities - Indicates whether the action is affecting the capabilities (like the manager bounds or the layer list, for example) or not.
capabilitiesParams - The array that contains the parameter to pass to the getCapabilities method (if the capabilities parameter is set to true). If this parameter is omitted, the array [false, false, true] is used.

readAdditionalCapabilities

readAdditionalCapabilities(context)
Allows you to read additional information generated by the capabilities request.
Parameters:
context - The object that contains the JavaScript variable generated by the server.

removeCapabilitiesOnLoadListener

removeCapabilitiesOnLoadListener(listener)
Removes a listener installed with addCapabilitiesOnLoadListener.
Parameters:
listener - The listener to remove.

removeErrorListener

removeErrorListener(listener)
Removes a listener installed with addErrorListener.
Parameters:
listener - The listener to remove.

removeImageOnLoadListener

removeImageOnLoadListener(listener)
Removes a listener installed with addImageOnLoadListener.
Parameters:
listener - The listener to remove.

removeInteractorListener

removeInteractorListener(listener)
Removes a listener installed with addInteractorListener.
Parameters:
listener - The listener to remove.

removeTimeoutErrorListener

removeTimeoutErrorListener(listener)
Removes a listener installed with addTimeoutErrorListener.
Parameters:
listener - The listener to remove.

resetSessionExpirationTimer

resetSessionExpirationTimer()
Resets the timer that will invoke the session expiration handler.

Since:
JViews 8.1
See also:
#setSessionExpirationHandler


setAdditionalParameters

setAdditionalParameters(key, value)
Installs an additional request parameter that will be added to all requests. You can remove the parameters by passing the null value. Adding additional parameters might be useful when defining a new interactor that requires additional parameters. In this case you may set additional parameters before calling updateImage, and then remove the additional parameters. The parameter added will be &key=value.

setAutoUpdateCapabilities

setAutoUpdateCapabilities(set)
When set to true the automatic update will also update the capabilities.

setBlendTransform

setBlendTransform(set)
Indicates if the new images will be revealed by fading the previous image. This method is available only on Internet Explorer and will be ignored on Netscape Communicator.

setConstrainedOnContents

setConstrainedOnContents(constrainedOnContents)
Defines whether the view is constrained to the manager content bounds or not. The default value is true.

Note that zoom levels (set by minZoomLevel or zoomLevels) lower than 1 will not be allowed if this property is set to true.

Parameters:
constrainedOnContents - Defines whether the view is constrained or not.

Since:
JViews 8.1


setDeletingCookieOnDispose

setDeletingCookieOnDispose(del)
Tells the view it should delete its cookie when the dispose function is called.
Parameters:
del - true to delete the cookie; false otherwise.

Since:
JViews 6.0


setImageFormat

setImageFormat(format)
Sets the format of the images generated by the server.
Parameters:
format - the format to be set: "JPEG" or "PNG".

setInteractor

setInteractor(inter)
Changes the interactor of the view.
Parameters:
inter - An instance of IlvInteractor.

setLayerVisible

setLayerVisible(layer, visible, update)
Hides or shows a layer by querying a new image from the server.
Parameters:
layer - The name of the layer.
visible - A Boolean value to turn the layer visibility on or off.
update - Whether to update the image or not.

setMessagePanel

setMessagePanel(ilvHTMLPanel)
Sets the message panel where the message will be displayed.
Parameters:
ilvHTMLPanel - An instance of IlvHTMLPanel.

setPanFactor

setPanFactor(factor)
Sets the factor used to pan. This factor is used in the methods panEast, panWest, panNorth, panNorthEast, panNorthWest, panSouth, panSouthEast, and panSouthWest.

The default value is 0.5.


setPopupMenu

setPopupMenu(popupMenu)
Sets the popup menu on this view.
Parameters:
popupMenu - the popup menu to set.

Since:
JViews 7.5


setRequestURL

setRequestURL(requestURL)
Sets the URL to be used to create the request.
Parameters:
requestURL - the request URL to be set.

setSessionExpirationHandler

setSessionExpirationHandler(handler)
Sets a listener that will be called when the HTTP session is about to be invalidated.

This method works if and only if the session inactivity is reset by a JViews request. If the session inactivity is reset by an external request, the #resetSessionTimeoutTimer method must be called.

This method must be called before the capabilities request is made.

Parameters:
handler - The session expiration handler. This must be a function with one parameter: the view.

Since:
JViews 8.1


setTimeoutErrorInterval

setTimeoutErrorInterval(interval)
Sets the timeout interval for requests to the server.
Parameters:
interval - The timeout, specified in seconds. The default value is 600 or 10 minutes.

setUpdateInterval

setUpdateInterval(rate)
Changes the automatic update interval of the view.
Parameters:
rate - The new interval in seconds. An interval of zero stops the automatic update.

setViewBBox

setViewBBox(x, y, w, h)
Queries a new image showing the specified rectangle. The rectangle is expressed in the server coordinate system (manager). If the zoom level is not free, the rectangle bounds can be adjusted to fit the nearest fixed zoom level.
Parameters:
x - New value for the left in the server coordinate system.
y - New value for the top in the server coordinate system.
w - New value for the width in the server coordinate system.
h - New value for the height in the server coordinate system.

setWaitingImage

setWaitingImage(image)
Sets the image to display when the component is waiting for a server response. The image may be an animated GIF.
Parameters:
image - URL of the image to display when waiting for a server response.

setZoomFactor

setZoomFactor(factor)
Changes the factor used when zooming. The factor is used in the methods zoomIn and zoomOut if the zoom is free.

The default value is 1.5.


showAll

showAll()
Queries a new image showing all the area available from the server.

showImageMap

showImageMap()
Shows the image map layer.

updateAll

updateAll(showAll, keepLayerVisibility)
Queries new capabilities and a new image from the server.
Parameters:
showAll - When true the new image will show all of the area available on the server.
keepLayerVisibility - When true the current layer's visibility state is kept.

updateImage

updateImage()
Queries a new image from the server.

zoomBy

zoomBy(z)
Zooms the view to a specified factor by querying a new image from the server. If the zoom is not free, the zoom level will be replaced by the nearest one.
Parameters:
z - The zoom factor.

zoomIn

zoomIn()
Zooms the view in by querying a new image from the server. If the zoom is free, the view is zoomed in by the zoom factor specified by #setZoomFactor .
If the zoom levels are fixed the view is zoomed to the next zoom level, if any.

zoomOut

zoomOut()
Zooms the view out by querying a new image from the server. If the zoom is free, the view is zoomed out by the zoom factor specified by #setZoomFactor .
If the zoom levels are fixed the view is zoomed to the next zoom level, if any.

zoomToIdentity

zoomToIdentity(nearZoomLevelAllowed)
Sets the identity transformer on the view.
. This method will not succeed if the identity zoom level is not in the fixed zoom level list or if the minimum or maximum zoom level is reached, in that case the view is left unchanged.
Parameters:
nearZoomLevelAllowed - Whether snap to the nearest zoom level in fixed zoom levels mode or fail if the exact zoom level is not in the list (default value is false).
Returns:
true if the transformation succeeded, false otherwise.

Inherited Methods from IlvAbstractView
childrenToHTML, getCursor, getGlassView, keyPress, mouseDown, mouseDrag, mouseMove, mouseOut, mouseOver, mouseUp, setChildrenBounds, setCursor
Inherited Methods from IlvResizableView
getMaximumSize, getMinimumSize, isResizable, setChildrenBounds, setMaximumSize, setMinimumSize, setResizable, toHTML
Inherited Methods from IlvEmptyView
addSizeListener, childrenToHTML, getBounds, getHeight, getLeft, getLocation, getSize, getTop, getWidth, isStateInCookie, removeSizeListener, restoreState, saveState, setBounds, setChildrenBounds, setLocation, setSize, setStateInCookie, toHTML
Inherited Methods from IlvObject
callDispose, dispose, getClassName, hashCode, inherits, instanceOf, invoke, registerDispose, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility