Class: Popup

cercalia.Popup

Let you create a window related to marker, where to paint information in HTML format.
Based on ol.Overlay class

Name Type Description
options
Name Type Description
closeOnClick boolean | undefined optional

Close popup when click on it. Default value false.

content string

HTML Popup content

customPopup boolean | undefined optional

Boolean indicating whether you want to use a custom popup, where the user adjusts the CSS styles from the elements. Default value: false

maxWidth number | undefined optional

Popup maximum width, in pixels. Default value 200px

offset Array.<number> | undefined optional

Popup offset, in pixels, format [x, y]. For example [20, -5]. It's necessary to note the positioning option value. Only apply when option customPopup=true

positioning string | undefined optional

Popup position. Values: 'top-left', 'top-center', 'top-right', 'bottom-left', 'bottom-center', 'bottom-right'. Default: 'bottom-left'. Only apply when option customPopup=true

title string | undefined optional

Popup title. Default value: 'Info'

visible boolean | undefined optional

Boolean indicating if Popup is initially visible. Default value: false

zIndex number | undefined optional

zIndex popup value (css) . Default 1000

Methods

Destroy popup and clean the marker reference to this popup

Returns:
ClassName. Value : cercalia.Popup.
Returns:
marker Obtain the marker related to this Popup, null if there's none assigned

getOffset(){Array.<number>}

Returns:
Popup Offset
Returns:
The popup object ol.Overlay
Returns:
Popup Position

getZIndex(){number|String}

Returns:
ZIndex value

Hide the popup

Name Type Description
fade boolean

Indicates whether to apply the 'fadeOut' animation effect

Returns:
visible Returns if it's visible

Change the popup body using Cambia a string with the HTML content

Name Type Description
htmlContent string | Object

Body popup HTML content (string, jQuery Object or DOM element).

Sets the popup position

Name Type Description
offset Array.<number>

Couple of values ​​for the offset.

setPosition(lonLat, projectionCode)

Sets the popup position

Name Type Description
lonLat cercalia.LonLat
projectionCode string

Change the popup title using a string with the HTML content

Name Type Description
htmlContent string

Popup title HTML content

Change the popup zIndex

Name Type Description
zIndex number | String

ZIndex value (numerical value or 'auto')

Open the popup

Name Type Description
fade boolean

Indicates whether to apply 'fadeIn' animation effect