Browse Source

small popup change

pull/9/head
Swrup 2 years ago
parent
commit
4413b178a1
  1. 2
      src/map.mli
  2. 4
      src/popup.ml
  3. 6
      src/popup.mli

2
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 *)

4
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;

6
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] *)

Loading…
Cancel
Save