aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-04-19 16:10:40 +0200
committerTeddy Wing2017-04-19 16:10:40 +0200
commit4b24aa49fe5222803e03d31d71f0362f47da457c (patch)
treee85e5510ff764275dbb1ae418717daa04dd54c76
parentf484cf3c23155ab0b31ab686f7f7ceb4e7186856 (diff)
downloadgeo-feature-examiner-4b24aa49fe5222803e03d31d71f0362f47da457c.tar.bz2
index.html: When a feature is clicked, display its WKT on the page
Allow us to see the coordinates of the selected feature.
-rw-r--r--index.html5
1 files changed, 5 insertions, 0 deletions
diff --git a/index.html b/index.html
index 3ef1da3..c2f719c 100644
--- a/index.html
+++ b/index.html
@@ -7,10 +7,14 @@
<link rel="stylesheet" href="https://openlayers.org/en/v4.1.0/css/ol.css" type="text/css">
</head>
<body>
+ <textarea class="js-selected-feature"></textarea>
+
<div id="map"></div>
<script src="https://openlayers.org/en/v4.1.0/build/ol.js"></script>
<script>
+ var output_el = document.getElementsByClassName('js-selected-feature')[0];
+
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
});
@@ -47,6 +51,7 @@
select_click.on('select', function(e) {
if (e.selected.length) {
var feature = e.selected[0];
+ output_el.textContent = format.writeFeature(feature);
}
});