Interface IS100MapSession
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
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
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
Navigator
The navigation surface bound to the same map.
MapsuiMapNavigator Navigator { get; }
Property Value
Query
Geographic query surface (feature / coverage picking).
IS100MapQuery Query { get; }
Property Value
Session
The underlying reusable dataset-layer session.
MapsuiDatasetLayerSession Session { get; }
Property Value
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
datasetMapDatasetThe renderer-neutral dataset state.
processorIDatasetProcessorThe 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.
minimumDisplayScaleint?Optional coarsest catalogue scale.
maximumDisplayScaleint?Optional finest catalogue scale.
cancellationTokenCancellationTokenCancellation 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
datasetIdMapDatasetId
Returns
GetDatasets()
Gets a snapshot of every registered dataset.
IReadOnlyList<MapsuiMapDatasetSnapshot> GetDatasets()
Returns
GetTimeSnapshot()
Gets the aggregate time state for all registered datasets.
MapsuiMapTimeSnapshot GetTimeSnapshot()
Returns
RemoveDataset(MapDatasetId)
Removes a dataset's layers, state, and processor.
bool RemoveDataset(MapDatasetId datasetId)
Parameters
datasetIdMapDatasetIdThe dataset identity.
Returns
SetActive(MapDatasetId, bool)
Sets a dataset's cross-product composition/query participation.
void SetActive(MapDatasetId datasetId, bool isActive)
Parameters
datasetIdMapDatasetIdisActivebool
SetOpacity(MapDatasetId, double)
Sets a dataset's opacity in the inclusive range 0..1.
void SetOpacity(MapDatasetId datasetId, double opacity)
Parameters
datasetIdMapDatasetIdopacitydouble
SetOrder(IReadOnlyList<MapDatasetId>)
Sets the bottom-to-top dataset paint order.
void SetOrder(IReadOnlyList<MapDatasetId> bottomToTopDatasetIds)
Parameters
bottomToTopDatasetIdsIReadOnlyList<MapDatasetId>
SetPresentationAsync(MapPresentationState, CancellationToken)
Applies immutable presentation state and re-renders datasets.
Task SetPresentationAsync(MapPresentationState presentation, CancellationToken cancellationToken = default)
Parameters
presentationMapPresentationStatecancellationTokenCancellationToken
Returns
SetTime(DateTime)
Sets the global map clock without rendering.
void SetTime(DateTime time)
Parameters
timeDateTime
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
timeDateTimecancellationTokenCancellationToken
Returns
SetVisible(MapDatasetId, bool)
Sets a dataset's visual enabled state.
void SetVisible(MapDatasetId datasetId, bool isVisible)
Parameters
datasetIdMapDatasetIdisVisiblebool
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
datasetIdMapDatasetIdThe dataset identity.
Events
CurrentTimeChanged
Raised after the global map clock changes.
event EventHandler<MapSessionCurrentTimeEventArgs>? CurrentTimeChanged
Event Type
DatasetRenderCompleted
Raised after a successful dataset render installs its layers.
event EventHandler<MapSessionDatasetRenderEventArgs>? DatasetRenderCompleted
Event Type
DatasetRenderFailed
Raised when a dataset render fails during a coalesced refresh.
event EventHandler<MapSessionDatasetRenderFailedEventArgs>? DatasetRenderFailed
Event Type
DatasetRenderStarted
Raised once a dataset is about to render.
event EventHandler<MapSessionDatasetRenderEventArgs>? DatasetRenderStarted
Event Type
LayersChanged
Raised after the final dataset-band projection changes.
event EventHandler? LayersChanged
Event Type
TimeRangeChanged
Raised after the aggregate registered time range changes.
event EventHandler? TimeRangeChanged