Hi Esri and ArcGISRuntime enthusiasts!
We have a problem when using GraphicsOverlay.FeatureReduction.MaxScale. When this value is set, affected graphics seem to have their default LabelDefinition hidden when clustering is not active.
Given the sample below, can anyone spot an error in the code, or is there a known problem with this?
Thanks in advance for any help!
public GraphicsOverlay CreateGraphicsOverlay()
{
var graphicsOverlay = new GraphicsOverlay
{
IsVisible = true,
Id = "points",
Renderer = new SimpleRenderer(new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Square, Color.Blue, 16).ToMultilayerSymbol()),
FeatureReduction = new ClusteringFeatureReduction(new SimpleRenderer
{
Symbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.IndianRed, 16)
})
{
//Label when clustering
LabelDefinitions =
{
new LabelDefinition
(
labelExpression: new SimpleLabelExpression(simpleExpression: "[cluster_count] CONCAT \" Items\""),
textSymbol: new TextSymbol {Color = Color.Black, Size = 12}
)
{
Placement = LabelingPlacement.PointCenterCenter,
}
},
MinSymbolSize = 50,
//BUG! WHEN THIS IS SET, MANY LABELS ARE NOT VISIBLE
MaxScale = 30_000,
},
//Label for individual points
LabelsEnabled = true,
LabelDefinitions =
{
new LabelDefinition
(
labelExpression: new SimpleLabelExpression("[Name]"),
textSymbol: new TextSymbol
{
Color = Color.Black,
Size = 12,
FontWeight = FontWeight.Bold,
BackgroundColor = Color.White,
HaloColor = Color.White,
HaloWidth = 1,
}
)
{
Placement = LabelingPlacement.PointBelowCenter,
},
},
RenderingMode = GraphicsRenderingMode.Dynamic,
};
var random = new Random();
for (var i = 0; i < 100; i++)
{
const double OsloN = 59.95138;
const double OsloS = 59.91070;
const double OsloE = 10.80758;
const double OsloW = 10.70544;
var x = OsloW + random.NextDouble() * (OsloE - OsloW);
var y = OsloS + random.NextDouble() * (OsloN - OsloS);
var graphic = new Graphic(new MapPoint(x, y, SpatialReferences.Wgs84))
{
IsVisible = true,
};
graphic.Attributes["Name"] = $"Point {i}";
graphicsOverlay.Graphics.Add(graphic);
}
return graphicsOverlay;
}
Solved! Go to Solution.
Thanks for reporting the issue, I am able to reproduce the problem. I have logged an internal issue and will investigate this shortly.
Thanks,
Preeti
Thanks for reporting the issue, I am able to reproduce the problem. I have logged an internal issue and will investigate this shortly.
Thanks,
Preeti
Thanks for looking into this!