SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A control element which allows the user to measure distances on the map by adding measure points.
This class is part of the module controls.
This class requires the package graphics. See the section about modules in the FAQ for details.
Constructor Summary | |
IWMeasuringControl(map)
Creates a new measuring control. |
Method Summary | |
void
|
activate()
Activates the measuring control and opens the info window control. |
void
|
addPoint(coordinate)
Adds a new measure point at the end of the polyline. |
void
|
afterAppend()
Overwrites the afterAppend method from IWControl and creates the GUI after the
control has been added to the map.
|
void
|
deactivate()
Deactivates the measuring control and closes the info window control. |
object
|
formatDistance(meter)
Formats the specified distance value (in meters) and returns an object with a distance value and a unit. Example: control.formatDistance(12050) will return { distance: 12.05, unit: 'km' }. |
IWWindowControl
|
getInfoWindow()
Returns the info window control. |
IWGraphisRenderer
|
getRenderer()
Returns the graphic renderer. |
void
|
hideInfoWindow()
Hides the InfoWindow. |
void
|
reset()
Deletes the polyline and sets the distance to zero. |
|
setLastPoint(point)
undocumented |
void
|
showInfoWindow()
Displays the InfoWindow (default). |
void
|
toString()
Returns a string representation of this object. |
Event Summary | |
void
|
triggerOnDistanceChange()
The onDistanceChange event is fired after the distance has been changed. Register an event listener with IWEventManager.addListener(theMeasuringSegment, 'ondistancechange', yourHandlerMethod(event)); to receive the event. |
Methods inherited from class IWMapElement |
isDisplayed() |
getParent() |
setParent(parent) |
isVisible() |
setVisible(visible) |
setPrintable(printable) |
isPrintable() |
setContainerClassname(classname) |
getContainer() |
setContainer(newContainer) |
setId(id) |
getId() |
onContextMenu(event) |
onMouseUp(event) |
onMouseDown(event) |
onMouseMove(event) |
onMouseOut(event) |
onMouseOver(event) |
onClick(event) |
onDblClick(event) |
onSelect(event) |
onMouseWheel(event) |
beforeAppend() |
beforeRemove() |
afterRemove() |
destroyMapElement() |
registerEvents(container) |
Methods inherited from class IWControl |
isControl() |
isRedrawable() |
setRedrawable(isRedrawable) |
getPadding() |
setPadding(newPadding) |
setFirstOrientation(alignment) |
getFirstOrientation() |
setSecondOrientation(alignment) |
getSecondOrientation() |
getName() |
Constructor Detail |
IWMeasuringControl(map)
IWMap map
Method Detail |
void activate()
void
void addPoint(coordinate)
IWCoordinate coordinate
void
void afterAppend()
afterAppend
method from IWControl
and creates the GUI after the
control has been added to the map.
void
void deactivate()
void
object formatDistance(meter)
Example: control.formatDistance(12050) will return { distance: 12.05, unit: 'km' }.
number meter
- the distance in meters
object
IWWindowControl getInfoWindow()
IWWindowControl
IWGraphisRenderer getRenderer()
IWGraphisRenderer
renderer
void hideInfoWindow()
void
void reset()
void
setLastPoint(point)
point
void showInfoWindow()
void
void toString()
void
Event Detail |
void triggerOnDistanceChange()
Register an event listener with IWEventManager.addListener(theMeasuringSegment, 'ondistancechange', yourHandlerMethod(event)); to receive the event.
void