本文整理汇总了C#中SharpMap.GetCentroid方法的典型用法代码示例。如果您正苦于以下问题:C# SharpMap.GetCentroid方法的具体用法?C# SharpMap.GetCentroid怎么用?C# SharpMap.GetCentroid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpMap
的用法示例。
在下文中一共展示了SharpMap.GetCentroid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ZoomToBox
/// <summary>
/// Zooms the map to fit a bounding box
/// </summary>
/// <remarks>
/// NOTE: If the aspect ratio of the box and the aspect ratio of the mapsize
/// isn't the same, the resulting map-envelope will be adjusted so that it contains
/// the bounding box, thus making the resulting envelope larger!
/// </remarks>
/// <param name="bbox"></param>
public void ZoomToBox(SharpMap.Geometries.BoundingBox bbox)
{
if (bbox != null)
{
this._Zoom = bbox.Width; //Set the private center value so we only fire one MapOnViewChange event
if (this.Envelope.Height < bbox.Height)
this._Zoom *= bbox.Height / this.Envelope.Height;
this.Center = bbox.GetCentroid();
}
}
示例2: SelectElements
public SharpMap.Data.FeatureDataSet SelectElements(SharpMap.Geometries.BoundingBox bbox, string layername)
{
if (!_MapLoaded)
return null;
SharpMap.Data.FeatureDataSet fds = new SharpMap.Data.FeatureDataSet();
SharpMap.Layers.VectorLayer l = (SharpMap.Layers.VectorLayer)Layers_[layername];
l.DataSource.Open();
if (layername == "Frentes")
{
(l.DataSource as SharpMap.Data.Providers.MemoryDataProvider<IntelliTrack.Data.FrenteDataPoint>).ExecuteIntersectionQuery2(bbox.GetCentroid(), fds);
}
else
{
l.DataSource.ExecuteIntersectionQuery(bbox, fds);
}
l.DataSource.Close();
return fds;
}