17 lines
466 B
OCaml
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
|