"git@transfer.hft-stuttgart.de:coors/visualization.git" did not exist on "dbf0ae2a05c78f1c352cec2814e0e086140bfebc"
Commit 8fc51340 authored by Eric Duminil's avatar Eric Duminil
Browse files

RegionChooser: Replace reset button with Backspace or Delete.

parent bcb08e02
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>Simstadt Region Chooser</title> <title>Simstadt Region Chooser</title>
<meta name="keywords" content="polygon,creator,google map,v3,draw,paint"> <meta name="keywords" content="polygon,creator,google map,v3,draw,paint">
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
<div id="side"> <div id="side">
<div id="dataPanel"></div> <div id="dataPanel"></div>
</div> </div>
<input id="reset" value="Reset" type="button" class="navi" disabled />
<script src="script/simstadt_openlayers.js" type="text/javascript"></script> <script src="script/simstadt_openlayers.js" type="text/javascript"></script>
</body> </body>
</html> </html>
...@@ -11,7 +11,6 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388 ...@@ -11,7 +11,6 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388
var regionChooser = (function(){ var regionChooser = (function(){
var publicScope = {}; var publicScope = {};
var fromJavaFX = navigator.userAgent.indexOf('JavaFX') !== -1; var fromJavaFX = navigator.userAgent.indexOf('JavaFX') !== -1;
var reset_btn = $('#reset')[0];
var dataPanel = $('#dataPanel'); var dataPanel = $('#dataPanel');
var wgs84Sphere = new ol.Sphere(6378137); var wgs84Sphere = new ol.Sphere(6378137);
...@@ -173,7 +172,6 @@ var regionChooser = (function(){ ...@@ -173,7 +172,6 @@ var regionChooser = (function(){
draw.on('drawstart', function(evt) { draw.on('drawstart', function(evt) {
sketch = evt.feature; sketch = evt.feature;
reset_btn.disabled = false;
updateGMLPolygons(); updateGMLPolygons();
}); });
var sourceProj = map.getView().getProjection(); var sourceProj = map.getView().getProjection();
...@@ -290,8 +288,17 @@ var regionChooser = (function(){ ...@@ -290,8 +288,17 @@ var regionChooser = (function(){
displayInfo(); displayInfo();
draw.setActive(false); draw.setActive(false);
}); });
// Pressing ESCAPE or DELETE resets the drawing.
// With OpenLayers 3.9, draw_interaction.removeLastPoint(); might be better.
document.addEventListener('keydown', function(e) {
if (e.which == 27 || e.which == 46){
resetDrawing();
}
});
$('#reset').click(function() { function resetDrawing(){
console.log("Reset drawing");
try { try {
draw.finishDrawing(); draw.finishDrawing();
} finally { } finally {
...@@ -300,10 +307,9 @@ var regionChooser = (function(){ ...@@ -300,10 +307,9 @@ var regionChooser = (function(){
draw.setActive(true); draw.setActive(true);
featureOverlay.getFeatures().clear(); featureOverlay.getFeatures().clear();
intersections.clear(); intersections.clear();
reset_btn.disabled = true;
focusOnMap(); focusOnMap();
} }
}); }
novafactory_layer.downloadFinished = function() { novafactory_layer.downloadFinished = function() {
// FIXME: Weird <br>s are inserted between lines // FIXME: Weird <br>s are inserted between lines
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment