Class TransformationAlgorithms
Inherited Members
Namespace: Mapsui.Utilities
Assembly: Mapsui.dll
Syntax
public static class TransformationAlgorithms
Methods
| Edit this page View SourceCalculateCenterOfMap(double, double, double, double, double, double)
Calculates the new CenterOfMap based on the CenterOfZoom and the new resolution. The CenterOfZoom is not the same as the CenterOfMap. CenterOfZoom is the one place in the map that stays on the same location when zooming. In Mapsui is can be equal to the CenterOfMap, for instance when using the +/- buttons. When using mouse wheel zoom the CenterOfZoom is the location of the mouse.
Declaration
public static (double x, double y) CalculateCenterOfMap(double centerOfZoomX, double centerOfZoomY, double newResolution, double currentCenterX, double currentCenterY, double currentResolution)
Parameters
| Type | Name | Description |
|---|---|---|
| double | centerOfZoomX | |
| double | centerOfZoomY | |
| double | newResolution | |
| double | currentCenterX | |
| double | currentCenterY | |
| double | currentResolution |
Returns
| Type | Description |
|---|---|
| (double x, double y) | The x and y of the center of the map. |