You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
573 B

include Layer
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
of_jv_t
@@ Jv.call Global.leaflet "tileLayer"
[| Jv.of_string tile_url
; Jv.obj
[| ( "attribution"
, Jv.of_string
"&copy; <a \
href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> \
contributors" )
|]
|]