diff --git a/src/marker.ml b/src/marker.ml index 16a99c0..93ebd05 100644 --- a/src/marker.ml +++ b/src/marker.ml @@ -3,7 +3,7 @@ include Layer type t = [ `Marker ] Layer.t -type marker_opt = +type opt = | Icon of Icon.t | Keyboard of bool | Title of string @@ -17,7 +17,7 @@ type marker_opt = | Bubbling_mouse_events of bool | Auto_pan_on_focus of bool -let marker_opt_to_string : marker_opt -> string = function +let opt_to_string : opt -> string = function | Icon _ -> "icon" | Keyboard _ -> "keyboard" | Title _ -> "title" @@ -31,7 +31,7 @@ let marker_opt_to_string : marker_opt -> string = function | Bubbling_mouse_events _ -> "bubblingMouseEvents" | Auto_pan_on_focus _ -> "autoPanOnFocus" -let marker_opt_to_jv = function +let opt_to_jv = function | Icon icon -> Icon.to_jv icon | Keyboard b | Rise_on_hover b | Bubbling_mouse_events b | Auto_pan_on_focus b -> @@ -40,11 +40,10 @@ let marker_opt_to_jv = function | Z_index_offset i | Rise_offset i -> Jv.of_int i | Opacity f -> Jv.of_float f -let create_marker : Latlng.t -> marker_opt list -> t = +let create : Latlng.t -> opt list -> t = fun latlng options -> let l = - Array.of_list - @@ List.map (fun o -> (marker_opt_to_string o, marker_opt_to_jv o)) options + Array.of_list @@ List.map (fun o -> (opt_to_string o, opt_to_jv o)) options in let jv_t = Jv.call Global.leaflet "marker" [| Latlng.to_jv latlng; Jv.obj l |] diff --git a/src/marker.mli b/src/marker.mli index 538ac95..ebb8096 100644 --- a/src/marker.mli +++ b/src/marker.mli @@ -1,7 +1,7 @@ type t = [ `Marker ] Layer.t (** type for marker option, used to create marker *) -type marker_opt = +type opt = | Icon of Icon.t | Keyboard of bool | Title of string @@ -15,9 +15,9 @@ type marker_opt = | Bubbling_mouse_events of bool | Auto_pan_on_focus of bool -(** [create_marker latlng options] is a new marker with the same position as - [latlng] and with options set to [options] *) -val create_marker : Latlng.t -> marker_opt list -> t +(** [create latlng options] is a new marker with the same position as [latlng] + and with options set to [options] *) +val create : Latlng.t -> opt list -> t (** Returns the current geographical position of the marker. *) val get_latlng : t -> Latlng.t