OpenSpace.InfoWindow

This class sets up a popup info window containing user supplied HTML content.  The info window is created with the default OpenSpace styling.

Inherits

  • <OpenLayers.Popup.Anchored>
Summary
OpenSpace.InfoWindowThis class sets up a popup info window containing user supplied HTML content.
Constructor
OpenSpace.InfoWindowConstructor for a new OpenSpace.InfoWindow instance.
Functions
setSizeSets the popup window’s size.
setPositionSets a new position for this popup.
setAnchorSets a new anchor position for this popup.
calculateNewPx

Constructor

OpenSpace.InfoWindow

Constructor for a new OpenSpace.InfoWindow instance.

Parameters

id{String} Id of an element in your page that will contain the map.
lonlat{Object} Optional object with properties to tag onto the map.
size{<OpenLayers.Size>} Size of the window
contentHTML{String} Content to draw in the window
anchor{<OpenLayers.Pixel>}
closeBox{Boolean} Whether to draw a close box

Examples

Functions

setSize

setSize: function(size)

Sets the popup window’s size.

Parameters

size{<OpenLayers.Size>} Size of the popup window

setPosition

setPosition: function(lonlat)

Sets a new position for this popup.

Parameters

lonlat{<OpenLayers.LonLat>}

setAnchor

setAnchor: function(anchor)

Sets a new anchor position for this popup.

Parameters

anchor{OpenSpace.Icon} Takes a size, offset and infoWindowAnchor from a OpenSpace.Icon object.

calculateNewPx

calculateNewPx: function(px)

Parameters

px{<OpenLayers.Pixel>}

Returns

{<OpenLayers.Pixel>} The the new px position of the popup on the screen relative to the passed-in px.

setSize: function(size)
Sets the popup window’s size.
setPosition: function(lonlat)
Sets a new position for this popup.
setAnchor: function(anchor)
Sets a new anchor position for this popup.
calculateNewPx: function(px)
A class to extend OpenLayers.Icon to hold extra information on the offset of the infoWindow.
Close