Class: Marker

cercalia.Marker

Marker graphical format with which perform a set of operations and customizations. The core of this class is based on OpenLayers3 ol.Feature class For obtain the reference of this object, use the getMap() function call.

new cercalia.Marker(options)

Name Type Description
options cercaliax.MarkerOptions

Marker options

Members

onClick{function}

onDoubleClick{function}

onMouseOut{function}

onMouseOver Function, if specified

onMouseOver{function}

onRightClick{function}

Methods

addExtraIcon(icon)

Add extra icon with a plus zIndex. You can add multiple icons to a marker.

Name Type Description
icon cercalia.Icon

Icon

addPopup(popup)

Name Type Description
popup cercalia.Popup

Destroy popup

getClass(){string}

Returns:
ClassName: cercalia.Marker

getExtraIcons(){Array.<cercalia.Icon>}

Returns:
Return extra icons

getFeature(){ol.Feature}

Returns:
Object ol.Feature
Returns:
Icon.

getId(){string}

Returns:
Marker ID. If specified, if not returns null.
Returns:
label Label assigned to th marker.
Returns:
The map where it's painted, if not returns null.
Returns:
Popup, if don't have returns null.
Returns:
position The marker Array position [lat, lon].
Returns:
Returns cercalia.SimpleLabel if created. If not, returns null.

getZIndex(){number}

Returns:
CSS marker zIndex

hasExtraIcons(){boolean}

Returns:
true if extra icons.

Hide marker label

isDraggable(){boolean}

Returns:
Boolean showing if marker it's draggable.
Returns:
true if marker is dragging, otherwise false.

isVisible(){boolean}

Returns:
true if visible, else false.

movePosition(position, duration, callbackFn, centerMapDuringMovement, numSteps)

Move the parker position with an animation movement from a starting to ending position, in a specified time (duration). Optionally it's possible to call a function specified via parameter.

Name Type Description
position cercalia.LonLat

Coordinate.

duration number | undefined optional

Movement duration, in milliseconds (default value 2000ms)

callbackFn function | undefined optional

Callback function, when movement ends

centerMapDuringMovement boolean | undefined optional

Center map during movement. Default false.

numSteps number | undefined optional

Number of steps to animate. Default 100.

onDragStart()

Force to draw feature.

refreshPositionFromGeometry()

Updates the marker position through its geometry. This function is usefull on marker dragging, where its position (obtained through its geometry) has been updated, but not its popup or label.

removeLabel()

Destroy the label object

setDraggable(draggable)

Name Type Description
draggable boolean

setIcon(icon)

Change the marker icon

Name Type Description
icon cercalia.Icon

Assign ID to marker

Name Type Description
id string

setLabel(label)

Assign/change marker label text

Name Type Description
label cercalia.Label

Label content

Name Type Description
map cercalia.Map

setPosition(position)

Move the marker position to the specified via parameter

Name Type Description
position cercalia.LonLat

setSimpleLabel(simpleLabel)

SimpleLabel to add/modify related with the marker

Name Type Description
simpleLabel cercalia.SimpleLabel

setVisible(visible)

Show or hide the marker, including its SimpleLabel, Label or Popup.

Name Type Description
visible boolean

setZIndex(zIndex)

Change the zIndex value

Name Type Description
zIndex number

Show marker label