aboutsummaryrefslogtreecommitdiff
path: root/src/View/Map.ml
diff options
context:
space:
mode:
authorJoris2020-07-13 21:30:32 +0200
committerJoris2020-07-13 21:30:32 +0200
commitd1135ff55db85ef81bbe2bd8f283cdbbd5464298 (patch)
treea971c4d88b862b21ca2263c6c48b053d64c9b125 /src/View/Map.ml
parent73a9d499c9e3709d99d61bbbbf412611a5c503b9 (diff)
downloadmap-d1135ff55db85ef81bbe2bd8f283cdbbd5464298.tar.gz
map-d1135ff55db85ef81bbe2bd8f283cdbbd5464298.tar.bz2
map-d1135ff55db85ef81bbe2bd8f283cdbbd5464298.zip
Show map and add marks with right click
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" |] ()
+ |]
+ ();
+ |]
+ ()