Class MapUtil
public static class MapUtil
- Inheritance
-
MapUtil
- Inherited Members
Fields
InchesPerDecimalDegree
public const double InchesPerDecimalDegree = 4374754
Field Value
InchesPerFeet
public const double InchesPerFeet = 12
Field Value
InchesPerMeter
public const double InchesPerMeter = 39.3701
Field Value
InchesPerMile
public const double InchesPerMile = 63360
Field Value
InchesPerNauticalMile
public const double InchesPerNauticalMile = 72913.4252
Field Value
InchesPerYard
public const double InchesPerYard = 36
Field Value
PointsPerInch
public const float PointsPerInch = 72
Field Value
StandardDpi
public const float StandardDpi = 96
Field Value
Methods
AdjustExtentByRestrictions(RectangleShape, double, double, RectangleShape, double, double, GeographyUnit)
public static RectangleShape AdjustExtentByRestrictions(RectangleShape targetExtent, double width, double height, RectangleShape restrictExtent, double maximumScale, double minimumScale, GeographyUnit mapUnit)
Parameters
targetExtentRectangleShapewidthdoubleheightdoublerestrictExtentRectangleShapemaximumScaledoubleminimumScaledoublemapUnitGeographyUnit
Returns
ApplyDrawingMarginToExtent(RectangleShape, float, float, float)
public static RectangleShape ApplyDrawingMarginToExtent(RectangleShape worldExtent, float marginInPixel, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapemarginInPixelfloatscreenWidthfloatscreenHeightfloat
Returns
BuildFourColorColumn(string, Collection<Feature>)
This method returns all features in the FeatureSource, the features contain the "Color" column. The column has a range of 1, 2, 3, 4, and each value represents a color.
public static Collection<Feature> BuildFourColorColumn(string columnName, Collection<Feature> features)
Parameters
columnNamestringfeaturesCollection<Feature>
Returns
- Collection<Feature>
This method returns four color features in the FeatureSource.
CalculateExtent(PointShape, double, GeographyUnit, double, double)
public static RectangleShape CalculateExtent(PointShape worldCenter, double scale, GeographyUnit mapUnit, double mapWidth, double mapHeight)
Parameters
worldCenterPointShapescaledoublemapUnitGeographyUnitmapWidthdoublemapHeightdouble
Returns
CenterAt(RectangleShape, float, float, float, float)
This method returns an adjusted extent centered on a point.
public static RectangleShape CenterAt(RectangleShape worldExtent, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the current extent you want to center.
screenXfloatThis parameter is the X coordinate on the screen to center on.
screenYfloatThis parameter is the Y coordinate on the screen to center on.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- RectangleShape
This method returns an adjusted extent centered on a point.
Remarks
None
CenterAt(RectangleShape, Feature, float, float)
This is a static function that allows you to pass in a world rectangle, a world point to center on, and a height and width in screen units. The function will center the rectangle based on the point, then adjust the rectangle's ratio based on the height and width in screen coordinates.
public static RectangleShape CenterAt(RectangleShape worldExtent, Feature centerFeature, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the current extent you want to center.
centerFeatureFeatureThis parameter is the world point you want to center on.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- RectangleShape
This method returns an adjusted extent centered on a point.
Remarks
None
CenterAt(RectangleShape, PointShape, float, float)
This is a static function that allows you to pass in a world rectangle, a world point to center on, and a height and width in screen units. The function will center the rectangle based on the point, then adjust the rectangle's ratio based on the height and width in screen coordinates.
public static RectangleShape CenterAt(RectangleShape worldExtent, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the current extent you want to center.
worldPointPointShapeThis parameter is the world point you want to center on.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- RectangleShape
This method returns an adjusted extent centered on a point.
Remarks
None
GetAreaUnitFromDistanceUnit(DistanceUnit)
public static AreaUnit GetAreaUnitFromDistanceUnit(DistanceUnit distanceUnit)
Parameters
distanceUnitDistanceUnit
Returns
GetBoundingBoxOfItems(IEnumerable<BaseShape>)
This API gets the BoundingBox of a group of BaseShapes.
public static RectangleShape GetBoundingBoxOfItems(IEnumerable<BaseShape> shapes)
Parameters
shapesIEnumerable<BaseShape>The target group of BaseShapes to get the BoundingBox for.
Returns
- RectangleShape
The BoundingBox that contains all of the shapes you passed in.
GetBoundingBoxOfItems(IEnumerable<Feature>)
This API gets the BoundingBox of a group of Features.
public static RectangleShape GetBoundingBoxOfItems(IEnumerable<Feature> features)
Parameters
featuresIEnumerable<Feature>The target group of Features to get the BoundingBox for.
Returns
- RectangleShape
The BoundingBox that contains all the features you passed in.
GetClosestZoomLevelIndex(double, Collection<double>)
public static int GetClosestZoomLevelIndex(double scale, Collection<double> zoomLevelScales)
Parameters
scaledoublezoomLevelScalesCollection<double>
Returns
GetClosestZoomLevelIndex(double, ZoomLevelSet)
public static int GetClosestZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scaledoublezoomLevelSetZoomLevelSet
Returns
GetDegreeFromPanDirection(PanDirection)
public static double GetDegreeFromPanDirection(PanDirection panDirection)
Parameters
panDirectionPanDirection
Returns
GetDistance(PointShape, PointShape)
public static double GetDistance(PointShape fromPoint, PointShape toPoint)
Parameters
fromPointPointShapetoPointPointShape
Returns
GetDrawingExtent(RectangleShape, double, double)
This method returns an adjusted extent based on the ratio of the screen width and height.
public static RectangleShape GetDrawingExtent(RectangleShape worldExtent, double screenWidth, double screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to adjust for drawing.
screenWidthdoubleThis parameter is the width of the screen.
screenHeightdoubleThis parameter is the height of the screen.
Returns
- RectangleShape
This method returns an adjusted extent based on the ratio of the screen width and height.
Remarks
This function is used because the extent to draw must be the rame ratio as the screen width and height. If they are not, then the image drawn will be stretched or compressed. We always adjust the extent upwards to ensure that no matter how we adjust it, the original extent will fit within the new extent. This ensures that everything you wanted to see in the first extent is visible and maybe a bit more.
GetExtentFromCenterPoint(PointShape, double, double, double, GeographyUnit)
public static RectangleShape GetExtentFromCenterPoint(PointShape centerPoint, double canvasWidth, double canvasHeight, double scale, GeographyUnit mapUnit)
Parameters
centerPointPointShapecanvasWidthdoublecanvasHeightdoublescaledoublemapUnitGeographyUnit
Returns
GetFloorCeilingScales(double, ZoomLevelSet)
public static (double, double) GetFloorCeilingScales(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scaledoublezoomLevelSetZoomLevelSet
Returns
GetFloorCeilingZoomLevelIndex(double, Collection<double>)
public static (int, int) GetFloorCeilingZoomLevelIndex(double scale, Collection<double> zoomLevelScales)
Parameters
scaledoublezoomLevelScalesCollection<double>
Returns
GetFloorCeilingZoomLevelIndex(double, ZoomLevelSet)
public static (int, int) GetFloorCeilingZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scaledoublezoomLevelSetZoomLevelSet
Returns
GetFloorZoomLevelIndex(double, Collection<double>)
Get the floor zoomlevel index based on the current scale. For example if the current scale is around zoomlevel 3.9, this method returns 3 instead of 4. We need this feature in some cases for example when we want to get a zoomlevel to totally contains a given extent, we don't want it just snap to the closest one. To get the closest zoomlevelIndex, use GetSnappedZoomLevelIndex.
public static int GetFloorZoomLevelIndex(double scale, Collection<double> zoomLevelScales)
Parameters
scaledoublezoomLevelScalesCollection<double>
Returns
- int
The floor zoomlevel index
GetFloorZoomLevelIndex(double, ZoomLevelSet)
Get the floor zoomlevel index based on the current scale. For example if the current scale is around zoomlevel 3.9, this method returns 3 instead of 4. We need this feature in some cases for example when we want to get a zoomlevel to totally contains a given extent, we don't want it just snap to the closest one. To get the closest zoomlevelIndex, use GetSnappedZoomLevelIndex.
public static int GetFloorZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scaledoublezoomLevelSetZoomLevelSet
Returns
- int
The floor zoomlevel index
GetInchesPerDistanceUnit(DistanceUnit)
public static double GetInchesPerDistanceUnit(DistanceUnit targetUnit)
Parameters
targetUnitDistanceUnit
Returns
GetInchesPerGeographyUnit(GeographyUnit)
public static double GetInchesPerGeographyUnit(GeographyUnit targetUnit)
Parameters
targetUnitGeographyUnit
Returns
GetResolution(RectangleShape, double, double)
public static double GetResolution(RectangleShape boundingBox, double widthInPixel, double heightInPixel)
Parameters
boundingBoxRectangleShapewidthInPixeldoubleheightInPixeldouble
Returns
GetResolutionFromScale(double, GeographyUnit, float)
public static double GetResolutionFromScale(double scale, GeographyUnit unit, float dpi = 96)
Parameters
scaledoubleunitGeographyUnitdpifloat
Returns
GetResolutionOfRotatedExtent(RectangleShape, double, double, double)
Get the resolution if displaying a rotated extent within a canvas
public static double GetResolutionOfRotatedExtent(RectangleShape extent, double rotationAngle, double canvasWidth, double canvasHeight)
Parameters
extentRectangleShapethe extent to display on the canvas
rotationAngledoublethe rotation angle of the extent
canvasWidthdoublecanvas width in pixel
canvasHeightdoublecanvas height in pixel
Returns
GetRotatedCanvasRadius(double, double, double, double)
public static double GetRotatedCanvasRadius(double pivotX, double pivotY, double canvasWidth, double canvasHeight)
Parameters
Returns
GetRotatedExtent(RectangleShape, double, PointShape)
public static RectangleShape GetRotatedExtent(RectangleShape extent, double rotatedAngle, PointShape pivotPoint)
Parameters
extentRectangleShaperotatedAngledoublepivotPointPointShape
Returns
GetRotatedPoint(double, double, double, PointShape)
public static PointShape GetRotatedPoint(double x, double y, double rotatedAngle, PointShape pivotPoint)
Parameters
xdoubleydoublerotatedAngledoublepivotPointPointShape
Returns
GetRotatedPolygon(RectangleShape, double, PointShape)
public static AreaBaseShape GetRotatedPolygon(RectangleShape extent, double rotatedAngle, PointShape pivotPoint)
Parameters
extentRectangleShaperotatedAngledoublepivotPointPointShape
Returns
GetRotatedScreenPoint(double, double, double, ScreenPointD)
public static ScreenPointF GetRotatedScreenPoint(double x, double y, double rotatedAngle, ScreenPointD pivotPoint)
Parameters
xdoubleydoublerotatedAngledoublepivotPointScreenPointD
Returns
GetRotatedScreenPoint(double, double, double, ScreenPointF)
public static ScreenPointF GetRotatedScreenPoint(double x, double y, double rotatedAngle, ScreenPointF pivotPoint)
Parameters
xdoubleydoublerotatedAngledoublepivotPointScreenPointF
Returns
GetScale(GeographyUnit, RectangleShape, double, double, float)
public static double GetScale(GeographyUnit mapUnit, RectangleShape boundingBox, double widthInPixel, double heightInPixel, float dpi = 96)
Parameters
mapUnitGeographyUnitboundingBoxRectangleShapewidthInPixeldoubleheightInPixeldoubledpifloat
Returns
GetScale(RectangleShape, double, GeographyUnit, float)
public static double GetScale(RectangleShape worldExtent, double screenWidth, GeographyUnit worldExtentUnit, float dpi = 96)
Parameters
worldExtentRectangleShapescreenWidthdoubleworldExtentUnitGeographyUnitdpifloat
Returns
GetScaleFromResolution(double, GeographyUnit, float)
public static double GetScaleFromResolution(double resolution, GeographyUnit unit, float dpi = 96)
Parameters
resolutiondoubleunitGeographyUnitdpifloat
Returns
GetScreenDistanceBetweenTwoWorldPoints(RectangleShape, Feature, Feature, float, float)
This method returns the number of pixels between two features.
public static float GetScreenDistanceBetweenTwoWorldPoints(RectangleShape worldExtent, Feature worldPointFeature1, Feature worldPointFeature2, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
worldPointFeature1FeatureThis parameter is the first feature -- the one you want to measure from.
worldPointFeature2FeatureThis parameter is the second feature -- the one you want to measure to.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- float
This method returns the number of pixels between two features.
Remarks
None
GetScreenDistanceBetweenTwoWorldPoints(RectangleShape, PointShape, PointShape, float, float)
This method returns the number of pixels between two world points.
public static float GetScreenDistanceBetweenTwoWorldPoints(RectangleShape worldExtent, PointShape worldPoint1, PointShape worldPoint2, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
worldPoint1PointShapeThis parameter is the first point -- the one you want to measure from.
worldPoint2PointShapeThis parameter is the second point -- the one you want to measure to.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- float
This method returns the number of pixels between two world points.
Remarks
None
GetShortUnitString(DistanceUnit, Dictionary<string, string>)
public static string GetShortUnitString(DistanceUnit targetUnit, Dictionary<string, string> preferredDisplayUnitString = null)
Parameters
targetUnitDistanceUnitpreferredDisplayUnitStringDictionary<string, string>
Returns
GetSnappedExtent(RectangleShape, GeographyUnit, float, float, ZoomLevelSet)
public static RectangleShape GetSnappedExtent(RectangleShape worldExtent, GeographyUnit worldExtentUnit, float screenWidth, float screenHeight, ZoomLevelSet zoomLevelSet)
Parameters
worldExtentRectangleShapeworldExtentUnitGeographyUnitscreenWidthfloatscreenHeightfloatzoomLevelSetZoomLevelSet
Returns
GetSnappedScale(double, ZoomLevelSet)
public static double GetSnappedScale(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scaledoublezoomLevelSetZoomLevelSet
Returns
GetSnappedScale(RectangleShape, float, GeographyUnit, ZoomLevelSet)
public static double GetSnappedScale(RectangleShape worldExtent, float screenWidth, GeographyUnit worldExtentUnit, ZoomLevelSet zoomLevelSet)
Parameters
worldExtentRectangleShapescreenWidthfloatworldExtentUnitGeographyUnitzoomLevelSetZoomLevelSet
Returns
GetSnappedZoomLevelIndex(double, IEnumerable<double>, double, double)
This method returns the closest zoomlevel index. If you want to return the zoomlevel index with a scale greater than the given one, use GetFloorZoomLevelIndex method instead.
public static int GetSnappedZoomLevelIndex(double scale, IEnumerable<double> zoomLevelScales, double minimumScale, double maximumScale)
Parameters
scaledoublezoomLevelScalesIEnumerable<double>minimumScaledoublemaximumScaledouble
Returns
- int
The closest zoomlevel index
GetSnappedZoomLevelIndex(double, ZoomLevelSet)
This method returns the closest zoomlevel index. If you want to return the zoomlevel index with a scale greater than the given one, use GetFloorZoomLevelIndex method instead.
public static int GetSnappedZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scaledoublezoomLevelSetZoomLevelSet
Returns
- int
The closest zoomlevel index
GetSnappedZoomLevelIndex(RectangleShape, GeographyUnit, Collection<double>, double, double)
This method returns the closest zoomlevel index. If you want to return the zoomlevel index with a scale contains the given extent, use GetFloorZoomLevelIndex method instead.
public static int GetSnappedZoomLevelIndex(RectangleShape extent, GeographyUnit mapUnit, Collection<double> zoomLevelScales, double actualWidth, double actualHeight)
Parameters
extentRectangleShapemapUnitGeographyUnitzoomLevelScalesCollection<double>actualWidthdoubleactualHeightdouble
Returns
- int
The closest zoomlevel index
GetVersion()
Get the current ThinkGeo.Core.dll file version.
public static string GetVersion()
Returns
- string
A string representing the file version of MapSuiteCore.dll.
GetWorldDistanceBetweenTwoScreenPoints(RectangleShape, float, float, float, float, float, float, GeographyUnit, DistanceUnit)
This method returns the distance in world units between two screen points.
public static double GetWorldDistanceBetweenTwoScreenPoints(RectangleShape worldExtent, float screenPoint1X, float screenPoint1Y, float screenPoint2X, float screenPoint2Y, float screenWidth, float screenHeight, GeographyUnit worldExtentUnit, DistanceUnit distanceUnit)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
screenPoint1XfloatThis parameter is the X of the point you want to measure from.
screenPoint1YfloatThis parameter is the Y of the point you want to measure from.
screenPoint2XfloatThis parameter is the X of the point you want to measure to.
screenPoint2YfloatThis parameter is the Y of the point you want to measure to.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
worldExtentUnitGeographyUnitThis is the geographic unit of the world extent you passed in.
distanceUnitDistanceUnitThis is the geographic unit you want the result to show in.
Returns
GetWorldDistanceBetweenTwoScreenPoints(RectangleShape, ScreenPointF, ScreenPointF, float, float, GeographyUnit, DistanceUnit)
This method returns the distance in world units between two screen points.
public static double GetWorldDistanceBetweenTwoScreenPoints(RectangleShape worldExtent, ScreenPointF screenPoint1, ScreenPointF screenPoint2, float screenWidth, float screenHeight, GeographyUnit worldExtentUnit, DistanceUnit distanceUnit)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
screenPoint1ScreenPointFThis is the screen point you want to measure from.
screenPoint2ScreenPointFThis is the screen point you want to measure to.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
worldExtentUnitGeographyUnitThis is the geographic unit of the world extent rectangle.
distanceUnitDistanceUnitThis is the geographic unit you want the result to show in.
Returns
- double
This method returns the distance in world units between two screen points.
Remarks
None
GetWorldExtent(GeographyUnit)
public static RectangleShape GetWorldExtent(GeographyUnit unit)
Parameters
unitGeographyUnit
Returns
IsSameDouble(double, double, double)
public static bool IsSameDouble(double double1, double double2, double epsilon = 1E-09)
Parameters
Returns
IsSameExtent(RectangleShape, RectangleShape, double)
public static bool IsSameExtent(RectangleShape extent1, RectangleShape extent2, double epsilon = 1E-09)
Parameters
extent1RectangleShapeextent2RectangleShapeepsilondouble
Returns
IsSamePoint(PointShape, PointShape, double)
public static bool IsSamePoint(PointShape a, PointShape b, double epsilon = 1E-09)
Parameters
aPointShapebPointShapeepsilondouble
Returns
IsSamePoint(Vertex, PointShape, double)
public static bool IsSamePoint(Vertex a, PointShape b, double epsilon = 1E-09)
Parameters
aVertexbPointShapeepsilondouble
Returns
IsSamePoint(Vertex, Vertex, double)
public static bool IsSamePoint(Vertex a, Vertex b, double epsilon = 1E-09)
Parameters
Returns
OffsetPointWithScreenOffset(PointShape, double, double, double, double, GeographyUnit)
public static PointShape OffsetPointWithScreenOffset(PointShape pointShape, double xScreenOffset, double yScreenOffset, double mapRotation, double mapScale, GeographyUnit mapUnit)
Parameters
pointShapePointShapexScreenOffsetdoubleyScreenOffsetdoublemapRotationdoublemapScaledoublemapUnitGeographyUnit
Returns
Pan(RectangleShape, float, int)
This method returns a panned extent.
public static RectangleShape Pan(RectangleShape worldExtent, float degree, int percentage)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to pan.
degreefloatThis parameter is the degree you want to pan.
percentageintThis parameter is the percentage by which you want to pan.
Returns
- RectangleShape
This method returns a panned extent.
Remarks
None
Pan(RectangleShape, PanDirection, int)
This method returns a panned extent.
public static RectangleShape Pan(RectangleShape worldExtent, PanDirection direction, int percentage)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to pan.
directionPanDirectionThis parameter is the direction in which you want to pan.
percentageintThis parameter is the percentage by which you want to pan.
Returns
- RectangleShape
This method returns a panned extent.
Remarks
None
Rotate(double, double, double, double, double)
this method rotates the vector source->target, and return the rotated vector based on source
public static (double, double) Rotate(double sourceX, double sourceY, double destinationX, double destinationY, double rotationAngle)
Parameters
sourceXdoublethe source x
sourceYdoublethe source y
destinationXdoublethe destination x before rotation
destinationYdoublethe destination y before rotation
rotationAngledoublethe angle to rotate. positive means counter-clockwise
Returns
RotatePoint(double, double, double, double, double)
public static (double, double) RotatePoint(double x, double y, double rotationAngle, double pivotX, double pivotY)
Parameters
Returns
RotatePolygonShape(PolygonShape, double, double, double)
public static PolygonShape RotatePolygonShape(PolygonShape polygonShape, double rotationAngle, double pivotX, double pivotY)
Parameters
polygonShapePolygonShaperotationAngledoublepivotXdoublepivotYdouble
Returns
RotateRingShape(RingShape, double, double, double)
public static RingShape RotateRingShape(RingShape ringShape, double rotationAngle, double pivotX, double pivotY)
Parameters
Returns
ScaleExtent(double, double, double, double, double, double, double)
Scale the current extent base on the given center point
public static RectangleShape ScaleExtent(double mapWidth, double mapHeight, double resolution, double centerScreenX, double centerScreenY, double centerWorldX, double centerWorldY)
Parameters
mapWidthdoubleThe width of the map canvas
mapHeightdoubleThe height of the map canvas
resolutiondoubleThe current resolution, in WorldUnit/Pixel
centerScreenXdoubleThe X of the new center screen point
centerScreenYdoubleThe Y of the new center screen point
centerWorldXdoubleThe X of the new center world point
centerWorldYdoubleThe Y of the new center world point
Returns
- RectangleShape
The scaled extent
ToScreenCoordinate(BaseShape, RectangleShape, float, float)
This method returns BaseShape in screen coordinates from BaseShape in world coordinates.
public static BaseShape ToScreenCoordinate(BaseShape shape, RectangleShape worldExtent, float screenWidth, float screenHeight)
Parameters
shapeBaseShapeThis parameter is the shape in world coordinate you want converted to a shape in screen coordinate.
worldExtentRectangleShapeThis parameter is the world extent.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- BaseShape
This method returns BaseShape in screen coordinates from BaseShape in world coordinates.
Remarks
None
ToScreenCoordinate(RectangleShape, double, double, double, double)
This method returns screen coordinates from world coordinates.
public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, double worldX, double worldY, double screenWidth, double screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
worldXdoubleThis parameter is the world X you want converted to screen points.
worldYdoubleThis parameter is the world Y you want converted to screen points.
screenWidthdoubleThis parameter is the width of the screen.
screenHeightdoubleThis parameter is the height of the screen.
Returns
- ScreenPointF
This method returns screen coordinates from world coordinates.
Remarks
None
ToScreenCoordinate(RectangleShape, Feature, float, float)
This method returns screen coordinates from world coordinates.
public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, Feature worldPointFeature, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
worldPointFeatureFeatureThis parameter is the feature you want converted to a screen point.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- ScreenPointF
This method returns screen coordinates from world coordinates.
Remarks
None
ToScreenCoordinate(RectangleShape, PointShape, float, float)
This method returns screen coordinates from world coordinates.
public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
worldPointPointShapeThis parameter is the world point you want converted to a screen point.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- ScreenPointF
This method returns screen coordinates from world coordinates.
Remarks
None
ToScreenCoordinate(RectangleShape, RectangleShape, float, float)
This method returns Rectangle in screen coordinates from RectangleShape in world coordinates.
public static DrawingRectangle ToScreenCoordinate(RectangleShape worldExtent, RectangleShape targetWorldExtent, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
targetWorldExtentRectangleShapeThis parameter is the rectangle shape in world coordinate you want converted to a rectangle in screen coordinate.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- DrawingRectangle
This method returns Rectangle in screen coordinates from RectangleShape in world coordinates.
Remarks
None
ToWorldCoordinate(double, double, PointShape, double, double, double, GeographyUnit, double)
public static PointShape ToWorldCoordinate(double screenX, double screenY, PointShape centerPoint, double centerScreenX, double centerScreenY, double scale, GeographyUnit mapUnit, double mapRotation = 0)
Parameters
screenXdoublescreenYdoublecenterPointPointShapecenterScreenXdoublecenterScreenYdoublescaledoublemapUnitGeographyUnitmapRotationdouble
Returns
ToWorldCoordinate(PolygonShape, RectangleShape, float, float)
public static Feature ToWorldCoordinate(PolygonShape simplyPolygon, RectangleShape currentWorldExtent, float canvasWidth, float canvasHeight)
Parameters
simplyPolygonPolygonShapecurrentWorldExtentRectangleShapecanvasWidthfloatcanvasHeightfloat
Returns
ToWorldCoordinate(RectangleShape, double, double, double, double)
public static PointShape ToWorldCoordinate(RectangleShape currentExtent, double screenX, double screenY, double screenWidth, double screenHeight)
Parameters
currentExtentRectangleShapescreenXdoublescreenYdoublescreenWidthdoublescreenHeightdouble
Returns
ToWorldCoordinate(RectangleShape, float, float, float, float)
This method returns world coordinates from screen coordinates.
public static PointShape ToWorldCoordinate(RectangleShape worldExtent, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
screenXfloatThis parameter is the X of the point you want converted to world coordinates.
screenYfloatThis parameter is the Y of the point you want converted to world coordinates.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- PointShape
This method returns world coordinates from screen coordinates.
Remarks
None
ToWorldCoordinate(RectangleShape, ScreenPointF, float, float)
This method returns world coordinates from screen coordinates.
public static PointShape ToWorldCoordinate(RectangleShape worldExtent, ScreenPointF screenPoint, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent.
screenPointScreenPointFThis parameter is the screen point you want converted to a world point.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- PointShape
This method returns world coordinates from screen coordinates.
Remarks
None
ZoomIn(RectangleShape, int)
This method returns a new extent that is zoomed in by the percentage provided.
public static RectangleShape ZoomIn(RectangleShape worldExtent, int percentage)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to zoom to.
percentageintThis parameter is the percentage by which you want to zoom in.
Returns
- RectangleShape
This method returns a new extent that is zoomed in by the percentage provided.
Remarks
None
ZoomIntoCenter(RectangleShape, int, float, float, float, float)
This method returns an extent that is centered and zoomed in.
public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to center and zoom to.
percentageintThis parameter is the percentage by which you want to zoom in.
screenXfloatThis parameter is the screen X you want to center on.
screenYfloatThis parameter is the screen Y you want to center on.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- RectangleShape
This method returns an extent that is centered and zoomed in.
Remarks
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomIntoCenter(RectangleShape, int, Feature, float, float)
This method returns an extent that is centered and zoomed.
public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, Feature centerFeature, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent that you want centered and zoomed to.
percentageintThis parameter is the percentage by which you want to zoom in.
centerFeatureFeatureThis parameter is the feature you want the extent to be centered on.
screenWidthfloatThis parameter is the width in screen coordinates.
screenHeightfloatThis parameter is the height in screen coordinates.
Returns
- RectangleShape
This method returns an extent that is centered and zoomed in.
Remarks
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomIntoCenter(RectangleShape, int, PointShape, float, float)
This method returns an extent that is centered and zoomed in.
public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent that you want centered and zoomed to.
percentageintThis parameter is the percentage by which you want to zoom in.
worldPointPointShapeThis parameter is the world point you want the extent to be centered on.
screenWidthfloatThis parameter is the width in screen coordinates.
screenHeightfloatThis parameter is the height in screen coordinates.
Returns
- RectangleShape
This method returns an extent that is centered and zoomed in.
Remarks
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomOut(RectangleShape, int)
This method returns a new extent that is zoomed out by the percentage provided.
public static RectangleShape ZoomOut(RectangleShape worldExtent, int percentage)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to zoom out to.
percentageintThis parameter is the percentage by which you want to zoom out.
Returns
- RectangleShape
This method returns a new extent that is zoomed out by the percentage provided.
Remarks
None
ZoomOutToCenter(RectangleShape, int, float, float, float, float)
This method returns an extent that is centered and zoomed out.
public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to center and zoom out to.
percentageintThis parameter is the percentage by which you want to zoom out.
screenXfloatThis parameter is the screen X you want to center on.
screenYfloatThis parameter is the screen Y you want to center on.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- RectangleShape
This method returns an extent that is centered and zoomed out.
Remarks
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterward.
ZoomOutToCenter(RectangleShape, int, Feature, float, float)
This method returns an extent that is centered and zoomed out.
public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, Feature centerFeature, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to center and zoom out to.
percentageintThis parameter is the percentage by which you want to zoom out.
centerFeatureFeatureThis parameter is the feature you want the extent to be centered on.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- RectangleShape
This method returns an extent that is centered and zoomed out.
Remarks
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomOutToCenter(RectangleShape, int, PointShape, float, float)
This method returns an extent that is centered and zoomed out.
public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters
worldExtentRectangleShapeThis parameter is the world extent you want to center and zoom out to.
percentageintThis parameter is the percentage by which you want to zoom out.
worldPointPointShapeThis parameter is the world point you want the extent to be centered on.
screenWidthfloatThis parameter is the width of the screen.
screenHeightfloatThis parameter is the height of the screen.
Returns
- RectangleShape
This method returns an extent that is centered and zoomed out.
Remarks
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomToScale(double, RectangleShape, GeographyUnit, double, double)
This method returns a extent that has been zoomed into a certain scale.
public static RectangleShape ZoomToScale(double targetScale, RectangleShape worldExtent, GeographyUnit worldExtentUnit, double screenWidth, double screenHeight)
Parameters
targetScaledoubleThis parameter is the scale you want to zoom into.
worldExtentRectangleShapeThis parameter is the world extent you want zoomed into the scale.
worldExtentUnitGeographyUnitThis parameter is the geographic unit of the world extent parameter.
screenWidthdoubleThis parameter is the screen width.
screenHeightdoubleThis parameter is the screen height.
Returns
- RectangleShape
This method returns a extent that has been zoomed into a certain scale.
Remarks
None
ZoomToScale(double, RectangleShape, GeographyUnit, float, float, ScreenPointF)
This method returns a extent that has been zoomed into a certain scale.
public static RectangleShape ZoomToScale(double targetScale, RectangleShape worldExtent, GeographyUnit worldExtentUnit, float screenWidth, float screenHeight, ScreenPointF offsetScreenPoint)
Parameters
targetScaledoubleThis parameter is the scale you want to zoom into.
worldExtentRectangleShapeThis parameter is the world extent you want zoomed into the scale.
worldExtentUnitGeographyUnitThis parameter is the geographic unit of the world extent parameter.
screenWidthfloatThis parameter is the screen width.
screenHeightfloatThis parameter is the screen height.
offsetScreenPointScreenPointFThis parameter is the offsetScreenPoint.
Returns
- RectangleShape
This method returns a extent that has been zoomed into a certain scale.
Remarks
None
isSameScale(double, double, double)
public static bool isSameScale(double scale1, double scale2, double epsilon = 1E-06)