diff --git a/README.md b/README.md index 2753fb4..7937b95 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ Note that, unlike in **geocsv**, *THERE IS NO DEFAULT PIN*, as there is no serve 1. There is no `category` column, or 2. If the `category` column is empty +## Other formats + +`geocsv-lite` now experimentally displays GPX and KML formated XML, by using [leaflet-omnivore](https://github.com/mapbox/leaflet-omnivore). While `leaflet-omnivore` also parses CSV, it doesn't +handle the CSV as richly as GeoCSV does natively, so we don't use Omnivore to parse CSV. + ## Setup To get an interactive development environment run: diff --git a/project.clj b/project.clj index 2b4b675..61eb9d0 100644 --- a/project.clj +++ b/project.clj @@ -16,7 +16,8 @@ [lein-npm "0.6.2"]] :npm {:dependencies [[papaparse "5.1.0"] - [leaflet "1.6.0"]] + [leaflet "1.6.0"] + [leaflet-omnivore "0.3.4"]] :root "resources/public/vendor"} :source-paths ["src"] @@ -56,7 +57,7 @@ :pretty-print true :warnings true}}]} - :figwheel {:http-server-root "../" + :figwheel {;; :http-server-root "../" ;; :server-port 3449 ;; default ;; :server-ip "127.0.0.1" diff --git a/resources/public/index.html b/resources/public/index.html index 5119821..3529637 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -101,6 +101,15 @@ crossorigin=""/ -->
++ This is more limited than I would like, because of cross-site scripting + blocks; the URL must be sourced from the same host as the page. +
+Use this page as a crib for how to use GeoCSV Lite in your projects. In order @@ -193,6 +202,7 @@ integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUT crossorigin=""> + url = url.substring(0, window.location.href.length - "index.html".length); } - url = url + "data/europe-capitals.csv"; + var csv_url = url + "data/europe-capitals.csv"; - geocsv_lite.core.initialise_map_element("url-map", url); + geocsv_lite.core.initialise_map_element("url-map", csv_url); + + /* Map using KML from URL */ + geocsv_lite.core.initialise_map_element("kml-map", url + "data/wild-lands/doc.kml");