Class: IWMarker

IWMarker

IWMarker is a simple implementation of the IWOverlay interface. An IWMarker can be used to mark a location on the map.

The marker can be customize with an image, or a set of images depending on the zoom level of the map. The optional parameter label may be used to display a label on the marker, e.g. the number of a hit in a hit list. This label has to be formatted by CSS; see tutorial for an example.


new IWMarker(map, coordinate, label)

Creates a new IWMarker object.
Parameters:
Name Type Description
map IWMap
coordinate IWCoordinate
label String a label to display in the marker (optional)
Since:
  • 0.66

Extends

Methods


addScaleDependentIcon(scaleDependentIcon)

Adds a scale dependent icon to the marker.
Parameters:
Name Type Description
scaleDependentIcon IWScaleDependentIcon
Returns:
Type
void

afterAppend()

Callback method. This method will be directly called by the addOverlay method after the overlay has been added to the map. Overwrite this method to react on this event.
Inherited From:
Overrides:
Returns:
Type
void

afterRemove()

Callback method. This method will be directly called by the removeOverlay method after the overlay has been removed from the map. Overwrite this method to react on this event.
Inherited From:
Returns:
Type
void

allowDraggingOutsideParent(isDraggingOutsideParentAllowed)

Enables or disables the dragging mode for elements out of the parent node. The default value is false.
Parameters:
Name Type Description
isDraggingOutsideParentAllowed boolean true if this element can be dragged out of the parent node
Inherited From:
Returns:
Type
void

beforeAppend()

Callback method. This method will be directly called by the addOverlay method before the overlay has been added to the map. Overwrite this method to react on this event.
Inherited From:
Returns:
Type
void

beforeRemove()

Callback method. This method will be directly called by the removeOverlay method before the overlay has been removed from the map. Overwrite this method to react on this event.
Inherited From:
Overrides:
Returns:
Type
void

destroy()

Destroys the marker. Releases all DOM references and event listeners.
Returns:
Type
void

destroyMapElement()

Releases all event listeners from the container.
Inherited From:
Returns:
Type
void

destroyOverlay()

Destroys the overlay.
Inherited From:
Returns:
Type
void

getContainer()

Returns the DIV container for this map element.
Inherited From:
Returns:
the container
Type
HTMLDivElement

getCoordinate()

Returns the coordinate for this overlay.
Inherited From:
Returns:
Type
IWCoordinate

getDefaultIcon()

Returns the default icon for this marker.
Returns:
Type
IWIcon

getDragButton()

Returns the drag button for this element.
Inherited From:
Returns:
Type
number

getDraggableContainer()

Returns the draggable container for this element.
Inherited From:
Returns:
Type
HTMLDivElement

getDraggingBounds()

Returns the dragging area.
Inherited From:
Returns:
Type
IWSize

getHotspot()

Returns the hotspot of the container object.
Inherited From:
Returns:
Type
IWPoint

getId()

Returns the id for this element.
Inherited From:
Returns:
Type
String

getLayer()

Returns the layer number of this overlay. The layer number defines the zIndex of the container. It was set by calling the addOverlay() method from the IWOverlayLayer.
Inherited From:
Returns:
the layer number
Type
number

getOnMouseMoveContainer()

Returns the container which will be registered for onmousemove events.
Inherited From:
Returns:
the container on which the onmousemove events are registered.
Type
DOMElement

getParent()

Returns the parent container for this element.
Inherited From:
Returns:
parent
Type
HTMLDivElement

getRotation()

Returns the rotation of the container object.
Inherited From:
Returns:
Type
Number

getScaleDependentIcons()

Returns the scale dependent icons.
Returns:
Type
Array.<IWScaleDependentIcon>

isDisplayed()

Checks if the element has been added to the DOM tree.
Inherited From:
Returns:
Type
boolean

isDraggable()

Returns true if this element is draggable, otherwise the return value is false.
Inherited From:
Returns:
true if this element is draggable
Type
boolean

isDraggingOutsideParentAllowed()

Returns true if this element can be dragged out of the parent node.
Inherited From:
Returns:
true if this control can be dragged out of the parent node
Type
boolean

