Is there a way like in the image layers to set a global transparency for a featurelayer? How can be the easiest way to do that?
How is the easiest way to set global trasparency on a featurelayer?
There are different ways you can set the transparency on a feature layer. For example, if you have an area based layer, you can use AreaStyles with an outline and a transparent fill or no outline and a semi transparent fill. You pretty much have full control on how you want to display your layer. See the code example below.
InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer();
//AreaStyle with black outline and transparent fill
AreaStyle transparentFillAreaStyle = new AreaStyle(new GeoPen(GeoColor.StandardColors.Black, 2),
new GeoSolidBrush(GeoColor.StandardColors.Transparent));
//AreaStyle with no outline and semi transparent red fill
AreaStyle semiTransparentFillAreaStyle = new AreaStyle(new GeoSolidBrush(GeoColor.FromArgb(150, GeoColor.StandardColors.Red)));
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = transparentFillAreaStyle; //semiTransparentFillAreaStyle;
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;