From f7c76115fd61d55089860172d9320793a32835d8 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Tue, 24 Jul 2018 11:38:10 +0100 Subject: [PATCH] Minor fixes re: pins on map --- resources/templates/login.html | 1 + src/cljc/youyesyet/locality.cljc | 6 +++++- src/cljs/youyesyet/canvasser_app/gis.cljs | 15 +++++---------- .../youyesyet/canvasser_app/views/building.cljs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/templates/login.html b/resources/templates/login.html index 25550d0..dca783e 100644 --- a/resources/templates/login.html +++ b/resources/templates/login.html @@ -13,6 +13,7 @@ {% block content %}
{% csrf-field %} +

Or use a test username and password

diff --git a/src/cljc/youyesyet/locality.cljc b/src/cljc/youyesyet/locality.cljc index 45c9872..3fe8600 100644 --- a/src/cljc/youyesyet/locality.cljc +++ b/src/cljc/youyesyet/locality.cljc @@ -23,6 +23,9 @@ ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; Specified here: +;;;; https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/scaling.md#searching-the-database-for-localities + ;;;; See also resources/sql/locality-trigger.sql (defn locality @@ -36,6 +39,7 @@ (int ;; we're interested in localities West of Greenwich. (* longitude 100))))) + (defn neighbouring-localities "Return this locality with the localities immediately north east, north, north west, east, west, south west, @@ -53,4 +57,4 @@ (+ locality 100) (+ locality 101))) -(neighbouring-localities 5482391) + diff --git a/src/cljs/youyesyet/canvasser_app/gis.cljs b/src/cljs/youyesyet/canvasser_app/gis.cljs index 64fbc18..0f694b8 100644 --- a/src/cljs/youyesyet/canvasser_app/gis.cljs +++ b/src/cljs/youyesyet/canvasser_app/gis.cljs @@ -109,22 +109,17 @@ (defn map-remove-pins "Remove all pins from this map `view`. Side-effecty; liable to be problematic." [view] - (if - view - (let [layers (.eachLayer view (fn [l] l))] - (doall - (map - #(if - (instance? js/L.Marker %) - (.removeLayer view %)) - layers)))) + (.eachLayer view + #(if + (instance? js/L.Marker %) + (.removeLayer view %))) view) (defn refresh-map-pins "Refresh the map pins on this map. Side-effecty; liable to be problematic." [] - (let [view @(subscribe [:view]) ;; (map-remove-pins @(subscribe [:view])) + (let [view (map-remove-pins @(subscribe [:view])) addresses @(subscribe [:addresses])] (if view diff --git a/src/cljs/youyesyet/canvasser_app/views/building.cljs b/src/cljs/youyesyet/canvasser_app/views/building.cljs index 5396b2e..d2cac79 100644 --- a/src/cljs/youyesyet/canvasser_app/views/building.cljs +++ b/src/cljs/youyesyet/canvasser_app/views/building.cljs @@ -47,8 +47,8 @@ (fn [dwelling] (ui/big-link - (:sub-address dwelling) + (:sub_address dwelling) :target (str "#/dwelling/" (:id dwelling))) ) (sort-by - :sub-address + :sub_address (:dwellings address)))]]]))