diff --git a/WebContent/OSRM.GUI.js b/WebContent/OSRM.GUI.js index b1ede611b..223c2a914 100644 --- a/WebContent/OSRM.GUI.js +++ b/WebContent/OSRM.GUI.js @@ -29,8 +29,10 @@ width: null, init: function() { OSRM.GUI.visible = true; OSRM.GUI.width = document.getElementById("main-wrapper").clientWidth; - - // translate +}, + +// set language dependent labels +setLanguage: 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"); diff --git a/WebContent/images/printer.pdf b/WebContent/images/printer.pdf new file mode 100644 index 000000000..91928b90f Binary files /dev/null and b/WebContent/images/printer.pdf differ diff --git a/WebContent/images/printer.png b/WebContent/images/printer.png new file mode 100644 index 000000000..5aefffea5 Binary files /dev/null and b/WebContent/images/printer.png differ diff --git a/WebContent/images/printer_active.png b/WebContent/images/printer_active.png new file mode 100644 index 000000000..439c7754e Binary files /dev/null and b/WebContent/images/printer_active.png differ diff --git a/WebContent/images/printer_hover.png b/WebContent/images/printer_hover.png new file mode 100644 index 000000000..5b8774baf Binary files /dev/null and b/WebContent/images/printer_hover.png differ diff --git a/WebContent/images/printer_inactive.png b/WebContent/images/printer_inactive.png new file mode 100644 index 000000000..860d349f8 Binary files /dev/null and b/WebContent/images/printer_inactive.png differ diff --git a/WebContent/localization/OSRM.Locale.de.js b/WebContent/localization/OSRM.Locale.de.js new file mode 100644 index 000000000..20094d1d6 --- /dev/null +++ b/WebContent/localization/OSRM.Locale.de.js @@ -0,0 +1,64 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM localization +// [German language support] + + +OSRM.Localization["de"] = { +//gui +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", +"GUI_START": "Start", +"GUI_END": "Ziel", +"GUI_RESET": "Reset", +"GUI_SEARCH": "Zeigen", +"GUI_REVERSE": "Umdrehen", +"GUI_OPTIONS": "Kartenwerkzeuge", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Straßen hervorheben", +"GUI_START_TOOLTIP": "Startposition eingeben", +"GUI_END_TOOLTIP": "Zielposition eingeben", +"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by KIT - Geocoder by OSM", +// geocoder +"SEARCH_RESULTS": "Suchergebnisse", +"TIMED_OUT": "Zeitüberschreitung", +"NO_RESULTS_FOUND": "Keine Ergebnisse gefunden", +"NO_RESULTS_FOUND_SOURCE": "Keine Ergebnisse gefunden für Start", +"NO_RESULTS_FOUND_TARGET": "Keine Ergebnisse gefunden für Ziel", +// routing +"ROUTE_DESCRIPTION": "Routenbeschreibung", +"GET_LINK_TO_ROUTE": "Generiere Link", +"GENERATE_LINK_TO_ROUTE": "Warte auf Antwort", +"LINK_TO_ROUTE_TIMEOUT": "nicht möglich", +"GPX_FILE": "GPX Datei", +"DISTANCE": "Distanz", +"DURATION": "Dauer", +"YOUR_ROUTE_IS_BEING_COMPUTED": "Ihre Route wird berechnet", +"NO_ROUTE_FOUND": "Keine Route hierher möglich", +// directions +"N": "Norden", +"O": "Ost", +"S": "Süden", +"W": "Westen", +"NO": "Nordost", +"SO": "Südost", +"SW": "Südwest", +"NW": "Nordwest" +}; + +// set GUI language on load +OSRM.GUI.setLanguage(); \ No newline at end of file diff --git a/WebContent/localization/OSRM.Locale.en.js b/WebContent/localization/OSRM.Locale.en.js new file mode 100644 index 000000000..686eb30bb --- /dev/null +++ b/WebContent/localization/OSRM.Locale.en.js @@ -0,0 +1,64 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM localization +// [English language support] + + +OSRM.Localization["en"] = { +//gui +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", +"GUI_START": "Start", +"GUI_END": "End", +"GUI_RESET": "  Reset  ", +"GUI_SEARCH": "  Show  ", +"GUI_REVERSE": "Reverse", +"GUI_OPTIONS": "Mapping Tools", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets", +"GUI_START_TOOLTIP": "Enter start", +"GUI_END_TOOLTIP": "Enter destination", +"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by KIT - Geocoder by OSM", +// geocoder +"SEARCH_RESULTS": "Search Results", +"TIMED_OUT": "Timed Out", +"NO_RESULTS_FOUND": "No results found", +"NO_RESULTS_FOUND_SOURCE": "No results found for start", +"NO_RESULTS_FOUND_TARGET": "No results found for end", +//routing +"ROUTE_DESCRIPTION": "Route Description", +"GET_LINK_TO_ROUTE": "Generate Link", +"GENERATE_LINK_TO_ROUTE": "waiting for link", +"LINK_TO_ROUTE_TIMEOUT": "not available", +"GPX_FILE": "GPX File", +"DISTANCE": "Distance", +"DURATION": "Duration", +"YOUR_ROUTE_IS_BEING_COMPUTED": "Your route is being computed", +"NO_ROUTE_FOUND": "No route possible", +// directions +"N": "north", +"E": "east", +"S": "south", +"W": "west", +"NE": "northeast", +"SE": "southeast", +"SW": "southwest", +"NW": "northwest" +}; + +//set GUI language on load +OSRM.GUI.setLanguage(); \ No newline at end of file diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js new file mode 100644 index 000000000..597e939b0 --- /dev/null +++ b/WebContent/localization/OSRM.Localization.js @@ -0,0 +1,74 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM localization +// [basic localization options] + + +OSRM.Localization = { + +supported_languages: ["en", "de"], + +// initialize localization +init: function() { + // create dropdown menu + var select = document.createElement('select'); + select.id = "language-toggle"; + select.onchange = function() { OSRM.Localization.change(this.value); }; + + // fill dropdown menu + for(var i=0, size=OSRM.Localization.supported_languages.length; i English string -> input string +translate: function(text) { + if( OSRM.Localization[OSRM.DEFAULTS.LANGUAGE] && OSRM.Localization[OSRM.DEFAULTS.LANGUAGE][text] ) + return OSRM.Localization[OSRM.DEFAULTS.LANGUAGE][text]; + else if( OSRM.Localization["en"] && OSRM.Localization["en"][text] ) + return OSRM.Localization["en"][text]; + else + return text; +} +}; + +// shorter call to translate function +OSRM.loc = OSRM.Localization.translate; \ No newline at end of file diff --git a/WebContent/main.css b/WebContent/main.css index 31c9ec175..bbd4e86f8 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -112,9 +112,9 @@ html, body, #map { .main-toggle-out { cursor:pointer; - position:absolute; +/* position:absolute; right:5px; - top:5px; + top:5px;*/ width:16px; height:16px; background-image:url("images/cancel.png"); @@ -322,7 +322,6 @@ html, body, #map { user-select: text; } - /* buttons */ .button { @@ -348,7 +347,7 @@ html, body, #map { color:#FF0000; } - +/* delete marker */ .delete-marker { cursor:pointer; @@ -367,4 +366,28 @@ html, body, #map { .delete-marker:active { background-image:url("images/cancel_active.png"); +} + +/* printer button */ +.printer-inactive +{ + cursor:pointer; + width:16px; + height:16px; + background-image:url("images/printer_inactive.png"); +} +.printer +{ + cursor:pointer; + width:16px; + height:16px; + background-image:url("images/printer.png"); +} +.printer:hover +{ + background-image:url("images/printer_hover.png"); +} +.printer:active +{ + background-image:url("images/printer_active.png"); } \ No newline at end of file diff --git a/WebContent/main.html b/WebContent/main.html index 5d6787d60..939df3ea5 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -64,7 +64,8 @@ or see http://www.gnu.org/licenses/agpl.txt. - + + @@ -78,16 +79,23 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
+
-
+
-
-
+
+
+
+
+
+
+ + + diff --git a/WebContent/main.js b/WebContent/main.js index 76471caa7..1dc16984d 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -27,6 +27,7 @@ OSRM.init = function() { OSRM.prefetchImages(); OSRM.prefetchIcons(); + OSRM.Localization.init(); OSRM.GUI.init(); OSRM.Map.init(); OSRM.Routing.init(); @@ -53,7 +54,11 @@ OSRM.prefetchImages = function() { 'images/cancel_hover.png', 'images/restore.png', 'images/restore_active.png', - 'images/restore_hover.png' + 'images/restore_hover.png', + 'images/printer.png', + 'images/printer_active.png', + 'images/printer_hover.png', + 'images/printer_inactive.png' ]; for(var i=0; ia
b
"); + OSRM.printwindow.focus(); + + OSRM.printwindow.addEventListener("DOMContentLoaded", OSRM.Printing.x, false); +} + +}; \ No newline at end of file diff --git a/WebContent/printing/printing.html b/WebContent/printing/printing.html new file mode 100644 index 000000000..01382ab0b --- /dev/null +++ b/WebContent/printing/printing.html @@ -0,0 +1,83 @@ + + + + + + + + + + + + +OSRM Website + + + + + + + + + + + + + + + + + + + + + +
+
+ + +