OpenLayers.Control.FeaturePopups.Popup

Summary
OpenLayers.Control.FeaturePopups.Popup
Properties
events{<OpenLayers.Events>} Events instance for listeners and triggering specific events.
Constants
EVENT_TYPESOnly required to use OpenLayers.Control.FeaturePopups with 2.11 or less
Properties
eventListeners{Object} If set on options at construction, the eventListeners object will be registered with <OpenLayers.Events.on>.
control{OpenLayers.Control.FeaturePopups} The control that initialized this popup manager.
type{String} Type of popup manager, read only.
popupClass{String|<OpenLayers.Popup>|Function} Type of popup to manage.
anchor{Object} Object to which we’ll anchor the popup.
minSize{<OpenLayers.Size>} Minimum size allowed for the popup’s contents.
maxSize{<OpenLayers.Size>} Maximum size allowed for the popup’s contents.
unselectOnClose{Boolean} If true, closing a popup all features are unselected on control.controls.select.
closeBox{Boolean} To display a close box inside the popup.
panMapIfOutOfView{Boolean} When drawn, pan map such that the entire popup is visible in the current viewport (if necessary).
observeItems{Boolean} If true, will be activated observers of the DOMElement of the popup to trigger some events (mostly in list popups).
relatedToClearArray({String}) Related FeaturePopups.popupObjs codes from control to clear.
relatedSimultaneous{Object} Object with two keys: “axis” key is the axis on which to display the two popups (valid values are “h” or “v”) and “related” key is a code of FeaturePopups.popupObjs from control to show simultaneously without much overlap.
popupType{String} Code of type of popup to manage: “div”, “OL” or “custom”
popup{Boolean|<OpenLayers.Popup>} True or instance of OpenLayers.Popup when popup is showing.
clearCustom{Function|null} stores while displaying a custom popup the function to clear the popup, this function is returned by the custom popup.
onCloseBoxMethod{Function|null} When the popup is created with closeBox argument to true, this property stores the method that implement any measures to close the popup, otherwise is null.
moveListener{Object} moveListener object will be registered with <OpenLayers.Events.on>, use only when <followCursor> is true.
Constructor
OpenLayers.Control.FeaturePopups.PopupThis class is a handler that is responsible for displaying and clear the one kind of popups managed by a OpenLayers.Control.FeaturePopups.
Functions
destroy
showPopupShows the popup if it has changed, and clears it previously
clearClear the popup and related popups.
observeShowPopupInternal use only.
showListItemInternal use only.
removeChildrenInternal use only.
createCreate the popup.
clearPopupClear the popup if it is showing.

Properties

events

{<OpenLayers.Events>} Events instance for listeners and triggering specific events.

Supported event types

beforepopupdisplayedTriggered before a popup is displayed.  To stop the popup from being displayed, a listener should return false.  Receives an event with; “popupType” see Constructor, “selection” a selection object except for the “list” popupType that is an array of selection objects, “html” the html content that will have the window (can override to alter html) and “popupClass” popupClass that will be used to display the popup.  Selection objects have three keys, “layerObj” (the FeaturePopups.Layer manager of the layer), “layer” (the layer) and “features” or “feature” (the singular key “feature” is used only for popupType: “single”, “hover” or “listItem”)
popupdisplayedTriggered after a popup is displayed.  Receives an event with; “popupType” see Constructor, “selection” (with the same structure described in the event “beforepopupdisplayed”), “div” the DOMElement used by the popup and “popup” the instance of the popup class that has shown the popup.
closedbyboxTriggered after close a popup using close box.  Receives an event with “popupType” see Constructor

Constants

EVENT_TYPES

Only required to use OpenLayers.Control.FeaturePopups with 2.11 or less

Properties

eventListeners

{Object} If set on options at construction, the eventListeners object will be registered with <OpenLayers.Events.on>.  Object structure must be a listeners object as shown in the example for the events.on method.

control

{OpenLayers.Control.FeaturePopups} The control that initialized this popup manager.

type

{String} Type of popup manager, read only.

popupClass

{String|<OpenLayers.Popup>|Function} Type of popup to manage.

anchor

{Object} Object to which we’ll anchor the popup.  Must expose a ‘size’ (<OpenLayers.Size>) and ‘offset’ (<OpenLayers.Pixel>).

minSize

{<OpenLayers.Size>} Minimum size allowed for the popup’s contents.

maxSize

{<OpenLayers.Size>} Maximum size allowed for the popup’s contents.

unselectOnClose

{Boolean} If true, closing a popup all features are unselected on control.controls.select.

closeBox

{Boolean} To display a close box inside the popup.

panMapIfOutOfView

