LatLngBounds
Namespace: Wisej.Web.Ext.GoogleMaps
Assembly: Wisej.Web.Ext.GoogleMaps (4.1.0.0)
A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian.
- C#
- VB.NET
public class LatLngBounds
Public Class LatLngBounds
An instance is returned in Value when the "bounds" property of the map changes. The class doesn't validate, clamp or wrap the values; the ranges described for each property are applied by the Google Maps library.
Example:
Reading the visible area of the map:
private void googleMap1_MapPropertyChanged(object sender, MapPropertyChangedEventArgs e)
{
if (e.Name == "bounds" && e.Value is LatLngBounds bounds)
this.labelBounds.Text = bounds.ToString();
}
Constructors
LatLngBounds()
Initializes a new instance of the LatLngBounds class with all the coordinates set to 0.
Properties
East
Double: Returns or sets the east longitude in degrees. Values outside the range [-180, 180] will be wrapped to the range [-180, 180). For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe.
North
Double: Returns or sets the north latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90.
South
Double: Returns or sets the south latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90.
West
Double: Returns or sets the west longitude in degrees. Values outside the range [-180, 180] will be wrapped to the range [-180, 180). For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe.