Skip to content

MapArguments

Namespace: ThinkGeo.Core

Contains important properties and methods of current map object.

public class MapArguments

Inheritance ObjectMapArguments

Properties

MapUnit

Gets or sets the GeographyUnit for the map.

public GeographyUnit MapUnit { get; set; }

Property Value

GeographyUnit

        The GeographyUnit object that indicates which geography unit the
        map is currently using.

ScreenWidth

Gets or sets the width of current map object in screen coordinate.It would be the same as ScreenHeight if the map is in rotation

public double ScreenWidth { get; set; }

Property Value

Double

ScreenHeight

Gets or sets the height of current map object in screen coordinate.It would be the same as ScreenHeight if the map is in rotation

public double ScreenHeight { get; set; }

Property Value

Double

MapWidth

public double MapWidth { get; set; }

Property Value

Double

MapHeight

public double MapHeight { get; set; }

Property Value

Double

RotationAngle

public double RotationAngle { get; set; }

Property Value

Double

ZoomLevelSet

This property gets or sets the ZoomLevelSet used for the MapView control.

public ZoomLevelSet ZoomLevelSet { get; set; }

Property Value

ZoomLevelSet
The zoom level set.

CustomData

Gets the custom data.

public Dictionary<string, object> CustomData { get; }

Property Value

Dictionary<String, Object>
The custom data.

PivotScreenPoint

public ScreenPointF PivotScreenPoint { get; set; }

Property Value

ScreenPointF

PivotWorldPoint

public PointShape PivotWorldPoint { get; set; }

Property Value

PointShape

ZoomLevelScales

Gets a collection of double values that determines the zoomlevel scales.

public Collection<double> ZoomLevelScales { get; }

Property Value

Collection<Double>

        A collection of double values that determines the openlayers' zoomlevel
        scales.

CurrentResolution

Gets or sets a double value that indicates the current resolution of the map.

public double CurrentResolution { get; set; }

Property Value

Double
A double value that indicates the current resolution of the map.

CurrentScale

Gets or sets the scale factor, this is a value number of device pixels per logical coordinate point.

public double CurrentScale { get; set; }

Property Value

Double

        The scale factory value.

Remarks:

The coordinate space used by application developers is measured in logical points. High-resolution (Retina) displays will have more than a single physical pixel per logical point and this property specifies the scale factor.

MaximumScale

This property gets and sets a maximum scale when navigating the map.

When you keep zooming out, and the target scale is bigger than the maximum scale, the zooming operation will be stopped.

public double MaximumScale { get; set; }

Property Value

Double

MinimumScale

This property gets and sets a minimum scale when navigating the map.

When you keep zooming in, and the target scale is smaller than the minimum scale, the zooming operation will be stopped.

public double MinimumScale { get; set; }

Property Value

Double

CurrentExtent

Gets or sets the extent of current map.

public RectangleShape CurrentExtent { get; set; }

Property Value

RectangleShape

CenterPoint

public PointShape CenterPoint { get; set; }

Property Value

PointShape

MaxExtent

Gets or sets the max extent of current map.

public RectangleShape MaxExtent { get; set; }

Property Value

RectangleShape

ScaleFactor

public float ScaleFactor { get; set; }

Property Value

Single

ZoomLevelSnappingMode

public ZoomLevelSnappingMode ZoomLevelSnappingMode { get; set; }

Property Value

ZoomLevelSnappingMode

RotationEnabled

public bool RotationEnabled { get; set; }

Property Value

Boolean

Constructors

MapArguments()

Constructor of MapArguments.

public MapArguments()

MapArguments(RectangleShape, GeographyUnit, Single, Single)

Initializes a new instance of the MapArguments class.

public MapArguments(RectangleShape currentExtent, GeographyUnit mapUnit, float screenWidth, float screenHeight)

Parameters

currentExtent RectangleShape
The current extent.

mapUnit GeographyUnit
The map unit.

screenWidth Single
Width of the screen.

screenHeight Single
Height of the screen.

Methods

ToWorldCoordinate(ScreenPointF)

Converts a point from screen coordinate to world coordinate.

public PointShape ToWorldCoordinate(ScreenPointF screenCoordinate)

Parameters

screenCoordinate ScreenPointF
A point in screen coordinate to be converted.

Returns

PointShape
A point in world coordinate.

GetSnappedZoomLevelIndex(RectangleShape)

Gets a snapped zoom level index from the provided extent.

public int GetSnappedZoomLevelIndex(RectangleShape extent)

Parameters

extent RectangleShape
An extent to be snapped.

Returns

Int32
An integar value that indicates the snapped zoom level index.

Remarks:

The extent will automatically snapped a closest scale from the ZoomLevelScale list, and create an extent back with the map's screen width and height.

GetSnappedZoomLevelIndex(Double)

Gets a snapped zoom level index from the provided scale.

public int GetSnappedZoomLevelIndex(double scale)

Parameters

scale Double
A scale to be snapped.

Returns

Int32
An integar value that indicates the snapped zoom level index.

Remarks:

The scale will automatically snapped a closest scale from the ZoomLevelScale list, and create an extent back with the map's screen width and height.

GetSnappedExtent(RectangleShape, ZoomSnapDirection)

public RectangleShape GetSnappedExtent(RectangleShape extent, ZoomSnapDirection zoomSnapDirection)

Parameters

extent RectangleShape

zoomSnapDirection ZoomSnapDirection

Returns

RectangleShape