add Icon.set_default_image_path

This commit is contained in:
Swrup 2024-01-29 22:08:10 +01:00
parent 4ef2368dc7
commit 6a58f6ff30
2 changed files with 8 additions and 0 deletions

View file

@ -67,3 +67,8 @@ let create_div ~html ~bg_pos options =
in in
let l = Array.of_list @@ div_options @ l in let l = Array.of_list @@ div_options @ l in
Jv.call Global.leaflet "divIcon" [| Jv.obj l |] Jv.call Global.leaflet "divIcon" [| Jv.obj l |]
let set_default_image_path s =
let icon = Jv.get Global.leaflet "Icon" in
let icon_default = Jv.get icon "Default" in
Jv.set icon_default "imagePath" (Jv.of_string s)

View file

@ -31,3 +31,6 @@ val create : string -> opt list -> t
background, in pixels [html] is custom HTML code to put inside the div background, in pixels [html] is custom HTML code to put inside the div
element, empty by default. *) element, empty by default. *)
val create_div : html:string option -> bg_pos:Point.t option -> opt list -> t val create_div : html:string option -> bg_pos:Point.t option -> opt list -> t
(** Sets the path of the default icon *)
val set_default_image_path : string -> unit