Exemplo n.º 1
0
        public static LatLngBounds FromList(List <LatLng> points)
        {
            LatLngBounds bounds = new LatLngBounds(points.First(), points.Last());

            foreach (var point in points)
            {
                if (point.Lat < bounds.Lower.Lat)
                {
                    bounds.Lower.Lat = point.Lat;
                }
                if (point.Lat > bounds.Upper.Lat)
                {
                    bounds.Upper.Lat = point.Lat;
                }
                if (point.Lng < bounds.Lower.Lng)
                {
                    bounds.Lower.Lng = point.Lng;
                }
                if (point.Lng > bounds.Upper.Lng)
                {
                    bounds.Upper.Lng = point.Lng;
                }
            }
            return(bounds);
        }
Exemplo n.º 2
0
 public void Extend(LatLngBounds bounds)
 {
     Extend(bounds.Lower);
     Extend(bounds.Upper);
 }
Exemplo n.º 3
0
 public bool Contains(LatLngBounds other)
 {
     return(Lower.Lat <= other.Lower.Lat && Lower.Lng <= other.Lower.Lng && Upper.Lat >= other.Upper.Lat && Upper.Lng >= other.Upper.Lng);
 }