Struct
Location

Represents latitude and longitude.

Definition

Namespace:Telerik.Windows.Controls.Map

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

cs-api-definition
[TypeConverter(typeof(LocationConverter))]
public struct Location

Constructors

Location(double, double)

Initializes a new instance of the Location structure.

Declaration

cs-api-definition
public Location(double latitude, double longitude)

Parameters

latitude

double

Latitude.

longitude

double

Longitude.

Properties

CalculationMethod

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

Declaration

cs-api-definition
public string CalculationMethod { get; set; }

Property Value

string

Description

Gets or sets the description of the location.

Declaration

cs-api-definition
public string Description { get; set; }

Property Value

string

Empty

Gets a value that represents an empty Location structure.

Declaration

cs-api-definition
public static Location Empty { get; }

Property Value

Location

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.

IsEmpty

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

Declaration

cs-api-definition
public bool IsEmpty { get; }

Property Value

bool

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.

Latitude

Get or sets latitude.

Declaration

cs-api-definition
public double Latitude { get; set; }

Property Value

double

Longitude

Get or sets longitude.

Declaration

cs-api-definition
public double Longitude { get; set; }

Property Value

double

Methods

Equals(Location, Location)

Compares two Location structures for equality.

Declaration

cs-api-definition
public static bool Equals(Location location1, Location location2)

Parameters

location1

Location

The instance of Location to compare.

location2

Location

The instance of Location to compare.

Returns

bool

true if instances are equal; otherwise, false.

Equals(object)

Compares two Location structures for equality.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

The instance of Location to compare to this instance.

Returns

bool

true if instances are equal; otherwise, false.

Overrides ValueType.Equals(object)

GetCoordinates(RadMap, Point)

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

Declaration

cs-api-definition
public static Location GetCoordinates(RadMap mapControl, Point point)

Parameters

mapControl

RadMap

The map control instance.

point

Point

Point.

Returns

Location

Location.

GetHashCode()

Gets a hash code for this Location structure.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

A hash code for this Location structure.

Overrides ValueType.GetHashCode()

GetPoint(RadMap)

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

Declaration

cs-api-definition
public Point GetPoint(RadMap mapControl)

Parameters

mapControl

RadMap

RadMap control.

Returns

Point

Point on the RadMap control.

LogicalToPixel(RadMap, Point)

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

Declaration

cs-api-definition
public static Point LogicalToPixel(RadMap mapControl, Point logicalPoint)

Parameters

mapControl

RadMap

The map control instance.

logicalPoint

Point

The logical Point.

Returns

Point

Pixel Point.

Parse(string, IFormatProvider)

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

Declaration

cs-api-definition
public static Location Parse(string source, IFormatProvider provider = null)

Parameters

source

string

The String representation of the Location object.

provider

IFormatProvider

The IFormatProvider used to format the Latitude / Longitude doubles.

Returns

Location

The equivalent Location structure.

PixelToLogical(RadMap, Point)

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

Declaration

cs-api-definition
public static Point PixelToLogical(RadMap mapControl, Point pixel)

Parameters

mapControl

RadMap

The map control instance.

pixel

Point

Pixel Point.

Returns

Point

The logical Point.

ToKmlString(IFormatProvider)

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.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Kml")]
public string ToKmlString(IFormatProvider provider)

Parameters

provider

IFormatProvider

The culture-specific formatting information.

Returns

string

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

ToString()

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).

Declaration

cs-api-definition
public override string ToString()

Returns

string

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

Overrides ValueType.ToString()

ToString(IFormatProvider)

Creates a String representation of this Location object.

Declaration

cs-api-definition
public string ToString(IFormatProvider provider)

Parameters

provider

IFormatProvider

The culture-specific formatting information.

Returns

string

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

ToString(string)

Creates a String representation of this Location object.

Declaration

cs-api-definition
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed.")]
public string ToString(string format)

Parameters

format

string

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.

ToString(string, IFormatProvider)

Creates a String representation of this Location object.

Declaration

cs-api-definition
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed.")]
public string ToString(string format, IFormatProvider provider)

Parameters

format

string

The string format for the Latitude and Longitute properties.

provider

IFormatProvider

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.

Operators

explicit operator Point(Location)

Converts this Location structure into a Point structure.

Declaration

cs-api-definition
public static explicit operator Point(Location location)

Parameters

location

Location

The Location to convert.

Returns

Point

The result of converting.

operator !=(Location, Location)

Compares two Location structures for inequality.

Declaration

cs-api-definition
public static bool operator !=(Location location1, Location location2)

Parameters

location1

Location

The instance of Location to compare.

location2

Location

The instance of Location to compare.

Returns

bool

true if instances are equal; otherwise, false.

operator ==(Location, Location)

Compares two Location structures for equality.

Declaration

cs-api-definition
public static bool operator ==(Location location1, Location location2)

Parameters

location1

Location

The instance of Location to compare.

location2

Location

The instance of Location to compare.

Returns

bool

true if instances are equal; otherwise, false.