flexview属性表格绑定图层layer时候,怎么排除某些特定的operationallayers

1.BusinessTableWidget.xml配置文件:

<?xml version="1.0" ?>
<configuration>
<excludelayer>管道</excludelayer>
<excludelayer>库区布置点</excludelayer>
</configuration>

2.BusinessTableWidget.mxml文件:


////////////////////////////////////////////获取所有的绑定到表格的图层

private function getLayers(layers:ArrayCollection):Array
{
// all the layers except basemaps                
var result:Array = [];
var includeLayer:Boolean;
var dynamicBaseMapLayers:Array = [];
for (var i:int = layers.length - 1; i >= 0; i--)
{
includeLayer = true;
var layer:Layer = layers.getItemAt(i) as Layer;
for (var n:int = 0; n < configData.basemaps.length; )
{
if (configData.basemaps[n].label == layer.id)
{
if (layer is ArcGISDynamicMapServiceLayer)
{
dynamicBaseMapLayers.push(layer);
}
includeLayer = false;
break;
}
else
{
n++;
}
}
if (includeLayer && !isLayerPartOfExcludeLayers(layer.name) && (layer is FeatureLayer || layer is ArcGISDynamicMapServiceLayer))
{
result.push(layer);
}
}
for each (var dynamicBaseMapLayer:ArcGISDynamicMapServiceLayer in dynamicBaseMapLayers.reverse())
{
if (!isLayerPartOfExcludeLayers(dynamicBaseMapLayer.name))
{
result.push(dynamicBaseMapLayer);
}
}
return result;
}


/////////////////////////////////////////////////////////判断是否包含排除的图层

private function isLayerPartOfExcludeLayers(layerName:String):Boolean
{
var result:Boolean;

// loop through all the excludeLayers
for (var n:int = 0; n < excludeLayers.length; )
{
if (layerName == excludeLayers[n])
{
result = true;
break;
}
else
{
n++;
}
}

return result;
}

      备注:

      GIS技术交流QQ群:432512093

      GIS论坛:http://arcgis.c.ev123.com/vip_arcgis.html


你可能感兴趣的:(Flex,flexview)