Skip to content
Snippets Groups Projects
Commit a92f38ec authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Wegpunkte werden nun immer direkt vor dem eingegebenen Ziel eingefügt

parent d2e30de6
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -3,7 +3,7 @@
* First thinkg would be to prepare the Results Div
*/
var vectorLayerRoutePreview;
var markers = [];
$(document).ready(function(){
deinitSearchBox();
initRouteFinder();
......@@ -39,6 +39,8 @@ function deinitSearchBox(){
function initRouteFinder(){
$("#results").html("");
// Remove Existing Markers
clearMarkers();
var vehicleChooser =
$("<div>\
......@@ -128,7 +130,8 @@ function initRouteFinder(){
// Add the Listener for adding Waypoints
$("#add-waypoint").click(function(){
waypoints.push('');
clearMarkers();
waypoints.splice(waypoints.length - 1, 0, '');
initRouteFinder();
});
......@@ -166,9 +169,19 @@ function addPositionMarker(lon, lat, index){
// So now the Pin
var el = $('<span id="'+chr+'" class="marker">' + chr + '</span>');
var pos = ol.proj.transform([parseFloat(lon), parseFloat(lat)], 'EPSG:4326', 'EPSG:3857');
addMarker(el, pos);
markers.push(addMarker(el, pos));
}
/*
* Clears all Markers which are on the map
*/
function clearMarkers(){
$.each(markers, function(index, value){
map.removeOverlay(value);
});
markers = [];
}
/*
* Generates Parameter to the Route until this point using the global waypoints variable
* @return{String} QueryParameter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment