From cf8f93ac9b3cd7b22155b0676bfa1b2208b9da5a Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Wed, 29 Jan 2020 12:56:06 +0000 Subject: [PATCH] Resources now working. --- README.md | 18 +++++- project.clj | 6 +- resources/docs/docs.md | 18 +++++- resources/html/error.html | 2 +- resources/html/home.html | 53 +++++++++--------- resources/public/css/screen.css | 8 +-- .../{unknown-pin.png => Unknown-pin.png} | Bin .../{unknown-pin.svg => Unknown-pin.svg} | 0 resources/public/img/map-pins/unknown-pin.xcf | Bin 3759 -> 0 bytes src/clj/geocsv/handler.clj | 9 +-- src/clj/geocsv/routes/resources.clj | 14 ----- src/cljs/geocsv/core.cljs | 29 +++++++++- src/cljs/geocsv/gis.cljs | 2 +- 13 files changed, 97 insertions(+), 62 deletions(-) rename resources/public/img/map-pins/{unknown-pin.png => Unknown-pin.png} (100%) rename resources/public/img/map-pins/{unknown-pin.svg => Unknown-pin.svg} (100%) delete mode 100644 resources/public/img/map-pins/unknown-pin.xcf delete mode 100644 src/clj/geocsv/routes/resources.clj diff --git a/README.md b/README.md index 34f9e16..9a1ef18 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,32 @@ If you run the server running **geocsv**, the simplest way to add CSV files is s https://geocsv.example.com/ -and the file you want to view is `myfile.csv`, then you would specify this as +and the file you want to view is `myfile.csv`, then you would specify this as the value of `file` in the query part of the URL. https://geocsv.example.com/?file=myfile.csv +### Loading CSV file onto another public server + +If you're not running the **geocsv** server yourself, you can upload the CSV to another server which is accessible by the **geocsv** server. You can then map data from the CSV file by specifying the URL of the file as the value of `uri` in the query part of the URL: + + https://geocsv.example.com/?uri=http://my.other.server/path/to/myfile.csv + ### Using a Google spreadsheet -If you use [Google Sheets](https://www.google.co.uk/sheets/about/), then every sheet has a 'document id', a long string of characters which uniquely identifies that sheet. Suppose your Google spreadsheet has a document id of `abcdefghijklmnopqrstuvwxyz-12345`, then you could pull data from this spreadsheet by specifying: +If you use [Google Sheets](https://www.google.co.uk/sheets/about/), then every sheet has a 'document id', a long string of characters which uniquely identifies that sheet. Suppose your Google spreadsheet has a document id of `abcdefghijklmnopqrstuvwxyz-12345`, then you could pull data from this spreadsheet by specifying this as the value of `docid` in the query part of the URL: https://geocsv.example.com/?docid=abcdefghijklmnopqrstuvwxyz-12345 The spreadsheet **must** be publicly readable. +### Precedence + +Nothing, of course, stops you from specifying multiple arguments in the query part of the URL, but only one will be used. The precedence is in this order: + +1. `docid` is considered first, and overrides anything else; +2. `uri` is considered next, and overrides `file`; +3. the value of `file` is considered only if neither of the other two are present. + ## Not yet working GeoCSV is at an early stage of development, and some features are not yet working. diff --git a/project.clj b/project.clj index fa8b919..b4d1cc9 100644 --- a/project.clj +++ b/project.clj @@ -32,6 +32,7 @@ [org.clojure/tools.cli "0.4.2"] [org.clojure/tools.logging "0.5.0"] [org.webjars.npm/bulma "0.8.0"] + [org.webjars.npm/leaflet "1.6.0"] [org.webjars.npm/material-icons "0.3.1"] [org.webjars/webjars-locator "0.38"] [re-frame "0.10.9"] @@ -43,10 +44,6 @@ [selmer "1.12.18"]] :min-lein-version "2.0.0" - :npm {:dependencies [[bulma "0.8.0"] - [leaflet "1.3.1"] - [material-design-icons "3.0.1"]] - :root "resources/public/js/lib/node_modules"} :source-paths ["src/clj" "src/cljs" "src/cljc"] :test-paths ["test/clj"] @@ -56,7 +53,6 @@ :plugins [[lein-cljsbuild "1.1.7"] [lein-codox "0.10.7"] - [lein-npm "0.6.2"] [lein-release "1.0.5"]] :clean-targets ^{:protect false} diff --git a/resources/docs/docs.md b/resources/docs/docs.md index 34f9e16..9a1ef18 100644 --- a/resources/docs/docs.md +++ b/resources/docs/docs.md @@ -20,18 +20,32 @@ If you run the server running **geocsv**, the simplest way to add CSV files is s https://geocsv.example.com/ -and the file you want to view is `myfile.csv`, then you would specify this as +and the file you want to view is `myfile.csv`, then you would specify this as the value of `file` in the query part of the URL. https://geocsv.example.com/?file=myfile.csv +### Loading CSV file onto another public server + +If you're not running the **geocsv** server yourself, you can upload the CSV to another server which is accessible by the **geocsv** server. You can then map data from the CSV file by specifying the URL of the file as the value of `uri` in the query part of the URL: + + https://geocsv.example.com/?uri=http://my.other.server/path/to/myfile.csv + ### Using a Google spreadsheet -If you use [Google Sheets](https://www.google.co.uk/sheets/about/), then every sheet has a 'document id', a long string of characters which uniquely identifies that sheet. Suppose your Google spreadsheet has a document id of `abcdefghijklmnopqrstuvwxyz-12345`, then you could pull data from this spreadsheet by specifying: +If you use [Google Sheets](https://www.google.co.uk/sheets/about/), then every sheet has a 'document id', a long string of characters which uniquely identifies that sheet. Suppose your Google spreadsheet has a document id of `abcdefghijklmnopqrstuvwxyz-12345`, then you could pull data from this spreadsheet by specifying this as the value of `docid` in the query part of the URL: https://geocsv.example.com/?docid=abcdefghijklmnopqrstuvwxyz-12345 The spreadsheet **must** be publicly readable. +### Precedence + +Nothing, of course, stops you from specifying multiple arguments in the query part of the URL, but only one will be used. The precedence is in this order: + +1. `docid` is considered first, and overrides anything else; +2. `uri` is considered next, and overrides `file`; +3. the value of `file` is considered only if neither of the other two are present. + ## Not yet working GeoCSV is at an early stage of development, and some features are not yet working. diff --git a/resources/html/error.html b/resources/html/error.html index 88103f7..fd31cc5 100644 --- a/resources/html/error.html +++ b/resources/html/error.html @@ -4,7 +4,7 @@ Something Bad Happened - {% style "/js/lib/node_modules/bulma/css/bulma.min.css" %} + {% style "/assets/bulma/css/bulma.min.css" %}