Oracle Maps example - Distance measuring tool

  • Click here to activate the distance tool and then start drawing on the map.
  • When you're finished, click the "Finish" link inside the distance measurement window to deactivate the distance tool, or click the "Clear" link to deactivate the distance tool and clear the measurement lines.
  • Check here to see the distance shape point coordinates whenever a new shape point is created or the existing ones are changed.

  • Instructions

    This demo shows you how to initiate a distance tool and draw simple shapes on the map.

    Source code

    The JavaScript code that creates the distance tool and adds event listeners is listed below.
        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.