DWG Filtering Application
|
167
7
Set the layer filter from the selected filter list using the
dwgMapLayerDataSource.setLayerFilter(filterList)
method.
8
Refresh the map using the
map.refresh
method.
DWG Filtering Application selChanged Example Code
//
Selection Changed Function
// Called whenever items are selected or deselected in the list box
function selChanged()
{
var map = getMap();
// Use the single map layer Floor Plan
var mapLayer = map.getMapLayer("Floor Plan");
// Get DWG data source object for the layer
var mapLayerSetup = mapLayer.getLayerSetup();
var dwgMapLayerDataSource = mapLayerSetup.getDwgDataSources();
// Create a collection object to hold filters selected fromlist box
var mapDwgLayerFilters = map.createObject("MGCollection");
// Iterate through list box selections and add each to the collection
var selOptions = document.forms[0].filters.options;
for (var i = 0; i < selOptions.length; i++)
{
if (selOptions[i].selected)
{
var selectedFilter = selOptions[i].value;
if (selectedFilter != null)
mapDwgLayerFilters.add(selectedFilter);
}
}
// Create comma-delimited string containing selected filters.
var filterList = "";
for (var i = 0; i < mapDwgLayerFilters.size(); i++)
{
var filter = mapDwgLayerFilters.item(i);
if (i == mapDwgLayerFilters.size() - 1)
filterList = filt filter;
else
filterList = filt ", ";
}
// Set the layer filter from the selected filter list
dwgMapLayerDataSource.setLayerFilter(filterList);
map.refresh();
}
Summary of Contents for 15606-011408-9300 - MAP R6.3 UPG
Page 1: ...15306 010000 5060 October 2001 Autodesk MapGuide Release 6 Developer s Guide ...
Page 6: ...vi ...
Page 16: ...16 ...
Page 30: ...30 ...
Page 84: ...84 ...
Page 134: ...134 ...
Page 202: ...202 ...