fix Point_to_layer
This commit is contained in:
parent
85e6ad34c6
commit
8579b9aeed
2 changed files with 5 additions and 3 deletions
|
|
@ -85,7 +85,7 @@ let on : type kind. kind Event.sub -> (kind Event.t -> 'b) -> 'c t -> unit =
|
||||||
(** Geojson layers *)
|
(** Geojson layers *)
|
||||||
|
|
||||||
type geojson_opt =
|
type geojson_opt =
|
||||||
| Point_to_layer of (Jv.t -> Latlng.t -> unit)
|
| Point_to_layer of (Jv.t -> Latlng.t -> [ `Marker ] t)
|
||||||
| Style of (Jv.t -> unit)
|
| Style of (Jv.t -> unit)
|
||||||
| On_each_feature of (Jv.t -> [ `Geojson ] t -> unit)
|
| On_each_feature of (Jv.t -> [ `Geojson ] t -> unit)
|
||||||
| Filter of (Jv.t -> bool)
|
| Filter of (Jv.t -> bool)
|
||||||
|
|
@ -102,7 +102,9 @@ let geojson_opt_to_string = function
|
||||||
|
|
||||||
let geojson_opt_to_jv = function
|
let geojson_opt_to_jv = function
|
||||||
| Markers_inherit_options b -> Jv.of_bool b
|
| Markers_inherit_options b -> Jv.of_bool b
|
||||||
| Point_to_layer f -> Jv.repr f
|
| Point_to_layer f ->
|
||||||
|
(* the marker returned by `pointToLayer` is used internally by leaflet so we neet to unwrap it to a Jv.t *)
|
||||||
|
Jv.repr (fun geojsonpoint latlng -> to_jv @@ f geojsonpoint latlng)
|
||||||
| Style f -> Jv.repr f
|
| Style f -> Jv.repr f
|
||||||
| On_each_feature f ->
|
| On_each_feature f ->
|
||||||
(* we need to wrap the Jv.t *)
|
(* we need to wrap the Jv.t *)
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ val on : 'a Event.sub -> ('a Event.t -> 'b) -> 'c t -> unit
|
||||||
|
|
||||||
(** type for geojson option, used to create geojson *)
|
(** type for geojson option, used to create geojson *)
|
||||||
type geojson_opt =
|
type geojson_opt =
|
||||||
| Point_to_layer of (Jv.t -> Latlng.t -> unit)
|
| Point_to_layer of (Jv.t -> Latlng.t -> [ `Marker ] t)
|
||||||
| Style of (Jv.t -> unit)
|
| Style of (Jv.t -> unit)
|
||||||
| On_each_feature of (Jv.t -> [ `Geojson ] t -> unit)
|
| On_each_feature of (Jv.t -> [ `Geojson ] t -> unit)
|
||||||
| Filter of (Jv.t -> bool)
|
| Filter of (Jv.t -> bool)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue