onViewedDistanceEx   Go to object model Go to parent topic Go to previous topic

Syntax

onViewedDistanceEx map, totalDistance, distances, units, useMcs

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 MGViewDistanceExObserver.onViewedDistanceEx.

Note that the event is fired only if the distances were measured using the viewDistanceEx method. If the distances were measured using the viewDistance method (or the user interface menu commands), onViewedDistance 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 type-double objects representing all the sub-distances.

points - An MGCollection containing MGPoint objects representing all the points used in the view distance action; the points will be in MCS or lat/lon coordinates, based on the setting of useMcs.

units - The units used to quantify the distance.

useMcs - A flag to indicate whether the points are in MCS or lat/lon.

Error Codes

none

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_onViewedDistanceEx(map, totalDistance, distances, units, useMcs)
onViewedDistanceEx map, totalDistance, distances, units, useMcs
End Sub
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
function onViewedDistanceEx(map, totalDistance, distances, units, useMcs)
{
 // 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

viewDistanceEx