Hi!
In 15.0.0-beta232, FeatureLayerTranslator translates a zoom level’s DefaultAreaStyle/DefaultLineStyle/DefaultPointStyle/DefaultTextStyle alongside its CustomStyles. Classic drawing uses the defaults only when CustomStyles is empty: ZoomLevel.GetStyles() returns CustomStyles alone once it has entries, and ZoomLevel.DrawCore skips the defaults in that case. As a result, the GPU map draws styles that the classic map ignores.
The translator already follows the classic rule one level down. For ValueItem, ClassBreak and RegexItem, the defaults are only translated when the entry has no CustomStyles. Only the zoom-level step is affected.
Repro
InMemoryFeatureLayer layer = new();
layer.InternalFeatures.Add(new Feature(0, 0, "1",
new Dictionary<string, string> { ["name"] = "Example" }));
ZoomLevel level = layer.ZoomLevelSet.ZoomLevel01;
level.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// Ignored by classic drawing, because the level has a custom style:
level.DefaultPointStyle = new PointStyle(PointSymbolType.Circle, 8, GeoBrushes.Red);
level.CustomStyles.Add(new PointStyle(PointSymbolType.Circle, 8, GeoBrushes.Blue));
FeatureSourceVectorTileSource source = new();
source.FeatureSources.Add("features", layer.FeatureSource);
FeatureLayerTranslation translation =
FeatureLayerTranslator.Translate(layer, source, source.TileMatrixSet.GetScales());
foreach (TranslatedStyleLayer part in translation.Layers)
Console.WriteLine($"{part.Id}: {((PointStyle)part.Origin).FillBrush}");
Expected: one circle layer, the blue custom style, which is what the classic map draws.
Actual: two circle layers (…-z01-20-01-circle from the red default, …-z01-20-02-circle from the blue custom style). The red circle is drawn on the GPU map only.
The same happens with the WebBasedAsyncFeatureLayer overload, and with any mix of defaults and custom styles. For example, a DefaultTextStyle left on a level whose CustomStyles hold a ValueStyle adds a label on GPU that classic never shows.
Workaround: before translating, we give the layer a copy of its ZoomLevelSet without the default styles on levels that have CustomStyles, then restore the original afterwards.
Could the translator follow ZoomLevel.GetStyles() here, the way it already does for value, class-break and regex items?
Thanks!