aboutsummaryrefslogtreecommitdiff
path: root/src/View/Map.ml
blob: bcd050649999de2e73dc57f3c75681e1dd3d3e3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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" |] ()
        |]
        ();
    |]
    ()