Class MapsuiMapNavigator
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
mapMapThe existing Mapsui map to navigate.
Exceptions
- ArgumentNullException
mapis 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
positionGeoPositionThe WGS-84 position to center.
durationMillisecondslongAnimation 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
degreesdoubleClockwise rotation in degrees.
SetViewportToCenterAndResolution(MPoint, double)
Sets an exact map-coordinate center and resolution without animation.
public void SetViewportToCenterAndResolution(MPoint center, double resolution)
Parameters
centerMPointThe center in the map's coordinate system.
resolutiondoubleThe map resolution in map units per pixel.
Exceptions
- ArgumentNullException
centeris null.
SetViewportToExtent(MRect)
Sets an exact map-coordinate extent without animation.
public void SetViewportToExtent(MRect extent)
Parameters
extentMRectThe extent in the map's coordinate system.
Exceptions
- ArgumentNullException
extentis 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
extentMRectThe dataset extent in the map's coordinate system.
durationMillisecondslongAnimation 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
extentis null.