Autodesk 15606-011408-9300 Developer Guide - Page 168
Show Properties Function (showProperties), DWG Filtering Application showProperties Example Code
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 168 highlights
Show Properties Function (showProperties) The following are excerpts from the showProperties() function. This function gets and displays properties of selected map features in a table in the output frame of the Web page, including DWG properties associated with the DWG map layer. The basic operational flow of this function is as follows: 1 Write JavaScript and style sheet selection code to output frame. 2 Write output table headings. 3 Get the map and selected features using the getMap function and the map.getSelection, and sel.getMapObjectsEx(null) methods. 4 Iterate through the selected map features (map objects) and write the fea- ture(s) properties to the output table. In this example, we get the feature name and key using the MGMapObject.getName and getKey methods. 5 Get the layer name for current map feature. To do this, we first get the map layer of the selected feature using the MGMapObject.getMapLayer method. We then use the MGMapLayer.getName method. 6 Get the map layer and its DWG data source object. To do this we first get the map layer using map.getMapLayer with the layer name, then get the layer setup using mapLayer.getLayerSetup method. Then, we get the DWG data sources object of the layer using mapLayerSetup.getDwgDataSources. 7 Using MGDwgDataSources methods, we get the DWG properties of the map layer, including getDataSource, getDwg, getKeyColumn, getKeyColumnType, and getKeyTable. 8 Next, using the getLayerFilter method, we get the DWG layer filters used to display the current map view, and indicate that if no filter was applied if layerFilter is null. 9 Finally, we complete the table by listing the remaining DWG properties using the MGDwgDataSources methods getNameColumn, getNameTable, getUrlColumn, and getUrlTable. DWG Filtering Application showProperties Example Code // Show Properties Function // Shows properties of the selected map feature(s), including DWG properties of the layer function showProperties() { // Write javascript and style sheet selection code to output frame ... // Write table headings parent.outputframe.document.write (""); parent.outputframe.document.write (""); 168 | Chapter 7 Applications