small popup change

This commit is contained in:
Swrup 2022-12-31 02:45:32 +01:00
parent 1e581ef172
commit b9c6864ef1
3 changed files with 6 additions and 6 deletions

View file

@ -48,7 +48,7 @@ val of_jv : Jv.t -> t
(** [to_jv o] is [o] as {!Jv.t} *) (** [to_jv o] is [o] as {!Jv.t} *)
val to_jv : t -> Jv.t val to_jv : t -> Jv.t
(* [open_popup popup map] opens [popup] on [map] *) (* [open_popup popup map] opens [popup] on [map]; Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability). *)
val open_popup : Popup.t -> t -> unit val open_popup : Popup.t -> t -> unit
(* [close_popup opt map] if [opt] is [Some popup] closes [popup] else closes previously opened popup *) (* [close_popup opt map] if [opt] is [Some popup] closes [popup] else closes previously opened popup *)

View file

@ -68,7 +68,7 @@ let opt_to_jv = function
Jv.of_bool b Jv.of_bool b
| Pane s | Class_name s -> Jv.of_string s | Pane s | Class_name s -> Jv.of_string s
let create content_opt ~latlng options = let create ~content ~latlng options =
let l = let l =
Array.of_list @@ List.map (fun o -> (opt_to_string o, opt_to_jv o)) options Array.of_list @@ List.map (fun o -> (opt_to_string o, opt_to_jv o)) options
in in
@ -80,7 +80,7 @@ let create content_opt ~latlng options =
set_latlng latlng popup; set_latlng latlng popup;
popup popup
in in
match content_opt with match content with
| None -> popup | None -> popup
| Some content -> | Some content ->
set_content content popup; set_content content popup;

View file

@ -41,9 +41,9 @@ val opt_to_string : opt -> string
(** [opt_to_jv opt] is [opt] as {!Jv.t} *) (** [opt_to_jv opt] is [opt] as {!Jv.t} *)
val opt_to_jv : opt -> Jv.t val opt_to_jv : opt -> Jv.t
(** [create s latlng options] is a new popup setup with [options], position set (** [create ~content ~latlng options] is a new popup setup with [options],
to [latlng] and content to [s] *) position set to [latlng] and content to [s] *)
val create : string option -> latlng:Latlng.t option -> opt list -> t val create : content:string option -> latlng:Latlng.t option -> opt list -> t
(** [create_from_el el latlng options] is a new popup setup with [options], (** [create_from_el el latlng options] is a new popup setup with [options],
position set to [latlng] and content to [el] *) position set to [latlng] and content to [el] *)