From fe420e5bfc212023ec76c28c1e1d5c9ed0bdf5b5 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Mon, 2 Apr 2012 08:54:25 +0200 Subject: [PATCH] added buttons to delete source and target --- WebContent/OSRM.Markers.js | 10 ++++++++-- WebContent/main.css | 21 +++++++++++++++++++++ WebContent/main.html | 8 ++++++-- WebContent/routing/OSRM.RoutingGUI.js | 15 +++++++++++++++ 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/WebContent/OSRM.Markers.js b/WebContent/OSRM.Markers.js index 529bf80b2..bc8ff1bd8 100644 --- a/WebContent/OSRM.Markers.js +++ b/WebContent/OSRM.Markers.js @@ -174,6 +174,8 @@ removeAll: function() { for(var i=0; i Start: - +
+ +
Zeigen Ende: - +
+ +
Zeigen diff --git a/WebContent/routing/OSRM.RoutingGUI.js b/WebContent/routing/OSRM.RoutingGUI.js index 4d23a0e54..da0f20289 100644 --- a/WebContent/routing/OSRM.RoutingGUI.js +++ b/WebContent/routing/OSRM.RoutingGUI.js @@ -109,6 +109,21 @@ openJOSM: function() { openOSMBugs: function() { var position = OSRM.G.map.getCenterUI(); window.open( "http://osmbugs.org/?lat="+position.lat.toFixed(6)+"&lon="+position.lng.toFixed(6)+"&zoom="+OSRM.G.map.getZoom() ); +}, + +//click: button "delete marker" +deleteMarker: function(marker_id) { + var id = null; + if(marker_id == 'source' && OSRM.G.markers.hasSource() ) + id = 0; + else if(marker_id == 'target' && OSRM.G.markers.hasTarget() ) + id = OSRM.G.markers.route.length-1; + if( id == null) + return; + + OSRM.G.markers.removeMarker( id ); + OSRM.Routing.getRoute(); + OSRM.G.markers.highlight.hide(); } }; \ No newline at end of file