Location

class Location(*args, **kwargs)

Implementations: Coordinate, Marker, Point, SymbolEvent, Viewport

An interface common to objects having latitude and longitude

By implementing Location the object declares that it has latitude and longitude and can be used to specify location on the map.

Methods

class Location
distance(other: Location) float

Calculates the distance in meters between two locations.

This function uses the great-circle distance formula, which assumes Earth is a perfect sphere. This limits the accuracy of the result, but is good enough for most purposes.

Added in version 1.2.

Parameters:

other – a Location

get_latitude() float

Gets the latitude coordinate in degrees.

get_longitude() float

Gets the longitude coordinate in degrees.

set_location(latitude: float, longitude: float) None

Sets the coordinates of the location

Parameters:
  • latitude – the latitude in degrees

  • longitude – the longitude in degrees

Properties

class Location
props.latitude: float

The latitude coordonate in degrees

props.longitude: float

The longitude coordonate in degrees

Virtual Methods

class Location
do_get_latitude() float

Gets the latitude coordinate in degrees.

do_get_longitude() float

Gets the longitude coordinate in degrees.

do_set_location(latitude: float, longitude: float) None

Sets the coordinates of the location

Parameters:
  • latitude – the latitude in degrees

  • longitude – the longitude in degrees