From b9c6864ef194d225dc2a46906b88c36bd7435d17 Mon Sep 17 00:00:00 2001 From: Swrup Date: Sat, 31 Dec 2022 02:45:32 +0100 Subject: [PATCH] small popup change --- src/map.mli | 2 +- src/popup.ml | 4 ++-- src/popup.mli | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/map.mli b/src/map.mli index 5d7a912..ede2965 100644 --- a/src/map.mli +++ b/src/map.mli @@ -48,7 +48,7 @@ val of_jv : Jv.t -> t (** [to_jv o] is [o] as {!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 (* [close_popup opt map] if [opt] is [Some popup] closes [popup] else closes previously opened popup *) diff --git a/src/popup.ml b/src/popup.ml index 2792e23..3960a81 100644 --- a/src/popup.ml +++ b/src/popup.ml @@ -68,7 +68,7 @@ let opt_to_jv = function Jv.of_bool b | Pane s | Class_name s -> Jv.of_string s -let create content_opt ~latlng options = +let create ~content ~latlng options = let l = Array.of_list @@ List.map (fun o -> (opt_to_string o, opt_to_jv o)) options in @@ -80,7 +80,7 @@ let create content_opt ~latlng options = set_latlng latlng popup; popup in - match content_opt with + match content with | None -> popup | Some content -> set_content content popup; diff --git a/src/popup.mli b/src/popup.mli index dae1db8..d099745 100644 --- a/src/popup.mli +++ b/src/popup.mli @@ -41,9 +41,9 @@ val opt_to_string : opt -> string (** [opt_to_jv opt] is [opt] as {!Jv.t} *) val opt_to_jv : opt -> Jv.t -(** [create s latlng options] is a new popup setup with [options], position set - to [latlng] and content to [s] *) -val create : string option -> latlng:Latlng.t option -> opt list -> t +(** [create ~content ~latlng options] is a new popup setup with [options], + position set to [latlng] and content to [s] *) +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], position set to [latlng] and content to [el] *)