@@ -684,27 +684,11 @@ let wait_for_service_worker =
684684 (as_target r));
685685 fut
686686
687- (*
688- let get_position () =
689- let open Fut.Syntax in
690- let open Brr_io.Geolocation in
691- let opts = opts ~high_accuracy:true () in
692- let+ pos = get ~opts (of_navigator Brr.G.navigator) in
693- match pos with
694- | Ok pos -> Ok (Pos.latitude pos, Pos.longitude pos, 0.)
695- | Error _ -> assert false
696- *)
697-
698- let get_position () =
687+ let get_preset_position () =
699688 let pos =
700- if true then (44.3950846 , 6.7669714 , 170. )
701- else if
702- (* if true then (48.849418, 2.3674101, 0.)
703- else*)
704- true
705- then (44.607649 , 6.8204019 , 220. )
706- (* (44.607728, 6.821075, 0.)*)
707- (* Col Girardin *)
689+ if true then (44.3950846 , 6.7669714 , 170. ) (* La Chalannette, Jausiers *)
690+ else if true then (48.849418 , 2.3674101 , 0. ) (* Paris *)
691+ else if true then (44.607649 , 6.8204019 , 220. ) (* Col Girardin *)
708692 else if true then (44.209067 , 6.9423065 , 0. ) (* Col du Blainon *)
709693 else if true then (44.207447 , 6.906400 , 40. )
710694 (* Auron vers est vallée de la Tinée *)
@@ -717,6 +701,17 @@ let get_position () =
717701 in
718702 Fut. return (Ok pos)
719703
704+ let get_position () =
705+ if true then get_preset_position ()
706+ else
707+ let open Fut.Syntax in
708+ let open Brr_io.Geolocation in
709+ let opts = opts ~high_accuracy: true () in
710+ let + pos = get ~opts (of_navigator Brr.G. navigator) in
711+ match pos with
712+ | Ok pos -> Ok (Pos. latitude pos, Pos. longitude pos, 0. )
713+ | Error err -> Error (Jv.Error. v (Error. message err))
714+
720715let main () =
721716 let * () = to_lwt wait_for_service_worker in
722717 let * lat, lon, angle = to_lwt (get_position () ) in
0 commit comments