diff --git a/.ocamlformat b/.ocamlformat index c54116a..74ae9c5 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,4 +1,4 @@ -version=0.24.1 +version=0.26.1 assignment-operator=end-line break-cases=fit break-fun-decl=wrap diff --git a/example/main.ml b/example/main.ml index 43b9fcd..4a90920 100644 --- a/example/main.ml +++ b/example/main.ml @@ -8,5 +8,5 @@ let () = Leaflet.Layer.add_to map osm_layer; (* 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 diff --git a/src/latlng.ml b/src/latlng.ml index 400200b..89cd3b8 100644 --- a/src/latlng.ml +++ b/src/latlng.ml @@ -2,7 +2,7 @@ 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 |] let lat latlng = Jv.get latlng "lat" |> Jv.to_float diff --git a/src/latlng.mli b/src/latlng.mli index 120d165..3bff192 100644 --- a/src/latlng.mli +++ b/src/latlng.mli @@ -4,7 +4,7 @@ type t (** [create lat lng] is an object representing a geographical point with the given latitude and longitude *) -val create : float -> float -> t +val create : lat:float -> lng:float -> t (** [lat o] is the latitude of [o] *) val lat : t -> float