- gui animations no longer trigger an onEndTransition event on loading

- refactored control management (handle is stored with map)
- refactored inactive control buttons (no background change)
- added localization strings for zooming and default search engine
- renaming: OSRM.MapView -> OSRM.Control.Map
This commit is contained in:
DennisSchiefer 2012-08-27 16:24:37 +01:00
parent 6dcea6d808
commit 794140711d
27 changed files with 243 additions and 109 deletions

View File

@ -24,5 +24,6 @@ OSRM.DATE = '120705';
OSRM.CONSTANTS = {}; OSRM.CONSTANTS = {};
OSRM.DEFAULTS = {}; OSRM.DEFAULTS = {};
OSRM.GLOBALS = {}; OSRM.GLOBALS = {};
OSRM.Control = {}; // control container
OSRM.G = OSRM.GLOBALS; // abbreviations OSRM.G = OSRM.GLOBALS; // abbreviations
OSRM.C = OSRM.CONSTANTS; OSRM.C = OSRM.CONSTANTS;

View File

@ -47,7 +47,7 @@ init: function() {
} }
// setup map // setup map
OSRM.G.map = new OSRM.MapView('map', { OSRM.G.map = new OSRM.Control.Map('map', {
center: new L.LatLng(OSRM.DEFAULTS.ONLOAD_LATITUDE, OSRM.DEFAULTS.ONLOAD_LONGITUDE), center: new L.LatLng(OSRM.DEFAULTS.ONLOAD_LATITUDE, OSRM.DEFAULTS.ONLOAD_LONGITUDE),
zoom: OSRM.DEFAULTS.ONLOAD_ZOOM_LEVEL, zoom: OSRM.DEFAULTS.ONLOAD_ZOOM_LEVEL,
layers: [base_maps[tile_servers[0].display_name]], layers: [base_maps[tile_servers[0].display_name]],
@ -57,18 +57,17 @@ init: function() {
}); });
// add locations control // add locations control
var locationsControl = new OSRM.Control.Locations(); OSRM.G.map.locationsControl = new OSRM.Control.Locations();
OSRM.G.map.addControl(locationsControl); OSRM.G.map.locationsControl.addTo(OSRM.G.map);
// add layer control // add layer control
var layerControl = new L.Control.QueryableLayers(base_maps, {}); OSRM.G.map.layerControl = new OSRM.Control.Layers(base_maps, {});
OSRM.G.map.addLayerControl(layerControl); OSRM.G.map.layerControl.addTo(OSRM.G.map);
// add zoom control // add zoom control
var zoomControl = new OSRM.Control.Zoom(); OSRM.G.map.zoomControl = new OSRM.Control.Zoom();
OSRM.G.map.addControl(zoomControl); OSRM.G.map.zoomControl.addTo(OSRM.G.map);
zoomControl.show(); OSRM.G.map.zoomControl.show();
// add scale control // add scale control
OSRM.G.map.scaleControl = new L.Control.Scale(); OSRM.G.map.scaleControl = new L.Control.Scale();

View File

@ -15,9 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt. or see http://www.gnu.org/licenses/agpl.txt.
*/ */
// queryable Layers control // OSRM Layers control
// [extension of Layers.Control with OSRM styling and additional query methods] // [extension of Layers.Control with OSRM styling and additional query methods]
L.Control.QueryableLayers = L.Control.Layers.extend({ OSRM.Control.Layers = L.Control.Layers.extend({
// query functionality // query functionality
getActiveLayerName: function () { getActiveLayerName: function () {
@ -49,6 +49,55 @@ getActiveLayer: function () {
// overwrite Control.Layers methods to get OSRM styling // overwrite Control.Layers methods to get OSRM styling
onAdd: function (map) {
this._initLayout(map);
this._update();
return this._container;
},
_initLayout: function (map) {
var className = 'leaflet-control-layers',
container = this._container = L.DomUtil.create('div', className);
if (!L.Browser.touch) {
L.DomEvent.disableClickPropagation(container);
} else {
L.DomEvent.on(container, 'click', L.DomEvent.stopPropagation);
}
var form = this._form = L.DomUtil.create('form', className + '-list');
if (this.options.collapsed) {
L.DomEvent
.on(container, 'mouseover', this._expand, this)
.on(container, 'mouseout', this._collapse, this);
var link = this._layersLink = L.DomUtil.create('a', className + '-toggle', container);
link.href = '#';
link.title = 'Layers';
if (L.Browser.touch) {
L.DomEvent
.on(link, 'click', L.DomEvent.stopPropagation)
.on(link, 'click', L.DomEvent.preventDefault)
.on(link, 'click', this._expand, this);
}
else {
L.DomEvent.on(link, 'focus', this._expand, this);
}
this._map.on('movestart', this._collapse, this);
// TODO keyboard accessibility
} else {
this._expand();
}
this._baseLayersList = L.DomUtil.create('div', className + '-base', form);
this._separator = L.DomUtil.create('div', className + '-separator', form);
this._overlaysList = L.DomUtil.create('div', className + '-overlays', form);
container.appendChild(form);
},
_expand: function () { _expand: function () {
L.DomUtil.addClass(this._container, 'leaflet-control-layers-expanded'); L.DomUtil.addClass(this._container, 'leaflet-control-layers-expanded');
}, },

View File

@ -17,34 +17,28 @@ or see http://www.gnu.org/licenses/agpl.txt.
// locations control // locations control
// [navigation buttons for important locations - zoom on route, zoom on user] // [navigation buttons for important locations - zoom on route, zoom on user]
OSRM.Control = OSRM.Control || {};
OSRM.Control.Locations = L.Control.extend({ OSRM.Control.Locations = L.Control.extend({
options: { options: {
position: 'topright' position: 'topright'
}, },
onAdd: function (map) { onAdd: function (map) {
// unique control
if( document.getElementById('gui-control-locations') )
return document.getElementById('gui-control-locations');
// create wrapper // create wrapper
var container = L.DomUtil.create('div', 'box-wrapper gui-control-wrapper'); var container = L.DomUtil.create('div', 'box-wrapper gui-control-wrapper');
container.id = 'gui-control-locations';
L.DomEvent.disableClickPropagation(container); L.DomEvent.disableClickPropagation(container);
// create buttons // create buttons
this._createButton('gui-locations-user', container, OSRM.GUI.zoomOnUser, map, !!navigator.geolocation ); this._userButton = this._createButton('gui-locations-user', container, OSRM.GUI.zoomOnUser, map, !!navigator.geolocation );
this._createButton('gui-locations-route', container, OSRM.GUI.zoomOnRoute, map, false); this._routeButton = this._createButton('gui-locations-route', container, OSRM.GUI.zoomOnRoute, map, false);
this._container = container;
return container; return container;
}, },
_createButton: function (id, container, fn, context, isActive) { _createButton: function (id, container, fn, context, isActive) {
var inactive = (isActive == false) ? "-inactive" : ""; var inactive = (isActive == false) ? "-inactive" : "";
var classNames = "box-content" + " " + "gui-control"+inactive + " " + id+inactive; var classNames = "box-content gui-control " + id+inactive;
var link = L.DomUtil.create('a', classNames, container); var link = L.DomUtil.create('a', classNames, container);
link.id = id;
link.title = id; link.title = id;
L.DomEvent L.DomEvent
@ -56,10 +50,14 @@ OSRM.Control.Locations = L.Control.extend({
return link; return link;
}, },
activate: function (id) { activateRoute: function() {
document.getElementById(id).className = "box-content gui-control " + id; this._routeButton.className = "box-content gui-control gui-locations-route";
}, },
deactivate: function (id) { deactivateRoute: function() {
document.getElementById(id).className = "box-content gui-control-inactive " + id + "-inactive"; this._routeButton.className = "box-content gui-control gui-locations-route-inactive";
},
setTooltips: function( userButton, routeButton) {
this._userButton.title = userButton;
this._routeButton.title = routeButton;
} }
}); });

View File

@ -15,9 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt. or see http://www.gnu.org/licenses/agpl.txt.
*/ */
// map view/model // OSRM Map control
// [extending Leaflet L.Map with setView/fitBounds methods that respect UI visibility, better layerControl] // [extension of L.Map with additional view & bounds methods that respect OSRM UI visibility; methods for querying active layers]
OSRM.MapView = L.Map.extend({ OSRM.Control.Map = L.Map.extend({
_boundsInsideView: function(bounds) { _boundsInsideView: function(bounds) {
var viewBounds = this.getBounds(), var viewBounds = this.getBounds(),
viewSw = this.project(viewBounds.getSouthWest()), viewSw = this.project(viewBounds.getSouthWest()),
@ -106,13 +106,6 @@ OSRM.MapView = L.Map.extend({
return this.unproject(centerPoint, this._zoom, unbounded); return this.unproject(centerPoint, this._zoom, unbounded);
}, },
addLayerControl: function( layerControl ) {
if( this.layerControl )
return;
this.layerControl = layerControl;
this.addControl(this.layerControl);
},
getActiveLayerId: function() { getActiveLayerId: function() {
var tile_server_id = 0; var tile_server_id = 0;

View File

@ -17,34 +17,28 @@ or see http://www.gnu.org/licenses/agpl.txt.
// zoom control // zoom control
// [modified zoom control with ids, prevention of click propagation, show/hide with respect to main OSRM window] // [modified zoom control with ids, prevention of click propagation, show/hide with respect to main OSRM window]
OSRM.Control = OSRM.Control || {};
OSRM.Control.Zoom = L.Control.extend({ OSRM.Control.Zoom = L.Control.extend({
options: { options: {
position: 'topleft' position: 'topleft'
}, },
onAdd: function (map) { onAdd: function (map) {
// unique control
if( document.getElementById('gui-control-zoom') )
return document.getElementById('gui-control-zoom');
// create wrapper // create wrapper
var container = L.DomUtil.create('div', 'box-wrapper gui-control-wrapper'); var container = L.DomUtil.create('div', 'box-wrapper gui-control-wrapper');
container.id = 'gui-control-zoom';
L.DomEvent.disableClickPropagation(container); L.DomEvent.disableClickPropagation(container);
// create buttons // create buttons
this._createButton('gui-zoom-in', container, map.zoomIn, map, true); this._zoomIn = this._createButton('gui-zoom-in', container, map.zoomIn, map, true);
this._createButton('gui-zoom-out', container, map.zoomOut, map, true); this._zoomOut = this._createButton('gui-zoom-out', container, map.zoomOut, map, true);
this._container = container;
return container; return container;
}, },
_createButton: function (id, container, fn, context, isActive) { _createButton: function (id, container, fn, context, isActive) {
var inactive = (isActive == false) ? "-inactive" : ""; var inactive = (isActive == false) ? "-inactive" : "";
var classNames = "box-content" + " " + "gui-control"+inactive + " " + id+inactive; var classNames = "box-content gui-control " + id+inactive;
var link = L.DomUtil.create('a', classNames, container); var link = L.DomUtil.create('a', classNames, container);
link.id = id;
link.title = id; link.title = id;
L.DomEvent L.DomEvent
@ -57,17 +51,19 @@ OSRM.Control.Zoom = L.Control.extend({
}, },
hide: function() { hide: function() {
var zoom_controls = document.getElementById("gui-control-zoom"); if( this._container )
if( zoom_controls ) this._container.style.visibility="hidden";
zoom_controls.style.visibility="hidden";
}, },
show: function() { show: function() {
var zoom_controls = document.getElementById("gui-control-zoom"); if( this._container ) {
if( zoom_controls ) { this._container.style.top = "5px";
zoom_controls.style.top = "5px"; this._container.style.left = ( OSRM.G.main_handle.boxVisible() == true ? (OSRM.G.main_handle.boxWidth()+10) : "30") + "px";
zoom_controls.style.left = ( OSRM.G.main_handle.boxVisible() == true ? (OSRM.G.main_handle.boxWidth()+10) : "30") + "px"; this._container.style.visibility="visible";
zoom_controls.style.visibility="visible";
} }
},
setTooltips: function( zoomIn, zoomOut) {
this._zoomIn.title = zoomIn;
this._zoomOut.title = zoomOut;
} }
}); });

View File

@ -99,7 +99,6 @@ $showBox: function() {
this._box.style.visibility="visible"; this._box.style.visibility="visible";
this._handle.style.visibility="hidden"; this._handle.style.visibility="hidden";
this._box.style[this._side]="5px"; this._box.style[this._side]="5px";
this._transitionEndFct();
}, },
$hideBox: function() { $hideBox: function() {
this._box_visible = false; this._box_visible = false;

View File

@ -71,10 +71,8 @@ setLabels: function() {
document.getElementById('config-handle-icon').title = OSRM.loc("GUI_CONFIGURATION"); document.getElementById('config-handle-icon').title = OSRM.loc("GUI_CONFIGURATION");
document.getElementById('mapping-handle-icon').title = OSRM.loc("GUI_MAPPING_TOOLS"); document.getElementById('mapping-handle-icon').title = OSRM.loc("GUI_MAPPING_TOOLS");
document.getElementById('main-handle-icon').title = OSRM.loc("GUI_MAIN_WINDOW"); document.getElementById('main-handle-icon').title = OSRM.loc("GUI_MAIN_WINDOW");
document.getElementById('gui-locations-route').title = OSRM.loc("GUI_ZOOM_ON_ROUTE"); OSRM.G.map.zoomControl.setTooltips( OSRM.loc("GUI_ZOOM_IN"), OSRM.loc("GUI_ZOOM_OUT") );
document.getElementById('gui-locations-user').title = OSRM.loc("GUI_ZOOM_ON_USER"); OSRM.G.map.locationsControl.setTooltips( OSRM.loc("GUI_ZOOM_ON_USER"), OSRM.loc("GUI_ZOOM_ON_ROUTE") );
document.getElementById('gui-zoom-in').title = OSRM.loc("GUI_ZOOM_IN");
document.getElementById('gui-zoom-out').title = OSRM.loc("GUI_ZOOM_OUT");
OSRM.GUI.setDistanceFormatsLanguage(); OSRM.GUI.setDistanceFormatsLanguage();
OSRM.GUI.setRoutingEnginesLanguage(); OSRM.GUI.setRoutingEnginesLanguage();
}, },
@ -87,11 +85,11 @@ clearResults: function() {
// reposition and hide zoom controls before main box animation // reposition and hide zoom controls before main box animation
beforeMainTransition: function() { beforeMainTransition: function() {
OSRM.Control.Zoom.prototype.hide(); OSRM.G.map.zoomControl.hide();
}, },
// show zoom controls after main box animation // show zoom controls after main box animation
afterMainTransition: function() { afterMainTransition: function() {
OSRM.Control.Zoom.prototype.show(); OSRM.G.map.zoomControl.show();
}, },
// distance format routines // distance format routines

View File

@ -46,11 +46,11 @@ init: function() {
// toggle GUI features that need a route to work // toggle GUI features that need a route to work
activateRouteFeatures: function() { activateRouteFeatures: function() {
OSRM.Printing.activate(); OSRM.Printing.activate();
OSRM.Control.Locations.prototype.activate('gui-locations-route'); OSRM.G.map.locationsControl.activateRoute();
}, },
deactivateRouteFeatures: function() { deactivateRouteFeatures: function() {
OSRM.Printing.deactivate(); OSRM.Printing.deactivate();
OSRM.Control.Locations.prototype.deactivate('gui-locations-route'); OSRM.G.map.locationsControl.deactivateRoute();
}, },
// click: button "reset" // click: button "reset"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 981 B

After

Width:  |  Height:  |  Size: 913 B

View File

@ -34,6 +34,8 @@ OSRM.Localization["bg"] = {
"GUI_START_TOOLTIP": "Въведи начало", "GUI_START_TOOLTIP": "Въведи начало",
"GUI_END_TOOLTIP": "Въведи карйна цел", "GUI_END_TOOLTIP": "Въведи карйна цел",
"GUI_MAIN_WINDOW": "главния прозорец", "GUI_MAIN_WINDOW": "главния прозорец",
"GUI_ZOOM_IN": "Приближаване",
"GUI_ZOOM_OUT": "Oтдалечаване",
// config // config
"GUI_CONFIGURATION": "Конфигурация", "GUI_CONFIGURATION": "Конфигурация",
"GUI_LANGUAGE": "Език", "GUI_LANGUAGE": "Език",
@ -66,6 +68,8 @@ OSRM.Localization["bg"] = {
// printing // printing
"OVERVIEW_MAP": "сбит изглед", "OVERVIEW_MAP": "сбит изглед",
"NO_ROUTE_SELECTED": "Не е изберан маршрут", "NO_ROUTE_SELECTED": "Не е изберан маршрут",
// routing engines
"ENGINE_0": "Kола (най-бързо)",
// directions // directions
"N": "север", "N": "север",
"E": "изток", "E": "изток",

View File

@ -32,6 +32,8 @@ OSRM.Localization["cs"] = {
"GUI_REVERSE": "Prohodit", "GUI_REVERSE": "Prohodit",
"GUI_START_TOOLTIP": "Zadejte začátek cesty", "GUI_START_TOOLTIP": "Zadejte začátek cesty",
"GUI_END_TOOLTIP": "Zadejte cíl cesty", "GUI_END_TOOLTIP": "Zadejte cíl cesty",
"GUI_ZOOM_IN": "Najíždět",
"GUI_ZOOM_OUT": "Oddálit",
// config // config
"GUI_CONFIGURATION": "Nastavení", "GUI_CONFIGURATION": "Nastavení",
"GUI_LANGUAGE": "Jazyk", "GUI_LANGUAGE": "Jazyk",
@ -64,6 +66,8 @@ OSRM.Localization["cs"] = {
// printing // printing
"OVERVIEW_MAP": "Přehledová mapka", "OVERVIEW_MAP": "Přehledová mapka",
"NO_ROUTE_SELECTED": "Ne vybranou trasu", "NO_ROUTE_SELECTED": "Ne vybranou trasu",
// routing engines
"ENGINE_0": "Auto (nejrychlejší)",
// directions // directions
"N": "sever", "N": "sever",
"E": "východ", "E": "východ",

View File

@ -34,6 +34,8 @@ OSRM.Localization["de"] = {
"GUI_START_TOOLTIP": "Startposition eingeben", "GUI_START_TOOLTIP": "Startposition eingeben",
"GUI_END_TOOLTIP": "Zielposition eingeben", "GUI_END_TOOLTIP": "Zielposition eingeben",
"GUI_MAIN_WINDOW": "Hauptfenster", "GUI_MAIN_WINDOW": "Hauptfenster",
"GUI_ZOOM_IN": "Vergrößern",
"GUI_ZOOM_OUT": "Verkleinern",
// config // config
"GUI_CONFIGURATION": "Einstellungen", "GUI_CONFIGURATION": "Einstellungen",
"GUI_LANGUAGE": "Sprache", "GUI_LANGUAGE": "Sprache",
@ -67,7 +69,7 @@ OSRM.Localization["de"] = {
"OVERVIEW_MAP": "Übersichtskarte", "OVERVIEW_MAP": "Übersichtskarte",
"NO_ROUTE_SELECTED": "Keine Route ausgewählt", "NO_ROUTE_SELECTED": "Keine Route ausgewählt",
//routing engines //routing engines
"ENGINE_0": "Auto (schnellste Strecke)", "ENGINE_0": "Auto (schnellste)",
"ENGINE_1": "Auto (nur Polen)", "ENGINE_1": "Auto (nur Polen)",
"ENGINE_2": "Fahrrad (nur Polen)", "ENGINE_2": "Fahrrad (nur Polen)",
// directions // directions

View File

@ -34,6 +34,8 @@ OSRM.Localization["dk"] = {
"GUI_START_TOOLTIP": "Indtast start", "GUI_START_TOOLTIP": "Indtast start",
"GUI_END_TOOLTIP": "Indtast destination", "GUI_END_TOOLTIP": "Indtast destination",
"GUI_MAIN_WINDOW": "Hovedvinduet", "GUI_MAIN_WINDOW": "Hovedvinduet",
"GUI_ZOOM_IN": "Zoome ind",
"GUI_ZOOM_OUT": "Zoome ud",
// config // config
"GUI_CONFIGURATION": "Konfiguration", "GUI_CONFIGURATION": "Konfiguration",
"GUI_LANGUAGE": "Sprog", "GUI_LANGUAGE": "Sprog",
@ -66,6 +68,8 @@ OSRM.Localization["dk"] = {
// printing // printing
"OVERVIEW_MAP": "Oversigtskort", "OVERVIEW_MAP": "Oversigtskort",
"NO_ROUTE_SELECTED": "Ikke valgte rute", "NO_ROUTE_SELECTED": "Ikke valgte rute",
// routing engines
"ENGINE_0": "Bil (hurtigste)",
// directions // directions
"N": "nord", "N": "nord",
"E": "øst", "E": "øst",

View File

@ -34,6 +34,8 @@ OSRM.Localization["en"] = {
"GUI_START_TOOLTIP": "Enter start", "GUI_START_TOOLTIP": "Enter start",
"GUI_END_TOOLTIP": "Enter destination", "GUI_END_TOOLTIP": "Enter destination",
"GUI_MAIN_WINDOW": "Main window", "GUI_MAIN_WINDOW": "Main window",
"GUI_ZOOM_IN": "Zoom in",
"GUI_ZOOM_OUT": "Zoom out",
// config // config
"GUI_CONFIGURATION": "Configuration", "GUI_CONFIGURATION": "Configuration",
"GUI_LANGUAGE": "Language", "GUI_LANGUAGE": "Language",
@ -67,7 +69,7 @@ OSRM.Localization["en"] = {
"OVERVIEW_MAP": "Overview Map", "OVERVIEW_MAP": "Overview Map",
"NO_ROUTE_SELECTED": "No route selected", "NO_ROUTE_SELECTED": "No route selected",
// routing engines // routing engines
"ENGINE_0": "Car (fastest route)", "ENGINE_0": "Car (fastest)",
"ENGINE_1": "Car (Poland only)", "ENGINE_1": "Car (Poland only)",
"ENGINE_2": "Bike (Poland only)", "ENGINE_2": "Bike (Poland only)",
// directions // directions

View File

@ -34,6 +34,8 @@ OSRM.Localization["es"] = {
"GUI_START_TOOLTIP": "Escriba la dirección de origen", "GUI_START_TOOLTIP": "Escriba la dirección de origen",
"GUI_END_TOOLTIP": "Escriba la dirección de destino", "GUI_END_TOOLTIP": "Escriba la dirección de destino",
"GUI_MAIN_WINDOW": "Ventana principal", "GUI_MAIN_WINDOW": "Ventana principal",
"GUI_ZOOM_IN": "Ampliar",
"GUI_ZOOM_OUT": "Alejar",
// config // config
"GUI_CONFIGURATION": "Configuración", "GUI_CONFIGURATION": "Configuración",
"GUI_LANGUAGE": "Idioma", "GUI_LANGUAGE": "Idioma",
@ -66,6 +68,8 @@ OSRM.Localization["es"] = {
// printing // printing
"OVERVIEW_MAP": "Mapa de referencia", "OVERVIEW_MAP": "Mapa de referencia",
"NO_ROUTE_SELECTED": "Ninguna ruta seleccionada", "NO_ROUTE_SELECTED": "Ninguna ruta seleccionada",
// routing engines
"ENGINE_0": "Coche (el más rápido)",
// directions // directions
"N": "norte", "N": "norte",
"E": "este", "E": "este",

View File

@ -34,6 +34,8 @@ OSRM.Localization["fi"] = {
"GUI_START_TOOLTIP": "Syötä lähtöpaikka", "GUI_START_TOOLTIP": "Syötä lähtöpaikka",
"GUI_END_TOOLTIP": "Syötä määränpää", "GUI_END_TOOLTIP": "Syötä määränpää",
"GUI_MAIN_WINDOW": "Pääikkuna", "GUI_MAIN_WINDOW": "Pääikkuna",
"GUI_ZOOM_IN": "Lähennä",
"GUI_ZOOM_OUT": "Loitonna",
// config // config
"GUI_CONFIGURATION": "Kokoonpano", "GUI_CONFIGURATION": "Kokoonpano",
"GUI_LANGUAGE": "Kieli", "GUI_LANGUAGE": "Kieli",
@ -66,6 +68,8 @@ OSRM.Localization["fi"] = {
// printing // printing
"OVERVIEW_MAP": "Yleiskuvakartta", "OVERVIEW_MAP": "Yleiskuvakartta",
"NO_ROUTE_SELECTED": "Ei reitti valittu", "NO_ROUTE_SELECTED": "Ei reitti valittu",
// routing engines
"ENGINE_0": "Auton (nopein)",
// directions // directions
"N": "pohjoiseen", "N": "pohjoiseen",
"E": "itään", "E": "itään",

View File

@ -34,6 +34,8 @@ OSRM.Localization["fr"] = {
"GUI_START_TOOLTIP": "Entrez le lieu de départ", "GUI_START_TOOLTIP": "Entrez le lieu de départ",
"GUI_END_TOOLTIP": "Entrez le lieu darrivée", "GUI_END_TOOLTIP": "Entrez le lieu darrivée",
"GUI_MAIN_WINDOW": "Fenêtre principale", "GUI_MAIN_WINDOW": "Fenêtre principale",
"GUI_ZOOM_IN": "Zoomer",
"GUI_ZOOM_OUT": "Rétrécir",
// config // config
"GUI_CONFIGURATION": "Configuration", "GUI_CONFIGURATION": "Configuration",
"GUI_LANGUAGE": "Langue", "GUI_LANGUAGE": "Langue",
@ -66,6 +68,8 @@ OSRM.Localization["fr"] = {
// printing // printing
"OVERVIEW_MAP": "Carte", "OVERVIEW_MAP": "Carte",
"NO_ROUTE_SELECTED": "Pas ditinéraire choisi", "NO_ROUTE_SELECTED": "Pas ditinéraire choisi",
// routing engines
"ENGINE_0": "voiture (le plus rapide)",
// directions // directions
"N": "nord", "N": "nord",
"E": "est", "E": "est",

View File

@ -34,6 +34,8 @@ OSRM.Localization["it"] = {
"GUI_START_TOOLTIP": "Inserire la Partenza", "GUI_START_TOOLTIP": "Inserire la Partenza",
"GUI_END_TOOLTIP": "Inserire la destinazione", "GUI_END_TOOLTIP": "Inserire la destinazione",
"GUI_MAIN_WINDOW": "Finestra principale", "GUI_MAIN_WINDOW": "Finestra principale",
"GUI_ZOOM_IN": "Ingrandire",
"GUI_ZOOM_OUT": "Diminuire",
// config // config
"GUI_CONFIGURATION": "Configurazione", "GUI_CONFIGURATION": "Configurazione",
"GUI_LANGUAGE": "Lingua", "GUI_LANGUAGE": "Lingua",
@ -65,6 +67,8 @@ OSRM.Localization["it"] = {
"NO_ROUTE_FOUND": "Nessun percorso possibile", "NO_ROUTE_FOUND": "Nessun percorso possibile",
// printing // printing
"OVERVIEW_MAP": "Mappa d'insieme", "OVERVIEW_MAP": "Mappa d'insieme",
// routing engines
"ENGINE_0": "Macchina (più veloce)",
// directions // directions
"N": "nord", "N": "nord",
"E": "est", "E": "est",

View File

@ -34,6 +34,8 @@ OSRM.Localization["lv"] = {
"GUI_START_TOOLTIP": "Izvēlieties sākumu", "GUI_START_TOOLTIP": "Izvēlieties sākumu",
"GUI_END_TOOLTIP": "Izvēlieties galamērķi", "GUI_END_TOOLTIP": "Izvēlieties galamērķi",
"GUI_MAIN_WINDOW": "Galvenais logs", "GUI_MAIN_WINDOW": "Galvenais logs",
"GUI_ZOOM_IN": "Palielinātu",
"GUI_ZOOM_OUT": "Attālinātu",
// config // config
"GUI_CONFIGURATION": "Konfigurācija", "GUI_CONFIGURATION": "Konfigurācija",
"GUI_LANGUAGE": "Valoda", "GUI_LANGUAGE": "Valoda",
@ -66,6 +68,8 @@ OSRM.Localization["lv"] = {
// printing // printing
"OVERVIEW_MAP": "Kartes pārskats", "OVERVIEW_MAP": "Kartes pārskats",
"NO_ROUTE_SELECTED": "Nav norādīts maršruts", "NO_ROUTE_SELECTED": "Nav norādīts maršruts",
// routing engines
"ENGINE_0": "Auto (ātrākais)",
// directions // directions
"N": "ziemeļu", "N": "ziemeļu",
"E": "austrumu", "E": "austrumu",

View File

@ -34,6 +34,8 @@ OSRM.Localization["pl"] = {
"GUI_START_TOOLTIP": "Wprowadź początek", "GUI_START_TOOLTIP": "Wprowadź początek",
"GUI_END_TOOLTIP": "Wprowadź koniec", "GUI_END_TOOLTIP": "Wprowadź koniec",
"GUI_MAIN_WINDOW": "Główne okno", "GUI_MAIN_WINDOW": "Główne okno",
"GUI_ZOOM_IN": "Powiększyć",
"GUI_ZOOM_OUT": "Pomniejszyć",
// config // config
"GUI_CONFIGURATION": "Konfiguracja", "GUI_CONFIGURATION": "Konfiguracja",
"GUI_LANGUAGE": "Język", "GUI_LANGUAGE": "Język",
@ -65,6 +67,8 @@ OSRM.Localization["pl"] = {
"NO_ROUTE_FOUND": "Nie można wyznaczyć trasy", "NO_ROUTE_FOUND": "Nie można wyznaczyć trasy",
// printing // printing
"OVERVIEW_MAP": "Mapa poglądowa", "OVERVIEW_MAP": "Mapa poglądowa",
// routing engines
"ENGINE_0": "samochód (najszybciej)",
// directions // directions
"N": "północ", "N": "północ",
"E": "wschód", "E": "wschód",

View File

@ -26,14 +26,16 @@ OSRM.Localization["ru"] = {
// gui // gui
"GUI_START": "Начало", "GUI_START": "Начало",
"GUI_END": "Конец", "GUI_END": "Конец",
"GUI_RESET": "  Сброс  ", "GUI_RESET": "Сброс",
"GUI_ZOOM_ON_ROUTE": "зум на маршрут", "GUI_ZOOM_ON_ROUTE": "зум на маршрут",
"GUI_ZOOM_ON_USER": "зум на Пользователь", "GUI_ZOOM_ON_USER": "зум на Пользователь",
"GUI_SEARCH": "  Показать  ", "GUI_SEARCH": "Показать",
"GUI_REVERSE": "Обратно", "GUI_REVERSE": "Обратно",
"GUI_START_TOOLTIP": "Укажите начальную точку", "GUI_START_TOOLTIP": "Укажите начальную точку",
"GUI_END_TOOLTIP": "Укажите пункт назначения", "GUI_END_TOOLTIP": "Укажите пункт назначения",
"GUI_MAIN_WINDOW": "Главное окно", "GUI_MAIN_WINDOW": "Главное окно",
"GUI_ZOOM_IN": "Yвеличить",
"GUI_ZOOM_OUT": "Mасштаб",
// config // config
"GUI_CONFIGURATION": "Настройки", "GUI_CONFIGURATION": "Настройки",
"GUI_LANGUAGE": "Язык", "GUI_LANGUAGE": "Язык",
@ -66,6 +68,8 @@ OSRM.Localization["ru"] = {
// printing // printing
"OVERVIEW_MAP": "Обзорная карта", "OVERVIEW_MAP": "Обзорная карта",
"NO_ROUTE_SELECTED": "Маршрут не выбран", "NO_ROUTE_SELECTED": "Маршрут не выбран",
// routing engines
"ENGINE_0": "Aвтомобиля (быстрый)",
// directions // directions
"N": "север", "N": "север",
"E": "восток", "E": "восток",

View File

@ -35,7 +35,7 @@ html, body {
/* changes/additions to leaflet styles */ /* changes/additions to leaflet styles */
.leaflet-control-layers { .leaflet-control-layers {
box-shadow: 0 0px 0px; box-shadow: none;
border-radius:10px; border-radius:10px;
-moz-border-radius:10px; -moz-border-radius:10px;
-webkit-border-radius:10px; -webkit-border-radius:10px;
@ -547,14 +547,6 @@ html, body {
background-repeat: no-repeat; background-repeat: no-repeat;
display: block; display: block;
} }
.gui-control-inactive {
cursor:default;
position:relative;
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
background-color: #EFEFEF;
}
/* zoom buttons */ /* zoom buttons */
@ -766,3 +758,68 @@ input[type=checkbox],
font-size: 9px; font-size: 9px;
font-weight: normal; font-weight: normal;
} }
/* .leaflet-control-layers {
box-shadow: 0 1px 7px #999;
background: #f8f8f9;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
}
.leaflet-touch .leaflet-control-layers {
box-shadow: none;
border: 5px solid #bbb;
}
.leaflet-control-layers a {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-touch .leaflet-control-layers a {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
color: #333;
background: #fff;
}
.leaflet-control-layers input {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
} */

View File

@ -37,7 +37,6 @@ or see http://www.gnu.org/licenses/agpl.txt.
<!-- scripts --> <!-- scripts -->
<script src="leaflet/leaflet-src.js" type="text/javascript"></script> <script src="leaflet/leaflet-src.js" type="text/javascript"></script>
<script src="base/leaflet/L.Bugfixes.js" type="text/javascript"></script> <script src="base/leaflet/L.Bugfixes.js" type="text/javascript"></script>
<script src="base/leaflet/L.Control.QueryableLayers.js" type="text/javascript"></script>
<script src="base/leaflet/L.LabelMarker.js" type="text/javascript"></script> <script src="base/leaflet/L.LabelMarker.js" type="text/javascript"></script>
<script src="base/leaflet/L.LabelMarkerIcon.js" type="text/javascript"></script> <script src="base/leaflet/L.LabelMarkerIcon.js" type="text/javascript"></script>
<script src="base/leaflet/L.BingLayer.js" type="text/javascript"></script> <script src="base/leaflet/L.BingLayer.js" type="text/javascript"></script>
@ -50,9 +49,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
<script src="main.js" type="text/javascript"></script> <script src="main.js" type="text/javascript"></script>
<!-- <script defer="defer" src="OSRM.debug.js" type="text/javascript"></script> --> <!-- <script defer="defer" src="OSRM.debug.js" type="text/javascript"></script> -->
<script src="base/osrm/OSRM.Control.Layers.js" type="text/javascript"></script>
<script src="base/osrm/OSRM.Control.Locations.js" type="text/javascript"></script> <script src="base/osrm/OSRM.Control.Locations.js" type="text/javascript"></script>
<script src="base/osrm/OSRM.Control.Zoom.js" type="text/javascript"></script> <script src="base/osrm/OSRM.Control.Zoom.js" type="text/javascript"></script>
<script src="base/osrm/OSRM.MapView.js" type="text/javascript"></script> <script src="base/osrm/OSRM.Control.Map.js" type="text/javascript"></script>
<script src="base/osrm/OSRM.Marker.js" type="text/javascript"></script> <script src="base/osrm/OSRM.Marker.js" type="text/javascript"></script>
<script src="base/osrm/OSRM.Route.js" type="text/javascript"></script> <script src="base/osrm/OSRM.Route.js" type="text/javascript"></script>

View File

@ -41,7 +41,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
<script src="../base/leaflet/L.LabelMarker.js" type="text/javascript"></script> <script src="../base/leaflet/L.LabelMarker.js" type="text/javascript"></script>
<script src="../base/leaflet/L.LabelMarkerIcon.js" type="text/javascript"></script> <script src="../base/leaflet/L.LabelMarkerIcon.js" type="text/javascript"></script>
<script src="../base/leaflet/L.BingLayer.js" type="text/javascript"></script> <script src="../base/leaflet/L.BingLayer.js" type="text/javascript"></script>
<script src="../base/osrm/OSRM.MapView.js" type="text/javascript"></script> <script src="../base/osrm/OSRM.Control.Map.js" type="text/javascript"></script>
</head> </head>

View File

@ -62,7 +62,7 @@ OSRM.drawMap = function(tile_server, bounds) {
if( tile_server.bing ) tile_layer = new L.BingLayer(tile_server.apikey, tile_server.options); if( tile_server.bing ) tile_layer = new L.BingLayer(tile_server.apikey, tile_server.options);
else tile_layer = new L.TileLayer(tile_server.url, tile_server.options); else tile_layer = new L.TileLayer(tile_server.url, tile_server.options);
tile_layer.options.culture = OSRM.G.Localization.culture; tile_layer.options.culture = OSRM.G.Localization.culture;
OSRM.G.map = new OSRM.MapView("overview-map", { OSRM.G.map = new OSRM.Control.Map("overview-map", {
center: new L.LatLng(48.84, 10.10), center: new L.LatLng(48.84, 10.10),
zoom: 13, zoom: 13,
zoomAnimation: false, zoomAnimation: false,