Exemple #1
0
 static RectLatLng()
 {
    Empty = new RectLatLng();
 }
Exemple #2
0
 // ok ???
 public bool IntersectsWith(RectLatLng rect)
 {
    return ((((rect.Lng < (this.Lng + this.WidthLng)) && (this.Lng < (rect.Lng + rect.WidthLng))) && (rect.Lat < (this.Lat + this.HeightLat))) && (this.Lat < (rect.Lat + rect.HeightLat)));
 }
Exemple #3
0
 // ok ???
 public static RectLatLng Union(RectLatLng a, RectLatLng b)
 {
    double lng = Math.Min(a.Lng, b.Lng);
    double num2 = Math.Max((double) (a.Lng + a.WidthLng), (double) (b.Lng + b.WidthLng));
    double lat = Math.Min(a.Lat, b.Lat);
    double num4 = Math.Max((double) (a.Lat + a.HeightLat), (double) (b.Lat + b.HeightLat));
    return new RectLatLng(lng, lat, num2 - lng, num4 - lat);
 } 
Exemple #4
0
 // ok ???
 public static RectLatLng Intersect(RectLatLng a, RectLatLng b)
 {
    double lng = Math.Max(a.Lng, b.Lng);
    double num2 = Math.Min((double) (a.Lng + a.WidthLng), (double) (b.Lng + b.WidthLng));
   
    double lat = Math.Max(a.Lat, b.Lat);
    double num4 = Math.Min((double) (a.Lat + a.HeightLat), (double) (b.Lat + b.HeightLat));
   
    if((num2 >= lng) && (num4 >= lat))
    {
       return new RectLatLng(lng, lat, num2 - lng, num4 - lat);
    }
    return Empty;
 }
Exemple #5
0
 public void Intersect(RectLatLng rect)
 {
    RectLatLng ef = Intersect(rect, this);
    this.Lng = ef.Lng;
    this.Lat = ef.Lat;
    this.WidthLng = ef.WidthLng;
    this.HeightLat = ef.HeightLat;
 }
Exemple #6
0
 public static RectLatLng Inflate(RectLatLng rect, double lat, double lng)
 {
    RectLatLng ef = rect;
    ef.Inflate(lat, lng);
    return ef;
 }
Exemple #7
0
 public bool Contains(RectLatLng rect)
 {
    return ((((this.Lng <= rect.Lng) && ((rect.Lng + rect.WidthLng) <= (this.Lng + this.WidthLng))) && (this.Lat >= rect.Lat)) && ((rect.Lat - rect.HeightLat) >= (this.Lat - this.HeightLat)));
 }
Exemple #8
0
      /// <summary>
      /// gets all tiles in view at specific zoom
      /// </summary>
      public List<Point> GetAreaTileList(RectLatLng rect, int zoom)
      {
         List<Point> ret = new List<Point>();

         Point topLeft = FromPixelToTileXY(FromLatLngToPixel(rect.Location, zoom));
         Point rightBottom = FromPixelToTileXY(FromLatLngToPixel(rect.Right, rect.Bottom, zoom));

         for(int x = topLeft.X; x <= rightBottom.X; x++)
         {
            for(int y = topLeft.Y; y <= rightBottom.Y; y++)
            {
               ret.Add(new Point(x, y));
            }
         }
         ret.TrimExcess();

         return ret;
      }