Exemple #1
0
		/// <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();
      }
		}
Exemple #2
0
 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;
 }