use gadts for layer, clean code

This commit is contained in:
zapashcanon 2022-04-09 22:21:22 +02:00
parent f4ab3e17ad
commit fbfb403734
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1
17 changed files with 152 additions and 163 deletions

View file

@ -9,7 +9,7 @@ type _ sub =
| Move_end : [> `Basic ] sub
| Zoom_end : [> `Basic ] sub
let of_jv_t : type kind. kind sub -> Jv.t -> kind t =
let of_jv : type kind. kind sub -> Jv.t -> kind t =
fun tag e ->
match tag with Click -> Mouse e | Move_end -> Basic e | Zoom_end -> Basic e
@ -48,7 +48,7 @@ let layer_point : [ `Mouse ] t -> Jv.t = function
| Mouse e -> Jv.get e "layerPoint"
let latlng : [ `Mouse ] t -> Latlng.t = function
| Mouse e -> Jv.get e "latlng" |> Latlng.of_jv_t
| Mouse e -> Jv.get e "latlng" |> Latlng.of_jv
(** Error events *)