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.
- C#
- VB.NET
public class LatLng
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
LatLng()
Initializes a new instance of the LatLng class with latitude and longitude set to 0.
Properties
Lat
Double: Returns or sets the latitude in degrees.
Lng
Double: Returns or sets the longitude in degrees.