When a FeatureLayer is see-through ( Opacity below 1), its labels become see-through too, in both renderers. Users often set a layer to 50–70 % so the base map shows through, but they still want readable labels.
Classic renderer: Layer.Opacity blends the whole rendered tile, labels included.
GPU (ThinkGeo.Gpu 15.0.0-beta154): FeatureLayerTranslator multiplies the text and icon opacity by FeatureLayer.Opacity . Shapes are fine — fills, lines and circles keep their own opacity and the group is blended at the layer opacity (the beta148 fix). Only symbols are multiplied, and there is no way to change it afterwards: SymbolStyleLayer is read-only, and MapStyle has SetHeatmapPaint but nothing for symbols. Making the text colour more opaque does not help; it is already at 100 %.
Request: a FeatureLayer.LabelOpacity property (or an option “labels ignore layer opacity”), honoured by the classic renderer and by the GPU translator. Labels would then keep their own opacity no matter how see-through the layer is.
Small example
var layer = new InMemoryFeatureLayer();
layer.InternalFeatures.Add(new Feature(0, 0, "p", new Dictionary<string, string> { ["name"] = "Label" }));
layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = new PointStyle(PointSymbolType.Circle, 8, GeoBrushes.Blue);
layer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = new TextStyle("name", new GeoFont("Arial", 12), GeoBrushes.Black);
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
layer.Opacity = 0.25;
var style = new MapStyle().AddFeatureLayer(layer);
// The SymbolStyleLayer resolves a paint with Opacity 0.25. Expected: 1.0, the brush is opaque.
// The classic renderer draws the label at 25 % as well.
Our workarounds today (we would rather not depend on them):
- Classic: a custom
ZoomLevelinCustomZoomLevelsthat draws the shapes offscreen at the layer opacity and the labels directly. We need this hook becauseShapeFileFeatureLayer.DrawCoredoes not raiseDrawingFeaturesandZoomLevelSet.GetZoomLevelForDrawingis not virtual. - GPU: we translate each layer twice on the same
FeatureSourceVectorTileSource— shapes at the layer opacity, text styles at opacity 1 — and add both under the same source id.
Versions: ThinkGeo.Core / ThinkGeo.UI.Wpf / ThinkGeo.Gpu 15.0.0-beta154, .NET 10, WPF.
