Marc,
Welcome to Map Suite discussion forum, any questions please feel free to post here.
There are two ways to manage it.
1. ClassBreakStyle is right for you, but it uses “Double” for compare. I think we can make a CustomClassBreakStyle inherited from ClassBreakStyle to overwrite the DrawCore method to make sure it can apply to DateTime. Things in my mind are that we can add a new Column or change the “TIMETAG” column value to double before DrawCore method. This is the simpler way I think.
public class CustomClassBreakStyle : ClassBreakStyle
{
public CustomClassBreakStyle(string columnName)
: this(columnName, BreakValueInclusion.IncludeValue)
{
}
public CustomClassBreakStyle(string columnName, BreakValueInclusion breakValueInclusion)
: this(columnName, breakValueInclusion, new Collection<ClassBreak>())
{
}
public CustomClassBreakStyle(string columnName, BreakValueInclusion breakValueInclusion, Collection<ClassBreak> classBreaks)
: base(columnName, breakValueInclusion, classBreaks)
{
}
protected override void DrawCore(System.Collections.Generic.IEnumerable<Feature> features, GeoCanvas canvas, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInThisLayer, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInAllLayers)
{
// Change the "TIMETAG" value to double type
foreach (Feature feature in features)
{
string dateTime = feature.ColumnValues["TIMETAG"];
double OADate = Convert.ToDateTime(dateTime).ToOADate();
feature.ColumnValues["TIMETAG"] = OADate.ToString(System.Globalization.CultureInfo.InvariantCulture);
}
base.DrawCore(features, canvas, labelsInThisLayer, labelsInAllLayers);
}
}
2. Another way is doing the spatial query to filter the features by Date Range. Please refer to the installation sample “QueryingFeatureLayers/ExecuteASqlQuery.aspx” for detail.
Thanks,
Johnny