MGViewDistanceExObserver.onViewedDistanceEx   Go to object model Go to parent topic

Syntax

public abstract void onViewedDistanceEx(MGMap map, double totalDistance, MGCollection distances, 
MGCollection points, String units, boolean useMcs)

Description

The view distance observer event method. This event is fired when a user has finished viewing distances.

This topic describes this event for Plug-In and Java Edition only. For ActiveX Control, see 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

Plug-In and Java Edition 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 Plug-In or Java Edition, a Java object that implements the MGViewDistanceExObserver interface must be established with a call to the setViewDistanceExObserver method. The observer Java object should include the following:

<class_definition> implements MGViewDistanceExObserver
{
// ...
public void onViewedDistanceEx(MGMap map,
 double totalDistance, 
 MGCollection distances, 
 MGCollection points,
 String units,
 boolean useMcs)
{
<... Event Handling Code Here >
}
// ...
}

The simplest way to include the observer object in a Web page is to implement it as an applet. See Advanced Examples for a fully functional observer object that supports all of the observer interfaces by forwarding the events back to JavaScript functions that have identical semantics to the ActiveX Control event handlers.

See Also

viewDistanceEx