URL v0.4.1 URL.Geo View Source

Parses a geo URL

Link to this section Summary

Functions

Parse a URI with the :scheme of “geo”

Link to this section Types

Link to this type t() View Source
t() :: %URL.Geo{
  alt: nil | number(),
  lat: number(),
  lng: number(),
  params: Map.t()
}

Link to this section Functions

Link to this function parse(uri) View Source
parse(URI.t()) :: URL.Geo.t() | {:error, {module(), binary()}}

Parse a URI with the :scheme of “geo”

Example

iex> geo = URI.parse("geo:48.198634,-16.371648,3.4;crs=wgs84;u=40.0")
iex> URL.Geo.parse(geo)
%URL.Geo{
  alt: 3.4,
  lat: 48.198634,
  lng: -16.371648,
  params: %{"crs" => "wgs84", "u" => 40.0}
}