|
|
distancetool = new MVDistanceTool(MVDistanceTool.IMPERIAL) ;
mapview.addDistanceTool(distancetool);
distancetool.setEventListener(MVEvent.NEW_SHAPE_POINT, getDistanceOrd);
distancetool.setEventListener(MVEvent.FINISH, finishAction);
distancetool.setEventListener(MVEvent.MODIFY, getDistanceOrd);
The JavaScript code that activates the distance tool is listed below.
<a href="javascript:distancetool.init();">Click here</a> to activate the distance tool and then start drawing on the map.