diff --git a/sw/ground_segment/cockpit/map2d.ml b/sw/ground_segment/cockpit/map2d.ml index bd19830bdf..be456996ed 100644 --- a/sw/ground_segment/cockpit/map2d.ml +++ b/sw/ground_segment/cockpit/map2d.ml @@ -1347,7 +1347,7 @@ let _main = and center = ref "" and zoom = ref 1. and maximize = ref false - and projection= ref G.UTM + and projection = ref G.Mercator and auto_ortho = ref false and mplayer = ref "" and plugin_window = ref "" in @@ -1360,7 +1360,8 @@ let _main = "-center_ac", Arg.Set auto_center_new_ac, "Centers the map on any new A/C"; "-plugin", Arg.Set_string plugin_window, "External X application (launched the id of the plugin window as argument)"; "-mplayer", Arg.Set_string mplayer, "Launch mplayer with the given argument as X plugin"; - "-mercator", Arg.Unit (fun () -> projection:=G.Mercator),"Switch to (Google Maps) Mercator projection"; + "-utm", Arg.Unit (fun () -> projection:=G.Mercator),"Switch to UTM local projection"; + "-mercator", Arg.Unit (fun () -> projection:=G.Mercator),"Switch to (Google Maps) Mercator projection, default"; "-lambertIIe", Arg.Unit (fun () -> projection:=G.LambertIIe),"Switch to LambertIIe projection"; "-ign", Arg.String (fun s -> ign:=true; IGN.data_path := s), "IGN tiles path"; "-ortho", Arg.Set_string get_bdortho, "IGN tiles path"; diff --git a/sw/lib/ocaml/mapFP.ml b/sw/lib/ocaml/mapFP.ml index a3c8c554b9..5e803218d1 100644 --- a/sw/lib/ocaml/mapFP.ml +++ b/sw/lib/ocaml/mapFP.ml @@ -85,9 +85,13 @@ let update_xml = fun xml_tree utm0 wp -> let xml_wpts = XmlEdit.children (waypoints_node xml_tree) in let node = List.find (fun w -> XmlEdit.attrib w "name" = wp#name) xml_wpts in let utm = utm_of WGS84 (wp#pos) in - let (dx, dy) = utm_sub utm utm0 in - XmlEdit.set_attribs node ["name",wp#name; "x",sof dx; "y",sof dy; "alt", sof wp#alt] - + try + let (dx, dy) = utm_sub utm utm0 in + XmlEdit.set_attribs node ["name",wp#name; "x",sof dx; "y",sof dy; "alt", sof wp#alt] + with + _ -> + prerr_endline "MapFP.update_xml: waypoint too far from ref (FIXME)" + let new_wp = fun xml_tree waypoints utm_ref ?(alt = 0.) node -> let float_attrib = fun a -> float_of_string (XmlEdit.attrib node a) in let x = (float_attrib "x") and y = (float_attrib "y") in