Js_of_ocaml.GeolocationGeolocation API
A code example:
if (Geolocation.is_supported()) then
  let geo = Geolocation.geolocation in
  let options = Geolocation.empty_position_options() in
  let () = options##.enableHighAccuracy := true in
  let f_success pos =
    let coords = pos##.coords in
    let latitude = coords##.latitude in
    Firebug.console##debug latitude ;
  in
  let f_error err =
    let code = err##.code in
    let msg = err##.message in
    if code = err##._TIMEOUT then Firebug.console##debug(msg)
  in
  geo##getCurrentPosition (Js.wrap_callback f_success) (Js.wrap_callback f_error) optionsclass type  coordinates = object ... endclass type  position = object ... endclass type  positionOptions = object ... endclass type  positionError = object ... endclass type  geolocation = object ... endval empty_position_options : unit -> positionOptions Js.tval geolocation : geolocation Js.t