leaflet/example/script.ml
2024-11-23 09:25:29 +01:00

17 lines
466 B
OCaml

(* this file will be compiled to js
you can then open map.html to see a simple page with a map loaded
by this script *)
(* create map *)
let map = Leaflet.Map.create_on "map"
(* setup map *)
let () =
(* set osm layer *)
let osm_layer = Leaflet.Layer.create_tile_osm [||] in
Leaflet.Layer.add_to map osm_layer;
(* set view *)
let latlng = Leaflet.Latlng.create ~lat:40.71 ~lng:(-74.0) in
ignore @@ Leaflet.Map.set_view latlng ~zoom:(Some 13) map