add layer

This commit is contained in:
Swrup 2022-04-08 13:21:20 +02:00
parent d99eafccbf
commit d9f25e4d8d
11 changed files with 123 additions and 35 deletions

23
src/layer.ml Normal file
View file

@ -0,0 +1,23 @@
type t = Jv.t
let add_to map layer = ignore @@ Jv.call layer "addTo" [| Map.to_jv_t map |]
let remove layer = ignore @@ Jv.call layer "remove" [||]
let remove_from map layer =
ignore @@ Jv.call layer "removeFrom" [| Map.to_jv_t map |]
let bind_popup el layer =
ignore @@ Jv.call layer "bindPopup" [| Brr.El.to_jv el |]
let unbind_popup layer = ignore @@ Jv.call layer "unbindPopup" [||]
let open_popup layer = ignore @@ Jv.call layer "openPopup" [||]
let close_popup layer = ignore @@ Jv.call layer "closePopup" [||]
let get_popup layer = Popup.of_jv_t @@ Jv.call layer "getPopup" [||]
let of_jv_t = Fun.id
let to_jv_t = Fun.id