diff --git a/src/icon.ml b/src/icon.ml index f8e1bb5..4ed4972 100644 --- a/src/icon.ml +++ b/src/icon.ml @@ -67,3 +67,8 @@ let create_div ~html ~bg_pos options = in let l = Array.of_list @@ div_options @ l in 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) diff --git a/src/icon.mli b/src/icon.mli index d7734dd..451b51f 100644 --- a/src/icon.mli +++ b/src/icon.mli @@ -31,3 +31,6 @@ val create : string -> opt list -> t background, in pixels [html] is custom HTML code to put inside the div element, empty by default. *) 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