-> Latlng.create ~lat ~lng

This commit is contained in:
Swrup 2024-01-29 20:27:37 +01:00
parent b9c6864ef1
commit 1118889253
4 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
version=0.24.1 version=0.26.1
assignment-operator=end-line assignment-operator=end-line
break-cases=fit break-cases=fit
break-fun-decl=wrap break-fun-decl=wrap

View file

@ -8,5 +8,5 @@ let () =
Leaflet.Layer.add_to map osm_layer; Leaflet.Layer.add_to map osm_layer;
(* set view *) (* set view *)
let latlng = Leaflet.Latlng.create 40.71 (-74.0) in let latlng = Leaflet.Latlng.create ~lat:40.71 ~lng:(-74.0) in
ignore @@ Leaflet.Map.set_view latlng ~zoom:(Some 13) map ignore @@ Leaflet.Map.set_view latlng ~zoom:(Some 13) map

View file

@ -2,7 +2,7 @@
type t = Jv.t type t = Jv.t
let create lat lng = let create ~lat ~lng =
Jv.call Global.leaflet "latLng" [| Jv.of_float lat; Jv.of_float lng |] Jv.call Global.leaflet "latLng" [| Jv.of_float lat; Jv.of_float lng |]
let lat latlng = Jv.get latlng "lat" |> Jv.to_float let lat latlng = Jv.get latlng "lat" |> Jv.to_float

View file

@ -4,7 +4,7 @@ type t
(** [create lat lng] is an object representing a geographical point with the (** [create lat lng] is an object representing a geographical point with the
given latitude and longitude *) given latitude and longitude *)
val create : float -> float -> t val create : lat:float -> lng:float -> t
(** [lat o] is the latitude of [o] *) (** [lat o] is the latitude of [o] *)
val lat : t -> float val lat : t -> float