diff options
author | Joris | 2020-08-08 21:04:28 +0200 |
---|---|---|
committer | Joris | 2020-08-08 21:04:28 +0200 |
commit | 38e42723a916b7d5c2a15e514b3f3e6dcab398dd (patch) | |
tree | 1b7415ae64ac9768b12fc4d543ee61d615d11e7e /src/View/Map.ml | |
parent | 3e39f97d844dbe0ff5f57e3977bc220d366d4c0e (diff) |
Propose already defined colors in the form
Diffstat (limited to 'src/View/Map.ml')
-rw-r--r-- | src/View/Map.ml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/View/Map.ml b/src/View/Map.ml index b46557d..678f5ae 100644 --- a/src/View/Map.ml +++ b/src/View/Map.ml @@ -8,6 +8,9 @@ let mapView = ; HA.href "#" |] [| H.text "Map" |] + ; Button.text + [| HE.on_click (fun _ -> Modal.show (Colors.content ())) |] + [| H.text "Colors" |] |] ; H.div [| HA.class_ "g-Map" |] @@ -48,9 +51,10 @@ let installMap () = () in let () = state := state_from_hash () in + let colors = State.colors !state in let () = Js.Array.forEach - (fun (m: State.marker_state) -> Leaflet.add_layer markers (Marker.create on_remove on_update m.pos m.name m.color m.icon)) + (fun (m: State.marker_state) -> Leaflet.add_layer markers (Marker.create on_remove on_update colors m.pos m.name m.color m.icon)) !state in if focus then @@ -89,7 +93,8 @@ let installMap () = | Some m -> { m with pos = pos; name = "" } | _ -> { pos = pos; name = ""; color = "#3f92cf"; icon = "" } in - Modal.show (Marker.form (add_marker pos) marker.name marker.color marker.icon)) + let colors = State.colors !state in + Modal.show (Marker.form (add_marker pos) colors marker.name marker.color marker.icon)) } |]) |