From e98afb46e73e9593f212b4a94eb416cd681654be Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Fri, 24 Aug 2012 08:00:27 +0100 Subject: [PATCH] removed new gui buttons again --- WebContent/OSRM.config.js | 17 ----------------- WebContent/gui/OSRM.MainGUI.js | 12 ++++-------- WebContent/gui/OSRM.RoutingGUI.js | 28 +++------------------------- WebContent/main.css | 5 ++--- WebContent/main.html | 6 +++--- 5 files changed, 12 insertions(+), 56 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 2b61dd830..b4324060b 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -19,23 +19,6 @@ or see http://www.gnu.org/licenses/agpl.txt. // [has to be loaded directly after OSRM.base] OSRM.DEFAULTS = { - ROUTING_ENGINES: [ - { url:'http://router.project-osrm.org/viaroute', - timestamp:'http://router.project-osrm.org/timestamp', - title:'car (fastest route)', - metric:0}, - { url:'http://mapa.ump.waw.pl/ump-www/viaroute', - timestamp:'http://mapa.ump.waw.pl/ump-www/timestamp', - title:'car (poland)', - metric:0 - }, - { url:'http://mapa.ump.waw.pl/ump-www/rower/viaroute', - timestamp:'http://mapa.ump.waw.pl/ump-www/rower/timestamp', - title:'bike (poland)', - metric:0 - } - ], - ONLOAD_ENGINE: 0, HOST_ROUTING_URL: ['http://router.project-osrm.org/viaroute'], HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index 48d14847f..8a740fe65 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -46,7 +46,7 @@ init: function() { // query last update of data OSRM.G.data_timestamp = "n/a"; - OSRM.JSONP.call(OSRM.DEFAULTS.HOST_TIMESTAMP_URL+"?jsonp=%jsonp", OSRM.GUI.setDataTimestamp, OSRM.GUI.setDataTimestampTimeout, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp'); + OSRM.JSONP.call(OSRM.DEFAULTS.HOST_TIMESTAMP_URL+"?jsonp=%jsonp", OSRM.GUI.setDataTimestamp, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp'); }, // set language dependent labels @@ -54,7 +54,7 @@ setLabels: function() { document.getElementById("open-josm").innerHTML = OSRM.loc("OPEN_JOSM"); document.getElementById("open-osmbugs").innerHTML = OSRM.loc("OPEN_OSMBUGS"); document.getElementById("gui-reset").innerHTML = OSRM.loc("GUI_RESET"); -// document.getElementById("gui-zoom").innerHTML = OSRM.loc("GUI_ZOOM_ON_ROUTE"); + document.getElementById("gui-zoom").innerHTML = OSRM.loc("GUI_ZOOM_ON_ROUTE"); document.getElementById("gui-reverse").innerHTML = OSRM.loc("GUI_REVERSE"); document.getElementById("gui-option-highlight-nonames-label").innerHTML = OSRM.loc("GUI_HIGHLIGHT_UNNAMED_ROADS"); document.getElementById("gui-option-show-previous-routes-label").innerHTML = OSRM.loc("GUI_SHOW_PREVIOUS_ROUTES"); @@ -133,14 +133,10 @@ changeDistanceFormat: function(type) { // set timestamp of data setDataTimestamp: function(response) { if(!response) - OSRM.GUI.setDataTimestampTimeout(); - + return; + OSRM.G.data_timestamp = response.timestamp.slice(0,25).replace(/<\/?[^>]+(>|$)/g ,""); // discard tags document.getElementById('gui-data-timestamp').innerHTML = OSRM.G.data_timestamp; -}, -setDataTimestampTimeout: function() { - OSRM.G.data_timestamp = "n/a"; - document.getElementById('gui-data-timestamp').innerHTML = OSRM.G.data_timestamp; } }); \ No newline at end of file diff --git a/WebContent/gui/OSRM.RoutingGUI.js b/WebContent/gui/OSRM.RoutingGUI.js index effcd124a..c5d5850d6 100644 --- a/WebContent/gui/OSRM.RoutingGUI.js +++ b/WebContent/gui/OSRM.RoutingGUI.js @@ -36,45 +36,23 @@ init: function() { document.getElementById("gui-search-target").onclick = function() {OSRM.GUI.showMarker(OSRM.C.TARGET_LABEL);}; document.getElementById("gui-reset").onclick = OSRM.GUI.resetRouting; -// document.getElementById("gui-zoom").onclick = OSRM.GUI.zoomOnRoute; + document.getElementById("gui-zoom").onclick = OSRM.GUI.zoomOnRoute; document.getElementById("gui-reverse").onclick = OSRM.GUI.reverseRouting; document.getElementById("open-josm").onclick = OSRM.GUI.openJOSM; document.getElementById("open-osmbugs").onclick = OSRM.GUI.openOSMBugs; document.getElementById("option-highlight-nonames").onclick = OSRM.GUI.hightlightNonames; document.getElementById("option-show-previous-routes").onclick = OSRM.GUI.showPreviousRoutes; - - // engine toggle - var engines = OSRM.DEFAULTS.ROUTING_ENGINES; - var options = []; - for(var i=0, size=engines.length; i 1 ) - OSRM.Routing.getRoute(); - - // query timestamp of data - OSRM.JSONP.call( OSRM.DEFAULTS.ROUTING_ENGINES[ OSRM.G.active_routing_engine ].timestamp+"?jsonp=%jsonp", OSRM.GUI.setDataTimestamp, OSRM.GUI.setDataTimestampTimeout, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp'); }, // toggle GUI features that need a route to work activateRouteFeatures: function() { OSRM.Printing.activate(); -// document.getElementById("gui-zoom").className = "button"; + document.getElementById("gui-zoom").className = "button"; // document.getElementById('leaflet-control-locations-route').className = "leaflet-control-locations-route"; }, deactivateRouteFeatures: function() { OSRM.Printing.deactivate(); -// document.getElementById("gui-zoom").className = "button-inactive"; + document.getElementById("gui-zoom").className = "button-inactive"; // document.getElementById('leaflet-control-locations-route').className = "leaflet-control-locations-route-inactive"; }, diff --git a/WebContent/main.css b/WebContent/main.css index 24f28e183..67fc3a12c 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -49,8 +49,8 @@ html, body { font-size:9px; display:none; } - /* + .leaflet-control-zoom { border-radius:8px; -moz-border-radius:8px; @@ -172,8 +172,7 @@ html, body { } .leaflet-control-layers a:hover { background-color: #CCCCCC; -} -*/ +}*/ /* ------------------------------------------------------------------------ */ diff --git a/WebContent/main.html b/WebContent/main.html index 5d1f7cea6..26aa2a933 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -37,7 +37,7 @@ or see http://www.gnu.org/licenses/agpl.txt. - + @@ -207,8 +207,8 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
- + +