当前位置: 首页>>代码示例>>C#>>正文


C# SharpMap.GetCentroid方法代码示例

本文整理汇总了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();
      }
		}
开发者ID:diegowald,项目名称:intellitrack,代码行数:19,代码来源:Map.cs

示例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;
 }
开发者ID:diegowald,项目名称:intellitrack,代码行数:18,代码来源:ComplexMap.cs


注:本文中的SharpMap.GetCentroid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。