New to Telerik UI for WPFStart a free 30-day trial

Location

Struct

Represents latitude and longitude.

Definition

Namespace:Telerik.Windows.Controls.Map

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

C#
[TypeConverter(typeof(LocationConverter))]
public struct Location

Constructors

Initializes a new instance of the Location structure.

C#
public Location(double latitude, double longitude)
Parameters:latitudedouble

Latitude.

longitudedouble

Longitude.

Properties

Gets or sets a string indicating the geocode method that was used to match the location to the map.

C#
public string CalculationMethod { get; set; }

Gets or sets the description of the location.

C#
public string Description { get; set; }

Gets a value that represents an empty Location structure.

C#
public static Location Empty { get; }
Remarks:

A Location structure with Latitude and Longitude values set to 0 is not empty. An empty Location structure has Latitude and Longitude values set to negative infinity. This is the only time a Location structure can have negative infinity values.

Gets a value that indicates whether this Location structure is empty.

C#
public bool IsEmpty { get; }
Remarks:

A Location structure with Latitude and Longitude values set to 0 is not empty. An empty Location structure has Latitude and Longitude values set to negative infinity. This is the only time a Location structure can have negative infinity values.

Get or sets latitude.

C#
public double Latitude { get; set; }

Get or sets longitude.

C#
public double Longitude { get; set; }

Methods

Compares two Location structures for equality.

C#
public static bool Equals(Location location1, Location location2)
Parameters:location1Location

The instance of Location to compare.

location2Location

The instance of Location to compare.

Returns:

bool

true if instances are equal; otherwise, false.

Compares two Location structures for equality.

C#
public override bool Equals(object obj)
Parameters:objobject

The instance of Location to compare to this instance.

Returns:

bool

true if instances are equal; otherwise, false.

Overrides: ValueType.Equals(object)

Gets coordinates of the point relative to the map control screen coordinates.

C#
public static Location GetCoordinates(RadMap mapControl, Point point)
Parameters:mapControlRadMap

The map control instance.

pointPoint

Point.

Returns:

Location

Location.

Gets a hash code for this Location structure.

C#
public override int GetHashCode()
Returns:

int

A hash code for this Location structure.

Overrides: ValueType.GetHashCode()

Gets location of the Location structure on the given RadMap control as Point relative to the size of the control.

C#
public Point GetPoint(RadMap mapControl)
Parameters:mapControlRadMap

RadMap control.

Returns:

Point

Point on the RadMap control.

Convert a logic point to a Pixel Point on the current screen at a particular zoom level.

C#
public static Point LogicalToPixel(RadMap mapControl, Point logicalPoint)
Parameters:mapControlRadMap

The map control instance.

logicalPointPoint

The logical Point.

Returns:

Point

Pixel Point.

Converts a String representation of a Latitude-Longitude into the equivalent Location object.

C#
public static Location Parse(string source, IFormatProvider provider = null)
Parameters:sourcestring

The String representation of the Location object.

providerIFormatProvider

The IFormatProvider used to format the Latitude / Longitude doubles.

Returns:

Location

The equivalent Location structure.

Convert a pixel point to a Logical Point on the current screen.

C#
public static Point PixelToLogical(RadMap mapControl, Point pixel)
Parameters:mapControlRadMap

The map control instance.

pixelPoint

Pixel Point.

Returns:

Point

The logical Point.

Creates a String representation of this Location object using KML format. KML uses sequence of the Latitude and Longitude. Longitude is first and the Latitude is second.

C#
public string ToKmlString(IFormatProvider provider)
Parameters:providerIFormatProvider

The culture-specific formatting information.

Returns:

string

A String containing the Latitude and Longitude values of this Location object in KML format.

Creates a String representation of this Location object. By default it uses CultureInfo.CurrentCulture to store the Latitude / Longitude. To use Invariant or other Culture, use the override ToString(IFormatProvider).

C#
public override string ToString()
Returns:

string

A String containing the Latitude and Longitude values of this Location object.

Overrides: ValueType.ToString()

Creates a String representation of this Location object.

C#
public string ToString(IFormatProvider provider)
Parameters:providerIFormatProvider

The culture-specific formatting information.

Returns:

string

A String containing the Latitude and Longitude values of this Location object.

Creates a String representation of this Location object.

C#
public string ToString(string format, IFormatProvider provider)
Parameters:formatstring

The string format for the Latitude and Longitute properties.

providerIFormatProvider

The culture-specific formatting information.

Returns:

string

A String containing the Latitude and Longitude values of this Location object formatted with specified string format and IFormatProvider.

Creates a String representation of this Location object.

C#
public string ToString(string format)
Parameters:formatstring

The string format for the Latitude and Longitute properties.

Returns:

string

A String containing the Latitude and Longitude values of this Location object with applied string format for the current culture.

Operators

Converts this Location structure into a Point structure.

C#
public static explicit operator Point(Location location)
Parameters:locationLocation

The Location to convert.

Returns:

Point

The result of converting.

Compares two Location structures for inequality.

C#
public static bool operator !=(Location location1, Location location2)
Parameters:location1Location

The instance of Location to compare.

location2Location

The instance of Location to compare.

Returns:

bool

true if instances are equal; otherwise, false.

Compares two Location structures for equality.

C#
public static bool operator ==(Location location1, Location location2)
Parameters:location1Location

The instance of Location to compare.

location2Location

The instance of Location to compare.

Returns:

bool

true if instances are equal; otherwise, false.