Table of Contents

Interface IS100MapSession

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

An explicitly owned S-100 subsystem attached to a Mapsui.Map. Composes and owns the reusable dataset-layer session, processor ownership, renderer, layer bands, and navigation convenience; disposing it releases all of them. Obtain one with AddS100(Map, S100MapsuiOptions?).

public interface IS100MapSession : IDisposable, IAsyncDisposable
Inherited Members

Remarks

This is the library's public entry point and the middle of three tiers: it composes the inner MapsuiDatasetLayerSession (dataset-layer lifecycle only) and is in turn composed by an application's own host (e.g. the Viewer's MapsuiMapHost). Start here.

Normal pan, zoom, and rotation stay with Map.Navigator; this session adds only S-100-specific operations plus the optional ZoomToDataset(MapDatasetId) convenience.

The rendering operations mutate Map.Layers and install generated layers on the calling synchronization context. Call and await them from the map-owning thread (e.g. a UI host's dispatcher thread), matching MapsuiDatasetLayerSession's threading contract.

Datasets can be added from a caller-supplied processor via AddDatasetAsync(MapDataset, IDatasetProcessor, int?, int?, CancellationToken), or loaded from a single file/cell path via Datasets. Exchange-set folder/archive loading is a later addition.

Properties

Datasets

Loads datasets into this session from a file path.

IS100DatasetLoader Datasets { get; }

Property Value

IS100DatasetLoader

DynamicSources

The dynamic-source registry: registers push-driven IDynamicFeatureSource instances (own-ship, AIS, …) as managed overlay layers over the same map, with per-source visibility and geographic hit-testing. The session owns the host and disposes it with the session.

IS100DynamicSourceRegistry DynamicSources { get; }

Property Value

IS100DynamicSourceRegistry

Layers

The host-facing basemap, overlay, and tool layer bands. A host attaches its own decoration layers here (basemaps, pick highlights, extent indicators, measure tools) so they keep their z-order relative to the session's dataset layers. The dataset band is intentionally not exposed — the session owns and drives it via AddDatasetAsync(MapDataset, IDatasetProcessor, int?, int?, CancellationToken), RemoveDataset(MapDatasetId), and SetOrder(IReadOnlyList<MapDatasetId>).

IS100MapLayerHost Layers { get; }

Property Value

IS100MapLayerHost

Navigator

The navigation surface bound to the same map.

MapsuiMapNavigator Navigator { get; }

Property Value

MapsuiMapNavigator

Query

Geographic query surface (feature / coverage picking).

IS100MapQuery Query { get; }

Property Value

IS100MapQuery

Session

The underlying reusable dataset-layer session.

MapsuiDatasetLayerSession Session { get; }

Property Value

MapsuiDatasetLayerSession

Methods

AddDatasetAsync(MapDataset, IDatasetProcessor, int?, int?, CancellationToken)

Registers a caller-supplied processor, records its dataset state, and renders its generated layers.

Task<bool> AddDatasetAsync(MapDataset dataset, IDatasetProcessor processor, int? minimumDisplayScale = null, int? maximumDisplayScale = null, CancellationToken cancellationToken = default)

Parameters

dataset MapDataset

The renderer-neutral dataset state.

processor IDatasetProcessor

The processor whose portrayal is rendered. Ownership by outcome:

  • Returns true: the session owns the processor and disposes it when the dataset is removed or the session is disposed.
  • Returns false (identity already in use): the processor was never registered; the caller still owns it and must dispose it.
  • Throws (render failure or cancellation, or the dataset was removed before its layers were installed): the session rolls back, which disposes the processor; the caller must not dispose it again.
minimumDisplayScale int?

Optional coarsest catalogue scale.

maximumDisplayScale int?

Optional finest catalogue scale.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

A task that returns true when the dataset was registered, or false when its identity is already in use (in which case the caller still owns processor).

GetDataset(MapDatasetId)

Gets one registered dataset's snapshot, or null.

MapsuiMapDatasetSnapshot? GetDataset(MapDatasetId datasetId)

Parameters

datasetId MapDatasetId

Returns

MapsuiMapDatasetSnapshot

GetDatasets()

Gets a snapshot of every registered dataset.

IReadOnlyList<MapsuiMapDatasetSnapshot> GetDatasets()

Returns

IReadOnlyList<MapsuiMapDatasetSnapshot>

GetTimeSnapshot()

Gets the aggregate time state for all registered datasets.

MapsuiMapTimeSnapshot GetTimeSnapshot()

Returns

MapsuiMapTimeSnapshot

RemoveDataset(MapDatasetId)

Removes a dataset's layers, state, and processor.

bool RemoveDataset(MapDatasetId datasetId)

Parameters

datasetId MapDatasetId

The dataset identity.

Returns

bool

true when a dataset was removed.

SetActive(MapDatasetId, bool)

Sets a dataset's cross-product composition/query participation.

void SetActive(MapDatasetId datasetId, bool isActive)

Parameters

datasetId MapDatasetId
isActive bool

SetOpacity(MapDatasetId, double)

Sets a dataset's opacity in the inclusive range 0..1.

void SetOpacity(MapDatasetId datasetId, double opacity)

Parameters

datasetId MapDatasetId
opacity double

SetOrder(IReadOnlyList<MapDatasetId>)

Sets the bottom-to-top dataset paint order.

void SetOrder(IReadOnlyList<MapDatasetId> bottomToTopDatasetIds)

Parameters

bottomToTopDatasetIds IReadOnlyList<MapDatasetId>

SetPresentationAsync(MapPresentationState, CancellationToken)

Applies immutable presentation state and re-renders datasets.

Task SetPresentationAsync(MapPresentationState presentation, CancellationToken cancellationToken = default)

Parameters

presentation MapPresentationState
cancellationToken CancellationToken

Returns

Task

SetTime(DateTime)

Sets the global map clock without rendering.

void SetTime(DateTime time)

Parameters

time DateTime

SetTimeAsync(DateTime, CancellationToken)

Sets the global map clock and applies time gating using the current presentation (the last one passed to SetPresentationAsync(MapPresentationState, CancellationToken), or the default before any).

Task SetTimeAsync(DateTime time, CancellationToken cancellationToken = default)

Parameters

time DateTime
cancellationToken CancellationToken

Returns

Task

SetVisible(MapDatasetId, bool)

Sets a dataset's visual enabled state.

void SetVisible(MapDatasetId datasetId, bool isVisible)

Parameters

datasetId MapDatasetId
isVisible bool

ZoomToDataset(MapDatasetId)

Zooms the map to a registered dataset's extent. A convenience over Map.Navigator; a no-op when the dataset is unknown or has no extent yet.

void ZoomToDataset(MapDatasetId datasetId)

Parameters

datasetId MapDatasetId

The dataset identity.

Events

CurrentTimeChanged

Raised after the global map clock changes.

event EventHandler<MapSessionCurrentTimeEventArgs>? CurrentTimeChanged

Event Type

EventHandler<MapSessionCurrentTimeEventArgs>

DatasetRenderCompleted

Raised after a successful dataset render installs its layers.

event EventHandler<MapSessionDatasetRenderEventArgs>? DatasetRenderCompleted

Event Type

EventHandler<MapSessionDatasetRenderEventArgs>

DatasetRenderFailed

Raised when a dataset render fails during a coalesced refresh.

event EventHandler<MapSessionDatasetRenderFailedEventArgs>? DatasetRenderFailed

Event Type

EventHandler<MapSessionDatasetRenderFailedEventArgs>

DatasetRenderStarted

Raised once a dataset is about to render.

event EventHandler<MapSessionDatasetRenderEventArgs>? DatasetRenderStarted

Event Type

EventHandler<MapSessionDatasetRenderEventArgs>

LayersChanged

Raised after the final dataset-band projection changes.

event EventHandler? LayersChanged

Event Type

EventHandler

TimeRangeChanged

Raised after the aggregate registered time range changes.

event EventHandler? TimeRangeChanged

Event Type

EventHandler