Merge pull request #2 from mattburchett/swapbutton

Adding a swap button to the route planner
This commit is contained in:
roblevesque 2018-01-24 11:40:52 -05:00 committed by GitHub
commit 19297d2614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -70,6 +70,7 @@
<select id="pointb" name="Point_B"> <select id="pointb" name="Point_B">
<!-- Options will generated in code --> <!-- Options will generated in code -->
</select> </select>
<button id="swapab" class="btn">Swap</button>
<br /> <br /> <br /> <br />
<label for="speed">Travel Speed</label> <br /> <label for="speed">Travel Speed</label> <br />
<input type="text" id="speed" value="14"> <br /> <input type="text" id="speed" value="14"> <br />

View File

@ -39,6 +39,11 @@ $(document).ready(function() {
var stop=$('#route_output :selected').parent().attr('label'); var stop=$('#route_output :selected').parent().attr('label');
zoomfocus(stop); zoomfocus(stop);
}); });
$('#swapab').click(function() {
var swap=$('#pointa').val();
$("#pointa").val($("#pointb").val());
$("#pointb").val(swap);
});
$('#calctnd').click(function() { $('#calctnd').click(function() {
removeEntity('arrow'); removeEntity('arrow');