-> Latlng.create ~lat ~lng
This commit is contained in:
parent
4413b178a1
commit
82f0015761
4 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue