add cirecle marker
This commit is contained in:
parent
bbd19599cd
commit
0ee6adaad5
2 changed files with 13 additions and 0 deletions
|
|
@ -228,8 +228,17 @@ let create_tile_osm : tile_layer_opt array -> [ `Tile ] t =
|
|||
|
||||
(* Vector Layers *)
|
||||
|
||||
(* TODO add options *)
|
||||
|
||||
let create_polyline : Latlng.t array -> [ `Vector ] t =
|
||||
fun l ->
|
||||
let l = Jv.of_array Latlng.to_jv l in
|
||||
let jv_t = Jv.call Global.leaflet "polyline" [| l |] in
|
||||
Vector jv_t
|
||||
|
||||
let create_circle_marker : Latlng.t -> float -> [ `Vector ] t =
|
||||
fun center radius ->
|
||||
let center = Latlng.to_jv center in
|
||||
let arr = [| ("radius", Jv.of_float radius) |] in
|
||||
let jv_t = Jv.call Global.leaflet "circleMarker" [| center; Jv.obj arr |] in
|
||||
Vector jv_t
|
||||
|
|
|
|||
|
|
@ -102,3 +102,7 @@ val create_tile_osm : tile_layer_opt array -> [ `Tile ] t
|
|||
|
||||
(** [create_polyline l] create a polyline layer from [l] *)
|
||||
val create_polyline : Latlng.t array -> [ `Vector ] t
|
||||
|
||||
(** [create_circle_marker c r] create a cirecle marker layer with center [c] and
|
||||
radius [r] *)
|
||||
val create_circle_marker : Latlng.t -> float -> [ `Vector ] t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue