Class S100DatasetExtentIndicatorLayer
A reusable Mapsui overlay layer that outlines the extents of loaded datasets
which have zoomed out of scale. A host adds Layer to its
Map.Layers once, then calls Show(IEnumerable<S100DatasetExtentIndicator>)
as datasets, visibility, or zoom-cutoffs change; Clear() empties it.
public sealed class S100DatasetExtentIndicatorLayer
- Inheritance
-
S100DatasetExtentIndicatorLayer
- Inherited Members
Remarks
This is step 8's "dataset extent indicators as an optional Mapsui module": it
depends only on Mapsui, not on the session, a catalogue, an application
palette, a view model, or Avalonia. Each indicator becomes one dashed accent
rectangle tracing the dataset extent, with its border
Mapsui.Styles.VectorStyle gated by MinVisible set to the dataset's
content cutoff. Mapsui therefore reveals the border precisely when the
viewport zooms out past the point where the dataset's content stops drawing,
and hides it again once the mariner zooms back in — so the overlay is
viewport-agnostic and needs no navigator subscription.
The outline is deliberately thin, dashed, and unfilled so it reads as a "here be data" hint rather than chart content. A host that captures dataset extents in mercator (Mapsui's native map units) passes them straight through; a host holding geographic bounds projects them itself (splitting any antimeridian-crossing footprint into two non-wrapping boxes) — which projection, and how to treat wide footprints, is host policy, so the layer takes already-projected rectangles.
Not thread-safe: build and mutate it on the host's UI thread, like any other Mapsui layer. It is cheap to rebuild, so every update replaces the layer's contents wholesale.
Constructors
S100DatasetExtentIndicatorLayer(S100DatasetExtentIndicatorStyle?, string?)
Creates the overlay. Add Layer to a Map.Layers
collection at the z-order the host wants the indicators to appear (above
the basemap, typically below chart content).
public S100DatasetExtentIndicatorLayer(S100DatasetExtentIndicatorStyle? style = null, string? name = null)
Parameters
styleS100DatasetExtentIndicatorStyleAppearance; defaults to Default.
namestringLayer name; defaults to DefaultLayerName.
Fields
DefaultLayerName
Default Mapsui.Layers.ILayer.Name for the overlay.
public const string DefaultLayerName = "S-100 Dataset Extent Indicators"
Field Value
Properties
Layer
The Mapsui layer to add to a Map.Layers collection. Starts empty;
its contents are driven by Show(IEnumerable<S100DatasetExtentIndicator>)
and Clear().
public ILayer Layer { get; }
Property Value
- ILayer
Methods
Clear()
Clears the indicators, leaving the layer attached and empty.
public void Clear()
Show(IEnumerable<S100DatasetExtentIndicator>)
Replaces the overlay with one dashed rectangle per indicator, coloured with the style's Accent. An empty collection clears the overlay.
public void Show(IEnumerable<S100DatasetExtentIndicator> indicators)
Parameters
indicatorsIEnumerable<S100DatasetExtentIndicator>
Show(IEnumerable<S100DatasetExtentIndicator>, (byte R, byte G, byte B))
Replaces the overlay with one dashed rectangle per indicator, coloured with
accent (overriding the style's accent so a host can
re-theme without rebuilding the layer). An empty collection clears it.
public void Show(IEnumerable<S100DatasetExtentIndicator> indicators, (byte R, byte G, byte B) accent)
Parameters
indicatorsIEnumerable<S100DatasetExtentIndicator>accent(byte R, byte G, byte B)