leaflet/src/point.ml

15 lines
276 B
OCaml
Raw Normal View History

2022-04-12 15:26:49 +02:00
(* BSD-2-Clause License *)
type t =
{ x : int
; y : int
}
let of_jv point =
let x = Jv.get point "x" |> Jv.to_int in
let y = Jv.get point "y" |> Jv.to_int in
{ x; y }
2022-06-20 07:57:38 +02:00
let to_jv point =
Jv.call Global.leaflet "point" [| Jv.of_int point.x; Jv.of_int point.y |]