Ondrej,
Hope the following code makes sense. Any questions please let me know.
MsSql2008FeatureLayer layer1 = new MsSql2008FeatureLayer("[ConectionString]", "[TableName]", "IdColumn");
layer1.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(GetValueStyle("1", AreaStyles.Country1));
layer1.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
MsSql2008FeatureLayer layer2 = new MsSql2008FeatureLayer("[ConectionString]", "[TableName]", "IdColumn");
layer2.ZoomLevelSet.ZoomLevel02.CustomStyles.Add(GetValueStyle("2", AreaStyles.Country2));
layer2.ZoomLevelSet.ZoomLevel02.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
MsSql2008FeatureLayer layer3 = new MsSql2008FeatureLayer("[ConectionString]", "[TableName]", "IdColumn");
layer3.ZoomLevelSet.ZoomLevel03.CustomStyles.Add(GetValueStyle("3", AreaStyles.County1));
layer3.ZoomLevelSet.ZoomLevel03.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
MsSql2008FeatureLayer layer4 = new MsSql2008FeatureLayer("[ConectionString]", "[TableName]", "IdColumn");
layer4.ZoomLevelSet.ZoomLevel04.CustomStyles.Add(GetValueStyle("4", AreaStyles.County2));
layer4.ZoomLevelSet.ZoomLevel04.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
MsSql2008FeatureLayer layer5 = new MsSql2008FeatureLayer("[ConectionString]", "[TableName]", "IdColumn");
layer5.ZoomLevelSet.ZoomLevel05.CustomStyles.Add(GetValueStyle("5", AreaStyles.Crop1));
layer5.ZoomLevelSet.ZoomLevel05.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay overlay = new LayerOverlay();
overlay.Layers.Add(layer1);
overlay.Layers.Add(layer2);
overlay.Layers.Add(layer3);
overlay.Layers.Add(layer4);
overlay.Layers.Add(layer5);
Map1.CustomOverlays.Add(overlay);
private ValueStyle GetValueStyle(string columnValue, Style style)
{
ValueStyle style = new ValueStyle();
style.ColumnName = "Category";
style.ValueItems.Add(new ValueItem(columnValue, style));
return style;
}
Thanks,
Howard