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)

src/cercalia/marker.js, line 26
Name Type Description
options

Marker options

Name Type Description
draggable boolean | undefined

Boolean indicating if dragging is enabled or not.

icon cercalia.Icon | undefined

cercalia.Icon object, if not specified use the default value.

id string | undefined

Marker Id. If not specified, generates a automatic value.

label cercalia.Label | undefined

Label content.

onClick function | undefined

Function to execute on marker click.

onDoubleClick function | undefined

Function to execute on marker double click.

onDragEnd function | undefined

Function to execute when ends marker dragging.

onDragMove function | undefined

Function to execute during marker dragging.

onDragStart function | undefined

Function to execute on marker dragging start.

onDrop function | undefined

Function to execute on marker drop. Returns the position of dragged markers list

onMouseOut function | undefined

Function to execute on Mouse Out.

onMouseOver function | undefined

Function to execute on Mouse Over.

onRightClick function | undefined

Function to execute on marker right click.

popup cercalia.Popup | undefined

Marker popup.

position cercalia.LonLat

Position. Required.

simpleLabel cercalia.SimpleLabel | undefined

Marker Simple Label object.

zIndex number

Z-Index marker. Default value 200. Required.

Extends

Methods

addExtraIcon(icon)

src/cercalia/marker.js, line 912

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

Name Type Description
icon cercalia.Icon

Icon

addPopup(popup)

src/cercalia/marker.js, line 616
Name Type Description
popup cercalia.Popup

Popup to add to marker.

closePopup(opt_fade)

src/cercalia/marker.js, line 741

Close popup

Name Type Description
fade boolean

Indicates whether to apply 'fadeOut' animation effect

destroy()

src/cercalia/marker.js, line 793

Destroy popup

get(key){*}

src/cercalia/marker.js, line 895

Gets a value.

Name Type Description
key string

Key name.

Returns:
Value.

getClass(){string} inherited

src/cercalia/object.js, line 41
Returns:
Get Class name of object

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

src/cercalia/marker.js, line 938
Returns:
Return extra icons

getFeature(){ol.Feature}

src/cercalia/marker.js, line 288
Returns:
Object ol.Feature

getIcon(){cercalia.Icon}

src/cercalia/marker.js, line 585
Returns:
Icon.

getId(){string} inherited

src/cercalia/object.js, line 33
Returns:
Unique Id.

getLabel(){cercalia.Label}

src/cercalia/marker.js, line 850
Returns:
label Label assigned to th marker.

getMap(){cercalia.Map}

src/cercalia/marker.js, line 642
Returns:
The map where it's painted, if not returns null.

getPopup(){cercalia.Popup}

src/cercalia/marker.js, line 650
Returns:
Popup, if don't have returns null.

getPosition(){cercalia.LonLat}

src/cercalia/marker.js, line 305
Returns:
position The marker Array position [lat, lon].

getSimpleLabel(){cercalia.SimpleLabel}

src/cercalia/marker.js, line 607
Returns:
Returns cercalia.SimpleLabel if created. If not, returns null.

getZIndex(){number}

src/cercalia/marker.js, line 470
Returns:
CSS marker zIndex

hideLabel()

src/cercalia/marker.js, line 840

Hide marker label

isDraggable(){boolean}

src/cercalia/marker.js, line 530
Returns:
Boolean showing if marker it's draggable.

isDragging(){boolean}

src/cercalia/marker.js, line 875
Returns:
true if marker is dragging, otherwise false.

isVisible(){boolean}

src/cercalia/marker.js, line 903
Returns:
true if visible, else false.

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

src/cercalia/marker.js, line 367

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

Movement duration, in milliseconds (default value 2000ms)

callbackFn function

Callback function, when movement ends

centerMapDuringMovement boolean

Center map during movement. Default false.

numSteps number

Number of steps to animate. Default 100.

openPopup(opt_fade)

src/cercalia/marker.js, line 724

Open popup

Name Type Description
fade boolean

Indicates whether to apply 'fadeIn' animation effect

removeLabel()

src/cercalia/marker.js, line 859

Destroy the label object

set(key, value)

src/cercalia/marker.js, line 885

Sets a value

Name Type Description
key string

Key name.

value *

Value.

setDraggable(draggable)

src/cercalia/marker.js, line 478
Name Type Description
draggable boolean

Change marker to draggable state.

setIcon(icon)

src/cercalia/marker.js, line 574

Change the marker icon

Name Type Description
icon cercalia.Icon

Icon

setId(id)

src/cercalia/marker.js, line 297

Assign ID to marker

Name Type Description
id string

Id.

setLabel(label)

src/cercalia/marker.js, line 812

Assign/change marker label text

Name Type Description
label cercalia.Label

Label content

setOnDragEnd(fn)

src/cercalia/marker.js, line 224
Name Type Description
fn function

Callback function

setOnDragMove(fn)

src/cercalia/marker.js, line 216
Name Type Description
fn function

Callback function

setOnDragStart(fn)

src/cercalia/marker.js, line 208
Name Type Description
fn function

Callback function

setPosition(position)

src/cercalia/marker.js, line 337

Move the marker position to the specified via parameter

Name Type Description
position cercalia.LonLat

Position

setSimpleLabel(simpleLabel)

src/cercalia/marker.js, line 595

SimpleLabel to add/modify related with the marker

Name Type Description
simpleLabel cercalia.SimpleLabel

Simple Label.

setVisible(visible)

src/cercalia/marker.js, line 540

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

Name Type Description
visible boolean

Visible. (true or false).

setZIndex(zIndex)

src/cercalia/marker.js, line 460

Change the zIndex value

Name Type Description
zIndex number

Z-Index of marker.

showInfoMap()

src/cercalia/marker.js, line 664

showLabel()

src/cercalia/marker.js, line 830

Show marker label