• Getting Started
  • Components
    • Barcodes
    • Buttons
    • Chartsupdated
    • Conversational UIupdated
    • Data Query
    • Date Inputsupdated
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filter
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicators
    • Inputsupdated
    • Labels
    • Layout
    • ListBox
    • ListView
    • Map
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PDFViewer
    • PivotGridupdated
    • Popup
    • ProgressBars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • ToolBar
    • Tooltips
    • TreeList
    • TreeView
    • Typography
    • Uploads
    • Utilities
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
  • Updates
  • Changelogs
New to Kendo UI for Angular? Start a free 30-day trial

Location

Represents a geographic location.

NameTypeDefaultDescription

lat

number

The location latitude in decimal degrees.

lng

number

The location longitude in decimal degrees.

Constructors

Location

(lat: number, lng: number)

Creates a new Location.

Parameters

lat

number

The location latitude in decimal degrees.
lng

number

The location longitude in decimal degrees.

Methods

clone

Creates a new instance with the same coordinates.

Returns

Location

The new Location instance.

destination

Finds a destination at the given distance and bearing from this location.

Parameters

distance

number

The distance to the destination in meters.

bearing

number

The initial bearing to the destination in decimal degrees.

Returns

Location

The destination at the given distance and bearing.

distanceTo

Calculates the great-circle distance to the given destination in meters.

Parameters

destination

Location

The destination location.

Returns

number

The distance to the specified location in meters.

equals

Compares this location with another instance.

Parameters

location

Location

The location to compare with.

Returns

boolean

true if the location coordinates match; false otherwise.

fromLatLng

Creates a Location instance from an [latitude, longitude] array.

Parameters

latlng

number[] | [number, number]

The [latitude, longitude] array.

Returns

Location

The Location instance.

fromLngLat

Creates a Location instance from an [longitude, latitude] array.

Parameters

lnglat

number[] | [number, number]

The [longitude, latitude] array.

Returns

Location

The Location instance.

round

Rounds the location coordinates to the specified number of fractional digits.

Parameters

digits

number

Number of fractional digits.

Returns

Location

The current Location instance.

toArray

Returns the location coordinates as an [lat, lng] array.

Returns

[number, number]

An array representation of the location.

toString

Returns the location coordinates formatted as '{lat},{lng}'.

Returns

string

A string representation of the location.

wrap

Wraps the latitude and longitude to fit into the [0, 90] and [0, 180] range.

Returns

Location

The current Location instance.