Table of Contents

Class MapsuiMapNavigator

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

Provides the focused S-100 map navigation conveniences used by interactive Mapsui hosts.

public sealed class MapsuiMapNavigator
Inheritance
MapsuiMapNavigator
Inherited Members

Remarks

This adapter mutates the supplied map's Mapsui.Map.Navigator directly. It does not own the map, dispatch to a UI thread, invalidate a control, or automatically frame datasets after loading. UI-framework hosts remain responsible for thread affinity and redraw behavior; automatic framing remains application policy.

Normal pan, zoom, rotation, and gesture behavior remains available through Mapsui's navigator. This type intentionally exposes only the conveniences already needed by S-100 hosts rather than duplicating the full Mapsui API.

Constructors

MapsuiMapNavigator(Map)

Creates a navigation adapter for map.

public MapsuiMapNavigator(Map map)

Parameters

map Map

The existing Mapsui map to navigate.

Exceptions

ArgumentNullException

map is null.

Methods

CenterOn(GeoPosition, long)

Centers the viewport on a WGS-84 position while preserving its current resolution.

public void CenterOn(GeoPosition position, long durationMilliseconds = 300)

Parameters

position GeoPosition

The WGS-84 position to center.

durationMilliseconds long

Animation duration in milliseconds.

Remarks

Invalid or non-finite coordinates are ignored so a transient dynamic vessel update cannot corrupt the live viewport.

SetRotation(double)

Sets clockwise viewport rotation without animation.

public void SetRotation(double degrees)

Parameters

degrees double

Clockwise rotation in degrees.

SetViewportToCenterAndResolution(MPoint, double)

Sets an exact map-coordinate center and resolution without animation.

public void SetViewportToCenterAndResolution(MPoint center, double resolution)

Parameters

center MPoint

The center in the map's coordinate system.

resolution double

The map resolution in map units per pixel.

Exceptions

ArgumentNullException

center is null.

SetViewportToExtent(MRect)

Sets an exact map-coordinate extent without animation.

public void SetViewportToExtent(MRect extent)

Parameters

extent MRect

The extent in the map's coordinate system.

Exceptions

ArgumentNullException

extent is null.

TryGetViewportCenterWgs84()

Returns the laid-out viewport center in WGS-84 coordinates.

public GeoPosition? TryGetViewportCenterWgs84()

Returns

GeoPosition?

The current center, or null when the viewport is not laid out or cannot be projected to a valid WGS-84 position.

TryGetViewportResolution()

Returns the laid-out viewport resolution in map units per pixel (EPSG:3857 metres at the equator), after any zoom limits the map applies.

public double? TryGetViewportResolution()

Returns

double?

The current resolution, or null when the viewport is not laid out or the resolution is not a positive, finite number.

ZoomToExtent(MRect, long)

Frames a rendered dataset extent with ten percent padding on every side. The extent is first clipped to the Web-Mercator world (±85.05°), so a polar dataset reaching towards the pole (e.g. the NIC Arctic S-411 chart, to 89.3°N) is framed on the part that can be drawn rather than on empty space above the top of the world (issue #760).

public void ZoomToExtent(MRect extent, long durationMilliseconds = -1)

Parameters

extent MRect

The dataset extent in the map's coordinate system.

durationMilliseconds long

Animation duration in milliseconds. A negative value uses Mapsui's default timing, zero applies the viewport immediately, and a positive value animates for the requested duration.

Exceptions

ArgumentNullException

extent is null.