isPrintable()

Returns true if the element is printable otherwise false.
Inherited From:
Returns:
Type
boolean

isVisible()

Returns true if the container is visible, otherwise false.
Inherited From:
Returns:
true if this container is visible
Type
boolean

onClick(event)

Callback method for onclick events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

onContextMenu(event)

Callback method for oncontextmenu events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

onDblClick(event)

Callback method for ondblclick events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

onMouseDown(event)

Callback method for onmousedown events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

onMouseMove(event)

Callback method for onmousemove events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

onMouseOut(event)

Callback method for onmouseout events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

onMouseOver(event)

Callback method for onmouseover events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

onMouseUp(event)

Callback method for onmouseup events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

onMouseWheel(event)

Callback method for onmousewheel events.
Parameters:
Name Type Description
event Event
Inherited From:
Returns:
Type
void

redraw()

Redraws the overlay. Calculates and sets the new pixel position where the overlay appears on the map.
Inherited From:
Returns:
Type
void

setContainer(newContainer)

Sets the DIV container for this map element.
Parameters:
Name Type Description
newContainer HTMLDivElement
Inherited From:
Returns:
Type
void

setContainerClassname(classname)

Sets the classname of the container. Only use this method to modify the containers classname because it preserves the classname set by setPrintable(false).
Parameters:
Name Type Description
classname
Inherited From:

setCoordinate(coordinate)

Sets the coordinate for this overlay.
Parameters:
Name Type Description
coordinate IWCoordinate
Inherited From:
Returns:
Type
void

setDefaultIcon(icon)

Sets the default icon.
Parameters:
Name Type Description
icon IWIcon
Returns:
Type
void

setDragButton(button)

Sets the drag button for this element. If you want to drag the object with the left and right mouse button you must call the setDragButton() method with the parameter IWButton.LEFT + IWButton.RIGHT.
Parameters:
Name Type Description
button number the new drag button. The default drag button is IWButton.LEFT.
Inherited From:
Returns:
Type
void

setDraggable(isDraggable)

Sets an flag to indicate whether this element is draggable or not.
Parameters:
Name Type Description
isDraggable boolean
Inherited From:
Returns:
Type
void

setDraggableContainer(draggableContainer)

Sets the draggable container for this element. The default value is the container returned by getContainer().
Parameters:
Name Type Description
draggableContainer HTMLDivElement the draggable container
Inherited From:
Returns:
Type
void

setDraggingBounds(bounds)

Sets the dragging area relative to the parent container.
Parameters:
Name Type Description
bounds IWSize the dragging area
Inherited From:
Returns:
Type
void

setHotspot(hotspot)

Sets the hotspot of the container object.
Parameters:
Name Type Description
hotspot IWPoint
Inherited From:
Returns:
Type
void

setId(id)

Sets the id for this element.
Parameters:
Name Type Description
id String
Inherited From:
Returns:
Type
void

setLabel(label)

Sets a label text which is displayed on the marker.
Parameters:
Name Type Description
label the text to display
Returns:
Type
void

setOnMouseMoveContainer(container)

Sets the container which will be registered for onmousemove events. By default the onmousemove events will be registered on the window.document container.
Parameters:
Name Type Description
container DOMElement
Inherited From:
Returns:
Type
void

setParent()

Sets the parent container for this element.
Inherited From:
Returns:
newParent
Type
HTMLDivElement

setPrintable(printable)

Enables or disables the element for printing.
Parameters:
Name Type Description
printable boolean
Inherited From:
Returns:
Type
void

setRotation(rotation)

Sets the rotation of the container object.
Parameters:
Name Type Description
rotation Number
Inherited From:
Returns:
Type
void

setScaleDependentIcons(newScaleDependentIcons)

Sets the scale dependent icons to the marker.
Parameters:
Name Type Description
newScaleDependentIcons Array.<IWScaleDependentIcon>
Returns:
Type
void

setVisible(visible)

Sets the visibility of this control to visible or hidden.
Parameters:
Name Type Description
visible boolean
Inherited From:
Returns:
Type
void

toString()

Returns a string representation of this marker.
Returns:
Type
String