leaflet/example/script.ml

17 lines
466 B
OCaml
Raw Normal View History

2024-02-08 15:58:52 +01:00
(* 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 *)
2022-05-19 15:46:43 +02:00
(* create map *)
2022-06-18 07:53:26 +02:00
let map = Leaflet.Map.create_on "map"
2022-05-19 15:46:43 +02:00
(* setup map *)
let () =
(* set osm layer *)
2024-01-30 16:55:19 +01:00
let osm_layer = Leaflet.Layer.create_tile_osm [||] in
2022-05-19 15:46:43 +02:00
Leaflet.Layer.add_to map osm_layer;
(* set view *)
2024-01-29 20:27:37 +01:00
let latlng = Leaflet.Latlng.create ~lat:40.71 ~lng:(-74.0) in
2022-05-19 15:46:43 +02:00
ignore @@ Leaflet.Map.set_view latlng ~zoom:(Some 13) map