:right-sidebar: True Location =================================================================== .. currentmodule:: gi.repository.Shumate .. class:: Location(*args, **kwargs) :no-contents-entry: Implementations: :class:`~gi.repository.Shumate.Coordinate`, :class:`~gi.repository.Shumate.Marker`, :class:`~gi.repository.Shumate.Point`, :class:`~gi.repository.Shumate.SymbolEvent`, :class:`~gi.repository.Shumate.Viewport` An interface common to objects having latitude and longitude By implementing :obj:`~gi.repository.Shumate.Location` the object declares that it has latitude and longitude and can be used to specify location on the map. Methods ------- .. rst-class:: interim-class .. class:: Location :no-index: .. method:: distance(other: ~gi.repository.Shumate.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. .. versionadded:: 1.2 :param other: a :obj:`~gi.repository.Shumate.Location` .. method:: get_latitude() -> float Gets the latitude coordinate in degrees. .. method:: get_longitude() -> float Gets the longitude coordinate in degrees. .. method:: set_location(latitude: float, longitude: float) -> None Sets the coordinates of the location :param latitude: the latitude in degrees :param longitude: the longitude in degrees Properties ---------- .. rst-class:: interim-class .. class:: Location :no-index: .. attribute:: props.latitude :type: float The type of the None singleton. .. attribute:: props.longitude :type: float The type of the None singleton. Virtual Methods --------------- .. rst-class:: interim-class .. class:: Location :no-index: .. method:: do_get_latitude() -> float Gets the latitude coordinate in degrees. .. method:: do_get_longitude() -> float Gets the longitude coordinate in degrees. .. method:: do_set_location(latitude: float, longitude: float) -> None Sets the coordinates of the location :param latitude: the latitude in degrees :param longitude: the longitude in degrees