Table of Contents

Class KindMatchingRenderer

Namespace
EncDotNet.S100.Renderers.Mapsui.DynamicSources
Assembly
EncDotNet.S100.Renderers.Mapsui.dll

Dispatches on Kind via exact or prefix match. Useful for adapters that publish multiple feature kinds (e.g. AIS cargo vs tanker vs passenger) and want to keep per-kind styling in separate small renderers.

public sealed class KindMatchingRenderer : IDynamicFeatureRenderer
Inheritance
KindMatchingRenderer
Implements
Inherited Members

Remarks

Match policy: longest registered key wins. A registration of "vessel" matches any feature with Kind equal to "vessel" when the constructor's prefixMatch is false, or equal to "vessel" / starting with "vessel." when prefixMatch is true. The latter follows the conventional dot-namespaced Kind shape (e.g. "vessel.cargo", "vessel.tanker").

Features whose Kind is null never match.

Constructors

KindMatchingRenderer(IReadOnlyDictionary<string, IDynamicFeatureRenderer>, bool)

Creates a kind-matching renderer with the supplied per-kind renderer map.

public KindMatchingRenderer(IReadOnlyDictionary<string, IDynamicFeatureRenderer> byKind, bool prefixMatch = false)

Parameters

byKind IReadOnlyDictionary<string, IDynamicFeatureRenderer>

Map from Kind (exact or prefix per prefixMatch) to the renderer that handles it.

prefixMatch bool

When true, a registered key k matches features whose Kind is k or starts with k + ".". Defaults to exact match.

Methods

CanRender(DynamicFeature)

Returns true if this renderer is willing to produce output for feature. Used by CompositeDynamicFeatureRenderer for ordered fallthrough.

public bool CanRender(DynamicFeature feature)

Parameters

feature DynamicFeature

Returns

bool

Render(DynamicFeature)

Produces zero or more Mapsui features for feature. May return an empty sequence when the feature is unsupported or degenerate.

public IEnumerable<IFeature> Render(DynamicFeature feature)

Parameters

feature DynamicFeature

Returns

IEnumerable<IFeature>