geocsv-lite/resources/public/index.html

111 lines
5.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>GeoCSV Lite</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link rel="icon" href="favicon.ico">
<!-- if you prefer loading libraries from standard hosts, un comment this and
comment out the local source -->
<!-- link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/ -->
<link rel="stylesheet" href="vendor/node_modules/leaflet/dist/leaflet.css" type="text/css">
</head>
<body>
<h1>GeoCSV Lite</h1>
<h4>
An ultra-lightweight tool to show comma-separated value data on a map
</h4>
<p id="message"></p>
<p id="error"></p>
<div id="app">
<p>
</p>
<h2>
Map using inline CSV
</h2>
<div id="inline-csv-map" style="height: 600px; width: 80%; border: thin solid gray;"></div>
<h2>
Map using CSV from URL
</h2>
<div id="map" style="height: 600px; width: 80%; border: thin solid gray;"></div>
<div id="doc">
<p>
Use this page as a crib for how to use <b>GeoCSV Lite</b> in your projects. In order
for it to work, you need:
</p>
<ol>
<li>Javascript dependencies:
<ol>
<li><a href="">Leaflet</a> (provides mapping);</li>
<li><a href="">PapaParse</a> (provides CSV parsing);</li>
</ol>
</li>
<li>
A line which includes the geocsv_lite library, which should be
<em>after</em> those including the dependencies: <br/>
<samp>&lt;script src="js/compiled/geocsv_lite.js"
type="text/javascript"&gt;&lt;/script&gt;</samp>
</li>
<li>One (or more) <code>div</code> elements to contain your maps. It
is a requirement of Leaflet that these must have a fixed pixel width.
Each must have a distinct <code>id</code>;</li>
<li>
For each <code>div</code> which you wish to contain a map view,
an invocation of the function
<code>geocsv_lite.core.initialise_map_element(id, data-source)</code>: <br/>
<samp>&lt;script&gt;geocsv_lite.core.initialise_map_element("map", "data/data.csv");&lt;/script&gt;</samp>
</li>
</ol>
</div>
</div>
<footer>
<div id="credits">
<div>
<img height="16" width="16" alt="Clojure" src="img/credits/clojure-icon.gif"/> Powered by <a href="http://clojure.org">Clojure</a> ||
<img height="16" width="16" alt="GitHub" src="img/credits/github-logo-transparent.png"/>Find me/fork me on <a href="https://github.com/simon-brooke/geocsv-lite">Github</a> ||
<img height="16" width="16" alt="Free Software Foundation" src="{{servlet-context}}/img/credits/gnu.small.png"/>Licensed under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License version 2.0</a>
</div>
</div>
</footer>
<!-- if you prefer loading libraries from standard hosts, un comment this and
comment out the local source -->
<!-- script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""></script -->
<!-- script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.1.0/papaparse.min.js"></script -->
<script src="vendor/node_modules/leaflet/dist/leaflet.js"></script>
<script src="vendor/node_modules/papaparse/papaparse.min.js"></script>
<script src="js/compiled/geocsv_lite.js" type="text/javascript"></script>
<script>
geocsv_lite.core.initialise_map_element("inline-csv-map", "Name,Latitude,Longitude\n"+
"Nether Hazelfield Cottage,54.816274,-3.887435,\n"+
"Over Hazelfield Cottage,54.823192,-3.899516,\n"+
"Winter Palace,54.822260,-3.920147,\n"+
"Craignair,54.842321,-3.872055,\n"+
"Carlinscraig,54.843224,-3.8730822,\n"+
"Orchardton,54.859129,-3.854212,\n"+
"Elderslie,54.845596,-3.866432\n" +
"Braendam Lodge,56.191257, -4.173869\n" +
"Moncrief Terrace,55.938946, -3.183590\n" +
"Craiglockhart Road, 55.916329, -3.243627\n" +
"Merchiston Gardens,55.929761, -3.220899\n" +
"Stamfordham, 55.042020, -1.877289\n" +
"Kaymanton, 54.965216, -2.102066\n" +
"Lonsdale College, 54.011382, -2.786183\n" +
"Glasson Dock, 53.997440, -2.845856\n" +
"Dolphinholme, 53.978104, -2.735363\n" +
"Greenfield Street, 54.048707, -2.792666\n" +
"Prospect Street,54.044364, -2.792685\n" +
"Westminster Palace Gardens, 51.497045, -0.135231\n" +
"Girdstingwood Cottage, 54.804639, -3.951338\n" +
"Millburn Street, 54.837358, -4.046627\n" +
"Palmer's Close, 54.834972, -4.053855"
);
geocsv_lite.core.initialise_map_element("map", "http://localhost:3449/data/data.csv");
</script>
</body>
</html>