small popup change
This commit is contained in:
parent
72949d06ad
commit
82fa7afc21
3 changed files with 6 additions and 6 deletions
|
|
@ -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 *)
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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] *)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue