From 5676ba2612dd9b39bdb97731df7571cd6385cf7d Mon Sep 17 00:00:00 2001
From: Simon Brooke <sbrooke>
Date: Wed, 19 Oct 2016 11:09:22 +0100
Subject: [PATCH] Beginning work on getting a map working.

---
 project.clj                       |  9 +++++++--
 resources/templates/home.html     |  4 ++--
 src/cljs/youyesyet/views/map.cljs | 16 +++++++++++++---
 3 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/project.clj b/project.clj
index 36d2ce9..39931cc 100644
--- a/project.clj
+++ b/project.clj
@@ -54,7 +54,8 @@
             [org.clojars.punkisdead/lein-cucumber "1.0.5"]
             [lein-cljsbuild "1.1.4"]
             [lein-uberwar "0.2.0"]
-            [lein-bower "0.5.1"]]
+            [lein-bower "0.5.1"]
+            [lein-less "1.7.5"]]
 
   :bower-dependencies [[bootstrap "2.3.1"]
                        [font-awesome "3.2.1"]
@@ -62,6 +63,8 @@
 
   :cucumber-feature-paths ["test/clj/features"]
 
+  :hooks [leiningen.less]
+
   :uberwar
   {:handler youyesyet.handler/app
    :init youyesyet.handler/init
@@ -70,12 +73,14 @@
 
   :clean-targets ^{:protect false}
   [:target-path [:cljsbuild :builds :app :compiler :output-dir] [:cljsbuild :builds :app :compiler :output-to]]
+
   :figwheel
   {:http-server-root "public"
    :nrepl-port 7002
    :css-dirs ["resources/public/css"]
    :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
 
+  :externs ["externs.js"]
 
   :profiles
   {:uberjar {:omit-source true
@@ -86,7 +91,7 @@
                {:source-paths ["src/cljc" "src/cljs" "env/prod/cljs"]
                 :compiler
                 {:output-to "target/cljsbuild/public/js/app.js"
-                 :externs ["react/externs/react.js"]
+                 :externs ["react/externs/react.js" "externs.js"]
                  :optimizations :advanced
                  :pretty-print false
                  :closure-warnings
diff --git a/resources/templates/home.html b/resources/templates/home.html
index b6644df..7509df9 100644
--- a/resources/templates/home.html
+++ b/resources/templates/home.html
@@ -29,8 +29,8 @@
     </div>
 
     <!-- scripts and styles -->
-    {% style "/vendor/bootstrap/css/bootstrap.min.css" %}
-    {% style "/vendor/font-awesome/css/font-awesome.min.css" %}
+    {% style "/assets/bootstrap/css/bootstrap.min.css" %}
+    {% style "/assets/font-awesome/css/font-awesome.min.css" %}
     {% style "/css/screen.css" %}
 
     <script type="text/javascript">
diff --git a/src/cljs/youyesyet/views/map.cljs b/src/cljs/youyesyet/views/map.cljs
index 0df2bf2..197525b 100644
--- a/src/cljs/youyesyet/views/map.cljs
+++ b/src/cljs/youyesyet/views/map.cljs
@@ -33,7 +33,17 @@
 ;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#map-view
 
 
-(defn panel
-  "Generate the map panel."
+;;; Cribbed heavily from
+;;;   https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/leaflet
+;;; but using OSM data because we can't afford commercial, so also cribbed from
+;;;   https://switch2osm.org/using-tiles/getting-started-with-leaflet/
+
+(defn map-div
+  "Generate the actual div containing the map."
   []
-  [])
+  [:div#map {:style {:height "360px"}}])
+
+(defn panel
+  "Generate the map panel"
+  []
+  [div-map])