Show / Hide Table of Contents

    Interface IReadOnlyViewport

    Namespace: Mapsui
    Assembly: Mapsui.dll
    Syntax
    public interface IReadOnlyViewport

    Properties

    | Improve this Doc View Source

    Center

    Coordinate of center of viewport in map coordinates

    Declaration
    ReadOnlyPoint Center { get; }
    Property Value
    Type Description
    ReadOnlyPoint
    | Improve this Doc View Source

    Extent

    BoundingBox of viewport in map coordinates respection Rotation

    Declaration
    BoundingBox Extent { get; }
    Property Value
    Type Description
    BoundingBox
    Remarks

    This BoundingBox is horizontally and vertically aligned, even if the viewport is rotated. So this BoundingBox perhaps contain parts, that are not visible.

    | Improve this Doc View Source

    HasSize

    Declaration
    bool HasSize { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Height

    Height of viewport in screen pixels

    Declaration
    double Height { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    IsRotated

    IsRotated is true, when viewport displays map rotated

    Declaration
    bool IsRotated { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Resolution

    Resolution of the viewport in units per pixel

    Declaration
    double Resolution { get; }
    Property Value
    Type Description
    System.Double
    Remarks

    Resolution is Mapsuis form of zoom level. Because Mapsui is projection independent, there aren't any zoom levels as other map libraries have. If your map has EPSG:3857 as projection and you want to calculate the zoom, you should use the following equation

    var zoom = (float)Math.Log(78271.51696401953125 / resolution, 2);

    | Improve this Doc View Source

    Rotation

    Viewport rotation from True North (clockwise degrees)

    Declaration
    double Rotation { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    Width

    Width of viewport in screen pixels

    Declaration
    double Width { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    WindowExtent

    WindowExtend gives the four corner points of viewport in map coordinates

    Declaration
    Quad WindowExtent { get; }
    Property Value
    Type Description
    Quad
    Remarks

    If viewport is rotated, this corner points are not horizontally or vertically aligned.

    Methods

    | Improve this Doc View Source

    ScreenToWorld(Point)

    Converts a point in screen pixels to one in map units, respecting rotation

    Declaration
    Point ScreenToWorld(Point position)
    Parameters
    Type Name Description
    Point position

    Coordinate in map units

    Returns
    Type Description
    Point

    Point in map units

    | Improve this Doc View Source

    ScreenToWorld(Double, Double)

    Converts X/Y in screen pixels to a point in map units, respecting rotation

    Declaration
    Point ScreenToWorld(double x, double y)
    Parameters
    Type Name Description
    System.Double x

    Screen position x coordinate

    System.Double y

    Screen position y coordinate

    Returns
    Type Description
    Point

    Point in map units

    | Improve this Doc View Source

    WorldToScreen(Point)

    Converts X/Y in map units to a point in device independent unit (or DIP or DP), respecting rotation

    Declaration
    Point WorldToScreen(Point worldPosition)
    Parameters
    Type Name Description
    Point worldPosition

    Coordinate in map units

    Returns
    Type Description
    Point

    Point in screen pixels

    | Improve this Doc View Source

    WorldToScreen(Double, Double)

    Converts X/Y in map units to a point in device independent units (or DIP or DP), respecting rotation

    Declaration
    Point WorldToScreen(double worldX, double worldY)
    Parameters
    Type Name Description
    System.Double worldX

    X coordinate in map units

    System.Double worldY

    Y coordinate in map units

    Returns
    Type Description
    Point

    Point in screen pixels

    | Improve this Doc View Source

    WorldToScreenUnrotated(Point)

    Converts X/Y in map units to a point in device independent units (or DIP or DP), respecting rotation

    Declaration
    Point WorldToScreenUnrotated(Point worldPosition)
    Parameters
    Type Name Description
    Point worldPosition

    Coordinate in map units

    Returns
    Type Description
    Point

    Point in screen pixels

    | Improve this Doc View Source

    WorldToScreenUnrotated(Double, Double)

    Converts X/Y in map units to a point in device independent units (or DIP or DP), respecting rotation

    Declaration
    Point WorldToScreenUnrotated(double worldX, double worldY)
    Parameters
    Type Name Description
    System.Double worldX

    X coordinate in map units

    System.Double worldY

    Y coordinate in map units

    Returns
    Type Description
    Point

    Point in screen pixels

    Events

    | Improve this Doc View Source

    ViewportChanged

    Declaration
    event PropertyChangedEventHandler ViewportChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX