Hi Jose,
If you are using database please let us know, we just give suggestion for the shape file now.
I understand your meaning here, your “sublayer” should a group of features, so we have another solution here.
Because your datasource is sql database, I think you can do that like this:
MsSqlFeatureLayer layer1 = new MsSqlFeatureLayer(connectionString, tableName, featureIdColumn);
layer1.WhereClause = "where inspected_month = 'January'";
MsSqlFeatureLayer layer2 = new MsSqlFeatureLayer(connectionString, tableName, featureIdColumn);
layer2.WhereClause = "where inspected_month = 'March'";
This solution need add many layers into a overlay, so you can operate the status of single layer.
Or you can implement that like this:
PointStyle JanStyle = PointStyles.City1;
PointStyle MarStyle = PointStyles.City2;
ValueStyle value = new ValueStyle();
value.ColumnName = "inspected_month";
value.ValueItems.Add(new ValueItem("January", JanStyle));
value.ValueItems.Add(new ValueItem("March", MarStyle));
MsSqlFeatureLayer layer1 = new MsSqlFeatureLayer(connectionString, tableName, featureIdColumn);
layer1.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(value);
layer1.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// Hide January features
PointStyle MarStyle = PointStyles.City2;
ValueStyle value = new ValueStyle();
value.ColumnName = "inspected_month";
value.ValueItems.Add(new ValueItem("March", MarStyle));
layer1.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
layer1.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(value);
layer1.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// Add April features
PointStyle JanStyle = PointStyles.City1;
PointStyle MarStyle = PointStyles.City2;
PointStyle AprStyle = PointStyles.City3;
ValueStyle value = new ValueStyle();
value.ColumnName = "inspected_month";
value.ValueItems.Add(new ValueItem("January", JanStyle));
value.ValueItems.Add(new ValueItem("March", MarStyle));
value.ValueItems.Add(new ValueItem("April", AprStyle));
layer1.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
layer1.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(value);
layer1.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Wish that’s helpful, any question please let us know.
Regards,
Don