Merge branch 'feature/8' into develop
This commit is contained in:
commit
0e943b0e18
|
@ -54,10 +54,6 @@ GeoCSV is at an early stage of development, and some features are not yet workin
|
|||
|
||||
At the current stage of development, if no appropriate image exists in the `resources/public/img/map-pins` folder, that's your problem. **TODO:** I intend at some point to make missing pin images default to `unknown-pin.png`, which does exist.
|
||||
|
||||
### Doesn't scale and centre the map to show the data in the sheet
|
||||
|
||||
Currently the map is initially centred roughly on the centre of Scotland, and scaled arbitrarily. It should compute an appropriate centre and scale from the data provided, but currently doesn't.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You will need [Leiningen][1] 2.0 or above installed.
|
||||
|
|
2
env/prod/cljs/geocsv/app.cljs
vendored
2
env/prod/cljs/geocsv/app.cljs
vendored
|
@ -1,5 +1,5 @@
|
|||
(ns geocsv.app
|
||||
(:require [geocsv.core :as core]))
|
||||
(:require [geocsv.client.core :as core]))
|
||||
|
||||
;;ignore println statements in prod
|
||||
(set! *print-fn* (fn [& _]))
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
[com.cemerick/url "0.1.1"]
|
||||
[com.cognitect/transit-clj "0.8.319"]
|
||||
[compojure "1.6.1"]
|
||||
[cpath-clj "0.1.2"]
|
||||
[cprop "0.1.15"]
|
||||
[csv2edn "0.1.6"]
|
||||
[day8.re-frame/http-fx "0.1.6"]
|
||||
|
|
|
@ -54,10 +54,6 @@ GeoCSV is at an early stage of development, and some features are not yet workin
|
|||
|
||||
At the current stage of development, if no appropriate image exists in the `resources/public/img/map-pins` folder, that's your problem. **TODO:** I intend at some point to make missing pin images default to `unknown-pin.png`, which does exist.
|
||||
|
||||
### Doesn't scale and centre the map to show the data in the sheet
|
||||
|
||||
Currently the map is initially centred roughly on the centre of Scotland, and scaled arbitrarily. It should compute an appropriate centre and scale from the data provided, but currently doesn't.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You will need [Leiningen][1] 2.0 or above installed.
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
[clojure.java.io :as io]
|
||||
[clojure.string :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[cpath-clj.core :as cp]
|
||||
[compojure.core :refer [defroutes GET POST]]
|
||||
[csv2edn.csv2edn :refer :all]
|
||||
[noir.response :as nresponse]
|
||||
|
@ -37,19 +38,18 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn get-pin-image-names
|
||||
"Return the category names for which we have pin images; `request` is ignored.
|
||||
|
||||
This looks odd - why not file-seq over the directory? - but the answer is we
|
||||
may be running in a jar file, and if we are that will fail."
|
||||
[request]
|
||||
(ar/do-or-server-fail
|
||||
(map
|
||||
#(s/replace (.getName %) #"-pin\.png$" "")
|
||||
(let [grammar-matcher (.getPathMatcher
|
||||
(java.nio.file.FileSystems/getDefault)
|
||||
"glob:*-pin.png")]
|
||||
#(s/replace (s/replace (str %) #"-pin\.png$" "") "/" "")
|
||||
(->> "public/img/map-pins"
|
||||
io/resource
|
||||
io/file
|
||||
file-seq
|
||||
(filter #(.isFile %))
|
||||
(filter #(.matches grammar-matcher (.getFileName (.toPath %)))))))
|
||||
cp/resources
|
||||
keys
|
||||
(filter #(re-find #".*-pin.png" %))))
|
||||
200))
|
||||
|
||||
(defn get-data-uri
|
||||
|
|
|
@ -6,11 +6,9 @@
|
|||
[re-frame.core :as rf]))
|
||||
|
||||
(defn local-uri? [{:keys [uri]}]
|
||||
(js/console.log (str "local-uri?: received `" (str uri) "` (type " (type uri) ") as uri"))
|
||||
(not (re-find #"^\w+?://" (str uri))))
|
||||
|
||||
(defn default-headers [request]
|
||||
(js/console.log (str "default-headers: received `" request "` as request"))
|
||||
(if (local-uri? request)
|
||||
(-> request
|
||||
(update :headers #(merge {"x-csrf-token" js/csrfToken} %)))
|
||||
|
|
|
@ -38,6 +38,4 @@
|
|||
"Other-key-customers"
|
||||
"Power-supplier"} ;; need to be fetched from server side
|
||||
:latitude 56
|
||||
:longitude -4
|
||||
:map {:map-centre [56 -4]
|
||||
:map-zoom 6}})
|
||||
:longitude -4})
|
||||
|
|
|
@ -198,11 +198,6 @@
|
|||
(js/console.log (str "Fetching longitude" v))
|
||||
v)))
|
||||
|
||||
(rf/reg-sub
|
||||
:map
|
||||
(fn [db _]
|
||||
(:map db)))
|
||||
|
||||
(rf/reg-sub
|
||||
:route
|
||||
(fn [db _]
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
(defn map-render
|
||||
"Render the actual div containing the map."
|
||||
[]
|
||||
[:div#map {:style {:height "1000px"}}])
|
||||
[:div#map {:style {:height "800px"}}])
|
||||
|
||||
(defn panel
|
||||
"A reagent class for the map object."
|
||||
|
|
Loading…
Reference in a new issue