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 iconcercalia.Icon Icon
-
addPopup(popup)
-
Name Type Description popupcercalia.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.SimpleLabelif created. If not, returnsnull.
-
getZIndex(){number}
-
Returns:
CSS marker zIndex
-
hasExtraIcons(){boolean}
-
Returns:
trueif 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:
trueif 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 positioncercalia.LonLat Coordinate.
durationnumber | undefined optional Movement duration, in milliseconds (default value 2000ms)
callbackFnfunction | undefined optional Callback function, when movement ends
centerMapDuringMovementboolean | undefined optional Center map during movement. Default
false.numStepsnumber | 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 draggableboolean -
setIcon(icon)
-
Change the marker icon
Name Type Description iconcercalia.Icon -
setId(id)
-
Assign ID to marker
Name Type Description idstring -
setLabel(label)
-
Assign/change marker label text
Name Type Description labelcercalia.Label Label content
-
setMap(map)
-
Name Type Description mapcercalia.Map -
setPosition(position)
-
Move the marker position to the specified via parameter
Name Type Description positioncercalia.LonLat -
setSimpleLabel(simpleLabel)
-
SimpleLabel to add/modify related with the marker
Name Type Description simpleLabelcercalia.SimpleLabel -
setVisible(visible)
-
Show or hide the marker, including its SimpleLabel, Label or Popup.
Name Type Description visibleboolean -
setZIndex(zIndex)
-
Change the zIndex value
Name Type Description zIndexnumber -
showLabel()
-
Show marker label