make Map.create take Brr.El
This commit is contained in:
parent
2965572a4b
commit
d242b1ac6e
4 changed files with 12 additions and 6 deletions
|
|
@ -6,8 +6,10 @@ let of_jv = Fun.id
|
|||
|
||||
let to_jv = Fun.id
|
||||
|
||||
let create ?(options = Jv.null) container_id =
|
||||
Jv.call Global.leaflet "map" [| Jv.of_string container_id; options |]
|
||||
let create ?(options = Jv.null) container =
|
||||
match Brr.El.at (Jstr.of_string "id") container with
|
||||
| None -> failwith "container doesn't have id"
|
||||
| Some id -> Jv.call Global.leaflet "map" [| Jv.of_jstr id; options |]
|
||||
|
||||
let invalidate_size map =
|
||||
let (_ : Jv.t) = Jv.call map "invalidateSize" [| Jv.true' |] in
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
type t
|
||||
|
||||
val create : ?options:Jv.t -> string -> t
|
||||
val create : ?options:Jv.t -> Brr.El.t -> t
|
||||
|
||||
val invalidate_size : t -> unit
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue