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); }
public void Extend(LatLngBounds bounds) { Extend(bounds.Lower); Extend(bounds.Upper); }
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); }