onViewedDistance   Go to object model Go to parent topic Go to previous topic Go to next topic

Syntax

onViewedDistance map, totalDistance, distances, units

Description

This event is fired when a user has finished viewing distances.

This topic describes this event for ActiveX Control. For Plug-In and Java Edition, see MGViewDistanceObserver.onViewedDistance.

Note that the event is fired only if the distances were measured using the viewDistance method or the UI menu commands. If the distances were measured using the viewDistanceEx method, onViewedDistanceEx is fired instead.

Applies To

ActiveX Control only

Parameters

map - The MGMap object for which the event occurred.

totalDistance - The total distance viewed.

distances - An MGCollection object containing all the sub-distances.

units - The units used to quantify the distance.

Error Codes

-1 (busy)

Example

To handle this event from the Autodesk MapGuide ActiveX Control, define the following VBScript and JavaScript functions:

<!--
The VBScript function handles the event from the ActiveX Control 
Control and then passes it to the JavaScript function.
-->
<SCRIPT LANGUAGE="VBScript">
Sub ObjectId_onViewedDistance(map, totalDistance, distances, units)
onViewedDistance map, totalDistance, distances, units
End Sub
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
function onViewedDistance(map, totalDistance, distances, units)
{
 // event handling code here...
}
</SCRIPT>

Where ObjectId is the ID of the embedded map specified as part of the HTML OBJECT tag. Refer to "Displaying Maps" in the Autodesk MapGuide Developer's Guide for details on how to embed the ActiveX Control using the OBJECT tag.

See Also

viewDistance