OpenLayers.Control.FeaturePopups.Layer

Summary
OpenLayers.Control.FeaturePopups.Layer
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>.
listenFeatures{Boolean} internal use to optimize performance, true if eventListeners contains a “featureschanged” event.
templates{Object} Set of templates, see FeaturePopups.addLayer
featureContext{Object} See FeaturePopups.addLayer
listContext{Object} See FeaturePopups.addLayer
safeSelection{Boolean} Read only, true if the control constructor argument in the FeaturePopups.mode have set OpenLayers.Control.FeaturePopups.SAFE_SELECTION.
popupOptions{Object} Options used to create a popup manager for selections only on this layer, set to {} to use default options, default is null.
popupObjOpenLayers.Control.FeaturePopups.Popup Internal use.
selection{Object} Used if safeSelection is true.
selectionObject{Object} Used to store calculations associated with current selection.
selectionHash{String} String unique for the single features of the selected features of the layer regardless of the order or clustering of these, is based on its id or fid (if it exists)
staticSelectionHash{String} String unique for the single features of the static selected features of the layer regardless of the order or clustering of these, is based on its id or fid (if it exists)
featuresHash{String} String unique for the single features of the layer regardless of the order or clustering of these, is based on its id or fid (if it exists)
layerListeners{Object} layerListeners object will be registered with <OpenLayers.Events.on>, internal use only.
active{Boolean} The object is active (read-only)
updatingSelection{Boolean} The control set to true this property while being refreshed selection on a set of features to can ignore others acctions, internal use only.
silentSelection{Boolean} Suppress “selectionchanged” event triggering during a selection process, internal use only.
refreshDelay{Number} Number of accepted milliseconds of waiting between removing and re-add features (useful when using strategies such as BBOX), after this time has expired is forced a popup refresh.
delayedRefresh{Number} Timeout id of forced refresh.
regExpI18n{RegEx} Used to internationalize templates.
regExpShow{RegEx} Used to activate events in the html elements to show individual popup.
regExpAttributes{RegEx} Used to omit the name “attributes” as ${.myPropertyName} instead of ${attributes.myPropertyName} to show data on a popup using templates.
Constructor
OpenLayers.Control.FeaturePopups.Layer
Functions and Properties
getFeatureIdReturns the id of the feature used specifically for this layer.
renderTemplateGiven a string with tokens in the form ${token}, return a string with tokens replaced with properties from the given context object.
applyTemplate{Object} The object contains an applicator of the template for each template name.
prepareTemplateWhen the template is a string returns a prepared template, otherwise returns it as is.
destroy
activate
deactivate
isEmptyObject
highlightFeatureInternal use only.
onFeatureselected
storeAsSelected
onFeatureunselectedCalled when the select feature control unselects a feature.
onBeforefeaturesremovedCalled before some features are removed, only used when mode contains OpenLayers.Control.FeaturePopups.SAFE_SELECTION.
onFeaturesremovedCalled when some features are removed, only used when mode = OpenLayers.Control.FeaturePopups.CLOSE_ON_REMOVE
onFeaturesaddedCalled when some features are added, only used when value of mode conbtains OpenLayers.Control.FeaturePopups.SAFE_SELECTION.
unselectLayerUnselect all selected features by `selControl` on the layer.
refreshFeatures
refreshSelection
getSingleHtml
showSingleFeatureByIdSee featureContext at FeaturePopups.addLayer to know how to use “id” or “fid” of features.
getSingleFeatures

Properties

events

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

Supported event types: see FeaturePopups.addLayer

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.

listenFeatures

{Boolean} internal use to optimize performance, true if eventListeners contains a “featureschanged” event.

templates

{Object} Set of templates, see FeaturePopups.addLayer

featureContext

listContext

safeSelection

{Boolean} Read only, true if the control constructor argument in the FeaturePopups.mode have set OpenLayers.Control.FeaturePopups.SAFE_SELECTION.

popupOptions

{Object} Options used to create a popup manager for selections only on this layer, set to {} to use default options, default is null.

May contain two keys: “list” and “single”.

For more details of valid options for any key see FeaturePopups.Popup.Constructor.

Default options for “list”

popupClass<OpenLayers.Popup.FramedCloud>
panMapIfOutOfViewtrue
unselectFunctionDepends on the FeaturePopups.mode (internal use)
closeBoxDepends on the FeaturePopups.mode (internal use)
observeItemstrue (internal use)
relatedToClear[[“hover”, “hoverList”, “listItem”], [“single”]] (internal use)

Default options for “single”

popupClass<OpenLayers.Popup.FramedCloud>
panMapIfOutOfViewtrue
unselectFunctionDepends on the mode (internal use)
closeBoxDepends on the mode (internal use) relatedToClear: [[“hover”, “hoverList”, “listItem”], [“list”]] (internal use)

selection

{Object} Used if safeSelection is true.  Set of the identifiers (id or fid if it exists) of the features that were selected, a feature remains on the object after being removed from the layer until occurs new selection.

selectionObject

{Object} Used to store calculations associated with current selection.

selectionHash

{String} String unique for the single features of the selected features of the layer regardless of the order or clustering of these, is based on its id or fid (if it exists)

staticSelectionHash

{String} String unique for the single features of the static selected features of the layer regardless of the order or clustering of these, is based on its id or fid (if it exists)

featuresHash

{String} String unique for the single features of the layer regardless of the order or clustering of these, is based on its id or fid (if it exists)

layerListeners

{Object} layerListeners object will be registered with <OpenLayers.Events.on>, internal use only.

active

{Boolean} The object is active (read-only)

updatingSelection

{Boolean} The control set to true this property while being refreshed selection on a set of features to can ignore others acctions, internal use only.

silentSelection

{Boolean} Suppress “selectionchanged” event triggering during a selection process, internal use only.

refreshDelay

{Number} Number of accepted milliseconds of waiting between removing and re-add features (useful when using strategies such as BBOX), after this time has expired is forced a popup refresh.

delayedRefresh

{Number} Timeout id of forced refresh.

regExpI18n

{RegEx} Used to internationalize templates.

regExpShow

{RegEx} Used to activate events in the html elements to show individual popup.

regExpAttributes

{RegEx} Used to omit the name “attributes” as ${.myPropertyName} instead of ${attributes.myPropertyName} to show data on a popup using templates.

Constructor

OpenLayers.Control.FeaturePopups.Layer

Functions and Properties

getFeatureId

this.getFeatureId = function(feature)

Returns the id of the feature used specifically for this layer.  Usually the id returned is the `fid` feature if it exists and otherwise is the `id`.

This function can not be overwritten, use featureContext to change this behavior.

Parameters

feature{OpenLayers.Feature.Vector}

Returns

{String} A unique identifier of the feature within the layer according featureContext.

renderTemplate

var renderTemplate = function(template,
context,
extendedContext)

Given a string with tokens in the form ${token}, return a string with tokens replaced with properties from the given context object.  Represent a literal “${“ by doubling it, e.g.  “${${“.

Parameters

template{String || Function} If template is a string then template has the form “literal ${token}” where the token will be replaced by the value of context[“token”].  When is a function it will receive the context as a argument.
context{Object} Object with properties corresponding to the tokens in the template.
extendedContext{Object} Object with properties corresponding to the overlaid tokens, if a token is a function its scope is context.

Returns

{String} A string with tokens replaced from the context object.

applyTemplate

{Object} The object contains an applicator of the template for each template name.  Each applicator returns a {String} with tokens replaced from the context of feature (for names single, item, hover, hoverItem) or context of list (for names list and hoverList)

prepareTemplate

prepareTemplate: function(template)

When the template is a string returns a prepared template, otherwise returns it as is.

Parameters

template{String || Function}

Returns

{String || Function} A internationalized template.

destroy

destroy: function()

activate

activate: function()

deactivate

deactivate: function()

isEmptyObject

isEmptyObject: function(obj)

Parameters

obj{Object}

highlightFeature

highlightFeature: function(feature)

Internal use only.

onFeatureselected

onFeatureselected: function(evt)

Parameters

evt{Object}

storeAsSelected

storeAsSelected: function(feature)

Parameter

feature{OpenLayers.Feature.Vector} Feature to store as selected.

onFeatureunselected

onFeatureunselected: function(evt)

Called when the select feature control unselects a feature.

Parameters

evt{Object}

onBeforefeaturesremoved

onBeforefeaturesremoved: function(evt)

Called before some features are removed, only used when mode contains OpenLayers.Control.FeaturePopups.SAFE_SELECTION.

Parameters

evt{Object}

onFeaturesremoved

onFeaturesremoved: function(evt)

Called when some features are removed, only used when mode = OpenLayers.Control.FeaturePopups.CLOSE_ON_REMOVE

Parameters

evt{Object}

onFeaturesadded

onFeaturesadded: function(evt)

Called when some features are added, only used when value of mode conbtains OpenLayers.Control.FeaturePopups.SAFE_SELECTION.

Parameters

evt{Object}

unselectLayer

unselectLayer: function(selControl)

Unselect all selected features by `selControl` on the layer.

refreshFeatures

refreshFeatures: function()

refreshSelection

refreshSelection: function()

getSingleHtml

getSingleHtml: function(feature)

showSingleFeatureById

showSingleFeatureById: function(featureId,
origin)

See featureContext at FeaturePopups.addLayer to know how to use “id” or “fid” of features.

Parameters

featureId{String} id of the feature.
origin{<OpenLayers.Control.FeaturePopups.Popup>|null}

getSingleFeatures

getSingleFeatures: function(features)
Extend of FeaturePopups control
{Object} If set on options at construction, the eventListeners object will be registered with OpenLayers.Events.on.
addLayer: function(layer,
options)
Add the layer to control and assigns it the templates, see options.
To enable or disable the various behaviors of the control.
{Integer} Used in mode indicates that the features will remain selected even have been removed from the layer.
{Boolean} Read only, true if the control constructor argument in the FeaturePopups.mode have set OpenLayers.Control.FeaturePopups.SAFE_SELECTION.
this.getFeatureId = function(feature)
Returns the id of the feature used specifically for this layer.
var renderTemplate = function(template,
context,
extendedContext)
Given a string with tokens in the form ${token}, return a string with tokens replaced with properties from the given context object.
prepareTemplate: function(template)
When the template is a string returns a prepared template, otherwise returns it as is.
destroy: function()
activate: function()
deactivate: function()
isEmptyObject: function(obj)
highlightFeature: function(feature)
Internal use only.
onFeatureselected: function(evt)
storeAsSelected: function(feature)
onFeatureunselected: function(evt)
Called when the select feature control unselects a feature.
onBeforefeaturesremoved: function(evt)
Called before some features are removed, only used when mode contains OpenLayers.Control.FeaturePopups.SAFE_SELECTION.
onFeaturesremoved: function(evt)
Called when some features are removed, only used when mode = OpenLayers.Control.FeaturePopups.CLOSE_ON_REMOVE
{Integer} Used in mode indicates that the popups will close when removing features in a layer.
onFeaturesadded: function(evt)
Called when some features are added, only used when value of mode conbtains OpenLayers.Control.FeaturePopups.SAFE_SELECTION.
unselectLayer: function(selControl)
Unselect all selected features by `selControl` on the layer.
refreshFeatures: function()
refreshSelection: function()
getSingleHtml: function(feature)
showSingleFeatureById: function(featureId,
origin)
See featureContext at FeaturePopups.addLayer to know how to use “id” or “fid” of features.
getSingleFeatures: function(features)
{Object} See FeaturePopups.addLayer
Close