Compare commits

...

62 Commits

Author SHA1 Message Date
DennisSchiefer 17bfe95cd3 Russian translation (thanks to Barboska) 2012-07-09 09:38:32 +01:00
DennisSchiefer e90fe88cc0 added whitespaces to the tooltips for alternatives before the numbers 2012-07-06 11:50:25 +01:00
DennisSchiefer eba6330db1 removed backup file 2012-07-05 14:50:16 +01:00
DennisSchiefer a21aaf330e added backup to tooltip handling with wrapper function (not entirely
working)
2012-07-05 14:49:59 +01:00
DennisSchiefer 390a14ac77 clarified introduction 2012-07-05 14:46:05 +01:00
DennisSchiefer f2d4f31b8f moved tooltip position a bit down and on top of everything else besides
exclusive notifications
2012-07-05 14:36:01 +01:00
DennisSchiefer ed72366e69 version jump to 0.1.7 2012-07-05 14:32:48 +01:00
DennisSchiefer 6feccd2507 clarified tooltips 2012-07-05 14:31:25 +01:00
DennisSchiefer f27e05564d fixed bug with dragging via markers while an alternative is active 2012-07-05 14:25:42 +01:00
DennisSchiefer d1bc05fcae clarified tooltips,
changed timers to short durations for testing
2012-07-05 14:16:36 +01:00
DennisSchiefer 8323ce78e3 fixed bug with route reversal 2012-07-05 14:08:12 +01:00
DennisSchiefer 517f321ccc Merge branch 'trial/notifications' into develop
Conflicts:
	WebContent/main.html
2012-07-05 14:02:37 +01:00
DennisSchiefer 5e24749826 clarified comments 2012-07-05 14:00:47 +01:00
DennisSchiefer 8f6cd99ff6 changed notification triggers from wrapped functions to simple function
calls
2012-07-05 13:53:07 +01:00
DennisSchiefer efa959d112 added clarifying comment 2012-07-05 13:01:27 +01:00
DennisSchiefer f119b79101 removed comment 2012-07-05 13:00:57 +01:00
DennisSchiefer 8b17e4864e changed check to make sure parameters exist 2012-07-05 09:45:54 +01:00
DennisSchiefer 4ebe4848af Merge branch 'trial/alternatives' into develop
Conflicts:
	WebContent/routing/OSRM.Routing.js
2012-07-05 09:33:00 +01:00
DennisSchiefer ba46d77d1d finalized alternative integration 2012-07-05 09:24:27 +01:00
DennisSchiefer 0c946f1476 added additional notifications,
better argument passing to wrapped trigger functions for notifications,
notification boxes adapt in size to contained text,
notification functions renamed,
2012-07-04 17:27:08 +01:00
DennisSchiefer 22783a53cd wrapper function for localization pulldown menu to work as trigger
function for notifications
2012-07-04 17:25:04 +01:00
DennisSchiefer 770f3b5979 added some notifications 2012-07-04 16:36:10 +01:00
DennisSchiefer a90b2371c2 Merge branch 'trial/geocoder' into develop 2012-07-04 16:15:27 +01:00
DennisSchiefer 052f7060c1 changed look of geocoder results a bit (vertical alignment, debug
messages)
2012-07-04 16:15:04 +01:00
DennisSchiefer 314ff97ca0 nominatim results with type "arial_views" will not be displayed 2012-07-04 15:42:20 +01:00
DennisSchiefer 35bb9efa51 separated normal notifications from important notifications (that lock
the screen)
2012-07-04 15:35:06 +01:00
DennisSchiefer 60436e9928 filter boundaries 2012-07-04 14:07:31 +01:00
DennisSchiefer f575ff2ba5 increased limit on search results 2012-07-04 13:58:06 +01:00
DennisSchiefer 84a960ae1e highlight markers are rendered below normal markers 2012-07-04 13:40:23 +01:00
DennisSchiefer 38ccb9d974 Merge branch 'trial/zooming' into develop 2012-07-04 13:32:36 +01:00
DennisSchiefer 5e3de973d7 recentering/zooming on a route is only done, when the route is first
drawn by clicking on the map and only if the rout doesn't fit into the
current viewport
2012-07-04 13:31:45 +01:00
DennisSchiefer f385ea4e97 modified notification markers, so that a trigger function can be named
that will prevent the notification from happening
2012-07-04 12:36:43 +01:00
DennisSchiefer c38c0b6f03 added notifications 2012-07-04 09:00:11 +01:00
DennisSchiefer 74154ab0a6 alternatives work - sort of 2012-07-04 07:42:49 +01:00
DennisSchiefer c33dbe67d8 printing and alternatives works! 2012-07-03 15:17:29 +01:00
DennisSchiefer 903c4577d1 removed selection restrictions 2012-07-03 14:51:31 +01:00
DennisSchiefer c07f87edca removed geomformat=cmp from jsonp requests as it is now the default 2012-07-03 14:42:23 +01:00
DennisSchiefer 537b9b0623 added stuff to alternatives 2012-07-03 14:39:29 +01:00
DennisSchiefer d88baaf1a4 zoom/pan to route when it doesn't fit on the screen 2012-07-03 13:37:12 +01:00
DennisSchiefer 232409d70b selector elements now use offsetHeight and offsetWidth instead of
clientHeight and clientWidth of invisible selector element
2012-07-03 10:24:10 +01:00
DennisSchiefer c549311349 setting a marker on the map no longer centers on the marker 2012-07-03 10:06:57 +01:00
DennisSchiefer 40c6ac0c28 added letvian translation (thanks to Lauris Bukšis-Haberkorns) 2012-07-03 09:59:16 +01:00
DennisSchiefer 80d2918203 alternatives work with zooming now 2012-06-21 08:26:57 +01:00
shiin 90c48abeaf more alternative stuff 2012-06-20 23:52:43 +02:00
shiin badd48f166 more alternative stuff 2012-06-20 22:08:25 +02:00
DennisSchiefer caa99038c5 no more special characters! 2012-06-18 16:35:10 +01:00
DennisSchiefer ec62156322 additional fix to the slight/sharp left dilema 2012-06-18 16:23:08 +01:00
DennisSchiefer 1423d80556 fixed language error on vs. onto 2012-06-18 08:48:03 +01:00
shiin 59775a9864 more towards alternatives 2012-06-17 18:23:57 +02:00
shiin 7b94a3092f preparation for zooming 2012-06-17 11:04:27 +02:00
shiin 7d82661927 first code for managing alternatives 2012-06-17 09:07:32 +02:00
shiin eeec69dfab added Spanish translation 2012-06-16 13:04:01 +02:00
shiin a8731d91ab fixed bug with "slight left" and "sharp left" instructions being
reversed
2012-06-16 12:44:19 +02:00
DennisSchiefer 3c5c26a8b5 fixed a bug where elements of hidden GUIBoxes could be selected by
tabbing.
2012-06-14 08:08:14 +01:00
DennisSchiefer 2e71ad3060 added fix for touch enabled devices using the layer control 2012-06-14 07:35:26 +01:00
DennisSchiefer 2ad919c970 added geocoder filtering and using Nominatim icons 2012-06-13 10:29:30 +01:00
DennisSchiefer 308b8e5f48 Merge branch 'feature/geocoder' into develop 2012-06-13 07:08:07 +01:00
DennisSchiefer 8677f15d47 zoom button now has same distance to left and right buttons 2012-06-13 07:07:31 +01:00
DennisSchiefer 5923d034c9 added button to zoom on current route 2012-06-12 16:58:16 +01:00
DennisSchiefer 05410d5587 using viewbox, removing zoom-on-route 2012-06-12 15:55:39 +01:00
shiin 1c76c992c1 merged two ideas of raphnik for testing 2012-06-11 14:58:00 +02:00
DennisSchiefer 1973198f3d changed order of loading scripts 2012-05-16 16:27:11 +01:00
44 changed files with 1051 additions and 158 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
The following people contributed code to the Open Source Routing Machine:
The following people contributed to the Open Source Routing Machine web frontend:
Dennis Schieferdecker
Dennis Luxen
@@ -10,4 +10,8 @@ Jean-Frederic
Zbigniew Czernik
Jonas Häggqvist
Sabas
Paul Spencer
Paul Spencer
Raphael Pinson
Juan Luis Rodriguez Ponce
Lauris Bukšis-Haberkorns
Barboska
+2 -2
View File
@@ -19,8 +19,8 @@ or see http://www.gnu.org/licenses/agpl.txt.
// [has to be loaded before all other OSRM classes]
var OSRM = {};
OSRM.VERSION = '0.1.6';
OSRM.DATE = '120516';
OSRM.VERSION = '0.1.7';
OSRM.DATE = '120705';
OSRM.CONSTANTS = {};
OSRM.DEFAULTS = {};
OSRM.GLOBALS = {};
+4 -1
View File
@@ -46,10 +46,13 @@ OSRM.DEFAULTS = {
{encoding:"en", name:"English"},
{encoding:"de", name:"Deutsch"},
{encoding:"dk", name:"Dansk"},
{encoding:"es", name:"Español"},
{encoding:"fi", name:"Suomi"},
{encoding:"fr", name:"Français"},
{encoding:"it", name:"Italiano"},
{encoding:"pl", name:"Polski", culture:"en-US"}
{encoding:"lv", name:"Latviešu"},
{encoding:"pl", name:"Polski", culture:"en-US"},
{encoding:"ru", name:"Русский"}
],
TILE_SERVERS: [
+69 -12
View File
@@ -34,7 +34,7 @@ call: function(marker_id, query) {
if(query=="")
return;
//geo coordinates given -> directly draw results
// geo coordinates given -> directly draw results
if(query.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
var coord = query.split(/[,;]/);
OSRM.Geocoder._onclickResult(marker_id, coord[0], coord[1]);
@@ -42,8 +42,11 @@ call: function(marker_id, query) {
return;
}
//build request for geocoder
var call = OSRM.DEFAULTS.HOST_GEOCODER_URL + "?format=json&json_callback=%jsonp" + OSRM.DEFAULTS.GEOCODER_BOUNDS + "&accept-language="+OSRM.Localization.current_language+"&q=" + query;
// build basic request for geocoder
var call = OSRM.DEFAULTS.HOST_GEOCODER_URL + "?format=json&json_callback=%jsonp" + OSRM.DEFAULTS.GEOCODER_BOUNDS + "&accept-language="+OSRM.Localization.current_language+"&limit=30&q=" + query;
// prioritize results in currently shown mapview
var bounds = OSRM.G.map.getBounds();
call += "&viewbox=" + bounds._southWest.lat + "," + bounds._northEast.lng + "," + bounds._northEast.lat + "," + bounds._southWest.lng;
OSRM.JSONP.call( call, OSRM.Geocoder._showResults, OSRM.Geocoder._showResults_Timeout, OSRM.DEFAULTS.JSONP_TIMEOUT, "geocoder_"+marker_id, {marker_id:marker_id,query:query} );
},
@@ -77,27 +80,42 @@ _showResults: function(response, parameters) {
return;
}
// filter/sort inputs
var filtered_response = [];
for(var i=0; i < response.length; i++){
var result = response[i];
if( OSRM.Geocoder._filterResult( result ) )
continue;
filtered_response.push( result );
}
filtered_response.sort( OSRM.Geocoder._compareResults );
// show first result
OSRM.Geocoder._onclickResult(parameters.marker_id, response[0].lat, response[0].lon);
OSRM.Geocoder._onclickResult(parameters.marker_id, filtered_response[0].lat, filtered_response[0].lon);
if( OSRM.G.markers.route.length > 1 ) // if a route is displayed, we don't need to show other possible geocoding results
return;
return;
// show possible results for input
var html = "";
html += '<table class="results medium-font">';
for(var i=0; i < response.length; i++){
var result = response[i];
for(var i=0; i < filtered_response.length; i++){
var result = filtered_response[i];
//odd or even ?
var rowstyle='results-body-odd';
if(i%2==0) { rowstyle='results-body-even'; }
html += '<tr class="'+rowstyle+'">';
html += '<td class="results-body-counter"><span">'+(i+1)+'.</span></td>';
if(!result.icon)
result.icon = "http://nominatim.openstreetmap.org/images/mapicons/poi_point_of_interest.glow.12.png";
html += '<td class="results-body-counter"><img src="'+ result.icon + '" alt=""/></td>';
html += '<td class="results-body-items">';
if(result.display_name){
html += '<div class="results-body-item" onclick="OSRM.Geocoder._onclickResult(\''+parameters.marker_id+'\', '+result.lat+', '+result.lon+');">'+result.display_name+'</div>';
html += '<div class="results-body-item" onclick="OSRM.Geocoder._onclickResult(\''+parameters.marker_id+'\', '+result.lat+', '+result.lon+');">'+result.display_name;
// debug output to show osm_type, class, type
// html += '<br/><span class="results-body-item-remark small-font">[osm_type: ' + result.osm_type + ', class: ' + result.class + ', type: ' + result.type + ']</span>';
html += '</div>';
}
html += "</td></tr>";
}
@@ -105,8 +123,8 @@ _showResults: function(response, parameters) {
document.getElementById('information-box-header').innerHTML =
"<div class='header-title'>"+OSRM.loc("SEARCH_RESULTS")+"</div>" +
"<div class='header-content'>("+OSRM.loc("FOUND_X_RESULTS").replace(/%i/,response.length)+")</div>";
"<div class='header-content'>(found "+response.length+" results)"+"</div>";
"<div class='header-content'>("+OSRM.loc("FOUND_X_RESULTS").replace(/%i/,filtered_response.length)+")</div>";
"<div class='header-content'>(found "+filtered_response.length+" results)"+"</div>";
document.getElementById('information-box').innerHTML = html;
},
_showResults_Empty: function(parameters) {
@@ -125,6 +143,45 @@ _showResults_Timeout: function() {
"<div class='header-title'>"+OSRM.loc("SEARCH_RESULTS")+"</div>" +
"<div class='header-content'>("+OSRM.loc("FOUND_X_RESULTS").replace(/%i/,0)+")</div>";
document.getElementById('information-box').innerHTML = "<div class='no-results big-font'>"+OSRM.loc("TIMED_OUT")+"</div>";
},
// filter search results [true: result will not be displayed]
_filterResult: function(result) {
if( result.osm_type == "relation")
return true;
if( result.type == "aerial_views")
return true;
return false;
},
// comparator for sorting results [higher weight: result will appear first]
_compare_class_weights: {
place: 9000,
highway: 8000,
boundary: 7000
},
_compare_type_weights: {
country: 13,
state: 12,
county: 11,
city: 10,
town: 9,
village: 8,
hamlet: 7,
suburb: 6,
locality: 5,
farm: 4
},
_compareResults: function(lhs, rhs) {
var class_values = OSRM.Geocoder._compare_class_weights;
var type_values = OSRM.Geocoder._compare_type_weights;
var lhs_value = (-class_values[ lhs.class ] || 0) + (-type_values[ lhs.type ] || 0);
var rhs_value = (-class_values[ rhs.class ] || 0) + (-type_values[ rhs.type ] || 0);
return (lhs_value - rhs_value);
},
+1 -1
View File
@@ -170,7 +170,7 @@ OSRM.extend( OSRM.HistoryRoute,{
},
_buildCall: function(history_id) {
var source = OSRM.DEFAULTS.HOST_ROUTING_URL;
source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp&geomformat=cmp';
source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp';
if(this._history[history_id].checksum)
source += '&checksum=' + this._history[history_id].checksum;
+5 -6
View File
@@ -81,23 +81,22 @@ zoomed: function(e) {
if(OSRM.G.dragging)
OSRM.Routing.getRoute_Dragging();
else
OSRM.Routing.getRoute_Redraw();
OSRM.Routing.getRoute_Redraw({keepAlternative:true});
},
contextmenu: function(e) {;},
mousemove: function(e) { OSRM.Via.drawDragMarker(e); },
click: function(e) {
OSRM.GUI.deactivateTooltip( "clicking" );
if( !OSRM.G.markers.hasSource() ) {
var index = OSRM.G.markers.setSource( e.latlng );
OSRM.Geocoder.updateAddress( OSRM.C.SOURCE_LABEL, OSRM.C.DO_FALLBACK_TO_LAT_LNG );
OSRM.G.markers.route[index].show();
OSRM.G.markers.route[index].centerView( OSRM.G.map.getZoom() );
OSRM.Routing.getRoute();
OSRM.G.markers.route[index].show();
OSRM.Routing.getRoute( {recenter:OSRM.G.markers.route.length == 2} ); // allow recentering when the route is first shown
} else if( !OSRM.G.markers.hasTarget() ) {
var index = OSRM.G.markers.setTarget( e.latlng );
OSRM.Geocoder.updateAddress( OSRM.C.TARGET_LABEL, OSRM.C.DO_FALLBACK_TO_LAT_LNG );
OSRM.G.markers.route[index].show();
OSRM.G.markers.route[index].centerView( OSRM.G.map.getZoom() );
OSRM.Routing.getRoute();
OSRM.Routing.getRoute( {recenter:OSRM.G.markers.route.length == 2} ); // allow recentering when the route is first shown
}
},
geolocationResponse: function(response) {
+1 -1
View File
@@ -20,7 +20,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
OSRM.Markers = function() {
this.route = new Array();
this.highlight = new OSRM.DragMarker("highlight", {draggable:true,icon:OSRM.G.icons['marker-highlight'],dragicon:OSRM.G.icons['marker-highlight-drag']});;
this.highlight = new OSRM.DragMarker("highlight", {zIndexOffset:-1,draggable:true,icon:OSRM.G.icons['marker-highlight'],dragicon:OSRM.G.icons['marker-highlight-drag']});;
this.dragger = new OSRM.DragMarker("drag", {draggable:true,icon:OSRM.G.icons['marker-drag'],dragicon:OSRM.G.icons['marker-drag']});;
};
OSRM.extend( OSRM.Markers,{
+17 -5
View File
@@ -20,9 +20,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
OSRM.Route = function() {
this._current_route = new OSRM.SimpleRoute("current" , {dashed:false} );
this._old_route = new OSRM.SimpleRoute("old", {dashed:false,color:"#123"} );
this._unnamed_route = new OSRM.MultiRoute("unnamed");
this._current_route = new OSRM.SimpleRoute("current" , {dashed:false} );
this._alternative_route = new OSRM.SimpleRoute("alternative" , {dashed:false} );
this._old_route = new OSRM.SimpleRoute("old", {dashed:false,color:"#123"} );
this._unnamed_route = new OSRM.MultiRoute("unnamed");
this._current_route_style = {dashed:false,color:'#0033FF', weight:5};
this._current_noroute_style = {dashed:true, color:'#222222', weight:2};
@@ -30,6 +31,7 @@ OSRM.Route = function() {
this._old_noroute_style = {dashed:true, color:'#000000', weight:2};
this._unnamed_route_style = {dashed:false, color:'#FF00FF', weight:10};
this._old_unnamed_route_style = {dashed:false, color:'#990099', weight:10};
this._alternative_route_style = {dashed:false,color:'#770033', weight:5, opacity:0.6};
this._noroute = OSRM.Route.ROUTE;
this._history = new OSRM.HistoryRoute();
@@ -59,8 +61,8 @@ OSRM.extend( OSRM.Route,{
this._history.fetchHistoryRoute();
this._history.showHistoryRoutes();
// deactivate printing
OSRM.Printing.deactivate();
// deactivate GUI features that need a route
OSRM.GUI.deactivateRouteFeatures();
},
// show/hide highlighting for unnamed routes
@@ -99,6 +101,16 @@ OSRM.extend( OSRM.Route,{
this._old_route.hide();
},
// show/hide alternative route
showAlternativeRoute: function(positions) {
this._alternative_route.setPositions( positions );
this._alternative_route.setStyle( this._alternative_route_style );
this._alternative_route.show();
},
hideAlternativeRoute: function() {
this._alternative_route.hide();
},
// query routines
isShown: function() {
return this._current_route.isShown();
@@ -16,8 +16,46 @@ or see http://www.gnu.org/licenses/agpl.txt.
*/
// queryable Layers control
// [simply Control.Layers extended by query functions]
// [simply Control.Layers extended by query functions and some fixes for touch screens]
L.Control.QueryableLayers = L.Control.Layers.extend({
// changes to leaflet behaviour
_initLayout: function () {
this._container = L.DomUtil.create('div', 'leaflet-control-layers');
L.DomEvent.disableClickPropagation(this._container); // change to Leaflet: always disable click propagation
this._form = L.DomUtil.create('form', 'leaflet-control-layers-list');
if (this.options.collapsed) {
L.DomEvent.addListener(this._container, 'mouseover', this._expand, this);
L.DomEvent.addListener(this._container, 'mouseout', this._collapse, this);
var link = this._layersLink = L.DomUtil.create('a', 'leaflet-control-layers-toggle');
link.href = '#';
link.title = 'Layers';
if (L.Browser.touch) {
L.DomEvent.addListener(link, 'click', this._expand, this);
L.DomEvent.disableClickPropagation(link); // change to Leaflet: disable click propagation
} else {
L.DomEvent.addListener(link, 'focus', this._expand, this);
}
this._map.on('movestart', this._collapse, this);
// TODO keyboard accessibility
this._container.appendChild(link);
} else {
this._expand();
}
this._baseLayersList = L.DomUtil.create('div', 'leaflet-control-layers-base', this._form);
this._separator = L.DomUtil.create('div', 'leaflet-control-layers-separator', this._form);
this._overlaysList = L.DomUtil.create('div', 'leaflet-control-layers-overlays', this._form);
this._container.appendChild(this._form);
},
// new query functionality
getActiveLayerName: function () {
var i, input, obj,
inputs = this._form.getElementsByTagName('input'),
+47
View File
@@ -18,6 +18,36 @@ or see http://www.gnu.org/licenses/agpl.txt.
// map view/model
// [extending Leaflet L.Map with setView/fitBounds methods that respect UI visibility, better layerControl]
OSRM.MapView = L.Map.extend({
_boundsInsideView: function(bounds) {
var viewBounds = this.getBounds(),
viewSw = this.project(viewBounds.getSouthWest()),
viewNe = this.project(viewBounds.getNorthEast()),
sw = this.project(bounds.getSouthWest()),
ne = this.project(bounds.getNorthEast());
if (viewNe.y > ne.y) { // north
return false;
}
if (viewNe.x < ne.x) { // east
return false;
}
if (viewSw.y < sw.y) { // south
return false;
}
if (viewSw.x > sw.x) { // west
return false;
}
return true;
},
setViewBounds: function(bounds) {
var zoom = this.getBoundsZoom(bounds); // maximum zoom level at which the bounds fit onto the map
if( this._zoom > zoom ) { // if current zoom level is too close change zoom level and recenter
this.setView(bounds.getCenter(), zoom);
} else if(!this._boundsInsideView(bounds)){ // if current zoom level is okay, but bounds are outside the viewport, pan
this.setView(bounds.getCenter(), this._zoom);
}
},
setViewUI: function(position, zoom, no_animation) {
if( OSRM.G.main_handle.boxVisible() ) {
var point = this.project( position, zoom);
@@ -26,6 +56,23 @@ OSRM.MapView = L.Map.extend({
}
this.setView( position, zoom, no_animation);
},
setViewBoundsUI: function(bounds) {
var southwest = bounds.getSouthWest();
var northeast = bounds.getNorthEast();
var zoom = this.getBoundsZoom(bounds);
var sw_point = this.project( southwest, zoom);
if( OSRM.G.main_handle.boxVisible() )
sw_point.x-=OSRM.G.main_handle.boxWidth()+20;
else
sw_point.x-=20;
sw_point.y+=20;
var ne_point = this.project( northeast, zoom);
ne_point.y-=20;
ne_point.x+=20;
bounds.extend( this.unproject(sw_point,zoom) );
bounds.extend( this.unproject(ne_point,zoom) );
this.setViewBounds( bounds );
},
fitBoundsUI: function(bounds) {
var southwest = bounds.getSouthWest();
var northeast = bounds.getNorthEast();
+1
View File
@@ -99,6 +99,7 @@ onDrag: function(e) {
OSRM.Geocoder.updateLocation( this.parent.label );
},
onDragStart: function(e) {
OSRM.GUI.deactivateTooltip( "dragging" );
OSRM.G.dragging = true;
this.switchIcon(this.options.dragicon);
+8 -2
View File
@@ -29,7 +29,7 @@ OSRM.GUIBoxHandle = function( box_name, side, css, transitionStartFct, transitio
// create handle DOM elements
var wrapper = document.createElement('div');
wrapper.id = box_name + '-handle-wrapper';
wrapper.className = 'not-selectable box-wrapper box-handle-wrapper-'+side;
wrapper.className = 'box-wrapper box-handle-wrapper-'+side;
wrapper.style.cssText += css;
var content = document.createElement('div');
content.id = box_name + '-handle-content';
@@ -54,6 +54,7 @@ OSRM.GUIBoxHandle = function( box_name, side, css, transitionStartFct, transitio
// hide box and show handle by default
this._box.style[this._side]=-this._width+"px";
this._box_visible = false;
this._box.style.visibility="hidden";
this._handle.style.visibility="visible";
// add functionality
@@ -94,12 +95,14 @@ $hide: function() {
},
$showBox: function() {
this._box_visible = true;
this._box.style.visibility="visible";
this._handle.style.visibility="hidden";
this._box.style[this._side]="5px";
this._transitionEndFct();
},
$hideBox: function() {
this._box_visible = false;
this._box.style.visibility="hidden";
this._handle.style.visibility="visible";
this._box.style[this._side]=-this._width+"px";
},
@@ -109,6 +112,7 @@ _toggle: function() {
if( this._box_visible == false ) {
this._box_group.$hide();
this._box.style[this._side]="5px";
this._box.style.visibility="visible"; // already show box, so that animation is seen
} else {
this._box.style[this._side]=-this._width+"px";
}
@@ -121,8 +125,10 @@ _onTransitionEnd: function() {
if( this._box_visible == true ) {
this._box_group.$show();
this._box_visible = false;
this._box.style.visibility="hidden";
} else {
this._box_visible = true;
this._box_visible = true;
this._box.style.visibility="visible";
}
}
});
+2 -1
View File
@@ -54,6 +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");
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");
@@ -100,7 +101,7 @@ afterMainTransition: function() {
// toggle distance units
onUnitsChanged: function(value) {
OSRM.Utils.setToHumanDistanceFunction(value);
OSRM.Routing.getRoute();
OSRM.Routing.getRoute({keepAlternative:true});
},
// set timestamp of data
+162
View File
@@ -0,0 +1,162 @@
/*
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 Notifications
// [handles notifications: timed tooltips and exclusive notifications]
OSRM.GUI.extend( {
// tooltips
tooltips: {
// triggered in OSRM.Localization.setLanguageWrapper
localization:
{ timeout: 180000, // 30min
header: "Did you know? You can change the display language.",
body: "You can use the pulldown menu in the upper left corner to select your favorite language. " +
"<br/><br/>" +
"Don't despair if you cannot find your language of choice. " +
"If you want, you can help to provide additional translations! " +
"Visit <a href='https://github.com/DennisSchiefer/Project-OSRM-Web'>here</a> for more information."
},
// triggered in OSRM.Map.click
clicking:
{ timeout: 60000, // 1min
header: "Did you know? You can click on the map to set route markers.",
body: "You can click on the map with the left mouse button to set a source marker (green) or a target marker (red), " +
"if the source marker already exists. " +
"The address of the selected location will be displayed in the boxes to the left. " +
"<br/><br/>" +
"You can delete a marker by clicking on it again with the left mouse button."
},
// triggered in OSRM.Routing.getRoute_Dragging
dragging:
{ timeout: 120000, // 2min
header: "Did you know? You can drag each route marker on the map.",
body: "You can drag a marker by clicking on it with the left mouse button and holding the button pressed. " +
"Then you can move the marker around the map and the route will be updated instantaneously. " +
"<br/><br/>" +
"You can even create intermediate markers by dragging them off of the main route! "
}
},
// initialize notifications and tooltip timers
init: function() {
// notifications
// [nothing to be done at the moment]
// tooltip timers
var tooltips = OSRM.GUI.tooltips;
for( id in tooltips ) {
// start timer
tooltips[id]._timer = setTimeout(
function(_id){ return function(){OSRM.GUI._showTooltip(_id);}; }(id),
tooltips[id].timeout
);
// mark tooltip as pending
tooltips[id]._pending = true;
}
},
// deactivate pending tooltip
deactivateTooltip: function(id) {
var tooltips = OSRM.GUI.tooltips;
if(tooltips[id] == undefined)
return;
// mark tooltip as no longer pending
tooltips[id]._pending = false;
},
// show tooltip after timer expired
_showTooltip: function(id) {
var tooltips = OSRM.GUI.tooltips;
if(tooltips[id] == undefined)
return;
// only show tooltip if it is still pending
if( tooltips[id]._pending == false ) {
return;
}
// if a notification is currently shown, restart timer
if( OSRM.GUI.isTooltipVisible() ) {
tooltips[id]._timer = setTimeout(
function(_id){ return function(){OSRM.GUI._showTooltip(_id);}; }(id),
tooltips[id].timeout
);
return;
}
// show notification
OSRM.GUI.tooltipNotify( tooltips[id].header, tooltips[id].body );
// mark tooltip as no longer pending
tooltips[id]._pending = false;
},
// exclusive notification
exclusiveNotify: function( header, text, closable ){
document.getElementById('exclusive-notification-blanket').style.display = "block";
document.getElementById('exclusive-notification-label').innerHTML = header;
document.getElementById('exclusive-notification-box').innerHTML = text;
if( closable )
document.getElementById('exclusive-notification-toggle').onclick = OSRM.GUI.exclusiveDenotify;
else
document.getElementById('exclusive-notification-toggle').style.display = "none";
},
exclusiveDenotify: function() {
document.getElementById('exclusive-notification-blanket').style.display = "none";
},
// tooltip notification
tooltipNotify: function( header, text ){
document.getElementById('tooltip-notification-wrapper').style.display = "block";
document.getElementById('tooltip-notification-label').innerHTML = header;
document.getElementById('tooltip-notification-box').innerHTML = text;
document.getElementById('tooltip-notification-box').style.display = "block"; // simple trick to always start with a minimized tooltip
OSRM.GUI.tooltipResize();
document.getElementById('tooltip-notification-toggle').onclick = OSRM.GUI.tooltipDenotify;
document.getElementById('tooltip-notification-resize').onclick = OSRM.GUI.tooltipResize;
},
tooltipResize: function() {
if( document.getElementById('tooltip-notification-box').style.display == "none" ) {
document.getElementById('tooltip-notification-box').style.display = "block";
var height = document.getElementById('tooltip-notification-box').clientHeight;
document.getElementById('tooltip-notification-content').style.height = (height + 28) + "px";
document.getElementById('tooltip-notification-wrapper').style.height = (height + 48) + "px";
document.getElementById('tooltip-notification-resize').className = "iconic-button up-marker top-right-button";
} else {
document.getElementById('tooltip-notification-box').style.display = "none";
document.getElementById('tooltip-notification-content').style.height = "18px";
document.getElementById('tooltip-notification-wrapper').style.height = "38px";
document.getElementById('tooltip-notification-resize').className = "iconic-button down-marker top-right-button";
}
},
tooltipDenotify: function() {
document.getElementById('tooltip-notification-wrapper').style.display = "none";
},
isTooltipVisible: function() {
return document.getElementById('tooltip-notification-wrapper').style.display == "block";
}
});
+26 -1
View File
@@ -36,13 +36,24 @@ 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-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.Routing.getRoute_Redraw;
document.getElementById("option-highlight-nonames").onclick = OSRM.GUI.hightlightNonames;
document.getElementById("option-show-previous-routes").onclick = OSRM.GUI.showPreviousRoutes;
},
// toggle GUI features that need a route to work
activateRouteFeatures: function() {
OSRM.Printing.activate();
document.getElementById("gui-zoom").className = "button";
},
deactivateRouteFeatures: function() {
OSRM.Printing.deactivate();
document.getElementById("gui-zoom").className = "button-inactive";
},
// click: button "reset"
resetRouting: function() {
document.getElementById('gui-input-source').value = "";
@@ -144,6 +155,20 @@ showPreviousRoutes: function(value) {
OSRM.G.route.deactivateHistoryRoutes();
else
OSRM.G.route.activateHistoryRoutes();
},
//click: button "zoom on route"
zoomOnRoute: function() {
if( OSRM.G.route.isShown() == false )
return;
var bounds = new L.LatLngBounds( OSRM.G.route._current_route.getPositions() );
OSRM.G.map.fitBoundsUI(bounds);
},
//click: toggle highlighting unnamed streets
hightlightNonames: function() {
OSRM.Routing.getRoute_Redraw({keepAlternative:true});
}
});
+2 -2
View File
@@ -44,8 +44,8 @@ selectorInit: function(id, options, selected, onchange_fct) {
myspan.id = "styled-select-" + select.id;
myspan.appendChild(textnode);
select.parentNode.insertBefore(myspan, select);
myspan.style.width = (select.clientWidth-2)+"px";
myspan.style.height = (select.clientHeight)+"px";
myspan.style.width = (select.offsetWidth-2)+"px";
myspan.style.height = (select.offsetHeight)+"px"; // clientHeight gives the height of the opened dropbox!
},
// required behaviour of selector on change to switch shown name
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

+3 -2
View File
@@ -26,6 +26,7 @@ OSRM.Localization["de"] = {
"GUI_START": "Start",
"GUI_END": "Ziel",
"GUI_RESET": "Reset",
"GUI_ZOOM": "Zoom auf Route",
"GUI_SEARCH": "Zeigen",
"GUI_REVERSE": "Umdrehen",
"GUI_START_TOOLTIP": "Startposition eingeben",
@@ -83,9 +84,9 @@ OSRM.Localization["de"] = {
"DIRECTION_3":"Rechts abbiegen[ auf <b>%s</b>]",
"DIRECTION_4":"Scharf rechts abbiegen[ auf <b>%s</b>]",
"DIRECTION_5":"Wenden[ auf <b>%s</b>]",
"DIRECTION_6":"Leicht links abbiegen[ auf <b>%s</b>]",
"DIRECTION_6":"Scharf links abbiegen[ auf <b>%s</b>]",
"DIRECTION_7":"Links abbiegen[ auf <b>%s</b>]",
"DIRECTION_8":"Scharf links abbiegen[ auf <b>%s</b>]",
"DIRECTION_8":"Leicht links abbiegen[ auf <b>%s</b>]",
"DIRECTION_10":"Fahren Sie Richtung <b>%d</b>[ auf <b>%s</b>]",
"DIRECTION_11-1":"In den Kreisverkehr einfahren und bei erster Möglichkeit[ in Richtung <b>%s</b>] verlassen",
"DIRECTION_11-2":"In den Kreisverkehr einfahren und bei zweiter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
+4 -3
View File
@@ -26,6 +26,7 @@ OSRM.Localization["dk"] = {
"GUI_START": "Start",
"GUI_END": "Destination",
"GUI_RESET": "Nulstil",
"GUI_ZOOM": "Zoom på Rute",
"GUI_SEARCH": "Vis",
"GUI_REVERSE": "Omvendt",
"GUI_START_TOOLTIP": "Indtast start",
@@ -83,9 +84,9 @@ OSRM.Localization["dk"] = {
"DIRECTION_3":"Drej til højre[ ad <b>%s</b>]",
"DIRECTION_4":"Drej skarpt til højre[ ad <b>%s</b>]",
"DIRECTION_5":"U-vending[ ad <b>%s</b>]",
"DIRECTION_6":"Drej svagt til venstre[ ad <b>%s</b>]",
"DIRECTION_6":"Drej skarpt til venstre[ ad <b>%s</b>]",
"DIRECTION_7":"Drej til venstre[ ad <b>%s</b>]",
"DIRECTION_8":"Drej skarpt til venstre[ ad <b>%s</b>]",
"DIRECTION_8":"Drej svagt til venstre[ ad <b>%s</b>]",
"DIRECTION_10":"Kør mod <b>%d</b>[ ad <b>%s</b>]",
"DIRECTION_11-1":"Kør ind i rundkørslen og tag første udkørsel[ ad <b>%s</b>]",
"DIRECTION_11-2":"Kør ind i rundkørslen og tag anden udkørsel[ ad <b>%s</b>]",
@@ -102,4 +103,4 @@ OSRM.Localization["dk"] = {
//set GUI language on load
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
OSRM.Localization.setLanguage("dk");
OSRM.Localization.setLanguage("dk");
+21 -20
View File
@@ -26,6 +26,7 @@ OSRM.Localization["en"] = {
"GUI_START": "Start",
"GUI_END": "End",
"GUI_RESET": "&nbsp;&nbsp;Reset&nbsp;&nbsp;",
"GUI_ZOOM": "Zoom onto Route",
"GUI_SEARCH": "&nbsp;&nbsp;Show&nbsp;&nbsp;",
"GUI_REVERSE": "Reverse",
"GUI_START_TOOLTIP": "Enter start",
@@ -77,26 +78,26 @@ OSRM.Localization["en"] = {
// %s: road name
// %d: direction
// [*]: will only be printed when there actually is a road name
"DIRECTION_0":"Unknown instruction[ on <b>%s</b>]",
"DIRECTION_1":"Continue[ on <b>%s</b>]",
"DIRECTION_2":"Turn slight right[ on <b>%s</b>]",
"DIRECTION_3":"Turn right[ on <b>%s</b>]",
"DIRECTION_4":"Turn sharp right[ on <b>%s</b>]",
"DIRECTION_5":"U-Turn[ on <b>%s</b>]",
"DIRECTION_6":"Turn slight left[ on <b>%s</b>]",
"DIRECTION_7":"Turn left[ on <b>%s</b>]",
"DIRECTION_8":"Turn sharp left[ on <b>%s</b>]",
"DIRECTION_10":"Head <b>%d</b>[ on <b>%s</b>]",
"DIRECTION_11-1":"Enter roundabout and leave at first exit[ on <b>%s</b>]",
"DIRECTION_11-2":"Enter roundabout and leave at second exit[ on <b>%s</b>]",
"DIRECTION_11-3":"Enter roundabout and leave at third exit[ on <b>%s</b>]",
"DIRECTION_11-4":"Enter roundabout and leave at fourth exit[ on <b>%s</b>]",
"DIRECTION_11-5":"Enter roundabout and leave at fifth exit[ on <b>%s</b>]",
"DIRECTION_11-6":"Enter roundabout and leave at sixth exit[ on <b>%s</b>]",
"DIRECTION_11-7":"Enter roundabout and leave at seventh exit[ on <b>%s</b>]",
"DIRECTION_11-8":"Enter roundabout and leave at eighth exit[ on <b>%s</b>]",
"DIRECTION_11-9":"Enter roundabout and leave at nineth exit[ on <b>%s</b>]",
"DIRECTION_11-x":"Enter roundabout and leave at one of the too many exits[ on <b>%s</b>]",
"DIRECTION_0":"Unknown instruction[ onto <b>%s</b>]",
"DIRECTION_1":"Continue[ onto <b>%s</b>]",
"DIRECTION_2":"Turn slight right[ onto <b>%s</b>]",
"DIRECTION_3":"Turn right[ onto <b>%s</b>]",
"DIRECTION_4":"Turn sharp right[ onto <b>%s</b>]",
"DIRECTION_5":"U-Turn[ onto <b>%s</b>]",
"DIRECTION_6":"Turn sharp left[ onto <b>%s</b>]",
"DIRECTION_7":"Turn left[ onto <b>%s</b>]",
"DIRECTION_8":"Turn slight left[ onto <b>%s</b>]",
"DIRECTION_10":"Head <b>%d</b>[ onto <b>%s</b>]",
"DIRECTION_11-1":"Enter roundabout and leave at first exit[ onto <b>%s</b>]",
"DIRECTION_11-2":"Enter roundabout and leave at second exit[ onto <b>%s</b>]",
"DIRECTION_11-3":"Enter roundabout and leave at third exit[ onto <b>%s</b>]",
"DIRECTION_11-4":"Enter roundabout and leave at fourth exit[ onto <b>%s</b>]",
"DIRECTION_11-5":"Enter roundabout and leave at fifth exit[ onto <b>%s</b>]",
"DIRECTION_11-6":"Enter roundabout and leave at sixth exit[ onto <b>%s</b>]",
"DIRECTION_11-7":"Enter roundabout and leave at seventh exit[ onto <b>%s</b>]",
"DIRECTION_11-8":"Enter roundabout and leave at eighth exit[ onto <b>%s</b>]",
"DIRECTION_11-9":"Enter roundabout and leave at nineth exit[ onto <b>%s</b>]",
"DIRECTION_11-x":"Enter roundabout and leave at one of the too many exits[ onto <b>%s</b>]",
"DIRECTION_15":"You have reached your destination"
};
+106
View File
@@ -0,0 +1,106 @@
/*
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
// [Spanish language support]
OSRM.Localization["es"] = {
// own language
"LANGUAGE": "Español",
// gui
"GUI_START": "Inicio",
"GUI_END": "Destino",
"GUI_RESET": "Borrar",
"GUI_ZOOM": "Zoom en la Ruta",
"GUI_SEARCH": "Mostrar",
"GUI_REVERSE": "Invertir",
"GUI_START_TOOLTIP": "Escriba la dirección de origen",
"GUI_END_TOOLTIP": "Escriba la dirección de destino",
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM alojado en <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder gracias a <a href='http://www.osm.org/'>OSM</a>",
// config
"GUI_CONFIGURATION": "Configuración",
"GUI_LANGUAGE": "Idioma",
"GUI_UNITS": "Unidades",
"GUI_KILOMETERS": "Kilometros",
"GUI_MILES": "Millas",
"GUI_DATA_TIMESTAMP": "datos",
// mapping
"GUI_MAPPING_TOOLS": "Herramientas del mapa",
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Resaltar calles sin nombre",
"GUI_SHOW_PREVIOUS_ROUTES": "Mostrar rutas anteriores",
"OPEN_JOSM": "JOSM",
"OPEN_OSMBUGS": "OSM Bugs",
// geocoder
"SEARCH_RESULTS": "Resultados de la búsqueda",
"FOUND_X_RESULTS": "%i resultado(s)",
"TIMED_OUT": "Se superó el tiempo máximo de espera",
"NO_RESULTS_FOUND": "No se han encontrado resultados",
"NO_RESULTS_FOUND_SOURCE": "Ningún resultado para el inicio",
"NO_RESULTS_FOUND_TARGET": "Ningún resultado para el destino",
// routing
"ROUTE_DESCRIPTION": "Descripción de la ruta",
"GET_LINK_TO_ROUTE": "Generar enlace",
"GENERATE_LINK_TO_ROUTE": "esperando el enlace",
"LINK_TO_ROUTE_TIMEOUT": "no disponible",
"GPX_FILE": "Archivo GPX",
"DISTANCE": "Distancia",
"DURATION": "Duración",
"YOUR_ROUTE_IS_BEING_COMPUTED": "Estamos calculando su ruta",
"NO_ROUTE_FOUND": "No hay ninguna ruta posible",
// printing
"OVERVIEW_MAP": "Mapa de referencia",
"NO_ROUTE_SELECTED": "Ninguna ruta seleccionada",
// directions
"N": "norte",
"E": "este",
"S": "sur",
"W": "oeste",
"NE": "noreste",
"SE": "sureste",
"SW": "suroeste",
"NW": "noroeste",
// driving directions
// %s: road name
// %d: direction
// [*]: will only be printed when there actually is a road name
"DIRECTION_0":"Instrucción desconocida[ en <b>%s</b>]",
"DIRECTION_1":"Continúe[ por <b>%s</b>]",
"DIRECTION_2":"Gire ligeramente a la derecha[ hacia <b>%s</b>]",
"DIRECTION_3":"Gire a la derecha [ hacia <b>%s</b>]",
"DIRECTION_4":"Gire pronunciadamente a la derecha[ hacia <b>%s</b>]",
"DIRECTION_5":"Realice un cambio de sentido[ en <b>%s</b>]",
"DIRECTION_6":"Gire pronunciadamente a la izquierda[ hacia <b>%s</b>]",
"DIRECTION_7":"Gire a la izquierda [ hacia <b>%s</b>]",
"DIRECTION_8":"Gire ligeramente a la izquierda[ hacia <b>%s</b>]",
"DIRECTION_10":"Diríjase hacia el <b>%d</b>[ por <b>%s</b>]",
"DIRECTION_11-1":"En la rotonda, tome la primera salida[ en dirección <b>%s</b>]",
"DIRECTION_11-2":"En la rotonda, tome la segunda salida[ en dirección <b>%s</b>]",
"DIRECTION_11-3":"En la rotonda, tome la tercera salida[ en dirección <b>%s</b>]",
"DIRECTION_11-4":"En la rotonda, tome la cuarta salida[ en dirección <b>%s</b>]",
"DIRECTION_11-5":"En la rotonda, tome la quinta salida[ en dirección <b>%s</b>]",
"DIRECTION_11-6":"En la rotonda, tome la sexta salida[ en dirección <b>%s</b>]",
"DIRECTION_11-7":"En la rotonda, tome la séptima salida[ en dirección <b>%s</b>]",
"DIRECTION_11-8":"En la rotonda, tome la octava salida[ en dirección <b>%s</b>]",
"DIRECTION_11-9":"En la rotonda, tome la novena salida[ en dirección <b>%s</b>]",
"DIRECTION_11-x":"En la rotonda, tome una de sus muchas salidas [ en dirección <b>%s</b>]",
"DIRECTION_15":"Ha llegado a su destino"
};
// set GUI language on load
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
OSRM.Localization.setLanguage("es");
+5 -4
View File
@@ -26,8 +26,9 @@ OSRM.Localization["fi"] = {
"GUI_START": "Lähtöpaikka",
"GUI_END": "Määränpää",
"GUI_RESET": "Tyhjennä",
"GUI_ZOOM": "Zoom reitillä",
"GUI_SEARCH": "Etsi",
"GUI_REVERSE": "Käänteinen reitti",
"GUI_REVERSE": "Käänteinen&nbsp;reitti",
"GUI_START_TOOLTIP": "Syötä lähtöpaikka",
"GUI_END_TOOLTIP": "Syötä määränpää",
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder by <a href='http://www.osm.org/'>OSM</a>",
@@ -83,9 +84,9 @@ OSRM.Localization["fi"] = {
"DIRECTION_3":"Käänny oikealle[ tielle <b>%s</b>]",
"DIRECTION_4":"Käänny jyrkästi oikealle[ tielle <b>%s</b>]",
"DIRECTION_5":"Tee U-käännös[ tiellä <b>%s</b>]",
"DIRECTION_6":"Käänny loivasti vasemmalle[ tielle <b>%s</b>]",
"DIRECTION_6":"Käänny jyrkästi vasemmalle [ tielle <b>%s</b>]",
"DIRECTION_7":"Käänny vasemmalle[ tielle <b>%s</b>]",
"DIRECTION_8":"Käänny jyrkästi vasemmalle [ tielle <b>%s</b>]",
"DIRECTION_8":"Käänny loivasti vasemmalle[ tielle <b>%s</b>]",
"DIRECTION_10":"Aja <b>%d</b> [ tielle <b>%s</b>]",
"DIRECTION_11-1":"Aja liikenneympyrään ja poistu ensimmäisestä haarasta[ tielle <b>%s</b>]",
"DIRECTION_11-2":"Aja liikenneympyrään ja poistu toisesta haarasta[ tielle <b>%s</b>]",
@@ -102,4 +103,4 @@ OSRM.Localization["fi"] = {
//set GUI language tielle load
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
OSRM.Localization.setLanguage("fi");
OSRM.Localization.setLanguage("fi");
+3 -2
View File
@@ -26,6 +26,7 @@ OSRM.Localization["fr"] = {
"GUI_START": "Départ",
"GUI_END": "Arrivée",
"GUI_RESET": "Réinitialiser",
"GUI_ZOOM": "Zoom sur la Route",
"GUI_SEARCH": "Montrer",
"GUI_REVERSE": "Inverser",
"GUI_START_TOOLTIP": "Entrez le lieu de départ",
@@ -82,9 +83,9 @@ OSRM.Localization["fr"] = {
"DIRECTION_3":"Tournez à droite[ sur <b>%s</b>]",
"DIRECTION_4":"Tournez fortement à droite[ sur <b>%s</b>]",
"DIRECTION_5":"Faites demi-tour[ sur <b>%s</b>]",
"DIRECTION_6":"Tournez légèrement à gauche[ sur <b>%s</b>]",
"DIRECTION_6":"Tournez fortement à gauche[ sur <b>%s</b>]",
"DIRECTION_7":"Tournez à gauche[ sur <b>%s</b>]",
"DIRECTION_8":"Tournez fortement à gauche[ sur <b>%s</b>]",
"DIRECTION_8":"Tournez légèrement à gauche[ sur <b>%s</b>]",
"DIRECTION_10":"Direction <b>%d</b>[ sur <b>%s</b>]",
"DIRECTION_11-1":"Au rond-point, prenez la première sortie[ sur <b>%s</b>]",
"DIRECTION_11-2":"Au rond-point, prenez la deuxième sortie[ sur <b>%s</b>]",
+4 -3
View File
@@ -26,6 +26,7 @@ OSRM.Localization["it"] = {
"GUI_START": "Partenza",
"GUI_END": "Destinazione",
"GUI_RESET": "Reset",
"GUI_ZOOM": "Zoom su Percorso",
"GUI_SEARCH": "Mostra",
"GUI_REVERSE": "Inverti",
"GUI_START_TOOLTIP": "Inserire la Partenza",
@@ -41,7 +42,7 @@ OSRM.Localization["it"] = {
// mapping
"GUI_MAPPING_TOOLS": "Strumenti per la Mappatura",
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Evidenzia strade senza nome",
"GUI_SHOW_PREVIOUS_ROUTES": "Show previous routes",
"GUI_SHOW_PREVIOUS_ROUTES": "Mostra le percorsi precedenti",
"OPEN_JOSM": "JOSM",
"OPEN_OSMBUGS": "OSM Bugs",
// geocoder
@@ -82,9 +83,9 @@ OSRM.Localization["it"] = {
"DIRECTION_3":"Girare a destra[ su <b>%s</b>]",
"DIRECTION_4":"Girare decisamente a destra[ su <b>%s</b>]",
"DIRECTION_5":"Compire una inversione ad U[ su <b>%s</b>]",
"DIRECTION_6":"Girare leggermente a sinistra[ su <b>%s</b>]",
"DIRECTION_6":"Girare decisamente a sinistra[ su <b>%s</b>]",
"DIRECTION_7":"Girare a sinistra[ su <b>%s</b>]",
"DIRECTION_8":"Girare decisamente a sinistra[ su <b>%s</b>]",
"DIRECTION_8":"Girare leggermente a sinistra[ su <b>%s</b>]",
"DIRECTION_10":"Dirigersi a <b>%d</b>[ su <b>%s</b>]",
"DIRECTION_11-1":"Immettersi nella rotonda ed abbandonarla alla prima uscita[ su <b>%s</b>]",
"DIRECTION_11-2":"Immettersi nella rotonda ed abbandonarla alla seconda uscita[ su <b>%s</b>]",
+106
View File
@@ -0,0 +1,106 @@
/*
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
// [Latvian language support]
OSRM.Localization["lv"] = {
// own language
"LANGUAGE": "Latviešu",
// gui
"GUI_START": "Sākums",
"GUI_END": "Galamērķis",
"GUI_RESET": "&nbsp;&nbsp;Reset&nbsp;&nbsp;",
"GUI_ZOOM": "Padidinti ant Route",
"GUI_SEARCH": "&nbsp;&nbsp;Rādīt&nbsp;&nbsp;",
"GUI_REVERSE": "Pretējā&nbsp;virzienā",
"GUI_START_TOOLTIP": "Izvēlieties sākumu",
"GUI_END_TOOLTIP": "Izvēlieties galamērķi",
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder by <a href='http://www.osm.org/'>OSM</a>",
// config
"GUI_CONFIGURATION": "Konfigurācija",
"GUI_LANGUAGE": "Valoda",
"GUI_UNITS": "Mērvienība",
"GUI_KILOMETERS": "Kilometri",
"GUI_MILES": "Jūdzes",
"GUI_DATA_TIMESTAMP": "data",
// mapping
"GUI_MAPPING_TOOLS": "Kartēšanas rīki",
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Izcelt ielas bez nosaukumiem",
"GUI_SHOW_PREVIOUS_ROUTES": "Rādīt vēsturiskos maršrutus",
"OPEN_JOSM": "JOSM",
"OPEN_OSMBUGS": "OSM Bugs",
// geocoder
"SEARCH_RESULTS": "Meklēšanas rezultāti",
"FOUND_X_RESULTS": "atrasti %i ieraksti",
"TIMED_OUT": "Iestājās noildze",
"NO_RESULTS_FOUND": "Neizdevās atrast šādu maršrutu",
"NO_RESULTS_FOUND_SOURCE": "Šāds sākuma punkts netika atrasts",
"NO_RESULTS_FOUND_TARGET": "Šāds galamērķis netika atrasts",
// routing
"ROUTE_DESCRIPTION": "Maršruta apraksts",
"GET_LINK_TO_ROUTE": "Izveidot saiti",
"GENERATE_LINK_TO_ROUTE": "notiek saites veidošana",
"LINK_TO_ROUTE_TIMEOUT": "saite nav pieejama",
"GPX_FILE": "GPX fails",
"DISTANCE": "Attālums",
"DURATION": "Ilgums",
"YOUR_ROUTE_IS_BEING_COMPUTED": "Tiek veikta maršruta aprēķināšana",
"NO_ROUTE_FOUND": "Maršrutu nav iespējams aprēķināt",
// printing
"OVERVIEW_MAP": "Kartes pārskats",
"NO_ROUTE_SELECTED": "Nav norādīts maršruts",
// directions
"N": "ziemeļu",
"E": "austrumu",
"S": "dienvidu",
"W": "rietumu",
"NE": "ziemeļaustrumu",
"SE": "dienvidaustrumu",
"SW": "dienvidrietumu",
"NW": "ziemeļrietumu",
// driving directions
// %s: road name
// %d: direction
// [*]: will only be printed when there actually is a road name
"DIRECTION_0":"Nezinama instrukcija[ uz <b>%s</b>]",
"DIRECTION_1":"Turpiniet ceļu[ pa <b>%s</b>]",
"DIRECTION_2":"Pagriezieties nedaudz pa labi [ uz <b>%s</b>]",
"DIRECTION_3":"Pagriezieties pa labi[ uz <b>%s</b>]",
"DIRECTION_4":"Pagriezieties strauji pa labi[ uz <b>%s</b>]",
"DIRECTION_5":"U-veida pagrieziens[ uz <b>%s</b>]",
"DIRECTION_6":"Pagriezieties strauji pa kreisi[ uz <b>%s</b>]",
"DIRECTION_7":"Pagriezieties pa kreisi[ uz <b>%s</b>]",
"DIRECTION_8":"Pagriezieties nedaudz pa kreisi[ uz <b>%s</b>]",
"DIRECTION_10":"Dotieties <b>%d</b> virzienā[ uz <b>%s</b>]",
"DIRECTION_11-1":"Iebrauciet aplī, brauciet pa pirmo izeju[ uz <b>%s</b>]",
"DIRECTION_11-2":"Iebrauciet aplī, brauciet pa otro izeju[ uz <b>%s</b>]",
"DIRECTION_11-3":"Iebrauciet aplī, brauciet pa trešo izeju[ uz <b>%s</b>]",
"DIRECTION_11-4":"Iebrauciet aplī, brauciet pa ceturto izeju[ uz <b>%s</b>]",
"DIRECTION_11-5":"Iebrauciet aplī, brauciet pa piekto izeju[ uz <b>%s</b>]",
"DIRECTION_11-6":"Iebrauciet aplī, brauciet pa sesto izeju[ uz <b>%s</b>]",
"DIRECTION_11-7":"Iebrauciet aplī, brauciet pa septīto izeju[ uz <b>%s</b>]",
"DIRECTION_11-8":"Iebrauciet aplī, brauciet pa astoto izeju[ uz <b>%s</b>]",
"DIRECTION_11-9":"Iebrauciet aplī, brauciet pa devīto izeju[ uz <b>%s</b>]",
"DIRECTION_11-x":"Ieprauciet aplī, brauciet pa vienu no pārāk daudzajām izejām[ uz <b>%s</b>]",
"DIRECTION_15":"Sasniegts galamērķis"
};
// set GUI language on load
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
OSRM.Localization.setLanguage("lv");
+3 -2
View File
@@ -26,6 +26,7 @@ OSRM.Localization["pl"] = {
"GUI_START": "Początek",
"GUI_END": "Koniec",
"GUI_RESET": "Reset",
"GUI_ZOOM": "Zoom na Trasy",
"GUI_SEARCH": "Pokaż",
"GUI_REVERSE": "Odwróć",
"GUI_START_TOOLTIP": "Wprowadź początek",
@@ -82,9 +83,9 @@ OSRM.Localization["pl"] = {
"DIRECTION_3":"Skręć w prawo[ na drogę <b>%s</b>]",
"DIRECTION_4":"Skręć ostro w prawo[ na drogę <b>%s</b>]",
"DIRECTION_5":"Zawróć[ na drogę <b>%s</b>]",
"DIRECTION_6":"Skręć lekko w lewo[ na drogę <b>%s</b>]",
"DIRECTION_6":"Skręć ostro w lewo[ na drogę <b>%s</b>]",
"DIRECTION_7":"Skręć w lewo[ na drogę <b>%s</b>]",
"DIRECTION_8":"Skręć ostro w lewo[ na drogę <b>%s</b>]",
"DIRECTION_8":"Skręć lekko w lewo[ na drogę <b>%s</b>]",
"DIRECTION_10":"Podążaj na <b>%d</b>[ drogą <b>%s</b>]",
"DIRECTION_11-1":"Wjedź na rondo, zjedź pierwszym zjazdem[ na drogę <b>%s</b>]",
"DIRECTION_11-2":"Wjedź na rondo, zjedź drugim zjazdem[ na drogę <b>%s</b>]",
+106
View File
@@ -0,0 +1,106 @@
/*
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["ru"] = {
// own language
"LANGUAGE": "Русский",
// gui
"GUI_START": "Начало",
"GUI_END": "Конец",
"GUI_RESET": "&nbsp;&nbsp;Сброс&nbsp;&nbsp;",
"GUI_ZOOM": "зум на маршрут",
"GUI_SEARCH": "&nbsp;&nbsp;Показать&nbsp;&nbsp;",
"GUI_REVERSE": "Обратно",
"GUI_START_TOOLTIP": "Укажите начальную точку",
"GUI_END_TOOLTIP": "Укажите пункт назначения",
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM хостинг от <a href='http://algo2.iti.kit.edu/'>KIT</a> - Геокодинг от <a href='http://www.osm.org/'>OSM</a>",
// config
"GUI_CONFIGURATION": "Настройки",
"GUI_LANGUAGE": "Язык",
"GUI_UNITS": "Единицы",
"GUI_KILOMETERS": "Километры",
"GUI_MILES": "Мили",
"GUI_DATA_TIMESTAMP": "версия",
// mapping
"GUI_MAPPING_TOOLS": "Настройки карты",
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Выделить безымянные улицы",
"GUI_SHOW_PREVIOUS_ROUTES": "Отображать предыдущий маршрут",
"OPEN_JOSM": "JOSM",
"OPEN_OSMBUGS": "OSM Bugs",
// geocoder
"SEARCH_RESULTS": "Результаты поиска",
"FOUND_X_RESULTS": "найдено %i результатов",
"TIMED_OUT": "Превышен интервал ожидания",
"NO_RESULTS_FOUND": "Ничего не найдено",
"NO_RESULTS_FOUND_SOURCE": "Начальная точка не найдена",
"NO_RESULTS_FOUND_TARGET": "Пункт назначения не найден",
// routing
"ROUTE_DESCRIPTION": "Описание маршрута",
"GET_LINK_TO_ROUTE": "Постоянная ссылка",
"GENERATE_LINK_TO_ROUTE": "создание ссылки",
"LINK_TO_ROUTE_TIMEOUT": "недоступно",
"GPX_FILE": "GPX Файл",
"DISTANCE": "Расстояние",
"DURATION": "Время",
"YOUR_ROUTE_IS_BEING_COMPUTED": "Вычисление маршрута",
"NO_ROUTE_FOUND": "Маршрут не возможен",
// printing
"OVERVIEW_MAP": "Обзорная карта",
"NO_ROUTE_SELECTED": "Маршрут не выбран",
// directions
"N": "север",
"E": "восток",
"S": "юг",
"W": "запад",
"NE": "северо-восток",
"SE": "юго-восток",
"SW": "юго-запад",
"NW": "северо-запад",
// driving directions
// %s: road name
// %d: direction
// [*]: will only be printed when there actually is a road name
"DIRECTION_0":"Неизвестная инструкция[ по <b>%s</b>]",
"DIRECTION_1":"Продолжайте движение[ по <b>%s</b>]",
"DIRECTION_2":"Примите вправо[ на <b>%s</b>]",
"DIRECTION_3":"Поверните направо[ на <b>%s</b>]",
"DIRECTION_4":"Поверните резко направо[ на <b>%s</b>]",
"DIRECTION_5":"U-образный разворот[ на <b>%s</b>]",
"DIRECTION_6":"Примите влево[ на <b>%s</b>]",
"DIRECTION_7":"Поверните налево[ на <b>%s</b>]",
"DIRECTION_8":"Поверните резко налево[ на <b>%s</b>]",
"DIRECTION_10":"Направляйтесь на <b>%d</b>[ по <b>%s</b>]",
"DIRECTION_11-1":"На кольцевой дороге выполните 1-ый съезд[ на <b>%s</b>]",
"DIRECTION_11-2":"На кольцевой дороге выполните 2-ой съезд[ на <b>%s</b>]",
"DIRECTION_11-3":"На кольцевой дороге выполните 3-ий съезд[ на <b>%s</b>]",
"DIRECTION_11-4":"На кольцевой дороге выполните 4-ый съезд[ на <b>%s</b>]",
"DIRECTION_11-5":"На кольцевой дороге выполните 5-ый съезд[ на <b>%s</b>]",
"DIRECTION_11-6":"На кольцевой дороге выполните 6-ой съезд[ на <b>%s</b>]",
"DIRECTION_11-7":"На кольцевой дороге выполните 7-ой съезд[ на <b>%s</b>]",
"DIRECTION_11-8":"На кольцевой дороге выполните 8-ой съезд[ на <b>%s</b>]",
"DIRECTION_11-9":"На кольцевой дороге выполните 9-ый съезд[ на <b>%s</b>]",
"DIRECTION_11-x":"На кольцевой дороге выполните съезд[ на <b>%s</b>]",
"DIRECTION_15":"Вы прибыли в пункт назначения"
};
// set GUI language on load
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
OSRM.Localization.setLanguage("ru");
+8 -4
View File
@@ -42,12 +42,16 @@ init: function() {
}
// generate selectors
OSRM.GUI.selectorInit("gui-language-toggle", options, selected, OSRM.Localization.setLanguage);
OSRM.GUI.selectorInit("gui-language-2-toggle", options_2, selected, OSRM.Localization.setLanguage);
OSRM.GUI.selectorInit("gui-language-toggle", options, selected, OSRM.Localization.setLanguageWrapper);
OSRM.GUI.selectorInit("gui-language-2-toggle", options_2, selected, OSRM.Localization.setLanguageWrapper);
// set default language
OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE );
},
setLanguageWrapper: function(language) { // wrapping required to correctly prevent localization tooltip from showing
OSRM.GUI.deactivateTooltip( "localization" );
OSRM.Localization.setLanguage(language);
},
setLanguage: function(language) {
// change value of both language selectors
OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language );
@@ -64,7 +68,7 @@ setLanguage: function(language) {
if( OSRM.G.markers == null )
return;
if( OSRM.G.markers.route.length > 1)
OSRM.Routing.getRoute();
OSRM.Routing.getRoute({keepAlternative:true});
else if(OSRM.G.markers.route.length > 0 && document.getElementById('information-box').innerHTML != "" ) {
OSRM.Geocoder.call( OSRM.C.SOURCE_LABEL, document.getElementById("gui-input-source").value );
OSRM.Geocoder.call( OSRM.C.TARGET_LABEL, document.getElementById("gui-input-target").value );
@@ -100,4 +104,4 @@ translate: function(text) {
};
// shorter call to translate function
OSRM.loc = OSRM.Localization.translate;
OSRM.loc = OSRM.Localization.translate;
+56 -24
View File
@@ -327,14 +327,14 @@ html, body {
.results-body-counter
{
text-align:right;
vertical-align:top;
vertical-align:middle;
font-weight:bold;
padding:1px 5px 1px 5px;
}
.results-body-items
{
text-align:left;
vertical-align: middle;
vertical-align:top;
width:100%;
padding:1px;
}
@@ -347,6 +347,10 @@ html, body {
{
color:#ff0000
}
.results-body-item-remark
{
color:#999999
}
/* style for main-output information-box -> table (driving directions) */
@@ -425,7 +429,7 @@ html, body {
width:390px;
height:80px;
}
#notification-wrapper
#exclusive-notification-wrapper
{
width:600px;
height:170px;
@@ -434,12 +438,12 @@ html, body {
margin-top:-85px;
margin-left:-300px;
}
#notification-content
#exclusive-notification-content
{
width:580px;
height:150px;
}
#notification-blanket
#exclusive-notification-blanket
{
position:absolute;
top:0px;
@@ -451,6 +455,21 @@ html, body {
z-index:100;
display:none;
}
#tooltip-notification-wrapper
{
width:700px;
height:38px;
top: 20px;
left: 50%;
margin-left:-350px;
z-index:98;
display: none;
}
#tooltip-notification-content
{
width:680px;
height:18px;
}
/* styles for content of other gui boxes */
@@ -517,6 +536,36 @@ html, body {
background-color:#F4F4F4;
color:#FF0000;
}
.button-inactive
{
cursor:default;
padding:2px 10px 2px 10px;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
background-color:#F9F9F9;
border:1px solid #CCCCCC;
color:#999999;
text-decoration:none;
font-size:9px;
outline-style:none;
vertical-align:1px;
}
.button-pressed
{
cursor:pointer;
padding:2px 10px 2px 10px;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
background-color:#AAAAAA;
border:1px solid #999999;
color:#000000;
text-decoration:none;
font-size:9px;
outline-style:none;
vertical-align:1px;
}
/* iconic buttons */
@@ -574,23 +623,6 @@ input[type=checkbox],
min-height:10px;
}
.not-selectable
{
cursor:default;
-moz-user-select: -moz-none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.text-selectable
{
cursor:default;
-moz-user-select: text;
-webkit-user-select: text;
-ms-user-select: text;
user-select: text;
}
/* ------------------------------------------------------------------------ */
/* table styles */
@@ -651,5 +683,5 @@ input[type=checkbox],
.small-font {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-weight: normal;
}
font-weight: normal;
}
+28 -11
View File
@@ -64,7 +64,9 @@ or see http://www.gnu.org/licenses/agpl.txt.
<script src="gui/OSRM.GUIBoxHandle.js" type="text/javascript"></script>
<script src="gui/OSRM.Selector.js" type="text/javascript"></script>
<script src="gui/OSRM.MainGUI.js" type="text/javascript"></script>
<script src="gui/OSRM.Notifications.js" type="text/javascript"></script>
<script src="routing/OSRM.Routing.js" type="text/javascript"></script>
<script src="routing/OSRM.RoutingAlternatives.js" type="text/javascript"></script>
<script src="routing/OSRM.RoutingDescription.js" type="text/javascript"></script>
<script src="routing/OSRM.RoutingGeometry.js" type="text/javascript"></script>
<script src="gui/OSRM.RoutingGUI.js" type="text/javascript"></script>
@@ -81,27 +83,41 @@ or see http://www.gnu.org/licenses/agpl.txt.
<!-- body -->
<body class="base-font not-selectable">
<body class="base-font">
<!-- map -->
<div id="map"></div>
<!-- notification -->
<div id="notification-blanket">
<div id="notification-wrapper" class="box-wrapper not-selectable">
<div id="notification-content" class="box-content">
<!-- exclusive notification -->
<div id="exclusive-notification-blanket">
<div id="exclusive-notification-wrapper" class="box-wrapper not-selectable">
<div id="exclusive-notification-content" class="box-content">
<!-- header -->
<div id="notification-toggle" class="iconic-button cancel-marker top-right-button"></div>
<div id="notification-label" class="box-label">Notification</div>
<div id="exclusive-notification-toggle" class="iconic-button cancel-marker top-right-button"></div>
<div id="exclusive-notification-label" class="box-label">Notification</div>
<!-- notification text -->
<div id="notification-box"></div>
<div id="exclusive-notification-box"></div>
</div>
</div>
</div>
<!-- tooltip notification -->
<div id="tooltip-notification-wrapper" class="box-wrapper not-selectable">
<div id="tooltip-notification-content" class="box-content">
<!-- header -->
<div id="tooltip-notification-toggle" class="iconic-button cancel-marker top-right-button"></div>
<div class="quad top-right-button"></div>
<div id="tooltip-notification-resize" class="iconic-button cancel-marker top-right-button"></div>
<div id="tooltip-notification-label" class="box-label">Notification</div>
<!-- notification text -->
<div id="tooltip-notification-box"></div>
</div>
</div>
<!-- config gui -->
<div id="config-wrapper" class="box-wrapper not-selectable">
<div id="config-wrapper" class="box-wrapper">
<div id="config-content" class="box-content">
<!-- header -->
<div id="config-toggle" class="iconic-button cancel-marker top-right-button"></div>
@@ -129,7 +145,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
</div>
<!-- mapping gui -->
<div id="mapping-wrapper" class="box-wrapper not-selectable">
<div id="mapping-wrapper" class="box-wrapper">
<div id="mapping-content" class="box-content">
<!-- header -->
<div id="mapping-toggle" class="iconic-button cancel-marker top-right-button"></div>
@@ -151,7 +167,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
</div>
<!-- main gui -->
<div id="main-wrapper" class="box-wrapper not-selectable">
<div id="main-wrapper" class="box-wrapper">
<!-- input box -->
<div id="main-input" class="box-content">
@@ -185,6 +201,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
<!-- action buttons -->
<div class="full">
<div class="left"><a class="button" id="gui-reset">Reset</a></div>
<div class="center full"><a class="button-inactive" id="gui-zoom">Reset</a></div>
<div class="right"><a class="button" id="gui-reverse">Reverse</a></div>
</div>
</div>
+31 -9
View File
@@ -29,6 +29,7 @@ OSRM.init = function() {
OSRM.Map.init();
OSRM.Printing.init();
OSRM.Routing.init();
OSRM.RoutingAlternatives.init();
OSRM.Localization.init();
// stop if in maintenance mode
@@ -63,6 +64,12 @@ OSRM.prefetchImages = function() {
{id:'restore', url:'images/restore.png'},
{id:'restore_active', url:'images/restore_active.png'},
{id:'restore_hover', url:'images/restore_hover.png'},
{id:'up', url:'images/up.png'},
{id:'up_active', url:'images/up_active.png'},
{id:'up_hover', url:'images/up_hover.png'},
{id:'down', url:'images/down.png'},
{id:'down_active', url:'images/down_active.png'},
{id:'down_hover', url:'images/down_hover.png'},
{id:'config', url:'images/config.png'},
{id:'config_active', url:'images/config_active.png'},
{id:'config_hover', url:'images/config_hover.png'},
@@ -79,9 +86,9 @@ OSRM.prefetchImages = function() {
{id:'direction_3', url:'images/turn-right.png'},
{id:'direction_4', url:'images/sharp-right.png'},
{id:'direction_5', url:'images/u-turn.png'},
{id:'direction_6', url:'images/slight-left.png'},
{id:'direction_6', url:'images/sharp-left.png'},
{id:'direction_7', url:'images/turn-left.png'},
{id:'direction_8', url:'images/sharp-left.png'},
{id:'direction_8', url:'images/slight-left.png'},
{id:'direction_10', url:'images/head.png'},
{id:'direction_11', url:'images/round-about.png'},
{id:'direction_15', url:'images/target.png'},
@@ -136,6 +143,14 @@ OSRM.prefetchCSSIcons = function() {
{ id:'.cancel-marker:hover', image_id:'cancel_hover'},
{ id:'.cancel-marker:active', image_id:'cancel_active'},
{ id:'.up-marker', image_id:'up'},
{ id:'.up-marker:hover', image_id:'up_hover'},
{ id:'.up-marker:active', image_id:'up_active'},
{ id:'.down-marker', image_id:'down'},
{ id:'.down-marker:hover', image_id:'down_hover'},
{ id:'.down-marker:active', image_id:'down_active'},
{ id:'#input-mask-header', image_id:'osrm-logo'},
{ id:'.styled-select', image_id:'selector'},
@@ -216,7 +231,13 @@ OSRM.parseParameters = function(){
if(coordinates.length!=2 || !OSRM.Utils.isLatitude(coordinates[0]) || !OSRM.Utils.isLongitude(coordinates[1]) )
return;
params.center = new L.LatLng( coordinates[0], coordinates[1]);
}
}
else if(name_val[0] == 'alt') {
var active_alternative = Number(name_val[1]);
if( active_alternative<0 || active_alternative>OSRM.RoutingAlternatives>10) // using 10 as arbitrary upper limit
return;
params.active_alternative = active_alternative;
}
}
// case 1: destination given
@@ -255,9 +276,12 @@ OSRM.parseParameters = function(){
} else {
OSRM.G.map.setView(params.center, params.zoom);
}
// set active alternative (if via points are set or alternative does not exists: automatic fallback to shortest route)
OSRM.G.active_alternative = params.active_alternative;
// compute route
OSRM.Routing.getRoute();
OSRM.Routing.getRoute({keepAlternative:true});
OSRM.G.initial_position_override = true;
return;
}
@@ -270,14 +294,12 @@ OSRM.parseParameters = function(){
// check whether to activate maintenance mode
OSRM.inMaintenance = function(){
if( OSRM.DEFAULTS.MAINTENANCE == true ) {
document.getElementById('notification-blanket').style.display = "block";
document.getElementById('notification-label').innerHTML = OSRM.DEFAULTS.MAINTENANCE_HEADER;
document.getElementById('notification-box').innerHTML = OSRM.DEFAULTS.MAINTENANCE_TEXT;
document.getElementById('notification-toggle').style.display = "none";
OSRM.GUI.exclusiveNotify( OSRM.DEFAULTS.MAINTENANCE_HEADER, OSRM.DEFAULTS.MAINTENANCE_TEXT, false);
return true;
}
return false;
};
// onload event
OSRM.Browser.onLoadHandler( OSRM.init );
OSRM.Browser.onLoadHandler( OSRM.init );
+6 -2
View File
@@ -187,13 +187,17 @@ show: function(response) {
// draw route & query for better geometry
print_window.OSRM.drawRoute( positions );
OSRM.JSONP.call(OSRM.Routing._buildCall()+'&z='+zoom+'&instructions=false', OSRM.Printing.drawRoute, OSRM.Printing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'print');
// NOTE: simply appended correct zoom level as second zoom parameter to JSONP call -> OSRM API only considers the last one!
// NOTE: correct zoom level was appended as second zoom parameter to JSONP call -> OSRM API only considers the last one!
},
timeoutRoute: function() {},
drawRoute: function(response) {
if(!response)
return;
var positions = OSRM.RoutingGeometry._decode(response.route_geometry, 5);
response.alternative_geometries.unshift( response.route_geometry );
if( OSRM.G.active_alternative >= response.alternative_geometries.length ) // no redraw if the selected alternative cannot be found
return;
positions = OSRM.RoutingGeometry._decode( response.alternative_geometries[ OSRM.G.active_alternative ], 5 );
OSRM.G.printwindow.OSRM.drawRoute( positions );
},
-8
View File
@@ -173,14 +173,6 @@ div.label
min-width:10px;
min-height:10px;
}
.not-selectable
{
cursor:default;
-moz-user-select: -moz-none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media print {
.pagebreak
{
+2 -2
View File
@@ -36,8 +36,8 @@ or see http://www.gnu.org/licenses/agpl.txt.
<link rel="stylesheet" href="printing.css" type="text/css"/>
<!-- scripts -->
<script src="printing.js" type="text/javascript"></script>
<script src="../leaflet/leaflet-src.js" type="text/javascript"></script>
<script src="printing.js" type="text/javascript"></script>
<script src="../base/leaflet/L.DashedPolyline.js" type="text/javascript"></script>
<script src="../base/leaflet/L.MouseMarker.js" type="text/javascript"></script>
<script src="../base/leaflet/L.SwitchableIcon.js" type="text/javascript"></script>
@@ -47,7 +47,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
<!-- body -->
<body class="base-font not-selectable">
<body class="base-font">
<!-- header -->
<div id="printing-header" class="noprint">
+29 -15
View File
@@ -54,9 +54,11 @@ timeoutRoute_Reversed: function() {
OSRM.G.markers.reverseMarkers();
OSRM.Routing.timeoutRoute();
},
showRoute: function(response) {
showRoute: function(response, parameters) {
if(!response)
return;
if( parameters.keepAlternative != true )
OSRM.G.active_alternative = 0;
OSRM.G.response = response; // needed for printing & history routes!
if(response.status == 207) {
@@ -65,12 +67,17 @@ showRoute: function(response) {
OSRM.RoutingDescription.showNA( OSRM.loc("NO_ROUTE_FOUND") );
OSRM.Routing._snapRoute();
} else {
OSRM.RoutingGeometry.show(response);
OSRM.RoutingNoNames.show(response);
OSRM.RoutingDescription.show(response);
OSRM.RoutingAlternatives.prepare(OSRM.G.response);
OSRM.RoutingGeometry.show(OSRM.G.response);
OSRM.RoutingNoNames.show(OSRM.G.response);
OSRM.RoutingDescription.show(OSRM.G.response);
OSRM.Routing._snapRoute();
}
OSRM.Routing._updateHints(response);
if( parameters.recenter == true ) { // allow recentering when the route is first shown
var bounds = new L.LatLngBounds( OSRM.G.route._current_route.getPositions() );
OSRM.G.map.setViewBoundsUI(bounds);
}
},
showRoute_Dragging: function(response) {
if(!response)
@@ -91,14 +98,17 @@ showRoute_Dragging: function(response) {
if(OSRM.G.pending)
setTimeout(OSRM.Routing.draggingTimeout,1);
},
showRoute_Redraw: function(response) {
showRoute_Redraw: function(response, parameters) {
if(!response)
return;
if( parameters.keepAlternative == false )
OSRM.G.active_alternative = 0;
//OSRM.G.response = response; // not needed, even harmful as important information is not stored!
OSRM.G.response = response; // not needed, even harmful as important information is not stored! ==> really ????
if(response.status != 207) {
OSRM.RoutingGeometry.show(response);
OSRM.RoutingNoNames.show(response);
OSRM.RoutingAlternatives.prepare(OSRM.G.response);
OSRM.RoutingGeometry.show(OSRM.G.response);
OSRM.RoutingNoNames.show(OSRM.G.response);
}
OSRM.Routing._updateHints(response);
},
@@ -107,17 +117,19 @@ showRoute_Redraw: function(response) {
//-- main function --
//generate server calls to query routes
getRoute: function() {
getRoute: function(parameters) {
// if source or target are not set -> hide route
if( OSRM.G.markers.route.length < 2 ) {
OSRM.G.route.hideRoute();
return;
}
parameters = parameters || {};
OSRM.JSONP.clear('dragging');
OSRM.JSONP.clear('redraw');
OSRM.JSONP.clear('route');
OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'route');
OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'route', parameters);
},
getRoute_Reversed: function() {
if( OSRM.G.markers.route.length < 2 )
@@ -126,15 +138,17 @@ getRoute_Reversed: function() {
OSRM.JSONP.clear('dragging');
OSRM.JSONP.clear('redraw');
OSRM.JSONP.clear('route');
OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute, OSRM.Routing.timeoutRoute_Reversed, OSRM.DEFAULTS.JSONP_TIMEOUT, 'route');
OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute, OSRM.Routing.timeoutRoute_Reversed, OSRM.DEFAULTS.JSONP_TIMEOUT, 'route', {});
},
getRoute_Redraw: function() {
getRoute_Redraw: function(parameters) {
if( OSRM.G.markers.route.length < 2 )
return;
parameters = parameters || {};
OSRM.JSONP.clear('dragging');
OSRM.JSONP.clear('redraw');
OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute_Redraw, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'redraw');
OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute_Redraw, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'redraw',parameters);
},
getRoute_Dragging: function() {
OSRM.G.pending = !OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=false', OSRM.Routing.showRoute_Dragging, OSRM.Routing.timeoutRoute_Dragging, OSRM.DEFAULTS.JSONP_TIMEOUT, 'dragging');;
@@ -146,7 +160,7 @@ draggingTimeout: function() {
_buildCall: function() {
var source = OSRM.DEFAULTS.HOST_ROUTING_URL;
source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp&geomformat=cmp';
source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp';
if(OSRM.G.markers.checksum)
source += '&checksum=' + OSRM.G.markers.checksum;
var markers = OSRM.G.markers.route;
@@ -0,0 +1,127 @@
/*
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 routing alternatives
// [everything about handling alternatives]
OSRM.RoutingAlternatives = {
// data of gui buttons for alternativess
_buttons: [
{id:"gui-a", label:"A"},
{id:"gui-b", label:"B"}
],
// initialize required values
init: function() {
OSRM.G.active_alternative = 0;
OSRM.G.alternative_count = 0;
},
// restructure response data
prepare: function(response) {
// move best route to alternative array
var the_response = OSRM.G.response;
the_response.alternative_geometries.unshift( response.route_geometry );
the_response.alternative_instructions.unshift( response.route_instructions );
the_response.alternative_summaries.unshift( response.route_summary );
// update basic information
OSRM.G.alternative_count = response.alternative_geometries.length;
if( OSRM.G.active_alternative >= OSRM.G.alternative_count ) // reset if the selected alternative cannot be found
OSRM.G.active_alternative = 0;
// switch data
the_response.route_geometry = the_response.alternative_geometries[OSRM.G.active_alternative];
the_response.route_instructions = the_response.alternative_instructions[OSRM.G.active_alternative];
the_response.route_summary = the_response.alternative_summaries[OSRM.G.active_alternative];
},
// switch active alternative and redraw buttons accordingly
setActive: function(button_id) {
// switch active alternative
OSRM.G.active_alternative = button_id;
// redraw clickable buttons
var buttons = OSRM.RoutingAlternatives._buttons;
for(var i=0, size=OSRM.G.alternative_count; i<size; i++) {
document.getElementById( buttons[i].id ).className = (button_id == i) ? "button-pressed top-right-button" : "button top-right-button";
}
// do nothing for non-clickable buttons
},
//draw GUI and register click events
show: function() {
var buttons = OSRM.RoutingAlternatives._buttons;
var data = "";
// draw clickable buttons
for(var i=0, size=OSRM.G.alternative_count; i<size; i++) {
var distance = OSRM.Utils.toHumanDistance(OSRM.G.response.alternative_summaries[i].total_distance);
var time = OSRM.Utils.toHumanTime(OSRM.G.response.alternative_summaries[i].total_time);
var tooltip = OSRM.loc("DISTANCE")+": "+distance+" "+OSRM.loc("DURATION")+": "+time;
var buttonClass = (i == OSRM.G.active_alternative) ? "button-pressed" : "button";
data = '<a class="'+buttonClass+' top-right-button" id="'+buttons[i].id+'" title="'+tooltip+'">'+buttons[i].label+'</a>' + data;
}
// draw non-clickable buttons
for(var i=OSRM.G.alternative_count, size=buttons.length; i<size; ++i) {
data = '<a class="button-inactive top-right-button" id="'+buttons[i].id+'">'+buttons[i].label+'</a>' + data;
}
// add buttons to DOM
document.getElementById('information-box-header').innerHTML = data + document.getElementById('information-box-header').innerHTML;
// add events
for(var i=0, size=OSRM.G.alternative_count; i<size; i++) {
document.getElementById(buttons[i].id).onclick = function (button_id) { return function() {OSRM.RoutingAlternatives._click(button_id); }; }(i) ;
document.getElementById(buttons[i].id).onmouseover = function (button_id) { return function() {OSRM.RoutingAlternatives._mouseover(button_id); }; } (i);
document.getElementById(buttons[i].id).onmouseout = function (button_id) { return function() {OSRM.RoutingAlternatives._mouseout(button_id); }; } (i);
}
},
// mouse events on buttons
_click: function(button_id) {
if( OSRM.G.active_alternative == button_id )
return;
OSRM.RoutingAlternatives.setActive(button_id);
OSRM.G.route.hideAlternativeRoute();
// switch data
var the_response = OSRM.G.response;
the_response.route_geometry = the_response.alternative_geometries[button_id];
the_response.route_instructions = the_response.alternative_instructions[button_id];
the_response.route_summary = the_response.alternative_summaries[button_id];
// redraw route & data
OSRM.RoutingGeometry.show(the_response);
OSRM.RoutingNoNames.show(the_response);
OSRM.RoutingDescription.show(the_response);
},
_mouseover: function(button_id) {
if( OSRM.G.active_alternative == button_id )
return;
var geometry = OSRM.RoutingGeometry._decode( OSRM.G.response.alternative_geometries[button_id], 5);
OSRM.G.route.showAlternativeRoute(geometry);
},
_mouseout: function(button_id) {
if( OSRM.G.active_alternative == button_id )
return;
OSRM.G.route.hideAlternativeRoute();
}
};
@@ -29,6 +29,7 @@ onClickRouteDescription: function(lat, lng) {
},
onClickCreateShortcut: function(src){
src += '&z='+ OSRM.G.map.getZoom() + '&center=' + OSRM.G.map.getCenter().lat.toFixed(6) + ',' + OSRM.G.map.getCenter().lng.toFixed(6);
src += '&alt='+OSRM.G.active_alternative;
src += '&df=' + OSRM.G.DISTANCE_FORMAT;
var source = OSRM.DEFAULTS.SHORTENER_PARAMETERS.replace(/%url/, OSRM.DEFAULTS.HOST_SHORTENER_URL+src);
@@ -48,8 +49,8 @@ showRouteLink_TimeOut: function(){
// handling of routing description
show: function(response) {
// activate printing
OSRM.Printing.activate();
// activate GUI features that need a route
OSRM.GUI.activateRouteFeatures();
// compute query string
var query_string = '?hl=' + OSRM.Localization.current_language;
@@ -100,11 +101,14 @@ show: function(response) {
body += '</table>';
// build header
header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.toHumanDistance(response.route_summary.total_distance), OSRM.Utils.toHumanTime(response.route_summary.total_time), route_link, gpx_link);
header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.toHumanDistance(response.route_summary.total_distance), OSRM.Utils.toHumanTime(response.route_summary.total_time), route_link, gpx_link);
// update DOM
document.getElementById('information-box-header').innerHTML = header;
document.getElementById('information-box').innerHTML = body;
// add alternative GUI (has to be done last since DOM has to be updated before events are registered)
OSRM.RoutingAlternatives.show();
},
// simple description
+3 -6
View File
@@ -30,12 +30,9 @@ toHumanTime: function(seconds){
seconds = seconds%60;
hours = parseInt(minutes/60);
minutes = minutes%60;
if(hours==0){
return minutes + '&nbsp;' + 'min';
}
else{
return hours + '&nbsp;' + 'h' + '&nbsp;' + minutes + '&nbsp;' + 'min';
}
if(hours==0 && minutes==0){ return seconds + '&nbsp;' + 's'; }
else if(hours==0){ return minutes + '&nbsp;' + 'min'; }
else{ return hours + '&nbsp;' + 'h' + '&nbsp;' + minutes + '&nbsp;' + 'min';}
},
//human readable distance
setToHumanDistanceFunction: function(type) {
+1 -1
View File
@@ -46,7 +46,7 @@ OSRM.debug.init = function() {
var clear = document.createElement('a');
clear.id = "OSRM.debug-clear";
clear.className = "button not-selectable";
clear.className = "button";
clear.innerHTML = "clear";
clear.onclick = OSRM.debug.clear;