
the surrounding accent is a transparent circle with a blue outline, added as a separate PointStyle. This path does not set PointStyle.Mask.
InMemoryFeatureLayer layer = new();
ZoomLevel zoomLevel = layer.ZoomLevelSet.ZoomLevel01;
zoomLevel.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
PointStyle iconStyle = new(new GeoImage(iconBytes))
{
ImageScale = 1.25d
};
zoomLevel.CustomStyles.Add(iconStyle);
// Added for the most recently received AGK coordinates.
// pixelWidth / pixelHeight are the original PNG dimensions.
GeoColor ringColor = GeoColor.FromArgb(96, 27, 111, 184);
float ringWidth = 1f;
double ringGap = 1d;
double displayedWidth = pixelWidth * iconStyle.ImageScale;
double displayedHeight = pixelHeight * iconStyle.ImageScale;
float diameter = (float)(
Math.Sqrt(
displayedWidth * displayedWidth +
displayedHeight * displayedHeight)
+ 2 * ringGap
+ ringWidth);
zoomLevel.CustomStyles.Add(
PointStyle.CreateSimpleCircleStyle(
GeoColors.Transparent,
diameter,
ringColor,
ringWidth));
layer.InternalFeatures.Add(new Feature(x, y));
For GPU rendering, we copy that layer’s features and styles into an immutable snapshot. Image point styles take the FeatureLayerTranslator path. The relevant calls from GpuHighlightTranslation.cs are:
_source.SourceId = id;
_source.SharedSources = true;
_source.MaxConcurrentEncodes = 1;
_source.FeatureSources.Add(id, _layer.FeatureSource);
Translation = FeatureLayerTranslator.Translate(
_layer, _source, zoomScales);
The translation is added to the map style in GpuHighlightScene.cs
style.AddFeatureLayer(binding.Translation.Translation);
New highlights trigger a recomposed style on the existing GPU basemap:
await basemap.SetStyleAsync(style);
The circular outline surrounding newly added image point features is intermittently partially clipped in GPU rendering. The image and circle are separate entries in
ZoomLevel.CustomStyles, translated together using FeatureLayerTranslator.Translate.