/** Update the drawing while moving the mouse. */
public void onMouseMove(MouseMoveEvent event) {
if (isMeasuring() && distanceLine.getOriginalLocation() != null) {
Geometry geometry = (Geometry) distanceLine.getOriginalLocation();
Coordinate coordinate1 = geometry.getCoordinates()[distanceLine.getGeometry().getNumPoints() - 1];
Coordinate coordinate2 = getWorldPosition(event);
lineSegment.setGeometry(getFactory().createLineString(new Coordinate[] { coordinate1, coordinate2 }));
mapWidget.render(mapWidget.getMapModel(), RenderGroup.VECTOR, RenderStatus.UPDATE);
label.setDistance(tempLength, (float) ((Geometry) lineSegment.getOriginalLocation()).getLength());
}
}