Skip to main content

LatLng

Namespace: Wisej.Web.Ext.GoogleMaps

Assembly: Wisej.Web.Ext.GoogleMaps (4.1.0.0)

A LatLng is a point in geographical coordinates: latitude and longitude.

public class LatLng

Latitude ranges between -90 and 90 degrees, inclusive. When the value is used by the Google Maps library on the client, values above or below this range are 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. Longitude ranges between -180 and 180 degrees, inclusive. Values above or below this range are wrapped by the Google Maps library so that they fall within the range. 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. Although the default map projection associates longitude with the x-coordinate of the map, and latitude with the y-coordinate, the latitude coordinate is always written first, followed by the longitude. The LatLng class doesn't validate, clamp or wrap the values assigned to Lat and Lng.

Example:

Creating a location and using it to center the map:

var location = new LatLng { Lat = 37.7749, Lng = -122.4194 };
this.googleMap1.Options.center = location;
this.googleMap1.AddMarker("sf", location);

Constructors​

Instance member LatLng()​

Initializes a new instance of the LatLng class with latitude and longitude set to 0.

Properties​

Instance member Lat​

Double: Returns or sets the latitude in degrees.

Instance member Lng​

Double: Returns or sets the longitude in degrees.