added switching between search engines

- works with different languages
- works with links

refactored selector code:
- changed method names
- changed method parameters (object -> id),
- added method to rename all options of dropdown menu

refactored distance format selector code:
- changed method names
- changed variable names
- changed how to init/select element/change language of dropdown menu

refactored maintenance notification overrides:
- changed names of default variables
This commit is contained in:
DennisSchiefer
2012-08-24 13:27:21 +01:00
parent e98afb46e7
commit 532d7cb057
16 changed files with 198 additions and 73 deletions
@@ -66,6 +66,10 @@ OSRM.Localization["de"] = {
// printing
"OVERVIEW_MAP": "Übersichtskarte",
"NO_ROUTE_SELECTED": "Keine Route ausgewählt",
//routing engines
"ENGINE_0": "Auto (schnellste Strecke)",
"ENGINE_1": "Auto (nur Polen)",
"ENGINE_2": "Fahrrad (nur Polen)",
// directions
"N": "Norden",
"E": "Ost",
@@ -66,6 +66,10 @@ OSRM.Localization["en"] = {
// printing
"OVERVIEW_MAP": "Overview Map",
"NO_ROUTE_SELECTED": "No route selected",
// routing engines
"ENGINE_0": "Car (fastest route)",
"ENGINE_1": "Car (Poland only)",
"ENGINE_2": "Bike (Poland only)",
// directions
"N": "north",
"E": "east",
+2 -2
View File
@@ -54,8 +54,8 @@ setLanguageWrapper: function(language) { // wrapping required to correctly prev
},
setLanguage: function(language) {
// change value of both language selectors
OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language );
OSRM.GUI.selectorChange( document.getElementById('gui-language-2-toggle'), language );
OSRM.GUI.selectorChange( 'gui-language-toggle', language );
OSRM.GUI.selectorChange( 'gui-language-2-toggle', language );
if( OSRM.Localization[language]) {
OSRM.Localization.current_language = language;