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()
-
Destroy popup
-
getClass(){string}
-
Returns:
ClassName:cercalia.Marker
-
getExtraIcons(){Array.<cercalia.Icon>}
-
Returns:
Return extra icons
-
getFeature(){ol.Feature}
-
Returns:
Objectol.Feature
-
getIcon(){cercalia.Icon}
-
Returns:
Icon.
-
getId(){string}
-
Returns:
Marker ID. If specified, if not returns null.
-
getLabel(){cercalia.Label}
-
Returns:
label Label assigned to th marker.
-
getMap(){cercalia.Map}
-
Returns:
The map where it's painted, if not returnsnull
.
-
getPopup(){cercalia.Popup}
-
Returns:
Popup, if don't have returnsnull
.
-
getPosition(){cercalia.LonLat}
-
Returns:
position The marker Array position[lat, lon]
.
-
getSimpleLabel(){cercalia.SimpleLabel}
-
Returns:
Returnscercalia.SimpleLabel
if created. If not, returnsnull
.
-
getZIndex(){number}
-
Returns:
CSS marker zIndex
-
hasExtraIcons(){boolean}
-
Returns:
true
if extra icons.
-
hideLabel()
-
Hide marker label
-
isDraggable(){boolean}
-
Returns:
Boolean showing if marker it's draggable.
-
isDragging()
-
Returns:
true if marker is dragging, otherwise false.
-
isVisible(){boolean}
-
Returns:
true
if visible, elsefalse
.
-
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
. -
onDragEnd()
-
-
onDragMove()
-
-
onDragStart()
-
-
redraw()
-
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 -
setId(id)
-
Assign ID to marker
Name Type Description id
string -
setLabel(label)
-
Assign/change marker label text
Name Type Description label
cercalia.Label Label content
-
setMap(map)
-
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 -
showLabel()
-
Show marker label