I created the custom style below and I have many elements represented along map. Even though there are many elements near each other the custom style never call the method DrawCore with more than one feature element. The variable features below always contain only a single element. I suppose that’s bad for the performance of the design. How can I setup the map to call this method DrawCore with more elements to be drawn at the same time?
public class ElementDrawer : TextStyle
{
public ElementDrawer(string identifierColumnName)
{
TextColumnName = identifierColumnName;
}
protected override void DrawCore(IEnumerable<feature> features, GeoCanvas canvas,
Collection<simplecandidate> labelsInThisLayer,
Collection<simplecandidate> labelsInAllLayers)
{
foreach (var feature in features)
{
…
}
}
}</simplecandidate></simplecandidate></feature>
CustomStyle draws only a single feature at a time
Hi Douglas,
Thanks for your post, would you please try to set :
TextStyle.OverlappingRule= LabelOverlappingRule.AllowOverlapping;?
Now there should be more elements now.
Thanks,
Summer
Thanks Summer but not resolved for TextStyle, continuing with the same problem, moreover, I would like a solution that worked well for LineStyle too.
Hi Douglas,
Thanks for your report, I tried to recreate your problem with our data, but the problem didn't show up, attached is our test result for your info, would you please provide us your data and code for a further test?
Waiting for your further information.
Best Regards
Summer
I know what happened with me. It always happen when a use a customized style like below (dotted and monophasic are customized):
var valueStyle = new ValueStyle();
valueStyle.ColumnName = "ColumnName";
valueStyle.RequiredColumnNames.Clear();
valueStyle.ValueItems.Clear();
valueStyle.ValueItems.Add(new ValueItem("1", dotted));
valueStyle.ValueItems.Add(new ValueItem("2", monophasic));
After I saw that the class CableValueStyle below receive the data correctly so I can treat the data in my way:
var valueStyle = new CableValueStyle();
valueStyle.ColumnName = "ColumnName";
valueStyle.RequiredColumnNames.Clear();
valueStyle.ValueItems.Clear();
valueStyle.ValueItems.Add(new ValueItem("1", dotted));
valueStyle.ValueItems.Add(new ValueItem("2", monophasic));
Hi Douglas,
Great to hear the problem is sorted out, if you have any more question, please feel free to let us know.
Best Regards
Summer