Class: PopupFeature

ol.Overlay. PopupFeature


new PopupFeature(options)

A popup element to be displayed on a feature.

Parameters:
Name Type Description
options

Extend Popup options

Properties
Name Type Description
popupClass String

the a class of the overlay to style the popup.

closeBox bool

popup has a close box, default false.

onclose: function | undefined

callback function when popup is closed

onshow function | undefined

callback function when popup is shown

offsetBox Number | Array.<number>

an offset box

positionning ol.OverlayPositioning | string | undefined

the 'auto' positioning var the popup choose its positioning to stay on the map.

template Template

A template with a list of properties to use in the popup

canFix boolean

Enable popup to be fixed, default false

showImage boolean

display image url as image, default false

maxChar boolean

max char to display in a cell, default 200

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:

getFix()

Is a popup fixed

Returns:
Type
boolean

getVisible()

Check if popup is visible

Inherited From:
Returns:
Type
boolean

hide()

Hide the popup

Inherited From:

removePopupClass(c)

Remove a CSS class to the popup.

Parameters:
Name Type Description
c string

class name.

Inherited From:

setClosebox(b)

Set a close box to the popup.

Parameters:
Name Type Description
b bool
Inherited From:

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:

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:

setTemplate(template)

Set the template

Parameters:
Name Type Description
template Template

A template with a list of properties to use in the popup


show(coordinate, features)

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

Overrides: