new PopupFeature(options)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Extend Popup options Properties
|
Fires:
- event:show
- event:hide
- event:select
Extends
Methods
-
<static> localString(locales, options)
-
Get a function to use as format to get local string for an attribute if the attribute is a number: Number.toLocaleString() if the attribute is a date: Date.toLocaleString() otherwise the attibute itself
Parameters:
Name Type Description locales
string string with a BCP 47 language tag, or an array of such strings
options
* Number or Date toLocaleString options
Returns:
a function that takes an attribute and return the formated attribute
- Type
- function
-
addPopupClass(c)
-
Add a CSS class to the popup.
Parameters:
Name Type Description c
string class name.
- Inherited From:
- Overrides:
-
getFix()
-
Is a popup fixed
Returns:
- Type
- boolean
-
getVisible()
-
Check if popup is visible
- Inherited From:
- Overrides:
Returns:
- Type
- boolean
-
hide()
-
Hide the popup
- Inherited From:
- Overrides:
-
removePopupClass(c)
-
Remove a CSS class to the popup.
Parameters:
Name Type Description c
string class name.
- Inherited From:
- Overrides:
-
setClosebox(b)
-
Set a close box to the popup.
Parameters:
Name Type Description b
bool - Inherited From:
- Overrides:
-
setFix(fix)
-
Fix the popup
Parameters:
Name Type Description fix
boolean -
setPopupClass(c)
-
Set the CSS class of the popup.
Parameters:
Name Type Description c
string class name.
- Inherited From:
- Overrides:
-
setPositioning(pos)
-
Set positionning of the popup
Parameters:
Name Type Description pos
ol.OverlayPositioning | string | undefined an ol.OverlayPositioning or 'auto' to var the popup choose the best position
- Inherited From:
- Overrides:
-
setTemplate( [template])
-
Set the template
Parameters:
Name Type Argument Description template
Template <optional>
A template with a list of properties to use in the popup, default use all features properties
-
show(coordinate, features, current)
-
Show the popup on the map
Parameters:
Name Type Description coordinate
ol.coordinate | undefined Position of the popup
features
ol.Feature | Array.<ol.Feature> The features on the popup
current
ol.Feature The current feature if keepSelection = true, otherwise get the first feature
- Overrides: