skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class Location

Represents latitude and longitude.

Inheritance
System.Object
Location
Namespace: Telerik.Windows.Controls.Map
Assembly: Telerik.Windows.Controls.DataVisualization.dll

Syntax

public sealed class Location : ValueType

Constructors

Location(Double, Double)

Initializes a new instance of the Location structure.

Declaration
public Location(double latitude, double longitude)
Parameters
System.Double latitude

Latitude.

System.Double longitude

Longitude.

Properties

CalculationMethod

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

Declaration
public string CalculationMethod { get; set; }
Property Value
System.String

Description

Gets or sets the description of the location.

Declaration
public string Description { get; set; }
Property Value
System.String

Empty

Gets a value that represents an empty Location structure.

Declaration
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
public bool IsEmpty { get; }
Property Value
System.Boolean

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
public double Latitude { get; set; }
Property Value
System.Double

Longitude

Get or sets longitude.

Declaration
public double Longitude { get; set; }
Property Value
System.Double

Methods

Equals(Object)

Compares two Location structures for equality.

Declaration
public override bool Equals(object obj)
Parameters
System.Object obj

The instance of Location to compare to this instance.

Returns
System.Boolean

true if instances are equal; otherwise, false.

Equals(Location, Location)

Compares two Location structures for equality.

Declaration
public static bool Equals(Location location1, Location location2)
Parameters
Location location1

The instance of Location to compare.

Location location2

The instance of Location to compare.

Returns
System.Boolean

true if instances are equal; otherwise, false.

GetCoordinates(RadMap, Point)

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

Declaration
public static Location GetCoordinates(RadMap mapControl, Point point)
Parameters
RadMap mapControl

The map control instance.

System.Windows.Point point

Point.

Returns
Location

Location.

GetHashCode()

Gets a hash code for this Location structure.

Declaration
public override int GetHashCode()
Returns
System.Int32

A hash code for this Location structure.

GetPoint(RadMap)

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

Declaration
public Point GetPoint(RadMap mapControl)
Parameters
RadMap mapControl

RadMap control.

Returns
System.Windows.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
public static Point LogicalToPixel(RadMap mapControl, Point logicalPoint)
Parameters
RadMap mapControl

The map control instance.

System.Windows.Point logicalPoint

The logical Point.

Returns
System.Windows.Point

Pixel Point.

Parse(String, IFormatProvider)

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

Declaration
public static Location Parse(string source, IFormatProvider provider = null)
Parameters
System.String source

The String representation of the Location object.

System.IFormatProvider provider

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
public static Point PixelToLogical(RadMap mapControl, Point pixel)
Parameters
RadMap mapControl

The map control instance.

System.Windows.Point pixel

Pixel Point.

Returns
System.Windows.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
public string ToKmlString(IFormatProvider provider)
Parameters
System.IFormatProvider provider

The culture-specific formatting information.

Returns
System.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
public override string ToString()
Returns
System.String

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

ToString(IFormatProvider)

Creates a String representation of this Location object.

Declaration
public string ToString(IFormatProvider provider)
Parameters
System.IFormatProvider provider

The culture-specific formatting information.

Returns
System.String

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

ToString(String)

Creates a String representation of this Location object.

Declaration
public string ToString(string format)
Parameters
System.String format

The string format for the Latitude and Longitute properties.

Returns
System.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
public string ToString(string format, IFormatProvider provider)
Parameters
System.String format

The string format for the Latitude and Longitute properties.

System.IFormatProvider provider

The culture-specific formatting information.

Returns
System.String

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

Operators

Equality(Location, Location)

Compares two Location structures for equality.

Declaration
public static bool operator ==(Location location1, Location location2)
Parameters
Location location1

The instance of Location to compare.

Location location2

The instance of Location to compare.

Returns
System.Boolean

true if instances are equal; otherwise, false.

Explicit(Location to Point)

Converts this Location structure into a Point structure.

Declaration
public static explicit operator Point(Location location)
Parameters
Location location

The Location to convert.

Returns
System.Windows.Point

The result of converting.

Inequality(Location, Location)

Compares two Location structures for inequality.

Declaration
public static bool operator !=(Location location1, Location location2)
Parameters
Location location1

The instance of Location to compare.

Location location2

The instance of Location to compare.

Returns
System.Boolean

true if instances are equal; otherwise, false.

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.