add tile_url option
This commit is contained in:
parent
2004c6ff60
commit
795508ff8f
2 changed files with 8 additions and 3 deletions
|
|
@ -1,8 +1,13 @@
|
|||
type t = Jv.t
|
||||
|
||||
let create_osm () =
|
||||
let create_osm ?tile_url () =
|
||||
(* see https://wiki.openstreetmap.org/wiki/Tile_servers *)
|
||||
let tile_url =
|
||||
Option.fold ~some:Fun.id
|
||||
~none:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" tile_url
|
||||
in
|
||||
Jv.call Global.leaflet "tileLayer"
|
||||
[| Jv.of_string "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
[| Jv.of_string tile_url
|
||||
; Jv.obj
|
||||
[| ( "attribution"
|
||||
, Jv.of_string
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
type t
|
||||
|
||||
val create_osm : unit -> t
|
||||
val create_osm : ?tile_url:string -> unit -> t
|
||||
|
||||
val add_to : t -> Map.t -> unit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue