diff --git a/sw/lib/ocaml/mapWaypoints.ml b/sw/lib/ocaml/mapWaypoints.ml index 9f5ce09955..938e89ef0f 100644 --- a/sw/lib/ocaml/mapWaypoints.ml +++ b/sw/lib/ocaml/mapWaypoints.ml @@ -52,7 +52,7 @@ let rotation_45 = let s = sin (Latlong.pi/.4.) in [|s;s;-.s;s;0.;0.|] -class waypoint = fun (wpts_group:group) (name :string) ?(alt=0.) wgs84 -> +class waypoint = fun ?(show = true) (wpts_group:group) (name :string) ?(alt=0.) wgs84 -> let geomap=wpts_group#geomap and color = wpts_group#color and editable = wpts_group#editable in @@ -82,6 +82,8 @@ class waypoint = fun (wpts_group:group) (name :string) ?(alt=0.) wgs84 -> val mutable moved = None val mutable deleted = false val mutable commit_cb = None + initializer + if not show then wpt_group#hide () initializer item#affine_absolute rotation_45; self#move xw yw @@ -282,6 +284,6 @@ class waypoint = fun (wpts_group:group) (name :string) ?(alt=0.) wgs84 -> let gensym = let n = ref 0 in fun prefix -> incr n; prefix ^ string_of_int !n -let waypoint = fun group ?(name = gensym "wp") ?alt en -> - new waypoint group name ?alt en +let waypoint = fun ?show group ?(name = gensym "wp") ?alt en -> + new waypoint ?show group name ?alt en diff --git a/sw/lib/ocaml/mapWaypoints.mli b/sw/lib/ocaml/mapWaypoints.mli index eae39df243..248e8c7eb7 100644 --- a/sw/lib/ocaml/mapWaypoints.mli +++ b/sw/lib/ocaml/mapWaypoints.mli @@ -38,6 +38,7 @@ class group : end class waypoint : + ?show:bool -> group -> string -> ?alt:float -> @@ -64,4 +65,4 @@ class waypoint : end -val waypoint : group -> ?name:string -> ?alt:float -> Latlong.geographic -> waypoint +val waypoint : ?show:bool -> group -> ?name:string -> ?alt:float -> Latlong.geographic -> waypoint