Class IWMeasuringControl

Extends IWControl.

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

IWMeasuringControl(map)

Method Detail

activate

void activate()

addPoint

void addPoint(coordinate)

afterAppend

void afterAppend()

deactivate

void deactivate()

formatDistance

object formatDistance(meter)

getInfoWindow

IWWindowControl getInfoWindow()

getRenderer

IWGraphisRenderer getRenderer()

hideInfoWindow

void hideInfoWindow()

reset

void reset()

setLastPoint

setLastPoint(point)

showInfoWindow

void showInfoWindow()

toString

void toString()

Event Detail

triggerOnDistanceChange

void triggerOnDistanceChange()

Source-Code Copyright 2007-2016 infoware GmbH - Documentation generated on Tue Nov 29 2022 14:20:14 GMT+0100 (MEZ)