package brr

  1. Overview
  2. Docs
On This Page
  1. Geolocalizing
Browser programming toolkit for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

brr-0.0.8.tbz
sha512=49e7bfbad2ea6a0139354e4a33c59c8a113c4c1e20a4f629bc5cad24aa801e474b4af10ce35adbda5d23dd294d1de5efa5b10bb3030d03f4758459977250a0f6

doc/brr/Brr_io/Geolocation/index.html

Module Brr_io.GeolocationSource

Access to device location.

See Geolocation API.

Sourcemodule Error : sig ... end

Position errors.

Sourcemodule Pos : sig ... end

Positions.

Sourcetype opts

The type for geolocalisation options.

Sourceval opts : ?high_accuracy:bool -> ?timeout_ms:int -> ?maximum_age_ms:int -> unit -> opts

opts ~high_accuracy ~maximum_age_ms ~timeout_ms () are geolocalisation options.

Geolocalizing

Sourcetype t

The type for device Geolocation objects.

Sourceval of_navigator : Brr.Navigator.t -> t

of_navigator n is a device geolocalisation object for navigator n.

Sourceval get : ?opts:opts -> t -> (Pos.t, Error.t) Fut.result

get l ~opts is the position of l determined with options opts.

Sourcetype watch_id = int

The type for watcher identifiers.

Sourceval watch : ?opts:opts -> t -> ((Pos.t, Error.t) result -> unit) -> watch_id

watch l ~opts f monitors the position of l determined with opts by periodically calling f. Stop watching by calling unwatch with the returned identifier.

Sourceval unwatch : t -> watch_id -> unit

unwatch l id unwatches id as returned by a previous call to watch.