Setting Up Event Handlers
|
73
To use Autodesk MapGuide detection and event observer applet
1
Embed the observer applet in your Web page, assigning a specific name to
it with the
NAME
attribute of the
<APPLET>
tag. If you are going to use
both types of applets, you must give them different names and use the
correct name in your method calls after you have detected which
Autodesk MapGuide Viewer your client is running.
2
Use the detection applet to determine which Autodesk MapGuide Viewer
(Autodesk MapGuide Viewer Plug-In or Autodesk MapGuide Viewer, Java
Edition) is running on the client machine.
3
Once you have detected which Autodesk MapGuide Viewer is running on
a client machine, invoke the event observer applet by calling a set
observer method like
setSelectionChangedObserver
or a method that
invokes an event, such as
digitizePolylineEx
.
For example, the following code shows how to check the Autodesk
MapGuide Viewer version and install the appropriate event observer applet
for Autodesk MapGuide Viewer Plug-In or Autodesk MapGuide Viewer, Java
Edition:
Installing Plug-In and Java Editions Observer Applets
<SCRIPT LANGUAGE="JavaScript">
// Embed the detect applet to check if the
// Autodesk MapGuide Viewer, Java Edition is installed
document.write('<APPLET');
document.write(' CODEBASE="detect_class"');
document.write(' ARCHIVE="MGDetectClass.zip"');
document.write(' CODE=MGDetectClass');
// Extract result from detector
tempurl = document.URL;
index = tempurl.indexOf("DETECTED=");
result = tempurl.substring(index, tempurl.length);
if (result == "DETECTED=true")
{
// The Autodesk MapGuide Viewer, Java Edition was installed,
// so we embed the Autodesk MapGuide Viewer, Java Edition
// Observer Applet and name it obsJava
document.write("<Applet CODE=\"MapGuideObserver6J.class\"
WIDTH=2 HEIGHT=2 NAME=\"obsJava\" MAYSCRIPT>");
document.write("</Applet>");
// After the page loads, the browser automatically calls
// the onLoad function.
// onLoad calls the setSelectionChangedObserver method
// from MGMap, providing the
Содержание 15606-011408-9300 - MAP R6.3 UPG
Страница 1: ...15306 010000 5060 October 2001 Autodesk MapGuide Release 6 Developer s Guide ...
Страница 6: ...vi ...
Страница 16: ...16 ...
Страница 30: ...30 ...
Страница 84: ...84 ...
Страница 134: ...134 ...
Страница 202: ...202 ...