MapSuiteGisEditor/WpfDesktopExtension/Shares/MapEngine.cs
/// <summary>
/// This Static API is used to calculate the scale based on the specified worldExtent
/// and its corresponding ScreenWidth and MapUnit.
/// </summary>
/// <param name="worldExtent">
/// This parameter specifies the worldExtent used to calculate the current
/// scale.
/// </param>
/// <param name="screenWidth">This parameter specifies the screenWidth corresponding to the worldExtent.</param>
/// <param name="mapUnit">
/// This parameter specifies the unit for the extent, the result will be different if
/// choose DecimalDegree as Unit and Meter as Unit.
/// </param>
This Static API is used to calculate the scale based on the specified worldExtent
and its corresponding ScreenWidth and MapUnit.
This Static API is used to calculate the scale based on the specified worldExtent and its corresponding ScreenWidth and MapUnit .
public static double GetCurrentScale(RectangleShape worldExtent, float screenWidth, GeographyUnit mapUnit)
        {
            ValidatorHelper.CheckExtentIsValid(worldExtent, "worldExtent");
            ValidatorHelper.CheckInputValueIsLargerThan(screenWidth, "screenWidth", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckGeographyUnitIsValid(mapUnit, "mapUnit");
            return ExtentHelper.GetScale(worldExtent, screenWidth, mapUnit);
        }
public static double GetCurrentScale ( RectangleShape worldExtent , float screenWidth , GeographyUnit mapUnit ) { ValidatorHelper . CheckExtentIsValid ( worldExtent , " " ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenWidth , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckGeographyUnitIsValid ( mapUnit , " " ) ; return ExtentHelper . GetScale ( worldExtent , screenWidth , mapUnit ) ; }
This Static API is used to calculate the scale based on the specified worldExtent
and its corresponding ScreenWidth and MapUnit.
This Static API is used to calculate the scale based on the specified worldExtent and its corresponding ScreenWidth and MapUnit .
worldExtent
RectangleShape
This parameter specifies the worldExtent used to calculate the current
scale.
This parameter specifies the worldExtent used to calculate the current scale .
screenWidth
float
This parameter specifies the screenWidth corresponding to the worldExtent.
This parameter specifies the screenWidth corresponding to the worldExtent .
mapUnit
GeographyUnit
This parameter specifies the unit for the extent, the result will be different if
choose DecimalDegree as Unit and Meter as Unit.
This parameter specifies the unit for the extent the result will be different if choose DecimalDegree as Unit and Meter as Unit .