Autodesk 15606-011408-9300 Developer Guide - Page 33
Map Access for ActiveX Control and Plug-In, getMap, MGMapLayer.getMap, Parcel Data
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 33 highlights
If your embedded map had the name map, the code to access the map on a simple, frameless HTML page would look like this: function getMap() { if (navigator.appName() == "Netscape") return document.map; else return window.map; } If your application had multiple HTML frames, the code to access the same map in a frame called Left would look like this: function getMap() { if (navigator.appName == "Netscape") return parent.Left.document.map; else return parent.Left.map; } Note We chose the name getMap for our function, but the name can be anything you want, as long as it follows JavaScript naming conventions. Be careful to not to confuse the getMap function with MGMapLayer.getMap, a predefined Autodesk MapGuide Viewer API method. After this function is defined, any other JavaScript method can simply call getMap to retrieve the map object. For example, you can create a variable to represent the map, and then use getMap to set the value of that variable: var map = getMap(); You can then apply methods to that variable to work with the map. For example, the following function displays an Autodesk MapGuide report called Parcel Data: function runReport() { var jb_map = getMap(); // assign map to variable jb_map.viewReport('Parcel Data'); // call method from variable } Or you could bypass the variable assignment and use getMap directly: function runReport() { getMap().viewReport('Parcels'); // use getMap() return value } Map Access for ActiveX Control and Plug-In | 33