{Boolean} When drawn, pan map such that the entire popup is visible in the current viewport (if necessary).  Default is true.

observeItems

{Boolean} If true, will be activated observers of the DOMElement of the popup to trigger some events (mostly in list popups).

relatedToClear

Array({String}) Related FeaturePopups.popupObjs codes from control to clear.

relatedSimultaneous

{Object} Object with two keys: “axis” key is the axis on which to display the two popups (valid values are “h” or “v”) and “related” key is a code of FeaturePopups.popupObjs from control to show simultaneously without much overlap.

popupType

{String} Code of type of popup to manage: “div”, “OL” or “custom”

popup

{Boolean|<OpenLayers.Popup>} True or instance of OpenLayers.Popup when popup is showing.

clearCustom

{Function|null} stores while displaying a custom popup the function to clear the popup, this function is returned by the custom popup.

onCloseBoxMethod

{Function|null} When the popup is created with closeBox argument to true, this property stores the method that implement any measures to close the popup, otherwise is null.

moveListener

{Object} moveListener object will be registered with <OpenLayers.Events.on>, use only when <followCursor> is true.

Constructor

OpenLayers.Control.FeaturePopups.Popup

This class is a handler that is responsible for displaying and clear the one kind of popups managed by a OpenLayers.Control.FeaturePopups.

The manager popup can handle three types of popups: a div a OpenLayers.Popup class or a custom popup, it depends on the type of “popupClass” argument.

Parameters

control{OpenLayers.Control.FeaturePopups} The control that initialized this popup manager.
popupType{String} Type of popup manager: “list”, “single”, “listItem” “hover” or “hoverList”
options{Object}

Valid ptions

eventListeners{Object} Listeners to register at object creation.
minSize{<OpenLayers.Size>} Minimum size allowed for the popup’s contents.
maxSize{<OpenLayers.Size>} Maximum size allowed for the popup’s contents.
popupClass{String|<OpenLayers.Popup>|Function} Type of popup to manage: string for a “id” of a DOMElement, OpenLayers.Popup and a function for a custom popup. anchor -{Object} Object to which we’ll anchor the popup.  Must expose a ‘size’ (<OpenLayers.Size>) and ‘offset’ (<OpenLayers.Pixel>).
followCursor{Boolean} If true, the popup will follow the cursor (useful for hover)
unselectOnClose{Boolean} If true, closing a popup all features are unselected on control.controls.select.
closeBox{Boolean} To display a close box inside the popup.
observeItems{Boolean} If true, will be activated observers of the DOMElement of the popup to trigger some events (mostly by list popups).
relatedToClearArray({String}) Related FeaturePopups.popupObjs codes from control to clear.
relatedSimultaneous{Object} Object with two keys: “axis” key is the axis on which to display the two popups (valid values are “h” or “v”) and “related” key is a code of FeaturePopups.popupObjs from control to show simultaneously without much overlap. panMapIfOutOfView -{Boolean} When drawn, pan map such that the entire popup is visible in the current viewport (if necessary), default is true.

Functions

destroy

destroy: function()

showPopup

showPopup: function(selection,
lonLat,
html,
panMap)

Shows the popup if it has changed, and clears it previously

Parameters

selection{Object}|Aray({Object}) Selected features.
lonlat{<OpenLayers.LonLat>} The position on the map the popup will be shown.
html{String} An HTML string to display inside the popup.
panMap{Boolean} If panMapIfOutOfView is true then pan map such that the entire popup is visible, defaul is true.

clear

clear: function()

Clear the popup and related popups.

observeShowPopup

observeShowPopup: function(div)

Internal use only.

Parameters

div{DOMElement}

showListItem

showListItem: function(evt)

Internal use only.

Parameters

div{DOMElement}

Scope

removeChildren

removeChildren: function(div)

Internal use only.

Parameters

div{DOMElement}

create

create: function(lonLat,
html,
panMap)

Create the popup.

clearPopup

clearPopup: function()

Clear the popup if it is showing.

The FeaturePopups control selects vector features from a given layers on click and hover and can show the feature attributes in a popups.
{Object} Internal use only.
{OpenLayers.Control.FeaturePopups} The control that initialized this popup manager.
destroy: function()
showPopup: function(selection,
lonLat,
html,
panMap)
Shows the popup if it has changed, and clears it previously
clear: function()
Clear the popup and related popups.
observeShowPopup: function(div)
Internal use only.
showListItem: function(evt)
Internal use only.
removeChildren: function(div)
Internal use only.
create: function(lonLat,
html,
panMap)
Create the popup.
clearPopup: function()
Clear the popup if it is showing.
{Boolean} When drawn, pan map such that the entire popup is visible in the current viewport (if necessary).
Close