本文整理汇总了C#中Envelope.GetCenter方法的典型用法代码示例。如果您正苦于以下问题:C# Envelope.GetCenter方法的具体用法?C# Envelope.GetCenter怎么用?C# Envelope.GetCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Envelope
的用法示例。
在下文中一共展示了Envelope.GetCenter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Expand
private Envelope Expand(Envelope e)
{
double factor = 0.6;
MapPoint centerMapPoint = e.GetCenter();
return new Envelope(centerMapPoint.X - e.Width * factor, centerMapPoint.Y - e.Height * factor,
centerMapPoint.X + e.Width * factor, centerMapPoint.Y + e.Height * factor);
}
示例2: GetDistance
private static double GetDistance(Envelope extent)
{
// get the distance between the center of the current map extent and one of its corners
if (extent != null && !extent.IsEmpty)
{
var d = GeometryEngine.GeodesicLength(new Polyline(new PointCollection(extent.SpatialReference){ extent.GetCenter(), new MapPoint(extent.XMin, extent.YMin) },
extent.SpatialReference), GeodeticCurveType.GreatElliptic);
// to increase the chances of finding results make sure the smallest returned distance is 5 Kilometers.
return (d <= 5000.0) ? 5000.0 : d;
}
return 5000.0; // return a default distance of 5 Kilometers
}