| onDigitizedCircle |
|
onDigitizedCircle map, units, center, radius
This event is fired when the user has finished digitizing a circle.
It is initiated by a call to digitizeCircle.
This topic describes this event for ActiveX Control. For Plug-In and Java Edition, see MGDigitizeCircleObserver.onDigitizedCircle.
ActiveX Control only
map - The map object for which the event occurred.
units - A string containing the units in which the radius is provided, one of the following codes: M (meters), KM (kilometers), FT (feet), or MI (miles).
center - An MGPoint object for the longitude/latitude center of the digitized circle.
radius - The radius of the digitized circle (a String).
-1 (busy)
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_onDigitizedCircle(map, units, center, radius)
onDigitizedCircle map, units, center, radius
End Sub
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function onDigitizedCircle(map, units, center, radius)
{
// 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.
Warning: Because the radius parameter provided by onDigitizedCircle is of type String, you may need to explicitly convert its type to float before passing it to other methods within the event handling code, or before performing mathematical manipulations to it. For example, you must convert its type to float before passing it to the MGMapObject.addCirclePrimitive method as follows:
<SCRIPT LANGUAGE="JavaScript">
function onDigitizedCircle(map, units, center, radius)
{
...
radius = parseFloat(radius);
obj.addCirclePrimitive(center, useMCS, radius, units, numLines);
...
}
</SCRIPT>