aboutsummaryrefslogtreecommitdiff
path: root/src/View/Map.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/View/Map.ml')
-rw-r--r--src/View/Map.ml28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/View/Map.ml b/src/View/Map.ml
new file mode 100644
index 0000000..bcd0506
--- /dev/null
+++ b/src/View/Map.ml
@@ -0,0 +1,28 @@
+let render () =
+ let
+ _ =
+ Js.Global.setTimeout
+ (fun () ->
+ let map = Leaflet.map("g-Map__Content") in
+ let tileLayer = Leaflet.tileLayer "http://{s}.tile.osm.org/{z}/{x}/{y}.png" in
+ let () = Leaflet.addTo tileLayer map in
+ let () = Leaflet.setView map [| 51.505; -0.09 |] 13 in
+ Leaflet.on map "contextmenu" (fun (event) ->
+ Leaflet.addTo (Leaflet.marker (Leaflet.latLng event) { title = "Hey"; }) map))
+ 0
+ in
+ H.div
+ ~attributes:[| H.className "g-Layout__Page" |]
+ ~children: [|
+ H.div
+ ~attributes:[| H.className "g-Layout__Header" |]
+ ~children:[| H.text "Map" |]
+ ();
+ H.div
+ ~attributes:[| H.className "g-Map" |]
+ ~children:[|
+ H.div ~attributes:[| H.id "g-Map__Content" |] ()
+ |]
+ ();
+ |]
+ ()