MapSuiteGisEditor/WpfDesktopExtension/Shares/MapEngine.cs
/// <summary>This method returns the distance in wold units between two screen points.</summary>
/// <overloads>This overload allows you to pass in the X &amp; Y for each point.</overloads>
/// <param name="worldExtent">This parameter is the world extent.</param>
/// <param name="screenPoint1X">This parameter is the X of the point you want to measure from.</param>
/// <param name="screenPoint1Y">This parameter is the Y of the point you want to measure from.</param>
/// <param name="screenPoint2X">This parameter is the X of the point you want to measure to.</param>
/// <param name="screenPoint2Y">This parameter is the Y of the point you want to measure to.</param>
/// <param name="screenWidth">This parameter is the width of the screen.</param>
/// <param name="screenHeight">This parameter is the height of the screen.</param>
/// <param name="worldExtentUnit">This is the geographic unit of the world extent you passed in.</param>
/// <param name="distanceUnit">This is the geographic unit you want the result to show in.</param>
This method returns the distance in wold units between two screen points.
This method returns the distance in wold 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)
        {
            ValidatorHelper.CheckExtentIsValid(worldExtent, "worldExtent");
            ValidatorHelper.CheckInputValueIsLargerThan(screenWidth, "screenWidth", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckInputValueIsLargerThan(screenHeight, "screenHeight", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckGeographyUnitIsValid(worldExtentUnit, "worldExtentUnit");
            ValidatorHelper.CheckDistanceUnitIsValid(distanceUnit, "distanceUnit");
            return ExtentHelper.GetWorldDistanceBetweenTwoScreenPoints(worldExtent, screenPoint1X, screenPoint1Y, screenPoint2X, screenPoint2Y, screenWidth, screenHeight, worldExtentUnit, distanceUnit);
        }
public static double GetWorldDistanceBetweenTwoScreenPoints ( RectangleShape worldExtent , float screenPoint1X , float screenPoint1Y , float screenPoint2X , float screenPoint2Y , float screenWidth , float screenHeight , GeographyUnit worldExtentUnit , DistanceUnit distanceUnit ) { ValidatorHelper . CheckExtentIsValid ( worldExtent , " " ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenWidth , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenHeight , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckGeographyUnitIsValid ( worldExtentUnit , " " ) ; ValidatorHelper . CheckDistanceUnitIsValid ( distanceUnit , " " ) ; return ExtentHelper . GetWorldDistanceBetweenTwoScreenPoints ( worldExtent , screenPoint1X , screenPoint1Y , screenPoint2X , screenPoint2Y , screenWidth , screenHeight , worldExtentUnit , distanceUnit ) ; }
This method returns the distance in wold units between two screen points.
This method returns the distance in wold units between two screen points .
worldExtent
RectangleShape
This parameter is the world extent.
This parameter is the world extent .
screenPoint1X
float
This parameter is the X of the point you want to measure from.
This parameter is the X of the point you want to measure from .
screenPoint1Y
float
This parameter is the Y of the point you want to measure from.
This parameter is the Y of the point you want to measure from .
screenPoint2X
float
This parameter is the X of the point you want to measure to.
This parameter is the X of the point you want to measure to .
screenPoint2Y
float
This parameter is the Y of the point you want to measure to.
This parameter is the Y of the point you want to measure to .
screenWidth
float
This parameter is the width of the screen.
This parameter is the width of the screen .
screenHeight
float
This parameter is the height of the screen.
This parameter is the height of the screen .
worldExtentUnit
GeographyUnit
This is the geographic unit of the world extent you passed in.
This is the geographic unit of the world extent you passed in .
distanceUnit
DistanceUnit
This is the geographic unit you want the result to show in.
This is the geographic unit you want the result to show in .
overloads
This overload allows you to pass in the X & Y for each point.
This overload allows you to pass in the X & Y for each point .