Autodesk 15606-011408-9300 Developer Guide - Page 38
Map Access Using Java, Wrapper Java Applet
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 38 highlights
Map Access Using Java You can access maps using Java and the Autodesk MapGuide Viewer, Java Edition in several different ways, including using a wrapper Java applet, a peer Java applet, or a wrapper Java application. Wrapper Java Applet You can write a wrapper Java applet that uses the pre-installed Autodesk MapGuide Viewer, Java Edition and contains all the Autodesk MapGuide Viewer API methods. This approach enables the Autodesk MapGuide Viewer API to work on all operating systems and browsers. To run Autodesk MapGuide Viewer from a wrapper applet, code your wrapper to instantiate MGMapComponent. Then, in HTML, set the CODE value of the tag to the name of the wrapper applet. For a Java wrapper applet example, choose Help ➤ Contents ➤ Examples Advanced ➤ Java Edition Examples ➤ Example6 in the Autodesk MapGuide Viewer API Help. Peer Java Applet You can write a peer Java applet that runs Autodesk MapGuide Viewer, Java Edition. This approach is slightly simpler than driving Autodesk MapGuide Viewer, Java Edition from a wrapper applet, because, with a peer java applet, Autodesk MapGuide Viewer, Java Edition is automatically provided with browser services such as showDocument. Another benefit is that Autodesk MapGuide Viewer, Java Edition and the peer applet can exist in separate frames in the HTML document. To run Autodesk MapGuide Viewer from a peer applet, your HTML page needs to include the tag twice: to set the CODE value to MGMapApplet, and to set it to the name of the peer applet. Wrapper Java Application You can write a Java wrapper application that runs Autodesk MapGuide Viewer, Java Edition outside a browser. This approach is analogous to using Visual Basic to run Autodesk MapGuide Viewer ActiveX Control outside a browser. You can still have Internet access from a Java application outside a browser, but browser-specific functionality will not be available. To run Autodesk MapGuide Viewer from a wrapper application, the application must embed the MGMapComponent object and then implement the MGMapContext object interface so that MGMapComponent can use the methods defined in MGMapContext that are normally provided by the browser. 38 | Chapter 3 Accessing Maps