Autodesk 15606-011408-9300 Developer Guide - Page 41
Accessing the Plug-In from a Java Applet, Communicating with the Plug-In from a Java Applet
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 41 highlights
Accessing the Plug-In from a Java Applet You can access Autodesk MapGuide Viewer Plug-In from your Java applet. To access Autodesk MapGuide Viewer Plug-In 1 Copy the npmapv32.zip file installed in your Netscape Plugins folder to a folder in your Java development environment, so that your Java compiler can import Autodesk MapGuide classes to your Java applet. 2 Write a setMap function in your applet that takes a parameter referencing the map and then storing the reference for future use. For example: Private MGMap myUSAMap; Public void setMap (MGMap map1) { myUSAMap = map1; } 3 Add your applet to the HTML page. You must include the MAYSCRIPT attribute in the APPLET tag to give the applet permission to interact with JavaScript. For example: . . . 4 If you have not already done so, embed Autodesk MapGuide Viewer PlugIn in the HTML page as shown in the following example (for more information, see "Embedding a Map," on page 22). Use the following code: 5 Enter the following code into your HTML page: function Init() { var map = document.map; var obs = document.obs; obs.setMap(map); }