Commit f1f87790 authored by duminil's avatar duminil
Browse files

Reset polygon while drawing

parent b89abe89
...@@ -183,17 +183,19 @@ function displayInfo() { ...@@ -183,17 +183,19 @@ function displayInfo() {
draw.on('drawend', function(e) { draw.on('drawend', function(e) {
displayInfo(); displayInfo();
reset_btn.disabled = false;
send_btn.disabled = false; send_btn.disabled = false;
}); });
$('#reset').click(function() { $('#reset').click(function() {
// TODO: Should also remove current drawing if polygon isn't finished try {
$('#dataPanel').empty(); draw.finishDrawing();
featureOverlay.getFeatures().clear(); } finally {
intersections.clear(); $('#dataPanel').empty();
reset_btn.disabled = true; featureOverlay.getFeatures().clear();
send_btn.disabled = true; intersections.clear();
reset_btn.disabled = true;
send_btn.disabled = true;
}
}); });
$('#send').click(function() { $('#send').click(function() {
......
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