Compare commits
129 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 35d2c6871f | |||
| 9a7863f8d5 | |||
| 716e5ed6b0 | |||
| 8f4e10de2d | |||
| 99b36e8f46 | |||
| d64fb6781c | |||
| cdaef51b20 | |||
| 40ad5a22ad | |||
| 54232645ae | |||
| 618bb3ef70 | |||
| a83a3d125d | |||
| f2a4a02af8 | |||
| cdc98b2ad8 | |||
| aee90bf530 | |||
| db857166b2 | |||
| 0d13f1f6d7 | |||
| 65f53b6563 | |||
| d4c5725613 | |||
| ab99ffc241 | |||
| 794140711d | |||
| 6dcea6d808 | |||
| c9f229fea8 | |||
| d3d3ebb5de | |||
| 94ad1003e9 | |||
| afb70126ad | |||
| 532d7cb057 | |||
| e98afb46e7 | |||
| f8779e479e | |||
| e1cb34cf38 | |||
| f2cd56b329 | |||
| 80d51683d4 | |||
| ee8d04656d | |||
| 3fc8c4309f | |||
| 3f1c3e0923 | |||
| 695ef4746b | |||
| 995466e89f | |||
| 4f28b2fe69 | |||
| 5498aa03a5 | |||
| 60d236dd3e | |||
| f571b5c7e5 | |||
| 792404b311 | |||
| 862cde1056 | |||
| 71399daf00 | |||
| 320bbcfb20 | |||
| 4bb52cfe8c | |||
| 915baf57c3 | |||
| f31abcea80 | |||
| 3ab5a22890 | |||
| 5a2dd78694 | |||
| 6c2e391622 | |||
| 9a6c6cd485 | |||
| ea84f774a7 | |||
| 5901b25e69 | |||
| d9b0ab3d2e | |||
| f004a65db1 | |||
| b792d44b4e | |||
| e8eb342434 | |||
| 0916e3f2e3 | |||
| 5f089e628b | |||
| de2e070dde | |||
| 8ecae7ef97 | |||
| ecd342224e | |||
| 1f7a724ded | |||
| ecd04188df | |||
| 71f55dc30a | |||
| 1746946b70 | |||
| 3746a25057 | |||
| 17bfe95cd3 | |||
| e90fe88cc0 | |||
| eba6330db1 | |||
| a21aaf330e | |||
| 390a14ac77 | |||
| f2d4f31b8f | |||
| ed72366e69 | |||
| 6feccd2507 | |||
| f27e05564d | |||
| d1bc05fcae | |||
| 8323ce78e3 | |||
| 517f321ccc | |||
| 5e24749826 | |||
| 8f6cd99ff6 | |||
| efa959d112 | |||
| f119b79101 | |||
| 8b17e4864e | |||
| 4ebe4848af | |||
| ba46d77d1d | |||
| 0c946f1476 | |||
| 22783a53cd | |||
| 770f3b5979 | |||
| a90b2371c2 | |||
| 052f7060c1 | |||
| 314ff97ca0 | |||
| 35bb9efa51 | |||
| 60436e9928 | |||
| f575ff2ba5 | |||
| 84a960ae1e | |||
| 38ccb9d974 | |||
| 5e3de973d7 | |||
| f385ea4e97 | |||
| c38c0b6f03 | |||
| 74154ab0a6 | |||
| c33dbe67d8 | |||
| 903c4577d1 | |||
| c07f87edca | |||
| 537b9b0623 | |||
| d88baaf1a4 | |||
| 232409d70b | |||
| c549311349 | |||
| 40c6ac0c28 | |||
| 80d2918203 | |||
| 90c48abeaf | |||
| badd48f166 | |||
| caa99038c5 | |||
| ec62156322 | |||
| 1423d80556 | |||
| 59775a9864 | |||
| 7b94a3092f | |||
| 7d82661927 | |||
| eeec69dfab | |||
| a8731d91ab | |||
| 3c5c26a8b5 | |||
| 2e71ad3060 | |||
| 2ad919c970 | |||
| 308b8e5f48 | |||
| 8677f15d47 | |||
| 5923d034c9 | |||
| 05410d5587 | |||
| 1c76c992c1 | |||
| 1973198f3d |
@@ -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 Schieferdecker
|
||||||
Dennis Luxen
|
Dennis Luxen
|
||||||
@@ -10,4 +10,10 @@ Jean-Frederic
|
|||||||
Zbigniew Czernik
|
Zbigniew Czernik
|
||||||
Jonas Häggqvist
|
Jonas Häggqvist
|
||||||
Sabas
|
Sabas
|
||||||
Paul Spencer
|
Paul Spencer
|
||||||
|
Raphael Pinson
|
||||||
|
Juan Luis Rodriguez Ponce
|
||||||
|
Lauris Bukšis-Haberkorns
|
||||||
|
Barboska
|
||||||
|
miszka999
|
||||||
|
Konstantin Delchev
|
||||||
@@ -19,10 +19,11 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
// [has to be loaded before all other OSRM classes]
|
// [has to be loaded before all other OSRM classes]
|
||||||
|
|
||||||
var OSRM = {};
|
var OSRM = {};
|
||||||
OSRM.VERSION = '0.1.6';
|
OSRM.VERSION = '0.1.8';
|
||||||
OSRM.DATE = '120516';
|
OSRM.DATE = '120831';
|
||||||
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;
|
||||||
|
|||||||
@@ -19,37 +19,50 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
// [has to be loaded directly after OSRM.base]
|
// [has to be loaded directly after OSRM.base]
|
||||||
|
|
||||||
OSRM.DEFAULTS = {
|
OSRM.DEFAULTS = {
|
||||||
HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute',
|
ROUTING_ENGINES: [
|
||||||
HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/',
|
{ url: 'http://router.project-osrm.org/viaroute',
|
||||||
HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp',
|
timestamp: 'http://router.project-osrm.org/timestamp',
|
||||||
|
metric: 0,
|
||||||
|
label: 'ENGINE_0',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
WEBSITE_URL: document.URL.replace(/#*(\?.*|$)/i,""), // truncates URL before first ?, and removes tailing #
|
||||||
HOST_GEOCODER_URL: 'http://nominatim.openstreetmap.org/search',
|
HOST_GEOCODER_URL: 'http://nominatim.openstreetmap.org/search',
|
||||||
HOST_REVERSE_GEOCODER_URL: 'http://nominatim.openstreetmap.org/reverse',
|
HOST_REVERSE_GEOCODER_URL: 'http://nominatim.openstreetmap.org/reverse',
|
||||||
WEBSITE_URL: document.URL.replace(/#*(\?.*|$)/i,""), // truncates URL before first ?, and removes tailing #
|
HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/',
|
||||||
JSONP_TIMEOUT: 10000,
|
|
||||||
|
SHORTENER_PARAMETERS: '%url&jsonp=%jsonp',
|
||||||
|
SHORTENER_REPLY_PARAMETER: 'ShortURL',
|
||||||
|
|
||||||
|
ROUTING_ENGINE: 0,
|
||||||
|
DISTANCE_FORMAT: 0, // 0: km, 1: miles
|
||||||
|
GEOCODER_BOUNDS: '',
|
||||||
ZOOM_LEVEL: 14,
|
ZOOM_LEVEL: 14,
|
||||||
|
HIGHLIGHT_ZOOM_LEVEL: 16,
|
||||||
|
JSONP_TIMEOUT: 10000,
|
||||||
|
|
||||||
ONLOAD_ZOOM_LEVEL: 5,
|
ONLOAD_ZOOM_LEVEL: 5,
|
||||||
ONLOAD_LATITUDE: 48.84,
|
ONLOAD_LATITUDE: 48.84,
|
||||||
ONLOAD_LONGITUDE: 10.10,
|
ONLOAD_LONGITUDE: 10.10,
|
||||||
ONLOAD_SOURCE: "",
|
ONLOAD_SOURCE: "",
|
||||||
ONLOAD_TARGET: "",
|
ONLOAD_TARGET: "",
|
||||||
HIGHLIGHT_ZOOM_LEVEL: 16,
|
|
||||||
DISTANCE_FORMAT: 0, // 0: km, 1: miles
|
|
||||||
GEOCODER_BOUNDS: '', // the world is not enough!
|
|
||||||
//GEOCODER_BOUNDS: '&bounded=1&viewbox=-27.0,72.0,46.0,36.0', // bounds for Europe
|
|
||||||
|
|
||||||
SHORTENER_PARAMETERS: '%url&jsonp=%jsonp',
|
|
||||||
SHORTENER_REPLY_PARAMETER: 'ShortURL',
|
|
||||||
|
|
||||||
LANGUAGE: "en",
|
LANGUAGE: "en",
|
||||||
LANUGAGE_ONDEMAND_RELOADING: true,
|
LANUGAGE_ONDEMAND_RELOADING: true,
|
||||||
LANGUAGE_SUPPORTED: [
|
LANGUAGE_SUPPORTED: [
|
||||||
{encoding:"en", name:"English"},
|
{encoding:"en", name:"English"},
|
||||||
|
{encoding:"bg", name:"Български"},
|
||||||
|
{encoding:"cs", name:"Česky"},
|
||||||
{encoding:"de", name:"Deutsch"},
|
{encoding:"de", name:"Deutsch"},
|
||||||
{encoding:"dk", name:"Dansk"},
|
{encoding:"dk", name:"Dansk"},
|
||||||
|
{encoding:"es", name:"Español"},
|
||||||
{encoding:"fi", name:"Suomi"},
|
{encoding:"fi", name:"Suomi"},
|
||||||
{encoding:"fr", name:"Français"},
|
{encoding:"fr", name:"Français"},
|
||||||
{encoding:"it", name:"Italiano"},
|
{encoding:"it", name:"Italiano"},
|
||||||
{encoding:"pl", name:"Polski", culture:"en-US"}
|
{encoding:"lv", name:"Latviešu"},
|
||||||
|
{encoding:"pl", name:"Polski"},
|
||||||
|
{encoding:"ru", name:"Русский"}
|
||||||
],
|
],
|
||||||
|
|
||||||
TILE_SERVERS: [
|
TILE_SERVERS: [
|
||||||
@@ -76,20 +89,23 @@ OSRM.DEFAULTS = {
|
|||||||
{
|
{
|
||||||
display_name: 'Bing Road',
|
display_name: 'Bing Road',
|
||||||
apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', // please use your own apikey (http://msdn.microsoft.com/en-us/library/ff428642.aspx)
|
apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', // please use your own apikey (http://msdn.microsoft.com/en-us/library/ff428642.aspx)
|
||||||
type:"Road",
|
options:{type:"Road", minZoom: 1},
|
||||||
options:{minZoom: 1},
|
|
||||||
bing:true,
|
bing:true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
display_name: 'Bing Aerial',
|
display_name: 'Bing Aerial',
|
||||||
apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', // please use your own apikey (http://msdn.microsoft.com/en-us/library/ff428642.aspx)
|
apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', // please use your own apikey (http://msdn.microsoft.com/en-us/library/ff428642.aspx)
|
||||||
type:"Aerial",
|
options:{type:"Aerial", minZoom: 1},
|
||||||
options:{minZoom: 1},
|
|
||||||
bing:true,
|
bing:true,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
MAINTENANCE: false,
|
NOTIFICATIONS: {
|
||||||
MAINTENANCE_HEADER: "Scheduled Maintenance",
|
LOCALIZATION: 1800000, // 30min
|
||||||
MAINTENANCE_TEXT: "The OSRM Website is down for a scheduled maintenance. Please be patient while required updates are performed. The site will be back online shortly.<br/><br/>In the meantime you may want to go out an map a friendly neighborhood near you...<br/><br/><br/>[OSRM]",
|
CLICKING: 60000, // 1min
|
||||||
|
DRAGGING: 120000, // 2min
|
||||||
|
MAINTENANCE: false
|
||||||
|
},
|
||||||
|
OVERRIDE_MAINTENANCE_NOTIFICATION_HEADER: undefined,
|
||||||
|
OVERRIDE_MAINTENANCE_NOTIFICATION_BODY: undefined
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ call: function(marker_id, query) {
|
|||||||
if(query=="")
|
if(query=="")
|
||||||
return;
|
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*$/)){
|
if(query.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
|
||||||
var coord = query.split(/[,;]/);
|
var coord = query.split(/[,;]/);
|
||||||
OSRM.Geocoder._onclickResult(marker_id, coord[0], coord[1]);
|
OSRM.Geocoder._onclickResult(marker_id, coord[0], coord[1]);
|
||||||
@@ -42,8 +42,11 @@ call: function(marker_id, query) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//build request for geocoder
|
// 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+"&q=" + query;
|
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} );
|
OSRM.JSONP.call( call, OSRM.Geocoder._showResults, OSRM.Geocoder._showResults_Timeout, OSRM.DEFAULTS.JSONP_TIMEOUT, "geocoder_"+marker_id, {marker_id:marker_id,query:query} );
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -71,33 +74,62 @@ _showResults: function(response, parameters) {
|
|||||||
OSRM.Geocoder._showResults_Empty(parameters);
|
OSRM.Geocoder._showResults_Empty(parameters);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(response.length == 0) {
|
if(response.length == 0) {
|
||||||
OSRM.Geocoder._showResults_Empty(parameters);
|
OSRM.Geocoder._showResults_Empty(parameters);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// filter/sort inputs
|
||||||
|
var filtered_response_temp = []; // filter results
|
||||||
|
for(var i=0, iEnd=response.length; i < iEnd; i++){
|
||||||
|
var result = response[i];
|
||||||
|
if( OSRM.Geocoder._filterResult( result ) )
|
||||||
|
continue;
|
||||||
|
filtered_response_temp.push( result );
|
||||||
}
|
}
|
||||||
|
if(filtered_response_temp.length == 0) { // stop if no results remain
|
||||||
|
OSRM.Geocoder._showResults_Empty(parameters);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
filtered_response_temp.sort( OSRM.Geocoder._compareResults ); // rank results
|
||||||
|
filtered_response_temp.sort( OSRM.Geocoder._compareLocations ); // remove duplicate locations (stable sort -> retain highest ranked)
|
||||||
|
var filtered_response = [];
|
||||||
|
filtered_response.push( filtered_response_temp[0] );
|
||||||
|
for(var i=1, iEnd = filtered_response_temp.length; i<iEnd; i++) {
|
||||||
|
var prev_result = filtered_response_temp[i-1];
|
||||||
|
var result = filtered_response_temp[i];
|
||||||
|
if( result.lat != prev_result.lat || result.lon != prev_result.lon ) {
|
||||||
|
filtered_response.push( result );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filtered_response.sort( OSRM.Geocoder._compareResults ); // rank results again
|
||||||
|
|
||||||
// show first result
|
// 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
|
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
|
// show possible results for input
|
||||||
var html = "";
|
var html = "";
|
||||||
html += '<table class="results medium-font">';
|
html += '<table class="results medium-font">';
|
||||||
for(var i=0; i < response.length; i++){
|
for(var i=0; i < filtered_response.length; i++){
|
||||||
var result = response[i];
|
var result = filtered_response[i];
|
||||||
|
|
||||||
//odd or even ?
|
//odd or even ?
|
||||||
var rowstyle='results-body-odd';
|
var rowstyle='results-body-odd';
|
||||||
if(i%2==0) { rowstyle='results-body-even'; }
|
if(i%2==0) { rowstyle='results-body-even'; }
|
||||||
|
|
||||||
html += '<tr class="'+rowstyle+'">';
|
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">';
|
html += '<td class="results-body-items">';
|
||||||
|
|
||||||
if(result.display_name){
|
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>";
|
html += "</td></tr>";
|
||||||
}
|
}
|
||||||
@@ -105,8 +137,8 @@ _showResults: function(response, parameters) {
|
|||||||
|
|
||||||
document.getElementById('information-box-header').innerHTML =
|
document.getElementById('information-box-header').innerHTML =
|
||||||
"<div class='header-title'>"+OSRM.loc("SEARCH_RESULTS")+"</div>" +
|
"<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'>("+OSRM.loc("FOUND_X_RESULTS").replace(/%i/,filtered_response.length)+")</div>";
|
||||||
"<div class='header-content'>(found "+response.length+" results)"+"</div>";
|
"<div class='header-content'>(found "+filtered_response.length+" results)"+"</div>";
|
||||||
document.getElementById('information-box').innerHTML = html;
|
document.getElementById('information-box').innerHTML = html;
|
||||||
},
|
},
|
||||||
_showResults_Empty: function(parameters) {
|
_showResults_Empty: function(parameters) {
|
||||||
@@ -125,7 +157,55 @@ _showResults_Timeout: function() {
|
|||||||
"<div class='header-title'>"+OSRM.loc("SEARCH_RESULTS")+"</div>" +
|
"<div class='header-title'>"+OSRM.loc("SEARCH_RESULTS")+"</div>" +
|
||||||
"<div class='header-content'>("+OSRM.loc("FOUND_X_RESULTS").replace(/%i/,0)+")</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>";
|
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: {
|
||||||
|
boundary: 9000,
|
||||||
|
place: 8000,
|
||||||
|
highway: 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);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// comparator for sorting objects according to their locations
|
||||||
|
_compareLocations: function(lhs, rhs) {
|
||||||
|
if( lhs.lat != rhs.lat )
|
||||||
|
return lhs.lat < rhs.lat;
|
||||||
|
else
|
||||||
|
return lhs.lon < rhs.lon;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
// [reverse geocoding]
|
// [reverse geocoding]
|
||||||
|
|||||||
@@ -21,15 +21,15 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.HistoryRoute = function() {
|
OSRM.HistoryRoute = function() {
|
||||||
// style and count of history routes
|
// style and count of history routes
|
||||||
this._history_styles = [{dashed:false, color:'#FFFFFF', opacity:0.5, weight:5},
|
this._history_styles = [{color:'#FFFFFF', opacity:0.5, weight:5, dashArray:""},
|
||||||
{dashed:false, color:'#0000DD', opacity:0.45, weight:5},
|
{color:'#0000DD', opacity:0.45, weight:5, dashArray:""},
|
||||||
{dashed:false, color:'#0000BB', opacity:0.40, weight:5},
|
{color:'#0000BB', opacity:0.40, weight:5, dashArray:""},
|
||||||
{dashed:false, color:'#000099', opacity:0.35, weight:5},
|
{color:'#000099', opacity:0.35, weight:5, dashArray:""},
|
||||||
{dashed:false, color:'#000077', opacity:0.30, weight:5},
|
{color:'#000077', opacity:0.30, weight:5, dashArray:""},
|
||||||
{dashed:false, color:'#000055', opacity:0.25, weight:5},
|
{color:'#000055', opacity:0.25, weight:5, dashArray:""},
|
||||||
{dashed:false, color:'#000033', opacity:0.20, weight:5},
|
{color:'#000033', opacity:0.20, weight:5, dashArray:""},
|
||||||
{dashed:false, color:'#000011', opacity:0.15, weight:5},
|
{color:'#000011', opacity:0.15, weight:5, dashArray:""},
|
||||||
{dashed:false, color:'#000000', opacity:0.10, weight:5}
|
{color:'#000000', opacity:0.10, weight:5, dashArray:""}
|
||||||
];
|
];
|
||||||
this._history_length = this._history_styles.length;
|
this._history_length = this._history_styles.length;
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ OSRM.HistoryRoute = function() {
|
|||||||
this._history = [];
|
this._history = [];
|
||||||
for(var i=0, size=this._history_length; i<size; i++) {
|
for(var i=0, size=this._history_length; i<size; i++) {
|
||||||
var history = {};
|
var history = {};
|
||||||
history.route = new OSRM.SimpleRoute("current" , {dashed:false} );
|
history.route = new OSRM.SimpleRoute("current" , {dashArray:""} );
|
||||||
history.markers = [];
|
history.markers = [];
|
||||||
history.checksum = null;
|
history.checksum = null;
|
||||||
this._history.push(history);
|
this._history.push(history);
|
||||||
@@ -169,8 +169,8 @@ OSRM.extend( OSRM.HistoryRoute,{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
_buildCall: function(history_id) {
|
_buildCall: function(history_id) {
|
||||||
var source = OSRM.DEFAULTS.HOST_ROUTING_URL;
|
var source = OSRM.G.active_routing_server_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)
|
if(this._history[history_id].checksum)
|
||||||
source += '&checksum=' + this._history[history_id].checksum;
|
source += '&checksum=' + this._history[history_id].checksum;
|
||||||
@@ -190,4 +190,4 @@ OSRM.extend( OSRM.HistoryRoute,{
|
|||||||
for(var i=0; i<hints.length; i++)
|
for(var i=0; i<hints.length; i++)
|
||||||
this._history[history_id].markers[i].hint = hints[i];
|
this._history[history_id].markers[i].hint = hints[i];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
// will hold the map object
|
// will hold the map object
|
||||||
OSRM.GLOBALS.map = null;
|
OSRM.GLOBALS.map = null;
|
||||||
|
OSRM.GLOBALS.localizable_maps = [];
|
||||||
|
|
||||||
|
|
||||||
// map controller
|
// map controller
|
||||||
@@ -37,7 +38,8 @@ init: function() {
|
|||||||
var base_maps = {};
|
var base_maps = {};
|
||||||
for(var i=0, size=tile_servers.length; i<size; i++) {
|
for(var i=0, size=tile_servers.length; i<size; i++) {
|
||||||
if( tile_servers[i].bing == true ) {
|
if( tile_servers[i].bing == true ) {
|
||||||
base_maps[ tile_servers[i].display_name ] = new L.TileLayer.Bing( tile_servers[i].apikey, tile_servers[i].type, tile_servers[i].options );
|
base_maps[ tile_servers[i].display_name ] = new L.BingLayer( tile_servers[i].apikey, tile_servers[i].options );
|
||||||
|
OSRM.G.localizable_maps.push( base_maps[ tile_servers[i].display_name ] );
|
||||||
} else {
|
} else {
|
||||||
tile_servers[i].options.attribution = tile_servers[i].attribution;
|
tile_servers[i].options.attribution = tile_servers[i].attribution;
|
||||||
base_maps[ tile_servers[i].display_name ] = new L.TileLayer( tile_servers[i].url, tile_servers[i].options );
|
base_maps[ tile_servers[i].display_name ] = new L.TileLayer( tile_servers[i].url, tile_servers[i].options );
|
||||||
@@ -45,21 +47,33 @@ 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]],
|
||||||
zoomAnimation: false, // remove animations -> routes are not hidden during zoom
|
zoomAnimation: false, // animations have to be inactive during initialization (leaflet issue #918)
|
||||||
fadeAnimation: false
|
fadeAnimation: false,
|
||||||
|
zoomControl: false // use OSRM zoom buttons
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// add locations control
|
||||||
|
OSRM.G.map.locationsControl = new OSRM.Control.Locations();
|
||||||
|
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);
|
||||||
|
|
||||||
// move zoom markers
|
// add zoom control
|
||||||
OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left=(OSRM.G.main_handle.boxWidth()+10)+"px";
|
OSRM.G.map.zoomControl = new OSRM.Control.Zoom();
|
||||||
OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.top="5px";
|
OSRM.G.map.zoomControl.addTo(OSRM.G.map);
|
||||||
|
OSRM.G.map.zoomControl.show();
|
||||||
|
|
||||||
|
// add scale control
|
||||||
|
OSRM.G.map.scaleControl = new L.Control.Scale();
|
||||||
|
OSRM.G.map.scaleControl.options.metric = (OSRM.G.DISTANCE_FORMAT != 1);
|
||||||
|
OSRM.G.map.scaleControl.options.imperial = (OSRM.G.DISTANCE_FORMAT == 1);
|
||||||
|
OSRM.G.map.scaleControl.addTo(OSRM.G.map);
|
||||||
|
|
||||||
// map events
|
// map events
|
||||||
OSRM.G.map.on('zoomend', OSRM.Map.zoomed );
|
OSRM.G.map.on('zoomend', OSRM.Map.zoomed );
|
||||||
@@ -67,6 +81,12 @@ init: function() {
|
|||||||
OSRM.G.map.on('contextmenu', OSRM.Map.contextmenu );
|
OSRM.G.map.on('contextmenu', OSRM.Map.contextmenu );
|
||||||
OSRM.G.map.on('mousemove', OSRM.Map.mousemove );
|
OSRM.G.map.on('mousemove', OSRM.Map.mousemove );
|
||||||
},
|
},
|
||||||
|
initFinally: function() {
|
||||||
|
L.Util.setOptions( OSRM.G.map, {
|
||||||
|
zoomAnimation: true,
|
||||||
|
fadeAnimation: true
|
||||||
|
} );
|
||||||
|
},
|
||||||
|
|
||||||
// init map position and zoom (respect UI visibility / use browser geolocation)
|
// init map position and zoom (respect UI visibility / use browser geolocation)
|
||||||
initPosition: function() {
|
initPosition: function() {
|
||||||
@@ -81,23 +101,22 @@ zoomed: function(e) {
|
|||||||
if(OSRM.G.dragging)
|
if(OSRM.G.dragging)
|
||||||
OSRM.Routing.getRoute_Dragging();
|
OSRM.Routing.getRoute_Dragging();
|
||||||
else
|
else
|
||||||
OSRM.Routing.getRoute_Redraw();
|
OSRM.Routing.getRoute_Redraw({keepAlternative:true});
|
||||||
},
|
},
|
||||||
contextmenu: function(e) {;},
|
contextmenu: function(e) {;},
|
||||||
mousemove: function(e) { OSRM.Via.drawDragMarker(e); },
|
mousemove: function(e) { OSRM.Via.drawDragMarker(e); },
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
|
OSRM.GUI.deactivateTooltip( "CLICKING" );
|
||||||
if( !OSRM.G.markers.hasSource() ) {
|
if( !OSRM.G.markers.hasSource() ) {
|
||||||
var index = OSRM.G.markers.setSource( e.latlng );
|
var index = OSRM.G.markers.setSource( e.latlng );
|
||||||
OSRM.Geocoder.updateAddress( OSRM.C.SOURCE_LABEL, OSRM.C.DO_FALLBACK_TO_LAT_LNG );
|
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].show();
|
||||||
OSRM.G.markers.route[index].centerView( OSRM.G.map.getZoom() );
|
OSRM.Routing.getRoute( {recenter:OSRM.G.markers.route.length == 2} ); // allow recentering when the route is first shown
|
||||||
OSRM.Routing.getRoute();
|
|
||||||
} else if( !OSRM.G.markers.hasTarget() ) {
|
} else if( !OSRM.G.markers.hasTarget() ) {
|
||||||
var index = OSRM.G.markers.setTarget( e.latlng );
|
var index = OSRM.G.markers.setTarget( e.latlng );
|
||||||
OSRM.Geocoder.updateAddress( OSRM.C.TARGET_LABEL, OSRM.C.DO_FALLBACK_TO_LAT_LNG );
|
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].show();
|
||||||
OSRM.G.markers.route[index].centerView( OSRM.G.map.getZoom() );
|
OSRM.Routing.getRoute( {recenter:OSRM.G.markers.route.length == 2} ); // allow recentering when the route is first shown
|
||||||
OSRM.Routing.getRoute();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
geolocationResponse: function(response) {
|
geolocationResponse: function(response) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.Markers = function() {
|
OSRM.Markers = function() {
|
||||||
this.route = new Array();
|
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']});;
|
this.dragger = new OSRM.DragMarker("drag", {draggable:true,icon:OSRM.G.icons['marker-drag'],dragicon:OSRM.G.icons['marker-drag']});;
|
||||||
};
|
};
|
||||||
OSRM.extend( OSRM.Markers,{
|
OSRM.extend( OSRM.Markers,{
|
||||||
|
|||||||
@@ -20,16 +20,18 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
|
|
||||||
OSRM.Route = function() {
|
OSRM.Route = function() {
|
||||||
this._current_route = new OSRM.SimpleRoute("current" , {dashed:false} );
|
this._current_route = new OSRM.SimpleRoute("current" , {dashArray:""} );
|
||||||
this._old_route = new OSRM.SimpleRoute("old", {dashed:false,color:"#123"} );
|
this._alternative_route = new OSRM.SimpleRoute("alternative" , {dashArray:""} );
|
||||||
this._unnamed_route = new OSRM.MultiRoute("unnamed");
|
this._old_route = new OSRM.SimpleRoute("old", {color:"#123", dashArray:""} );
|
||||||
|
this._unnamed_route = new OSRM.MultiRoute("unnamed");
|
||||||
|
|
||||||
this._current_route_style = {dashed:false,color:'#0033FF', weight:5};
|
this._current_route_style = {color:'#0033FF', weight:5, dashArray:""};
|
||||||
this._current_noroute_style = {dashed:true, color:'#222222', weight:2};
|
this._current_noroute_style = {color:'#222222', weight:2, dashArray:"8,6"};
|
||||||
this._old_route_style = {dashed:false,color:'#112233', weight:5};
|
this._old_route_style = {color:'#112233', weight:5, dashArray:""};
|
||||||
this._old_noroute_style = {dashed:true, color:'#000000', weight:2};
|
this._old_noroute_style = {color:'#000000', weight:2, dashArray:"8,6"};
|
||||||
this._unnamed_route_style = {dashed:false, color:'#FF00FF', weight:10};
|
this._unnamed_route_style = {color:'#FF00FF', weight:10, dashArray:""};
|
||||||
this._old_unnamed_route_style = {dashed:false, color:'#990099', weight:10};
|
this._old_unnamed_route_style = {color:'#990099', weight:10, dashArray:""};
|
||||||
|
this._alternative_route_style = {color:'#770033', weight:5, opacity:0.6, dashArray:""};
|
||||||
|
|
||||||
this._noroute = OSRM.Route.ROUTE;
|
this._noroute = OSRM.Route.ROUTE;
|
||||||
this._history = new OSRM.HistoryRoute();
|
this._history = new OSRM.HistoryRoute();
|
||||||
@@ -59,8 +61,8 @@ OSRM.extend( OSRM.Route,{
|
|||||||
|
|
||||||
this._history.fetchHistoryRoute();
|
this._history.fetchHistoryRoute();
|
||||||
this._history.showHistoryRoutes();
|
this._history.showHistoryRoutes();
|
||||||
// deactivate printing
|
// deactivate GUI features that need a route
|
||||||
OSRM.Printing.deactivate();
|
OSRM.GUI.deactivateRouteFeatures();
|
||||||
},
|
},
|
||||||
|
|
||||||
// show/hide highlighting for unnamed routes
|
// show/hide highlighting for unnamed routes
|
||||||
@@ -99,6 +101,16 @@ OSRM.extend( OSRM.Route,{
|
|||||||
this._old_route.hide();
|
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
|
// query routines
|
||||||
isShown: function() {
|
isShown: function() {
|
||||||
return this._current_route.isShown();
|
return this._current_route.isShown();
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ drawDragMarker: function(event) {
|
|||||||
|
|
||||||
// get distance to route
|
// get distance to route
|
||||||
var minpoint = OSRM.G.route._current_route.route.closestLayerPoint( event.layerPoint );
|
var minpoint = OSRM.G.route._current_route.route.closestLayerPoint( event.layerPoint );
|
||||||
var min_dist = minpoint ? minpoint._sqDist : 1000;
|
var min_dist = minpoint ? minpoint.distance : 1000;
|
||||||
|
|
||||||
// get distance to markers
|
// get distance to markers
|
||||||
var mouse = event.latlng;
|
var mouse = event.latlng;
|
||||||
@@ -109,7 +109,7 @@ drawDragMarker: function(event) {
|
|||||||
min_dist = 1000;
|
min_dist = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( min_dist < 400) {
|
if( min_dist < 20) {
|
||||||
OSRM.G.markers.dragger.setPosition( OSRM.G.map.layerPointToLatLng(minpoint) );
|
OSRM.G.markers.dragger.setPosition( OSRM.G.map.layerPointToLatLng(minpoint) );
|
||||||
OSRM.G.markers.dragger.show();
|
OSRM.G.markers.dragger.show();
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -0,0 +1,147 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2011-2012, Pavel Shramov
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are
|
||||||
|
permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||||
|
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||||
|
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// TileLayer using BingMaps
|
||||||
|
// [modified to support multiple cultures]
|
||||||
|
|
||||||
|
L.BingLayer = L.TileLayer.extend({
|
||||||
|
options: {
|
||||||
|
subdomains: [0, 1, 2, 3],
|
||||||
|
type: 'Aerial', // supported: 'Road', 'Aerial', 'AerialWithLabels'
|
||||||
|
attribution: 'Bing',
|
||||||
|
culture: 'en-US'
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize: function(key, options) {
|
||||||
|
L.Util.setOptions(this, options);
|
||||||
|
|
||||||
|
this._key = key;
|
||||||
|
this._url = null;
|
||||||
|
this.meta = {};
|
||||||
|
this.loadMetadata();
|
||||||
|
},
|
||||||
|
|
||||||
|
tile2quad: function(x, y, z) {
|
||||||
|
var quad = '';
|
||||||
|
for (var i = z; i > 0; i--) {
|
||||||
|
var digit = 0;
|
||||||
|
var mask = 1 << (i - 1);
|
||||||
|
if ((x & mask) != 0) digit += 1;
|
||||||
|
if ((y & mask) != 0) digit += 2;
|
||||||
|
quad = quad + digit;
|
||||||
|
}
|
||||||
|
return quad;
|
||||||
|
},
|
||||||
|
|
||||||
|
getTileUrl: function(p, z) {
|
||||||
|
var z = this._getZoomForUrl();
|
||||||
|
var subdomains = this.options.subdomains,
|
||||||
|
s = this.options.subdomains[(p.x + p.y) % subdomains.length];
|
||||||
|
return this._url.replace('{subdomain}', s)
|
||||||
|
.replace('{quadkey}', this.tile2quad(p.x, p.y, z))
|
||||||
|
.replace('{culture}', this.options.culture);
|
||||||
|
},
|
||||||
|
|
||||||
|
loadMetadata: function() {
|
||||||
|
var _this = this;
|
||||||
|
var cbid = '_bing_metadata_' + L.Util.stamp(this);
|
||||||
|
window[cbid] = function (meta) {
|
||||||
|
_this.meta = meta;
|
||||||
|
window[cbid] = undefined;
|
||||||
|
var e = document.getElementById(cbid);
|
||||||
|
e.parentNode.removeChild(e);
|
||||||
|
if (meta.errorDetails) {
|
||||||
|
alert("Got metadata" + meta.errorDetails);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_this.initMetadata();
|
||||||
|
};
|
||||||
|
var url = "http://dev.virtualearth.net/REST/v1/Imagery/Metadata/" + this.options.type + "?include=ImageryProviders&jsonp=" + cbid + "&key=" + this._key;
|
||||||
|
var script = document.createElement("script");
|
||||||
|
script.type = "text/javascript";
|
||||||
|
script.src = url;
|
||||||
|
script.id = cbid;
|
||||||
|
document.getElementsByTagName("head")[0].appendChild(script);
|
||||||
|
},
|
||||||
|
|
||||||
|
initMetadata: function() {
|
||||||
|
var r = this.meta.resourceSets[0].resources[0];
|
||||||
|
this.options.subdomains = r.imageUrlSubdomains;
|
||||||
|
this._url = r.imageUrl;
|
||||||
|
this._providers = [];
|
||||||
|
for (var i = 0; i < r.imageryProviders.length; i++) {
|
||||||
|
var p = r.imageryProviders[i];
|
||||||
|
for (var j = 0; j < p.coverageAreas.length; j++) {
|
||||||
|
var c = p.coverageAreas[j];
|
||||||
|
var coverage = {zoomMin: c.zoomMin, zoomMax: c.zoomMax, active: false};
|
||||||
|
var bounds = new L.LatLngBounds(
|
||||||
|
new L.LatLng(c.bbox[0]+0.01, c.bbox[1]+0.01),
|
||||||
|
new L.LatLng(c.bbox[2]-0.01, c.bbox[3]-0.01)
|
||||||
|
);
|
||||||
|
coverage.bounds = bounds;
|
||||||
|
coverage.attrib = p.attribution;
|
||||||
|
this._providers.push(coverage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this._update();
|
||||||
|
},
|
||||||
|
|
||||||
|
_update: function() {
|
||||||
|
if (this._url == null || !this._map) return;
|
||||||
|
this._update_attribution();
|
||||||
|
L.TileLayer.prototype._update.apply(this, []);
|
||||||
|
},
|
||||||
|
|
||||||
|
_update_attribution: function() {
|
||||||
|
var bounds = this._map.getBounds();
|
||||||
|
var zoom = this._map.getZoom();
|
||||||
|
if(this._map.attributionControl) // check if attributionControl is active
|
||||||
|
for (var i = 0; i < this._providers.length; i++) {
|
||||||
|
var p = this._providers[i];
|
||||||
|
if ((zoom <= p.zoomMax && zoom >= p.zoomMin) &&
|
||||||
|
bounds.intersects(p.bounds)) {
|
||||||
|
if (!p.active)
|
||||||
|
this._map.attributionControl.addAttribution(p.attrib);
|
||||||
|
p.active = true;
|
||||||
|
} else {
|
||||||
|
if (p.active)
|
||||||
|
this._map.attributionControl.removeAttribution(p.attrib);
|
||||||
|
p.active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onRemove: function(map) {
|
||||||
|
if(this._map.attributionControl) // check if attributionControl is activ
|
||||||
|
for (var i = 0; i < this._providers.length; i++) {
|
||||||
|
var p = this._providers[i];
|
||||||
|
if (p.active) {
|
||||||
|
this._map.attributionControl.removeAttribution(p.attrib);
|
||||||
|
p.active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
L.TileLayer.prototype.onRemove.apply(this, [map]);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -19,62 +19,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
// [assorted bugfixes to Leaflet functions we use]
|
// [assorted bugfixes to Leaflet functions we use]
|
||||||
|
|
||||||
|
|
||||||
// return closest point on segment or distance to that point
|
// bugfix for issue #892 of Leaflet
|
||||||
L.LineUtil._sqClosestPointOnSegment = function (p, p1, p2, sqDist) {
|
L.DomUtil.enableTextSelection = function () {
|
||||||
var x = p1.x,
|
if( !document.onselectstart )
|
||||||
y = p1.y,
|
return;
|
||||||
dx = p2.x - x,
|
document.onselectstart = this._onselectstart;
|
||||||
dy = p2.y - y,
|
this._onselectstart = null;
|
||||||
dot = dx * dx + dy * dy,
|
};
|
||||||
t;
|
|
||||||
|
|
||||||
if (dot > 0) {
|
|
||||||
t = ((p.x - x) * dx + (p.y - y) * dy) / dot;
|
|
||||||
|
|
||||||
if (t > 1) {
|
|
||||||
x = p2.x;
|
|
||||||
y = p2.y;
|
|
||||||
} else if (t > 0) {
|
|
||||||
x += dx * t;
|
|
||||||
y += dy * t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dx = p.x - x;
|
|
||||||
dy = p.y - y;
|
|
||||||
|
|
||||||
// DS_CHANGE: modified return values
|
|
||||||
if(sqDist)
|
|
||||||
return dx*dx + dy*dy;
|
|
||||||
else {
|
|
||||||
var p = new L.Point(x,y);
|
|
||||||
p._sqDist = dx*dx + dy*dy;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// makes requestAnimFrame respect the immediate paramter -> prevents drag events after dragend events
|
|
||||||
// (alternatively: add if(!this.dragging ) return to L.Draggable._updatePosition, but must be done in leaflet.js!)
|
|
||||||
// [TODO: In Leaflet 0.4 use L.Util.cancelAnimFrame(this._animRequest) in L.Draggable._onUp() instead, also has to be done in leaflet.js!]
|
|
||||||
L.Util.requestAnimFrame = (function () {
|
|
||||||
function timeoutDefer(callback) {
|
|
||||||
window.setTimeout(callback, 1000 / 60);
|
|
||||||
}
|
|
||||||
|
|
||||||
var requestFn = window.requestAnimationFrame ||
|
|
||||||
window.webkitRequestAnimationFrame ||
|
|
||||||
window.mozRequestAnimationFrame ||
|
|
||||||
window.oRequestAnimationFrame ||
|
|
||||||
window.msRequestAnimationFrame ||
|
|
||||||
timeoutDefer;
|
|
||||||
|
|
||||||
return function (callback, context, immediate, contextEl) {
|
|
||||||
callback = context ? L.Util.bind(callback, context) : callback;
|
|
||||||
if (immediate ) { // DS_CHANGE: removed additional condition requestFn === timeoutDefer
|
|
||||||
callback();
|
|
||||||
} else {
|
|
||||||
requestFn(callback, contextEl);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}());
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// queryable Layers control
|
|
||||||
// [simply Control.Layers extended by query functions]
|
|
||||||
L.Control.QueryableLayers = L.Control.Layers.extend({
|
|
||||||
getActiveLayerName: function () {
|
|
||||||
var i, input, obj,
|
|
||||||
inputs = this._form.getElementsByTagName('input'),
|
|
||||||
inputsLen = inputs.length;
|
|
||||||
|
|
||||||
for (i = 0; i < inputsLen; i++) {
|
|
||||||
input = inputs[i];
|
|
||||||
obj = this._layers[input.layerId];
|
|
||||||
if (input.checked && !obj.overlay) {
|
|
||||||
return obj.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getActiveLayer: function () {
|
|
||||||
var i, input, obj,
|
|
||||||
inputs = this._form.getElementsByTagName('input'),
|
|
||||||
inputsLen = inputs.length;
|
|
||||||
|
|
||||||
for (i = 0; i < inputsLen; i++) {
|
|
||||||
input = inputs[i];
|
|
||||||
obj = this._layers[input.layerId];
|
|
||||||
if (input.checked && !obj.overlay) {
|
|
||||||
return obj.layer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Leaflet extension: Dashed Polyline
|
|
||||||
// [adds dashed optionally dashed lines when using SVG or VML rendering]
|
|
||||||
|
|
||||||
|
|
||||||
// dashed polyline class
|
|
||||||
L.DashedPolyline = L.Polyline.extend({
|
|
||||||
initialize: function(latlngs, options) {
|
|
||||||
L.Polyline.prototype.initialize.call(this, latlngs, options);
|
|
||||||
},
|
|
||||||
|
|
||||||
options: {
|
|
||||||
dashed: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// svg rendering
|
|
||||||
L.DashedPolyline = !L.Browser.svg ? L.DashedPolyline : L.DashedPolyline.extend({
|
|
||||||
_updateStyle: function () {
|
|
||||||
L.Polyline.prototype._updateStyle.call(this);
|
|
||||||
if (this.options.stroke) {
|
|
||||||
if (this.options.dashed == true)
|
|
||||||
this._path.setAttribute('stroke-dasharray', '8,6');
|
|
||||||
else
|
|
||||||
this._path.setAttribute('stroke-dasharray', '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// vml rendering
|
|
||||||
L.DashedPolyline = L.Browser.svg || !L.Browser.vml ? L.DashedPolyline : L.DashedPolyline.extend({
|
|
||||||
_updateStyle: function () {
|
|
||||||
L.Polyline.prototype._updateStyle.call(this);
|
|
||||||
if (this.options.stroke) {
|
|
||||||
if (this.options.dashed == true)
|
|
||||||
this._stroke.dashstyle = "dash";
|
|
||||||
else
|
|
||||||
this._stroke.dashstyle = "solid";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Leaflet extension: LabelMarker
|
||||||
|
// [marker class that allows for changing icons while dragging]
|
||||||
|
|
||||||
|
|
||||||
|
// extended marker class
|
||||||
|
L.LabelMarker = L.Marker.extend({
|
||||||
|
// change marker icon
|
||||||
|
changeIcon: function( icon ) {
|
||||||
|
this.options.icon = icon;
|
||||||
|
|
||||||
|
if (this._map) {
|
||||||
|
this._changeIcon();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// add/change marker label
|
||||||
|
setLabel: function( label ) {
|
||||||
|
if(this._icon) {
|
||||||
|
this._icon.lastChild.innerHTML=label;
|
||||||
|
this._icon.lastChild.style.display = "block";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// actual icon changing routine
|
||||||
|
_changeIcon: function () {
|
||||||
|
var options = this.options,
|
||||||
|
map = this._map,
|
||||||
|
animation = (map.options.zoomAnimation && map.options.markerZoomAnimation),
|
||||||
|
classToAdd = animation ? 'leaflet-zoom-animated' : 'leaflet-zoom-hide';
|
||||||
|
|
||||||
|
if (this._icon) {
|
||||||
|
this._icon = options.icon.changeIcon( this._icon );
|
||||||
|
L.DomUtil.addClass(this._icon, classToAdd);
|
||||||
|
L.DomUtil.addClass(this._icon, 'leaflet-clickable');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Leaflet extension: LabelMarkerIcon
|
||||||
|
// [icon class with extra label and simple icon changing]
|
||||||
|
|
||||||
|
|
||||||
|
// extended icon class
|
||||||
|
L.LabelMarkerIcon = L.Icon.extend({
|
||||||
|
// altered icon creation (with label)
|
||||||
|
_createImg: function (src) {
|
||||||
|
var el;
|
||||||
|
if (!L.Browser.ie6) {
|
||||||
|
el = document.createElement('div');
|
||||||
|
|
||||||
|
var img = document.createElement('img');
|
||||||
|
var num = document.createElement('div');
|
||||||
|
img.src = src;
|
||||||
|
num.className = 'via-counter';
|
||||||
|
num.innerHTML = "";
|
||||||
|
|
||||||
|
el.appendChild(img);
|
||||||
|
el.appendChild(num);
|
||||||
|
} else {
|
||||||
|
el = document.createElement('div');
|
||||||
|
el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '")';
|
||||||
|
}
|
||||||
|
return el;
|
||||||
|
},
|
||||||
|
|
||||||
|
// non-destructive icon changing
|
||||||
|
changeIcon: function (el) {
|
||||||
|
return this._changeIcon('icon', el);
|
||||||
|
},
|
||||||
|
|
||||||
|
changeShadow: function (el) {
|
||||||
|
return this.options.shadowUrl ? this._changeIcon('shadow', el) : null;
|
||||||
|
},
|
||||||
|
|
||||||
|
_changeIcon: function (name, el) {
|
||||||
|
var src = this._getIconUrl(name);
|
||||||
|
if (!src) {
|
||||||
|
if (name === 'icon') {
|
||||||
|
throw new Error("iconUrl not set in Icon options (see the docs).");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var img = this._changeImg(src, el);
|
||||||
|
this._setIconStyles(img, name);
|
||||||
|
|
||||||
|
return img;
|
||||||
|
},
|
||||||
|
|
||||||
|
_changeImg: function (src, el) {
|
||||||
|
if (!L.Browser.ie6) {
|
||||||
|
el.firstChild.src = src;
|
||||||
|
} else {
|
||||||
|
el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '")';
|
||||||
|
}
|
||||||
|
return el;
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Leaflet extension: MouseMarker
|
|
||||||
// [marker class that propagates modifier and button presses in mouse click events and allows for changing icons]
|
|
||||||
|
|
||||||
|
|
||||||
// extended marker class
|
|
||||||
L.MouseMarker = L.Marker.extend({
|
|
||||||
initialize: function (latlng, options) {
|
|
||||||
L.Marker.prototype.initialize.apply(this, arguments);
|
|
||||||
},
|
|
||||||
|
|
||||||
switchIcon: function( icon ) {
|
|
||||||
this.options.icon = icon;
|
|
||||||
|
|
||||||
if (this._map) {
|
|
||||||
this._changeIcon();
|
|
||||||
this._reset();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setLabel: function( label ) {
|
|
||||||
if(this._icon) {
|
|
||||||
this._icon.lastChild.innerHTML=label;
|
|
||||||
this._icon.lastChild.style.display = "block";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_changeIcon: function () {
|
|
||||||
var options = this.options;
|
|
||||||
|
|
||||||
if (this._icon) {
|
|
||||||
this._icon = options.icon.switchIcon( this._icon );
|
|
||||||
if (this.options.clickable) // TODO: only needed until Leaflet 0.4
|
|
||||||
this._icon.className += ' leaflet-clickable';
|
|
||||||
}
|
|
||||||
|
|
||||||
var panes = this._map._panes;
|
|
||||||
|
|
||||||
if (this._shadow)
|
|
||||||
panes.shadowPane.removeChild(this._shadow);
|
|
||||||
this._shadow = options.icon.createShadow();
|
|
||||||
if (this._shadow)
|
|
||||||
panes.shadowPane.appendChild(this._shadow);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onMouseClick: function (e) {
|
|
||||||
L.DomEvent.stopPropagation(e);
|
|
||||||
if (this.dragging && this.dragging.moved()) { return; }
|
|
||||||
this.fire(e.type, {
|
|
||||||
altKey: e.altKey,
|
|
||||||
ctrlKey: e.ctrlKey,
|
|
||||||
shiftKey: e.shiftKey,
|
|
||||||
button: e.button
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
/*
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Leaflet extension: SwitchableIcon
|
|
||||||
// [will be an extension of L.Icon in Leaflet 0.4, for now it is a copy with added functionality]
|
|
||||||
|
|
||||||
|
|
||||||
// icon class with functions to simply switch the icon images
|
|
||||||
L.SwitchableIcon = L.Class.extend({
|
|
||||||
options: {
|
|
||||||
/*
|
|
||||||
iconUrl: (String) (required)
|
|
||||||
iconSize: (Point) (can be set through CSS)
|
|
||||||
iconAnchor: (Point) (centered by default if size is specified, can be set in CSS with negative margins)
|
|
||||||
popupAnchor: (Point) (if not specified, popup opens in the anchor point)
|
|
||||||
shadowUrl: (Point) (no shadow by default)
|
|
||||||
shadowSize: (Point)
|
|
||||||
*/
|
|
||||||
className: ''
|
|
||||||
},
|
|
||||||
|
|
||||||
initialize: function (options) {
|
|
||||||
L.Util.setOptions(this, options);
|
|
||||||
},
|
|
||||||
|
|
||||||
createIcon: function () {
|
|
||||||
return this._createIcon('icon');
|
|
||||||
},
|
|
||||||
|
|
||||||
createShadow: function () {
|
|
||||||
return this.options.shadowUrl ? this._createIcon('shadow') : null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_createIcon: function (name) {
|
|
||||||
var img = this._createImg(this.options[name + 'Url']);
|
|
||||||
this._setIconStyles(img, name);
|
|
||||||
return img;
|
|
||||||
},
|
|
||||||
|
|
||||||
_setIconStyles: function (img, name) {
|
|
||||||
var options = this.options,
|
|
||||||
size = options[name + 'Size'],
|
|
||||||
anchor = options.iconAnchor;
|
|
||||||
|
|
||||||
if (!anchor && size) {
|
|
||||||
anchor = size.divideBy(2, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'shadow' && anchor && options.shadowOffset) {
|
|
||||||
anchor._add(options.shadowOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
img.className = 'leaflet-marker-' + name + ' ' + options.className;
|
|
||||||
|
|
||||||
if (anchor) {
|
|
||||||
img.style.marginLeft = (-anchor.x) + 'px';
|
|
||||||
img.style.marginTop = (-anchor.y) + 'px';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size) {
|
|
||||||
img.style.width = size.x + 'px';
|
|
||||||
img.style.height = size.y + 'px';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_createImg: function (src) {
|
|
||||||
var el;
|
|
||||||
if (!L.Browser.ie6) {
|
|
||||||
el = document.createElement('div');
|
|
||||||
|
|
||||||
var img = document.createElement('img');
|
|
||||||
var num = document.createElement('div');
|
|
||||||
img.src = src;
|
|
||||||
num.className = 'via-counter';
|
|
||||||
num.innerHTML = "";
|
|
||||||
|
|
||||||
el.appendChild(img);
|
|
||||||
el.appendChild(num);
|
|
||||||
} else {
|
|
||||||
el = document.createElement('div');
|
|
||||||
el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '")';
|
|
||||||
}
|
|
||||||
return el;
|
|
||||||
},
|
|
||||||
|
|
||||||
// new functions start here
|
|
||||||
switchIcon: function (el) {
|
|
||||||
return this._switchIcon('icon', el);
|
|
||||||
},
|
|
||||||
|
|
||||||
switchShadow: function (el) {
|
|
||||||
return this.options.shadowUrl ? this._switchIcon('shadow', el) : null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_switchIcon: function (name, el) {
|
|
||||||
var img = this._switchImg(this.options[name + 'Url'], el);
|
|
||||||
this._setIconStyles(img, name);
|
|
||||||
return img;
|
|
||||||
},
|
|
||||||
|
|
||||||
_switchImg: function (src, el) {
|
|
||||||
if (!L.Browser.ie6) {
|
|
||||||
el.firstChild.src = src;
|
|
||||||
} else {
|
|
||||||
el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '")';
|
|
||||||
}
|
|
||||||
return el;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
/*
|
|
||||||
* Portions of this code and logic copied from OpenLayers and
|
|
||||||
* redistributed under the original Clear BSD license terms:
|
|
||||||
*
|
|
||||||
* http://trac.osgeo.org/openlayers/browser/license.txt
|
|
||||||
*
|
|
||||||
* Copyright 2005-2010 OpenLayers Contributors, released under
|
|
||||||
* the Clear BSD license. See authors.txt for a list of contributors.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* --
|
|
||||||
*
|
|
||||||
* Leaflet-specific modifications are released under the following
|
|
||||||
* terms:
|
|
||||||
*
|
|
||||||
* This program is free software. It comes without any warranty, to
|
|
||||||
* the extent permitted by applicable law. You can redistribute it
|
|
||||||
* and/or modify it under the terms of the Do What The Fuck You Want
|
|
||||||
* To Public License, Version 2, as published by Sam Hocevar. See
|
|
||||||
* http://sam.zoy.org/wtfpl/COPYING for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
L.TileLayer.Bing = L.TileLayer.extend({
|
|
||||||
|
|
||||||
supportedTypes: ['Road', 'Aerial', 'AerialWithLabels'],
|
|
||||||
|
|
||||||
attributionTemplate: '<span style="display:inline-block">' +
|
|
||||||
'<a target="_blank" href="http://www.bing.com/maps/">' +
|
|
||||||
//'<img src="{logo}" /></a><br><span>{copyrights}' +
|
|
||||||
'</a><span>{copyrights}' +
|
|
||||||
'<a style="white-space: nowrap" target="_blank" '+
|
|
||||||
'href="http://www.microsoft.com/maps/product/terms.html">' +
|
|
||||||
'Terms of Use</a></span></span>',
|
|
||||||
|
|
||||||
supportedCultures: {"en":"en-US", "de":"de-DE", "fr":"fr-FR", "it":"it-IT", "es":"es-ES", "nl":"nl-BE"},
|
|
||||||
|
|
||||||
initialize: function(/*String*/ apiKey, /*String*/ mapType, /*Object*/ options) {
|
|
||||||
|
|
||||||
this._apiKey = apiKey;
|
|
||||||
this._mapType = mapType;
|
|
||||||
|
|
||||||
this._loadMetadata();
|
|
||||||
|
|
||||||
L.Util.setOptions(this, options);
|
|
||||||
},
|
|
||||||
|
|
||||||
redraw: function() {
|
|
||||||
this._reset();
|
|
||||||
this._update();
|
|
||||||
},
|
|
||||||
|
|
||||||
_loadMetadata: function() {
|
|
||||||
this._callbackId = "_l_tilelayer_bing_" + (L.TileLayer.Bing._callbackId++);
|
|
||||||
var that = this;
|
|
||||||
window[this._callbackId] = function() {
|
|
||||||
L.TileLayer.Bing.processMetadata.apply(that, arguments);
|
|
||||||
};
|
|
||||||
|
|
||||||
var params = {
|
|
||||||
key: this._apiKey,
|
|
||||||
jsonp: this._callbackId,
|
|
||||||
include: 'ImageryProviders'
|
|
||||||
},
|
|
||||||
url = "http://dev.virtualearth.net/REST/v1/Imagery/Metadata/" +
|
|
||||||
this._mapType + L.Util.getParamString(params),
|
|
||||||
script = document.createElement("script");
|
|
||||||
|
|
||||||
script.type = "text/javascript";
|
|
||||||
script.src = url;
|
|
||||||
script.id = this._callbackId;
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(script);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onMetadataLoaded: function() {},
|
|
||||||
|
|
||||||
onAdd: function(map, insertAtTheBottom) {
|
|
||||||
if (!this.metadata) {
|
|
||||||
this._onMetadataLoaded = L.Util.bind(function() {
|
|
||||||
L.TileLayer.prototype.onAdd.call(this, map, insertAtTheBottom);
|
|
||||||
map.on('moveend', this._updateAttribution, this);
|
|
||||||
this._updateAttribution();
|
|
||||||
}, this);
|
|
||||||
} else {
|
|
||||||
L.TileLayer.prototype.onAdd.call(this, map, insertAtTheBottom);
|
|
||||||
map.on('moveend', this._updateAttribution, this);
|
|
||||||
this._updateAttribution();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onRemove: function(map) {
|
|
||||||
if (this._map.attributionControl) {
|
|
||||||
this._map.attributionControl.removeAttribution(this.attribution);
|
|
||||||
}
|
|
||||||
this._map.off('moveend', this._updateAttribution, this);
|
|
||||||
L.TileLayer.prototype.onRemove.call(this, map);
|
|
||||||
},
|
|
||||||
|
|
||||||
getTileUrl: function(xy, z) {
|
|
||||||
var subdomains = this.options.subdomains,
|
|
||||||
quadDigits = [],
|
|
||||||
i = z,
|
|
||||||
digit,
|
|
||||||
mask,
|
|
||||||
quadKey;
|
|
||||||
// borrowed directly from OpenLayers
|
|
||||||
for (; i > 0; --i) {
|
|
||||||
digit = '0';
|
|
||||||
mask = 1 << (i - 1);
|
|
||||||
if ((xy.x & mask) != 0) {
|
|
||||||
digit++;
|
|
||||||
}
|
|
||||||
if ((xy.y & mask) != 0) {
|
|
||||||
digit++;
|
|
||||||
digit++;
|
|
||||||
}
|
|
||||||
quadDigits.push(digit);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this._url
|
|
||||||
.replace('{culture}', this.supportedCultures[OSRM.Localization.current_language] || "en-US" )
|
|
||||||
.replace('{subdomain}', subdomains[(xy.x + xy.y) % subdomains.length])
|
|
||||||
.replace('{quadkey}', quadDigits.join(""));
|
|
||||||
},
|
|
||||||
|
|
||||||
_updateAttribution: function() {
|
|
||||||
if (this._map.attributionControl) {
|
|
||||||
var metadata = this.metadata;
|
|
||||||
var res = metadata.resourceSets[0].resources[0];
|
|
||||||
var bounds = this._map.getBounds();
|
|
||||||
var providers = res.imageryProviders, zoom = this._map.getZoom() + 1,
|
|
||||||
copyrights = "", provider, i, ii, j, jj, bbox, coverage;
|
|
||||||
for (i=0,ii=providers.length; i<ii; ++i) {
|
|
||||||
provider = providers[i];
|
|
||||||
for (j=0,jj=provider.coverageAreas.length; j<jj; ++j) {
|
|
||||||
coverage = provider.coverageAreas[j];
|
|
||||||
if (zoom <= coverage.zoomMax && zoom >= coverage.zoomMin && coverage.bbox.intersects(bounds)) {
|
|
||||||
copyrights += provider.attribution + " ";
|
|
||||||
j = jj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this._map.attributionControl.removeAttribution(this.attribution);
|
|
||||||
this._map.attributionControl._attributions = {};
|
|
||||||
this._map.attributionControl._update();
|
|
||||||
this.attribution = this.attributionTemplate
|
|
||||||
.replace('{logo}', metadata.brandLogoUri)
|
|
||||||
.replace('{copyrights}', copyrights);
|
|
||||||
this._map.attributionControl.addAttribution(this.attribution);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
L.TileLayer.Bing._callbackId = 0;
|
|
||||||
|
|
||||||
L.TileLayer.Bing.processMetadata = function(metadata) {
|
|
||||||
if (metadata.authenticationResultCode != 'ValidCredentials') {
|
|
||||||
throw "Invalid Bing Maps API Key"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!metadata.resourceSets.length || !metadata.resourceSets[0].resources.length) {
|
|
||||||
throw "No resources returned, perhaps " + this._mapType + " is an invalid map type?";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (metadata.statusCode != 200) {
|
|
||||||
throw "Bing Maps API request failed with status code " + metadata.statusCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.metadata = metadata;
|
|
||||||
var res = metadata.resourceSets[0].resources[0],
|
|
||||||
providers = res.imageryProviders,
|
|
||||||
i = 0,
|
|
||||||
j,
|
|
||||||
provider,
|
|
||||||
bbox,
|
|
||||||
script = document.getElementById(this._callbackId);
|
|
||||||
|
|
||||||
for (; i<providers.length; i++) {
|
|
||||||
provider = providers[i];
|
|
||||||
for (j=0; j<provider.coverageAreas.length; j++) {
|
|
||||||
bbox = provider.coverageAreas[j].bbox;
|
|
||||||
provider.coverageAreas[j].bbox = new L.LatLngBounds(new L.LatLng(bbox[0],bbox[1],true),new L.LatLng(bbox[2],bbox[3], true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this._url = res.imageUrl;
|
|
||||||
this.options.subdomains = [].concat(res.imageUrlSubdomains);
|
|
||||||
script.parentNode.removeChild(script);
|
|
||||||
window[this._callbackId] = undefined; // cannot delete from window in IE
|
|
||||||
delete this._callbackId;
|
|
||||||
this._onMetadataLoaded();
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
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 Layers control
|
||||||
|
// [extension of Layers.Control with OSRM styling and additional query methods]
|
||||||
|
OSRM.Control.Layers = L.Control.Layers.extend({
|
||||||
|
|
||||||
|
// query functionality
|
||||||
|
getActiveLayerName: function () {
|
||||||
|
var i, input, obj,
|
||||||
|
inputs = this._form.getElementsByTagName('input'),
|
||||||
|
inputsLen = inputs.length;
|
||||||
|
|
||||||
|
for (i = 0; i < inputsLen; i++) {
|
||||||
|
input = inputs[i];
|
||||||
|
obj = this._layers[input.layerId];
|
||||||
|
if (input.checked && !obj.overlay) {
|
||||||
|
return obj.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getActiveLayer: function () {
|
||||||
|
var i, input, obj,
|
||||||
|
inputs = this._form.getElementsByTagName('input'),
|
||||||
|
inputsLen = inputs.length;
|
||||||
|
|
||||||
|
for (i = 0; i < inputsLen; i++) {
|
||||||
|
input = inputs[i];
|
||||||
|
obj = this._layers[input.layerId];
|
||||||
|
if (input.checked && !obj.overlay) {
|
||||||
|
return obj.layer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// overwrite Control.Layers methods to get OSRM styling
|
||||||
|
_initLayout: function () {
|
||||||
|
L.Control.Layers.prototype._initLayout.apply(this);
|
||||||
|
this._container.className = "box-wrapper gui-control-wrapper";
|
||||||
|
this._layersLink.className = "box-content gui-control gui-layers";
|
||||||
|
this._form.className = "box-content gui-control gui-layers-list medium-font";
|
||||||
|
|
||||||
|
this._baseLayersList.className = "gui-layers-base";
|
||||||
|
this._separator.className = "gui-layers-separator";
|
||||||
|
this._overlaysList.className = "gui-layers-overlays";
|
||||||
|
},
|
||||||
|
_expand: function () {
|
||||||
|
L.DomUtil.addClass(this._container, 'gui-layers-expanded');
|
||||||
|
},
|
||||||
|
_collapse: function () {
|
||||||
|
this._container.className = this._container.className.replace(' gui-layers-expanded', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// locations control
|
||||||
|
// [navigation buttons for important locations - zoom on route, zoom on user]
|
||||||
|
OSRM.Control.Locations = L.Control.extend({
|
||||||
|
options: {
|
||||||
|
position: 'topright'
|
||||||
|
},
|
||||||
|
|
||||||
|
onAdd: function (map) {
|
||||||
|
// create wrapper
|
||||||
|
var container = L.DomUtil.create('div', 'box-wrapper gui-control-wrapper');
|
||||||
|
L.DomEvent.disableClickPropagation(container);
|
||||||
|
|
||||||
|
// create buttons
|
||||||
|
this._userButton = this._createButton('gui-locations-user', container, OSRM.GUI.zoomOnUser, map, !!navigator.geolocation );
|
||||||
|
this._routeButton = this._createButton('gui-locations-route', container, OSRM.GUI.zoomOnRoute, map, false);
|
||||||
|
|
||||||
|
this._container = container;
|
||||||
|
return container;
|
||||||
|
},
|
||||||
|
|
||||||
|
_createButton: function (id, container, fn, context, isActive) {
|
||||||
|
var inactive = (isActive == false) ? "-inactive" : "";
|
||||||
|
var classNames = "box-content" + " " + "gui-control"+inactive + " " + id+inactive;
|
||||||
|
var link = L.DomUtil.create('a', classNames, container);
|
||||||
|
link.title = id;
|
||||||
|
|
||||||
|
L.DomEvent
|
||||||
|
.on(link, 'click', L.DomEvent.stopPropagation)
|
||||||
|
.on(link, 'click', L.DomEvent.preventDefault)
|
||||||
|
.on(link, 'click', fn, context)
|
||||||
|
.on(link, 'dblclick', L.DomEvent.stopPropagation);
|
||||||
|
|
||||||
|
return link;
|
||||||
|
},
|
||||||
|
|
||||||
|
activateRoute: function() {
|
||||||
|
this._routeButton.className = "box-content gui-control gui-locations-route";
|
||||||
|
},
|
||||||
|
deactivateRoute: function() {
|
||||||
|
this._routeButton.className = "box-content gui-control-inactive gui-locations-route-inactive";
|
||||||
|
},
|
||||||
|
setTooltips: function( userButton, routeButton) {
|
||||||
|
this._userButton.title = userButton;
|
||||||
|
this._routeButton.title = routeButton;
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -15,9 +15,39 @@ 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) {
|
||||||
|
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) {
|
setViewUI: function(position, zoom, no_animation) {
|
||||||
if( OSRM.G.main_handle.boxVisible() ) {
|
if( OSRM.G.main_handle.boxVisible() ) {
|
||||||
var point = this.project( position, zoom);
|
var point = this.project( position, zoom);
|
||||||
@@ -26,6 +56,23 @@ OSRM.MapView = L.Map.extend({
|
|||||||
}
|
}
|
||||||
this.setView( position, zoom, no_animation);
|
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) {
|
fitBoundsUI: function(bounds) {
|
||||||
var southwest = bounds.getSouthWest();
|
var southwest = bounds.getSouthWest();
|
||||||
var northeast = bounds.getNorthEast();
|
var northeast = bounds.getNorthEast();
|
||||||
@@ -59,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;
|
||||||
|
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// zoom control
|
||||||
|
// [modified zoom control with ids, prevention of click propagation, show/hide with respect to main OSRM window]
|
||||||
|
OSRM.Control.Zoom = L.Control.extend({
|
||||||
|
options: {
|
||||||
|
position: 'topleft'
|
||||||
|
},
|
||||||
|
|
||||||
|
onAdd: function (map) {
|
||||||
|
// create wrapper
|
||||||
|
var container = L.DomUtil.create('div', 'box-wrapper gui-control-wrapper');
|
||||||
|
L.DomEvent.disableClickPropagation(container);
|
||||||
|
|
||||||
|
// create buttons
|
||||||
|
this._zoomIn = this._createButton('gui-zoom-in', container, map.zoomIn, map, true);
|
||||||
|
this._zoomOut = this._createButton('gui-zoom-out', container, map.zoomOut, map, true);
|
||||||
|
|
||||||
|
this._container = container;
|
||||||
|
return container;
|
||||||
|
},
|
||||||
|
|
||||||
|
_createButton: function (id, container, fn, context, isActive) {
|
||||||
|
var inactive = (isActive == false) ? "-inactive" : "";
|
||||||
|
var classNames = "box-content" + " " + "gui-control"+inactive + " " + id+inactive;
|
||||||
|
var link = L.DomUtil.create('a', classNames, container);
|
||||||
|
link.title = id;
|
||||||
|
|
||||||
|
L.DomEvent
|
||||||
|
.on(link, 'click', L.DomEvent.stopPropagation)
|
||||||
|
.on(link, 'click', L.DomEvent.preventDefault)
|
||||||
|
.on(link, 'click', fn, context)
|
||||||
|
.on(link, 'dblclick', L.DomEvent.stopPropagation);
|
||||||
|
|
||||||
|
return link;
|
||||||
|
},
|
||||||
|
|
||||||
|
hide: function() {
|
||||||
|
if( this._container )
|
||||||
|
this._container.style.visibility="hidden";
|
||||||
|
},
|
||||||
|
|
||||||
|
show: function() {
|
||||||
|
if( this._container ) {
|
||||||
|
this._container.style.top = "5px";
|
||||||
|
this._container.style.left = ( OSRM.G.main_handle.boxVisible() == true ? (OSRM.G.main_handle.boxWidth()+10) : "30") + "px";
|
||||||
|
this._container.style.visibility="visible";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setTooltips: function( zoomIn, zoomOut) {
|
||||||
|
this._zoomIn.title = zoomIn;
|
||||||
|
this._zoomOut.title = zoomOut;
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -24,7 +24,7 @@ OSRM.Marker = function( label, style, position ) {
|
|||||||
this.label = label ? label : "marker";
|
this.label = label ? label : "marker";
|
||||||
this.position = position ? position : new L.LatLng(0,0);
|
this.position = position ? position : new L.LatLng(0,0);
|
||||||
|
|
||||||
this.marker = new L.MouseMarker( this.position, style );
|
this.marker = new L.LabelMarker( this.position, style );
|
||||||
this.marker.parent = this;
|
this.marker.parent = this;
|
||||||
|
|
||||||
this.shown = false;
|
this.shown = false;
|
||||||
@@ -99,8 +99,9 @@ onDrag: function(e) {
|
|||||||
OSRM.Geocoder.updateLocation( this.parent.label );
|
OSRM.Geocoder.updateLocation( this.parent.label );
|
||||||
},
|
},
|
||||||
onDragStart: function(e) {
|
onDragStart: function(e) {
|
||||||
|
OSRM.GUI.deactivateTooltip( "DRAGGING" );
|
||||||
OSRM.G.dragging = true;
|
OSRM.G.dragging = true;
|
||||||
this.switchIcon(this.options.dragicon);
|
this.changeIcon(this.options.dragicon);
|
||||||
|
|
||||||
// store id of dragged marker
|
// store id of dragged marker
|
||||||
for( var i=0; i<OSRM.G.markers.route.length; i++)
|
for( var i=0; i<OSRM.G.markers.route.length; i++)
|
||||||
@@ -118,7 +119,7 @@ onDragStart: function(e) {
|
|||||||
},
|
},
|
||||||
onDragEnd: function(e) {
|
onDragEnd: function(e) {
|
||||||
OSRM.G.dragging = false;
|
OSRM.G.dragging = false;
|
||||||
this.switchIcon(this.options.baseicon);
|
this.changeIcon(this.options.baseicon);
|
||||||
|
|
||||||
this.parent.setPosition( e.target.getLatLng() );
|
this.parent.setPosition( e.target.getLatLng() );
|
||||||
if (OSRM.G.route.isShown()) {
|
if (OSRM.G.route.isShown()) {
|
||||||
|
|||||||
@@ -22,10 +22,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
// simple route class (wraps Leaflet Polyline)
|
// simple route class (wraps Leaflet Polyline)
|
||||||
OSRM.SimpleRoute = function (label, style) {
|
OSRM.SimpleRoute = function (label, style) {
|
||||||
this.label = (label ? label : "route");
|
this.label = (label ? label : "route");
|
||||||
this.route = new L.DashedPolyline();
|
this.route = new L.Polyline( [], style );
|
||||||
this.route.setLatLngs( [] );
|
|
||||||
if(style) this.route.setStyle( style );
|
|
||||||
|
|
||||||
this.shown = false;
|
this.shown = false;
|
||||||
};
|
};
|
||||||
OSRM.extend( OSRM.SimpleRoute,{
|
OSRM.extend( OSRM.SimpleRoute,{
|
||||||
@@ -82,7 +79,7 @@ isShown: function() {
|
|||||||
return this.shown;
|
return this.shown;
|
||||||
},
|
},
|
||||||
addRoute: function(positions) {
|
addRoute: function(positions) {
|
||||||
var line = new L.DashedPolyline( positions );
|
var line = new L.Polyline( positions );
|
||||||
line.on('click', function(e) { OSRM.G.route.fire('click',e); });
|
line.on('click', function(e) { OSRM.G.route.fire('click',e); });
|
||||||
this.route.addLayer( line );
|
this.route.addLayer( line );
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ OSRM.GUIBoxHandle = function( box_name, side, css, transitionStartFct, transitio
|
|||||||
// create handle DOM elements
|
// create handle DOM elements
|
||||||
var wrapper = document.createElement('div');
|
var wrapper = document.createElement('div');
|
||||||
wrapper.id = box_name + '-handle-wrapper';
|
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;
|
wrapper.style.cssText += css;
|
||||||
var content = document.createElement('div');
|
var content = document.createElement('div');
|
||||||
content.id = box_name + '-handle-content';
|
content.id = box_name + '-handle-content';
|
||||||
@@ -37,6 +37,7 @@ OSRM.GUIBoxHandle = function( box_name, side, css, transitionStartFct, transitio
|
|||||||
var icon = document.createElement('div');
|
var icon = document.createElement('div');
|
||||||
icon.id = box_name + '-handle-icon';
|
icon.id = box_name + '-handle-icon';
|
||||||
icon.className = 'iconic-button';
|
icon.className = 'iconic-button';
|
||||||
|
icon.title = box_name;
|
||||||
|
|
||||||
content.appendChild(icon);
|
content.appendChild(icon);
|
||||||
wrapper.appendChild(content);
|
wrapper.appendChild(content);
|
||||||
@@ -54,6 +55,7 @@ OSRM.GUIBoxHandle = function( box_name, side, css, transitionStartFct, transitio
|
|||||||
// hide box and show handle by default
|
// hide box and show handle by default
|
||||||
this._box.style[this._side]=-this._width+"px";
|
this._box.style[this._side]=-this._width+"px";
|
||||||
this._box_visible = false;
|
this._box_visible = false;
|
||||||
|
this._box.style.visibility="hidden";
|
||||||
this._handle.style.visibility="visible";
|
this._handle.style.visibility="visible";
|
||||||
|
|
||||||
// add functionality
|
// add functionality
|
||||||
@@ -94,12 +96,13 @@ $hide: function() {
|
|||||||
},
|
},
|
||||||
$showBox: function() {
|
$showBox: function() {
|
||||||
this._box_visible = true;
|
this._box_visible = true;
|
||||||
|
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;
|
||||||
|
this._box.style.visibility="hidden";
|
||||||
this._handle.style.visibility="visible";
|
this._handle.style.visibility="visible";
|
||||||
this._box.style[this._side]=-this._width+"px";
|
this._box.style[this._side]=-this._width+"px";
|
||||||
},
|
},
|
||||||
@@ -109,6 +112,7 @@ _toggle: function() {
|
|||||||
if( this._box_visible == false ) {
|
if( this._box_visible == false ) {
|
||||||
this._box_group.$hide();
|
this._box_group.$hide();
|
||||||
this._box.style[this._side]="5px";
|
this._box.style[this._side]="5px";
|
||||||
|
this._box.style.visibility="visible"; // already show box, so that animation is seen
|
||||||
} else {
|
} else {
|
||||||
this._box.style[this._side]=-this._width+"px";
|
this._box.style[this._side]=-this._width+"px";
|
||||||
}
|
}
|
||||||
@@ -121,8 +125,10 @@ _onTransitionEnd: function() {
|
|||||||
if( this._box_visible == true ) {
|
if( this._box_visible == true ) {
|
||||||
this._box_group.$show();
|
this._box_group.$show();
|
||||||
this._box_visible = false;
|
this._box_visible = false;
|
||||||
|
this._box.style.visibility="hidden";
|
||||||
} else {
|
} else {
|
||||||
this._box_visible = true;
|
this._box_visible = true;
|
||||||
|
this._box.style.visibility="visible";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -41,22 +41,18 @@ init: function() {
|
|||||||
document.getElementById('gui-input-source').value = OSRM.DEFAULTS.ONLOAD_SOURCE;
|
document.getElementById('gui-input-source').value = OSRM.DEFAULTS.ONLOAD_SOURCE;
|
||||||
document.getElementById('gui-input-target').value = OSRM.DEFAULTS.ONLOAD_TARGET;
|
document.getElementById('gui-input-target').value = OSRM.DEFAULTS.ONLOAD_TARGET;
|
||||||
|
|
||||||
// init units selector
|
//init units selector
|
||||||
OSRM.GUI.selectorInit( "gui-units-toggle", [{display:"Kilometers",value:0},{display:"Miles",value:1}], 0, OSRM.GUI.onUnitsChanged );
|
OSRM.GUI.initDistanceFormatsSelector();
|
||||||
|
|
||||||
// query last update of data
|
|
||||||
OSRM.G.data_timestamp = "n/a";
|
|
||||||
OSRM.JSONP.call(OSRM.DEFAULTS.HOST_TIMESTAMP_URL+"?jsonp=%jsonp", OSRM.GUI.setDataTimestamp, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// set language dependent labels
|
// set language dependent labels
|
||||||
setLabels: function() {
|
setLabels: function() {
|
||||||
document.getElementById("open-josm").innerHTML = OSRM.loc("OPEN_JOSM");
|
document.getElementById("open-josm").innerHTML = OSRM.loc("OPEN_JOSM");
|
||||||
document.getElementById("open-osmbugs").innerHTML = OSRM.loc("OPEN_OSMBUGS");
|
document.getElementById("open-osmbugs").innerHTML = OSRM.loc("OPEN_OSMBUGS");
|
||||||
document.getElementById("gui-reset").innerHTML = OSRM.loc("GUI_RESET");
|
document.getElementById("gui-reset").innerHTML = OSRM.loc("GUI_RESET");
|
||||||
document.getElementById("gui-reverse").innerHTML = OSRM.loc("GUI_REVERSE");
|
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-highlight-nonames-label").lastChild.nodeValue = OSRM.loc("GUI_HIGHLIGHT_UNNAMED_ROADS");
|
||||||
document.getElementById("gui-option-show-previous-routes-label").innerHTML = OSRM.loc("GUI_SHOW_PREVIOUS_ROUTES");
|
document.getElementById("gui-option-show-previous-routes-label").lastChild.nodeValue = OSRM.loc("GUI_SHOW_PREVIOUS_ROUTES");
|
||||||
document.getElementById("gui-search-source").innerHTML = OSRM.loc("GUI_SEARCH");
|
document.getElementById("gui-search-source").innerHTML = OSRM.loc("GUI_SEARCH");
|
||||||
document.getElementById("gui-search-target").innerHTML = OSRM.loc("GUI_SEARCH");
|
document.getElementById("gui-search-target").innerHTML = OSRM.loc("GUI_SEARCH");
|
||||||
document.getElementById("gui-search-source-label").innerHTML = OSRM.loc("GUI_START")+":";
|
document.getElementById("gui-search-source-label").innerHTML = OSRM.loc("GUI_START")+":";
|
||||||
@@ -68,11 +64,17 @@ setLabels: function() {
|
|||||||
document.getElementById("gui-config-label").innerHTML = OSRM.loc("GUI_CONFIGURATION");
|
document.getElementById("gui-config-label").innerHTML = OSRM.loc("GUI_CONFIGURATION");
|
||||||
document.getElementById("gui-language-2-label").innerHTML = OSRM.loc("GUI_LANGUAGE")+":";
|
document.getElementById("gui-language-2-label").innerHTML = OSRM.loc("GUI_LANGUAGE")+":";
|
||||||
document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS")+":";
|
document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS")+":";
|
||||||
document.getElementById('gui-data-timestamp').innerHTML = OSRM.loc("GUI_DATA_TIMESTAMP")+": " + OSRM.G.data_timestamp;
|
document.getElementById('gui-data-timestamp-label').innerHTML = OSRM.loc("GUI_DATA_TIMESTAMP");
|
||||||
|
document.getElementById('gui-data-timestamp').innerHTML = OSRM.G.data_timestamp;
|
||||||
document.getElementById("gui-units-toggle").getElementsByTagName("option")[0].innerHTML = OSRM.loc("GUI_KILOMETERS");
|
document.getElementById('gui-timestamp-label').innerHTML = OSRM.loc("GUI_VERSION");
|
||||||
document.getElementById("gui-units-toggle").getElementsByTagName("option")[1].innerHTML = OSRM.loc("GUI_MILES");
|
document.getElementById('gui-timestamp').innerHTML = OSRM.DATE+"; v"+OSRM.VERSION;
|
||||||
OSRM.GUI.selectorOnChange( document.getElementById("gui-units-toggle") );
|
document.getElementById('config-handle-icon').title = OSRM.loc("GUI_CONFIGURATION");
|
||||||
|
document.getElementById('mapping-handle-icon').title = OSRM.loc("GUI_MAPPING_TOOLS");
|
||||||
|
document.getElementById('main-handle-icon').title = OSRM.loc("GUI_MAIN_WINDOW");
|
||||||
|
OSRM.G.map.zoomControl.setTooltips( OSRM.loc("GUI_ZOOM_IN"), OSRM.loc("GUI_ZOOM_OUT") );
|
||||||
|
OSRM.G.map.locationsControl.setTooltips( OSRM.loc("GUI_ZOOM_ON_USER"), OSRM.loc("GUI_ZOOM_ON_ROUTE") );
|
||||||
|
OSRM.GUI.setDistanceFormatsLanguage();
|
||||||
|
OSRM.GUI.setRoutingEnginesLanguage();
|
||||||
},
|
},
|
||||||
|
|
||||||
// clear output area
|
// clear output area
|
||||||
@@ -83,33 +85,60 @@ clearResults: function() {
|
|||||||
|
|
||||||
// reposition and hide zoom controls before main box animation
|
// reposition and hide zoom controls before main box animation
|
||||||
beforeMainTransition: function() {
|
beforeMainTransition: function() {
|
||||||
var zoom_controls = OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom');
|
OSRM.G.map.zoomControl.hide();
|
||||||
if( zoom_controls.length > 0)
|
|
||||||
zoom_controls[0].style.visibility="hidden";
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// show zoom controls after main box animation
|
// show zoom controls after main box animation
|
||||||
afterMainTransition: function() {
|
afterMainTransition: function() {
|
||||||
var zoom_controls = OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom');
|
OSRM.G.map.zoomControl.show();
|
||||||
if( zoom_controls.length > 0) {
|
},
|
||||||
zoom_controls[0].style.left = ( OSRM.G.main_handle.boxVisible() == true ? (OSRM.G.main_handle.boxWidth()+10) : "30") + "px";
|
|
||||||
zoom_controls[0].style.visibility="visible";
|
// distance format routines
|
||||||
|
initDistanceFormatsSelector: function() {
|
||||||
|
var options = OSRM.GUI.getDistanceFormats();
|
||||||
|
OSRM.GUI.selectorInit( "gui-units-toggle", options, OSRM.DEFAULTS.DISTANCE_FORMAT, OSRM.GUI._onDistanceFormatChanged );
|
||||||
|
},
|
||||||
|
setDistanceFormat: function(type) {
|
||||||
|
if( OSRM.G.active_distance_format == type )
|
||||||
|
return;
|
||||||
|
OSRM.G.active_distance_format = type;
|
||||||
|
|
||||||
|
// change scale control
|
||||||
|
if(OSRM.G.map) {
|
||||||
|
OSRM.G.map.scaleControl.removeFrom(OSRM.G.map);
|
||||||
|
OSRM.G.map.scaleControl.options.metric = (type != 1);
|
||||||
|
OSRM.G.map.scaleControl.options.imperial = (type == 1);
|
||||||
|
OSRM.G.map.scaleControl.addTo(OSRM.G.map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// change converter
|
||||||
|
if( type == 1 )
|
||||||
|
OSRM.Utils.toHumanDistance = OSRM.Utils.toHumanDistanceMiles;
|
||||||
|
else
|
||||||
|
OSRM.Utils.toHumanDistance = OSRM.Utils.toHumanDistanceMeters;
|
||||||
|
},
|
||||||
|
_onDistanceFormatChanged: function(type) {
|
||||||
|
OSRM.GUI.setDistanceFormat(type);
|
||||||
|
OSRM.Routing.getRoute({keepAlternative:true});
|
||||||
|
},
|
||||||
|
setDistanceFormatsLanguage: function() {
|
||||||
|
var options = OSRM.GUI.getDistanceFormats();
|
||||||
|
OSRM.GUI.selectorRenameOptions("gui-units-toggle", options );
|
||||||
|
},
|
||||||
|
getDistanceFormats: function() {
|
||||||
|
return [{display:OSRM.loc("GUI_KILOMETERS"),value:0},{display:OSRM.loc("GUI_MILES"),value:1}];
|
||||||
},
|
},
|
||||||
|
|
||||||
// toggle distance units
|
// data timestamp routines
|
||||||
onUnitsChanged: function(value) {
|
queryDataTimestamp: function() {
|
||||||
OSRM.Utils.setToHumanDistanceFunction(value);
|
OSRM.G.data_timestamp = "n/a";
|
||||||
OSRM.Routing.getRoute();
|
OSRM.JSONP.call( OSRM.G.active_routing_timestamp_url+"?jsonp=%jsonp", OSRM.GUI.setDataTimestamp, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp');
|
||||||
},
|
},
|
||||||
|
|
||||||
// set timestamp of data
|
|
||||||
setDataTimestamp: function(response) {
|
setDataTimestamp: function(response) {
|
||||||
if(!response)
|
if(!response)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OSRM.G.data_timestamp = response.timestamp.slice(0,25).replace(/<\/?[^>]+(>|$)/g ,""); // discard tags
|
OSRM.G.data_timestamp = response.timestamp.slice(0,25).replace(/<\/?[^>]+(>|$)/g ,""); // discard tags
|
||||||
document.getElementById('gui-data-timestamp').innerHTML = OSRM.loc("GUI_DATA_TIMESTAMP")+": " + OSRM.G.data_timestamp;
|
document.getElementById('gui-data-timestamp').innerHTML = OSRM.G.data_timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
/*
|
||||||
|
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
|
||||||
|
activeExclusive: undefined,
|
||||||
|
activeTooltip: undefined,
|
||||||
|
tooltips: {},
|
||||||
|
// LOCALIZATION: deactivation triggered in OSRM.Localization.setLanguageWrapper
|
||||||
|
// CLICKING: deactivation triggered in OSRM.Map.click
|
||||||
|
// DRAGGING: deactivation triggered in OSRM.Routing.getRoute_Dragging
|
||||||
|
// MAINTENANCE: deactivation only by config
|
||||||
|
|
||||||
|
|
||||||
|
// initialize notifications and tooltip timers
|
||||||
|
init: function() {
|
||||||
|
// exclusive notifications
|
||||||
|
var config = OSRM.DEFAULTS.NOTIFICATIONS;
|
||||||
|
if( config["MAINTENANCE"] == true ) {
|
||||||
|
var header = OSRM.DEFAULTS.OVERRIDE_MAINTENANCE_NOTIFICATION_HEADER || OSRM.loc("NOTIFICATION_MAINTENANCE_HEADER");
|
||||||
|
var body = OSRM.DEFAULTS.OVERRIDE_MAINTENANCE_NOTIFICATION_BODY || OSRM.loc("NOTIFICATION_MAINTENANCE_BODY");
|
||||||
|
OSRM.GUI.exclusiveNotify( header, body, false);
|
||||||
|
OSRM.GUI.activeExclusive = "MAINTENANCE";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// tooltip timers
|
||||||
|
var config = OSRM.DEFAULTS.NOTIFICATIONS;
|
||||||
|
var tooltips = OSRM.GUI.tooltips;
|
||||||
|
for( id in config ) {
|
||||||
|
// skip notification?
|
||||||
|
if( !OSRM.Utils.isNumber( config[id] ) )
|
||||||
|
continue;
|
||||||
|
// create structure to hold timer data
|
||||||
|
tooltips[id] = {};
|
||||||
|
// start timer
|
||||||
|
tooltips[id]._timer = setTimeout(
|
||||||
|
function(_id){ return function(){OSRM.GUI._showTooltip(_id);}; }(id),
|
||||||
|
config[id]
|
||||||
|
);
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
// only show tooltip if it exists
|
||||||
|
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
|
||||||
|
var config = OSRM.DEFAULTS.NOTIFICATIONS;
|
||||||
|
if( OSRM.GUI.isTooltipVisible() ) {
|
||||||
|
tooltips[id]._timer = setTimeout(
|
||||||
|
function(_id){ return function(){OSRM.GUI._showTooltip(_id);}; }(id),
|
||||||
|
config[id]
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// show notification
|
||||||
|
OSRM.GUI.tooltipNotify( OSRM.loc("NOTIFICATION_"+id+"_HEADER"), OSRM.loc("NOTIFICATION_"+id+"_BODY") );
|
||||||
|
OSRM.GUI.activeTooltip = id;
|
||||||
|
|
||||||
|
// 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";
|
||||||
|
OSRM.GUI.exclusiveResize();
|
||||||
|
},
|
||||||
|
exclusiveDenotify: function() {
|
||||||
|
document.getElementById('exclusive-notification-blanket').style.display = "none";
|
||||||
|
OSRM.GUI.activeExclusive = undefined;
|
||||||
|
},
|
||||||
|
exclusiveUpdate: function() {
|
||||||
|
if( OSRM.GUI.activeExclusive == undefined )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// override mainly intended for maintenance mode
|
||||||
|
var header = OSRM.DEFAULTS["OVERRIDE_"+OSRM.GUI.activeExclusive+"_HEADER"] || OSRM.loc("NOTIFICATION_MAINTENANCE_HEADER");
|
||||||
|
var body = OSRM.DEFAULTS["OVERRIDE_"+OSRM.GUI.activeExclusive+"_BODY"] || OSRM.loc("NOTIFICATION_MAINTENANCE_BODY");
|
||||||
|
|
||||||
|
document.getElementById('exclusive-notification-label').innerHTML = header;
|
||||||
|
document.getElementById('exclusive-notification-box').innerHTML = body;
|
||||||
|
OSRM.GUI.exclusiveResize();
|
||||||
|
},
|
||||||
|
exclusiveResize: function() {
|
||||||
|
var height = document.getElementById('exclusive-notification-box').clientHeight;
|
||||||
|
document.getElementById('exclusive-notification-content').style.height = (height + 28) + "px";
|
||||||
|
document.getElementById('exclusive-notification-wrapper').style.height = (height + 48) + "px";
|
||||||
|
},
|
||||||
|
inMaintenance: function() {
|
||||||
|
return OSRM.GUI.activeExclusive == "MAINTENANCE";
|
||||||
|
},
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
},
|
||||||
|
tooltipDenotify: function() {
|
||||||
|
document.getElementById('tooltip-notification-wrapper').style.display = "none";
|
||||||
|
OSRM.GUI.activeTooltip = undefined;
|
||||||
|
},
|
||||||
|
tooltipUpdate: function() {
|
||||||
|
if( OSRM.GUI.activeTooltip == undefined )
|
||||||
|
return;
|
||||||
|
document.getElementById('tooltip-notification-label').innerHTML = OSRM.loc("NOTIFICATION_"+OSRM.GUI.activeTooltip+"_HEADER");
|
||||||
|
document.getElementById('tooltip-notification-box').innerHTML = OSRM.loc("NOTIFICATION_"+OSRM.GUI.activeTooltip+"_BODY");
|
||||||
|
OSRM.GUI.tooltipResize();
|
||||||
|
OSRM.GUI.tooltipResize(); // simple trick to retain opened/closed state of tooltip
|
||||||
|
},
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isTooltipVisible: function() {
|
||||||
|
return document.getElementById('tooltip-notification-wrapper').style.display == "block";
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// update language of any notification
|
||||||
|
updateNotifications: function() {
|
||||||
|
OSRM.GUI.exclusiveUpdate();
|
||||||
|
OSRM.GUI.tooltipUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
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 RoutingEngineGUI
|
||||||
|
// [handles all GUI aspects that deals with switching the routing engine]
|
||||||
|
|
||||||
|
|
||||||
|
OSRM.GUI.extend( {
|
||||||
|
|
||||||
|
// init
|
||||||
|
init: function() {
|
||||||
|
// gather routing engines
|
||||||
|
var options = OSRM.GUI.getRoutingEngines();
|
||||||
|
|
||||||
|
// generate selectors
|
||||||
|
OSRM.GUI.selectorInit("gui-engine-toggle", options, OSRM.DEFAULTS.ROUTING_ENGINE, OSRM.GUI._onRoutingEngineChanged);
|
||||||
|
},
|
||||||
|
|
||||||
|
// change active routing engine
|
||||||
|
setRoutingEngine: function(engine) {
|
||||||
|
if( engine == OSRM.G.active_routing_engine )
|
||||||
|
return;
|
||||||
|
|
||||||
|
OSRM.GUI.selectorChange( 'gui-engine-toggle', engine );
|
||||||
|
|
||||||
|
OSRM.G.active_routing_engine = engine;
|
||||||
|
OSRM.G.active_routing_metric = OSRM.DEFAULTS.ROUTING_ENGINES[ OSRM.G.active_routing_engine ].metric;;
|
||||||
|
OSRM.G.active_routing_server_url = OSRM.DEFAULTS.ROUTING_ENGINES[ OSRM.G.active_routing_engine ].url;
|
||||||
|
OSRM.G.active_routing_timestamp_url = OSRM.DEFAULTS.ROUTING_ENGINES[ OSRM.G.active_routing_engine ].timestamp;
|
||||||
|
|
||||||
|
// requery data timestamp
|
||||||
|
OSRM.GUI.queryDataTimestamp();
|
||||||
|
OSRM.JSONP.call( OSRM.DEFAULTS.ROUTING_ENGINES[ OSRM.G.active_routing_engine ].timestamp+"?jsonp=%jsonp", OSRM.GUI.setDataTimestamp, OSRM.GUI.setDataTimestampTimeout, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp');
|
||||||
|
},
|
||||||
|
_onRoutingEngineChanged: function(engine) {
|
||||||
|
if( engine == OSRM.G.active_routing_engine )
|
||||||
|
return;
|
||||||
|
|
||||||
|
OSRM.GUI.setRoutingEngine( engine );
|
||||||
|
|
||||||
|
// requery route
|
||||||
|
if( OSRM.G.markers.route.length > 1 )
|
||||||
|
OSRM.Routing.getRoute();
|
||||||
|
},
|
||||||
|
|
||||||
|
// change language of routing engine entries
|
||||||
|
setRoutingEnginesLanguage: function() {
|
||||||
|
// gather routing engines
|
||||||
|
var options = OSRM.GUI.getRoutingEngines();
|
||||||
|
|
||||||
|
// change dropdown menu names
|
||||||
|
OSRM.GUI.selectorRenameOptions( "gui-engine-toggle", options );
|
||||||
|
},
|
||||||
|
|
||||||
|
// gather routing engines
|
||||||
|
getRoutingEngines: function() {
|
||||||
|
var engines = OSRM.DEFAULTS.ROUTING_ENGINES;
|
||||||
|
var options = [];
|
||||||
|
for(var i=0, size=engines.length; i<size; i++) {
|
||||||
|
options.push( {display:OSRM.loc(engines[i].label), value:i} );
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
@@ -24,7 +24,7 @@ OSRM.GUI.extend( {
|
|||||||
// init
|
// init
|
||||||
init: function() {
|
init: function() {
|
||||||
// init variables
|
// init variables
|
||||||
OSRM.Utils.setToHumanDistanceFunction(OSRM.DEFAULTS.DISTANCE_FORMAT);
|
OSRM.GUI.setDistanceFormat(OSRM.DEFAULTS.DISTANCE_FORMAT);
|
||||||
|
|
||||||
// init events
|
// init events
|
||||||
document.getElementById("gui-input-source").onchange = function() {OSRM.GUI.inputChanged(OSRM.C.SOURCE_LABEL);};
|
document.getElementById("gui-input-source").onchange = function() {OSRM.GUI.inputChanged(OSRM.C.SOURCE_LABEL);};
|
||||||
@@ -39,10 +39,22 @@ init: function() {
|
|||||||
document.getElementById("gui-reverse").onclick = OSRM.GUI.reverseRouting;
|
document.getElementById("gui-reverse").onclick = OSRM.GUI.reverseRouting;
|
||||||
document.getElementById("open-josm").onclick = OSRM.GUI.openJOSM;
|
document.getElementById("open-josm").onclick = OSRM.GUI.openJOSM;
|
||||||
document.getElementById("open-osmbugs").onclick = OSRM.GUI.openOSMBugs;
|
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;
|
document.getElementById("option-show-previous-routes").onclick = OSRM.GUI.showPreviousRoutes;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// toggle GUI features that need a route to work
|
||||||
|
activateRouteFeatures: function() {
|
||||||
|
OSRM.Printing.activate();
|
||||||
|
OSRM.G.map.locationsControl.activateRoute();
|
||||||
|
OSRM.G.active_shortlink = null; // delete shortlink when new route is shown (RoutingDescription calls this method!)
|
||||||
|
},
|
||||||
|
deactivateRouteFeatures: function() {
|
||||||
|
OSRM.Printing.deactivate();
|
||||||
|
OSRM.G.map.locationsControl.deactivateRoute();
|
||||||
|
OSRM.G.active_shortlink = null; // delete shortlink when the route is hidden
|
||||||
|
},
|
||||||
|
|
||||||
// click: button "reset"
|
// click: button "reset"
|
||||||
resetRouting: function() {
|
resetRouting: function() {
|
||||||
document.getElementById('gui-input-source').value = "";
|
document.getElementById('gui-input-source').value = "";
|
||||||
@@ -144,6 +156,26 @@ showPreviousRoutes: function(value) {
|
|||||||
OSRM.G.route.deactivateHistoryRoutes();
|
OSRM.G.route.deactivateHistoryRoutes();
|
||||||
else
|
else
|
||||||
OSRM.G.route.activateHistoryRoutes();
|
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: button "zoom on user"
|
||||||
|
zoomOnUser: function() {
|
||||||
|
if (navigator.geolocation)
|
||||||
|
navigator.geolocation.getCurrentPosition(OSRM.Map.geolocationResponse);
|
||||||
|
},
|
||||||
|
|
||||||
|
//click: toggle highlighting unnamed streets
|
||||||
|
hightlightNonames: function() {
|
||||||
|
OSRM.Routing.getRoute_Redraw({keepAlternative:true});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ selectorInit: function(id, options, selected, onchange_fct) {
|
|||||||
// create dropdown menu
|
// create dropdown menu
|
||||||
var select = document.getElementById(id);
|
var select = document.getElementById(id);
|
||||||
select.className += " styled-select-helper base-font";
|
select.className += " styled-select-helper base-font";
|
||||||
select.onchange = function() { OSRM.GUI.selectorOnChange(this); onchange_fct(this.value); };
|
select.onchange = function() { OSRM.GUI._selectorOnChange(this); onchange_fct(this.value); };
|
||||||
|
|
||||||
// fill dropdown menu
|
// fill dropdown menu
|
||||||
for(var i=0, size=options.length; i<size; i++) {
|
for(var i=0, size=options.length; i<size; i++) {
|
||||||
@@ -44,12 +44,12 @@ selectorInit: function(id, options, selected, onchange_fct) {
|
|||||||
myspan.id = "styled-select-" + select.id;
|
myspan.id = "styled-select-" + select.id;
|
||||||
myspan.appendChild(textnode);
|
myspan.appendChild(textnode);
|
||||||
select.parentNode.insertBefore(myspan, select);
|
select.parentNode.insertBefore(myspan, select);
|
||||||
myspan.style.width = (select.clientWidth-2)+"px";
|
myspan.style.width = (select.offsetWidth-2)+"px";
|
||||||
myspan.style.height = (select.clientHeight)+"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
|
// required behaviour of selector on change to switch shown name
|
||||||
selectorOnChange: function(select) {
|
_selectorOnChange: function(select) {
|
||||||
var option = select.getElementsByTagName("option");
|
var option = select.getElementsByTagName("option");
|
||||||
for(var i = 0; i < option.length; i++)
|
for(var i = 0; i < option.length; i++)
|
||||||
if(option[i].selected == true) {
|
if(option[i].selected == true) {
|
||||||
@@ -59,9 +59,61 @@ selectorOnChange: function(select) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// change selector value
|
// change selector value
|
||||||
selectorChange: function(select, value) {
|
selectorChange: function(id, value) {
|
||||||
|
var select = document.getElementById(id);
|
||||||
select.value = value;
|
select.value = value;
|
||||||
OSRM.GUI.selectorOnChange(select);
|
OSRM.GUI._selectorOnChange(select);
|
||||||
|
},
|
||||||
|
|
||||||
|
// replace selector options with new names
|
||||||
|
selectorRenameOptions: function(id, options) {
|
||||||
|
var select = document.getElementById(id);
|
||||||
|
var styledSelect = document.getElementById("styled-select-"+id);
|
||||||
|
|
||||||
|
// create new dropdown menu
|
||||||
|
var new_select = document.createElement("select");
|
||||||
|
new_select.id = id;
|
||||||
|
new_select.className = select.className;
|
||||||
|
new_select.onchange = select.onchange;
|
||||||
|
|
||||||
|
// fill new dropdown menu
|
||||||
|
var selected_display = "";
|
||||||
|
for(var i=0, size=options.length; i<size; i++) {
|
||||||
|
var option=document.createElement("option");
|
||||||
|
option.innerHTML = options[i].display;
|
||||||
|
option.value = options[i].value;
|
||||||
|
new_select.appendChild(option);
|
||||||
|
|
||||||
|
if( options[i].value == select.value )
|
||||||
|
selected_display = options[i].display;
|
||||||
|
}
|
||||||
|
new_select.value = select.value;
|
||||||
|
|
||||||
|
// switch old with new dropdown menu
|
||||||
|
select.parentNode.insertBefore(new_select, select);
|
||||||
|
select.parentNode.removeChild(select);
|
||||||
|
|
||||||
|
// change styled dropdown menu size & language
|
||||||
|
styledSelect.childNodes[0].nodeValue = selected_display;
|
||||||
|
styledSelect.style.width = (new_select.offsetWidth-2)+"px";
|
||||||
|
styledSelect.style.height = (new_select.offsetHeight)+"px";
|
||||||
|
|
||||||
|
// // old variant without creating a new dropdown menu (works in current browsers, but not in older FF or IE)
|
||||||
|
// var select = document.getElementById(id);
|
||||||
|
// var select_options = select.getElementsByTagName("option");
|
||||||
|
// var styledSelect = document.getElementById("styled-select-"+id);
|
||||||
|
//
|
||||||
|
// // fill dropdown menu with new option names
|
||||||
|
// for(var i = 0; i < select_options.length; i++) {
|
||||||
|
// select_options[i].childNodes[0].nodeValue = options[i].display;
|
||||||
|
//
|
||||||
|
// if(select_options[i].selected == true)
|
||||||
|
// styledSelect.childNodes[0].nodeValue = options[i].display;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // resize visible dropdown menu as needed
|
||||||
|
// styledSelect.style.width = (select.offsetWidth-2)+"px";
|
||||||
|
// styledSelect.style.height = (select.offsetHeight)+"px"; // clientHeight gives the height of the opened dropbox!
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 534 B |
|
After Width: | Height: | Size: 690 B |
|
After Width: | Height: | Size: 737 B |
|
After Width: | Height: | Size: 713 B |
|
After Width: | Height: | Size: 700 B |
|
After Width: | Height: | Size: 684 B |
|
After Width: | Height: | Size: 824 B |
|
After Width: | Height: | Size: 817 B |
|
After Width: | Height: | Size: 913 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 169 B |
|
After Width: | Height: | Size: 165 B |
|
After Width: | Height: | Size: 153 B |
|
After Width: | Height: | Size: 156 B |
|
After Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -11,14 +11,13 @@
|
|||||||
.leaflet-popup-pane,
|
.leaflet-popup-pane,
|
||||||
.leaflet-overlay-pane svg,
|
.leaflet-overlay-pane svg,
|
||||||
.leaflet-zoom-box,
|
.leaflet-zoom-box,
|
||||||
.leaflet-image-layer { /* TODO optimize classes */
|
.leaflet-image-layer,
|
||||||
|
.leaflet-layer { /* TODO optimize classes */
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
.leaflet-container {
|
.leaflet-container {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
outline: 0;
|
||||||
.leaflet-tile-pane, .leaflet-container {
|
|
||||||
-webkit-transform: translate3d(0,0,0);
|
|
||||||
}
|
}
|
||||||
.leaflet-tile,
|
.leaflet-tile,
|
||||||
.leaflet-marker-icon,
|
.leaflet-marker-icon,
|
||||||
@@ -34,44 +33,50 @@
|
|||||||
.leaflet-clickable {
|
.leaflet-clickable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.leaflet-dragging, .leaflet-dragging .leaflet-clickable {
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
.leaflet-container img {
|
.leaflet-container img {
|
||||||
|
/* map is broken in FF if you have max-width: 100% on tiles */
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
}
|
}
|
||||||
|
.leaflet-container img.leaflet-image-layer {
|
||||||
|
/* stupid Android 2 doesn't understand "max-width: none" properly */
|
||||||
|
max-width: 15000px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.leaflet-tile-pane { z-index: 2; }
|
.leaflet-tile-pane { z-index: 2; }
|
||||||
|
|
||||||
.leaflet-objects-pane { z-index: 3; }
|
.leaflet-objects-pane { z-index: 3; }
|
||||||
.leaflet-overlay-pane { z-index: 4; }
|
.leaflet-overlay-pane { z-index: 4; }
|
||||||
.leaflet-shadow-pane { z-index: 5; }
|
.leaflet-shadow-pane { z-index: 5; }
|
||||||
.leaflet-marker-pane { z-index: 6; }
|
.leaflet-marker-pane { z-index: 6; }
|
||||||
.leaflet-popup-pane { z-index: 7; }
|
.leaflet-popup-pane { z-index: 7; }
|
||||||
|
|
||||||
.leaflet-zoom-box {
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-tile {
|
.leaflet-tile {
|
||||||
visibility: hidden;
|
filter: inherit;
|
||||||
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
.leaflet-tile-loaded {
|
.leaflet-tile-loaded {
|
||||||
visibility: inherit;
|
visibility: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.leaflet-active {
|
.leaflet-zoom-box {
|
||||||
outline: 2px solid orange;
|
width: 0;
|
||||||
}
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Leaflet controls */
|
/* Leaflet controls */
|
||||||
|
|
||||||
.leaflet-control {
|
.leaflet-control {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 7;
|
z-index: 7;
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
.leaflet-top,
|
.leaflet-top,
|
||||||
.leaflet-bottom {
|
.leaflet-bottom {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
z-index: 1000;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.leaflet-top {
|
.leaflet-top {
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -105,7 +110,7 @@ a.leaflet-active {
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-zoom, .leaflet-control-layers {
|
.leaflet-control-zoom {
|
||||||
-moz-border-radius: 7px;
|
-moz-border-radius: 7px;
|
||||||
-webkit-border-radius: 7px;
|
-webkit-border-radius: 7px;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
@@ -132,7 +137,7 @@ a.leaflet-active {
|
|||||||
.leaflet-control-zoom a:hover {
|
.leaflet-control-zoom a:hover {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.leaflet-big-buttons .leaflet-control-zoom a {
|
.leaflet-touch .leaflet-control-zoom a {
|
||||||
width: 27px;
|
width: 27px;
|
||||||
height: 27px;
|
height: 27px;
|
||||||
}
|
}
|
||||||
@@ -145,18 +150,18 @@ a.leaflet-active {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-layers {
|
.leaflet-control-layers {
|
||||||
-moz-box-shadow: 0 0 7px #999;
|
box-shadow: 0 1px 7px #999;
|
||||||
-webkit-box-shadow: 0 0 7px #999;
|
|
||||||
box-shadow: 0 0 7px #999;
|
|
||||||
|
|
||||||
background: #f8f8f9;
|
background: #f8f8f9;
|
||||||
|
-moz-border-radius: 8px;
|
||||||
|
-webkit-border-radius: 8px;
|
||||||
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
.leaflet-control-layers a {
|
.leaflet-control-layers a {
|
||||||
background-image: url(images/layers.png);
|
background-image: url(images/layers.png);
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
}
|
}
|
||||||
.leaflet-big-buttons .leaflet-control-layers a {
|
.leaflet-touch .leaflet-control-layers a {
|
||||||
width: 44px;
|
width: 44px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
}
|
}
|
||||||
@@ -189,23 +194,60 @@ a.leaflet-active {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-container .leaflet-control-attribution {
|
.leaflet-container .leaflet-control-attribution {
|
||||||
margin: 0;
|
|
||||||
padding: 0 5px;
|
|
||||||
|
|
||||||
font: 11px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
|
|
||||||
color: #333;
|
|
||||||
|
|
||||||
background-color: rgba(255, 255, 255, 0.7);
|
background-color: rgba(255, 255, 255, 0.7);
|
||||||
|
box-shadow: 0 0 5px #bbb;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
-moz-box-shadow: 0 0 7px #ccc;
|
.leaflet-control-attribution,
|
||||||
-webkit-box-shadow: 0 0 7px #ccc;
|
.leaflet-control-scale-line {
|
||||||
box-shadow: 0 0 7px #ccc;
|
padding: 0 5px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-container .leaflet-control-attribution,
|
||||||
|
.leaflet-container .leaflet-control-scale {
|
||||||
|
font: 11px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-left .leaflet-control-scale {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
.leaflet-bottom .leaflet-control-scale {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-control-scale-line {
|
||||||
|
border: 2px solid #777;
|
||||||
|
border-top: none;
|
||||||
|
color: black;
|
||||||
|
line-height: 1;
|
||||||
|
font-size: 10px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
text-shadow: 1px 1px 1px #fff;
|
||||||
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
|
}
|
||||||
|
.leaflet-control-scale-line:not(:first-child) {
|
||||||
|
border-top: 2px solid #777;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-bottom: none;
|
||||||
|
margin-top: -2px;
|
||||||
|
}
|
||||||
|
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
|
||||||
|
border-bottom: 2px solid #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-touch .leaflet-control-attribution, .leaflet-touch .leaflet-control-layers {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
.leaflet-touch .leaflet-control-layers {
|
||||||
|
border: 5px solid #bbb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Fade animations */
|
/* Zoom and fade animations */
|
||||||
|
|
||||||
.leaflet-fade-anim .leaflet-tile {
|
.leaflet-fade-anim .leaflet-tile, .leaflet-fade-anim .leaflet-popup {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
||||||
-webkit-transition: opacity 0.2s linear;
|
-webkit-transition: opacity 0.2s linear;
|
||||||
@@ -213,30 +255,27 @@ a.leaflet-active {
|
|||||||
-o-transition: opacity 0.2s linear;
|
-o-transition: opacity 0.2s linear;
|
||||||
transition: opacity 0.2s linear;
|
transition: opacity 0.2s linear;
|
||||||
}
|
}
|
||||||
.leaflet-fade-anim .leaflet-tile-loaded {
|
.leaflet-fade-anim .leaflet-tile-loaded, .leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-fade-anim .leaflet-popup {
|
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||||
opacity: 0;
|
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0.25,0.1,0.25,0.75);
|
||||||
|
-moz-transition: -moz-transform 0.25s cubic-bezier(0.25,0.1,0.25,0.75);
|
||||||
-webkit-transition: opacity 0.2s linear;
|
-o-transition: -o-transform 0.25s cubic-bezier(0.25,0.1,0.25,0.75);
|
||||||
-moz-transition: opacity 0.2s linear;
|
transition: transform 0.25s cubic-bezier(0.25,0.1,0.25,0.75);
|
||||||
-o-transition: opacity 0.2s linear;
|
|
||||||
transition: opacity 0.2s linear;
|
|
||||||
}
|
|
||||||
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-zoom-anim .leaflet-tile {
|
.leaflet-zoom-anim .leaflet-tile,
|
||||||
-webkit-transition: none;
|
.leaflet-pan-anim .leaflet-tile,
|
||||||
-moz-transition: none;
|
.leaflet-touching .leaflet-zoom-animated {
|
||||||
-o-transition: none;
|
-webkit-transition: none;
|
||||||
transition: none;
|
-moz-transition: none;
|
||||||
}
|
-o-transition: none;
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
.leaflet-zoom-anim .leaflet-objects-pane {
|
.leaflet-zoom-anim .leaflet-zoom-hide {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,19 +285,18 @@ a.leaflet-active {
|
|||||||
.leaflet-popup {
|
.leaflet-popup {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
-webkit-transform: translate3d(0,0,0);
|
|
||||||
}
|
}
|
||||||
.leaflet-popup-content-wrapper {
|
.leaflet-popup-content-wrapper {
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.leaflet-popup-content {
|
.leaflet-popup-content {
|
||||||
margin: 19px;
|
margin: 14px 20px;
|
||||||
}
|
}
|
||||||
.leaflet-popup-tip-container {
|
.leaflet-popup-tip-container {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 16px;
|
height: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@@ -275,19 +313,30 @@ a.leaflet-active {
|
|||||||
-o-transform: rotate(45deg);
|
-o-transform: rotate(45deg);
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
}
|
}
|
||||||
.leaflet-popup-close-button {
|
.leaflet-container a.leaflet-popup-close-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 9px;
|
top: 0;
|
||||||
right: 9px;
|
right: 0;
|
||||||
|
padding: 4px 5px 0 0;
|
||||||
width: 10px;
|
text-align: center;
|
||||||
height: 10px;
|
width: 18px;
|
||||||
|
height: 14px;
|
||||||
overflow: hidden;
|
font: 16px/14px Tahoma, Verdana, sans-serif;
|
||||||
|
color: #c3c3c3;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.leaflet-container a.leaflet-popup-close-button:hover {
|
||||||
|
color: #999;
|
||||||
}
|
}
|
||||||
.leaflet-popup-content p {
|
.leaflet-popup-content p {
|
||||||
margin: 18px 0;
|
margin: 18px 0;
|
||||||
}
|
}
|
||||||
|
.leaflet-popup-scrolled {
|
||||||
|
overflow: auto;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Visual appearance */
|
/* Visual appearance */
|
||||||
@@ -298,17 +347,27 @@ a.leaflet-active {
|
|||||||
.leaflet-container a {
|
.leaflet-container a {
|
||||||
color: #0078A8;
|
color: #0078A8;
|
||||||
}
|
}
|
||||||
|
.leaflet-container a.leaflet-active {
|
||||||
|
outline: 2px solid orange;
|
||||||
|
}
|
||||||
.leaflet-zoom-box {
|
.leaflet-zoom-box {
|
||||||
border: 2px dotted #05f;
|
border: 2px dotted #05f;
|
||||||
background: white;
|
background: white;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
.leaflet-div-icon {
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #666;
|
||||||
|
}
|
||||||
|
.leaflet-editing-icon {
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
|
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
|
||||||
background: white;
|
background: white;
|
||||||
|
|
||||||
box-shadow: 0 1px 10px #888;
|
box-shadow: 0 3px 10px #888;
|
||||||
-moz-box-shadow: 0 1px 10px #888;
|
-moz-box-shadow: 0 3px 10px #888;
|
||||||
-webkit-box-shadow: 0 1px 14px #999;
|
-webkit-box-shadow: 0 3px 14px #999;
|
||||||
}
|
}
|
||||||
.leaflet-popup-content-wrapper {
|
.leaflet-popup-content-wrapper {
|
||||||
-moz-border-radius: 20px;
|
-moz-border-radius: 20px;
|
||||||
@@ -318,6 +377,3 @@ a.leaflet-active {
|
|||||||
.leaflet-popup-content {
|
.leaflet-popup-content {
|
||||||
font: 12px/1.4 "Helvetica Neue", Arial, Helvetica, sans-serif;
|
font: 12px/1.4 "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||||
}
|
}
|
||||||
.leaflet-popup-close-button {
|
|
||||||
background: white url(images/popup-close.png);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
.leaflet-tile {
|
|
||||||
filter: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-vml-shape {
|
.leaflet-vml-shape {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
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
|
||||||
|
// [Bulgarian language support]
|
||||||
|
|
||||||
|
|
||||||
|
OSRM.Localization["bg"] = {
|
||||||
|
// own language
|
||||||
|
"CULTURE": "bg-BG",
|
||||||
|
"LANGUAGE": "Български",
|
||||||
|
// gui
|
||||||
|
"GUI_START": "Начало",
|
||||||
|
"GUI_END": "Край",
|
||||||
|
"GUI_RESET": "Изчисти",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Приближи на маршрута",
|
||||||
|
"GUI_ZOOM_ON_USER": "Приближи на потребител",
|
||||||
|
"GUI_SEARCH": "Покажи",
|
||||||
|
"GUI_REVERSE": "Размени",
|
||||||
|
"GUI_START_TOOLTIP": "Въведи начало",
|
||||||
|
"GUI_END_TOOLTIP": "Въведи карйна цел",
|
||||||
|
"GUI_MAIN_WINDOW": "главния прозорец",
|
||||||
|
"GUI_ZOOM_IN": "Приближаване",
|
||||||
|
"GUI_ZOOM_OUT": "Oтдалечаване",
|
||||||
|
// config
|
||||||
|
"GUI_CONFIGURATION": "Конфигурация",
|
||||||
|
"GUI_LANGUAGE": "Език",
|
||||||
|
"GUI_UNITS": "единици",
|
||||||
|
"GUI_KILOMETERS": "Километри",
|
||||||
|
"GUI_MILES": "Мили",
|
||||||
|
// mapping
|
||||||
|
"GUI_MAPPING_TOOLS": "Инструменти за карта",
|
||||||
|
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Подчертай неименувани улици",
|
||||||
|
"GUI_SHOW_PREVIOUS_ROUTES": "Покажи преднишни маршрути",
|
||||||
|
"OPEN_JOSM": "JOSM",
|
||||||
|
"OPEN_OSMBUGS": "OSM Грешки",
|
||||||
|
// 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": "Не е изберан маршрут",
|
||||||
|
// routing engines
|
||||||
|
"ENGINE_0": "Kола (най-бързо)",
|
||||||
|
// 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":"Обратен завой[ по <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":"Влез в кръговото и излез на първия изход[ по <b>%s</b>]",
|
||||||
|
"DIRECTION_11-2":"Влез в кръговото и излез на втория изход[ по <b>%s</b>]",
|
||||||
|
"DIRECTION_11-3":"Влез в кръговото и излез на третия изход[ по <b>%s</b>]",
|
||||||
|
"DIRECTION_11-4":"Влез в кръговото и излез на четвъртия изход[ по <b>%s</b>]",
|
||||||
|
"DIRECTION_11-5":"Влез в кръговото и излез на петия изход[ по <b>%s</b>]",
|
||||||
|
"DIRECTION_11-6":"Влез в кръговото и излез на шестия изход[ по <b>%s</b>]",
|
||||||
|
"DIRECTION_11-7":"Влез в кръговото и излез на седмия изход[ по <b>%s</b>]",
|
||||||
|
"DIRECTION_11-8":"Влез в кръговото и излез на осмия изход[ по <b>%s</b>]",
|
||||||
|
"DIRECTION_11-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("bg");
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
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
|
||||||
|
// [Czech language support]
|
||||||
|
|
||||||
|
|
||||||
|
OSRM.Localization["cs"] = {
|
||||||
|
// own language
|
||||||
|
"CULTURE": "cs-CZ",
|
||||||
|
"LANGUAGE": "česky",
|
||||||
|
// gui
|
||||||
|
"GUI_START": "Odkud",
|
||||||
|
"GUI_END": "Kam",
|
||||||
|
"GUI_RESET": "Vyčistit",
|
||||||
|
"GUI_ZOOM": "Zoom na trasu",
|
||||||
|
"GUI_SEARCH": "Ukázat",
|
||||||
|
"GUI_REVERSE": "Prohodit",
|
||||||
|
"GUI_START_TOOLTIP": "Zadejte začátek cesty",
|
||||||
|
"GUI_END_TOOLTIP": "Zadejte cíl cesty",
|
||||||
|
"GUI_ZOOM_IN": "Najíždět",
|
||||||
|
"GUI_ZOOM_OUT": "Oddálit",
|
||||||
|
// config
|
||||||
|
"GUI_CONFIGURATION": "Nastavení",
|
||||||
|
"GUI_LANGUAGE": "Jazyk",
|
||||||
|
"GUI_UNITS": "Jednotky",
|
||||||
|
"GUI_KILOMETERS": "kilometry",
|
||||||
|
"GUI_MILES": "míle",
|
||||||
|
// mapping
|
||||||
|
"GUI_MAPPING_TOOLS": "Mapovací nástroje",
|
||||||
|
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Zvýraznit nepojmenované ulice",
|
||||||
|
"GUI_SHOW_PREVIOUS_ROUTES": "Zobrazit předchozí trasy",
|
||||||
|
"OPEN_JOSM": "JOSM",
|
||||||
|
"OPEN_OSMBUGS": "OSM Bugs",
|
||||||
|
// geocoder
|
||||||
|
"SEARCH_RESULTS": "Výsledky hledání",
|
||||||
|
"FOUND_X_RESULTS": "nalezeno %i výsledků",
|
||||||
|
"TIMED_OUT": "Časová lhůta uplynula",
|
||||||
|
"NO_RESULTS_FOUND": "Nejsou žádné výsledky",
|
||||||
|
"NO_RESULTS_FOUND_SOURCE": "Nejsou žádné výsledky pro začátek trasy",
|
||||||
|
"NO_RESULTS_FOUND_TARGET": "Nejsou žádné výsledky pro konec trasy",
|
||||||
|
//routing
|
||||||
|
"ROUTE_DESCRIPTION": "Popis trasy",
|
||||||
|
"GET_LINK_TO_ROUTE": "Generovat odkaz",
|
||||||
|
"GENERATE_LINK_TO_ROUTE": "čekání na odkaz",
|
||||||
|
"LINK_TO_ROUTE_TIMEOUT": "není k dispozici",
|
||||||
|
"GPX_FILE": "GPX soubor",
|
||||||
|
"DISTANCE": "Vzdálenost",
|
||||||
|
"DURATION": "Doba",
|
||||||
|
"YOUR_ROUTE_IS_BEING_COMPUTED": "Vaše trasa byla vyznačena",
|
||||||
|
"NO_ROUTE_FOUND": "Trasu nelze vyznačit",
|
||||||
|
// printing
|
||||||
|
"OVERVIEW_MAP": "Přehledová mapka",
|
||||||
|
"NO_ROUTE_SELECTED": "Ne vybranou trasu",
|
||||||
|
// routing engines
|
||||||
|
"ENGINE_0": "Auto (nejrychlejší)",
|
||||||
|
// directions
|
||||||
|
"N": "sever",
|
||||||
|
"E": "východ",
|
||||||
|
"S": "jih",
|
||||||
|
"W": "západ",
|
||||||
|
"NE": "severovýchod",
|
||||||
|
"SE": "jihovýchod",
|
||||||
|
"SW": "jihozápad",
|
||||||
|
"NW": "severozápad",
|
||||||
|
// driving directions
|
||||||
|
// %s: road name
|
||||||
|
// %d: direction
|
||||||
|
// [*]: will only be printed when there actually is a road name
|
||||||
|
"DIRECTION_0":"Neznámý pokyn[ na <b>%s</b>]",
|
||||||
|
"DIRECTION_1":"Pokračujte[ silnicí <b>%s</b>]",
|
||||||
|
"DIRECTION_2":"Zahněte mírně vpravo[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_3":"Zahněte vpravo[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_4":"Zahněte ostře doprava[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_5":"Otočte se[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_6":"Zahněte ostře doleva[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_7":"Zahněte vlevo[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_8":"Zahněte mírně vlevo[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_10":"Jeďte na <b>%d</b>[ silnicí <b>%s</b>]",
|
||||||
|
"DIRECTION_11-1":"Najeďte na kruhový objezd a opusťte jej prvním výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-2":"Najeďte na kruhový objezd a opusťte jej druhým výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-3":"Najeďte na kruhový objezd a opusťte jej třetím výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-4":"Najeďte na kruhový objezd a opusťte jej čtvrtým výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-5":"Najeďte na kruhový objezd a opusťte jej pátým výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-6":"Najeďte na kruhový objezd a opusťte jej šestým výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-7":"Najeďte na kruhový objezd a opusťte jej sedmým výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-8":"Najeďte na kruhový objezd a opusťte jej osmým výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-9":"Najeďte na kruhový objezd a opusťte jej devátým výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_11-1":"Najeďte na kruhový objezd a opusťte jej vámi vybraným výjezdem[ na silnici <b>%s</b>]",
|
||||||
|
"DIRECTION_15":"Jste u cíle"
|
||||||
|
};
|
||||||
|
|
||||||
|
// set GUI language on load
|
||||||
|
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
||||||
|
OSRM.Localization.setLanguage("cs");
|
||||||
@@ -21,23 +21,27 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.Localization["de"] = {
|
OSRM.Localization["de"] = {
|
||||||
// own language
|
// own language
|
||||||
|
"CULTURE": "de-DE",
|
||||||
"LANGUAGE": "Deutsch",
|
"LANGUAGE": "Deutsch",
|
||||||
//gui
|
// gui
|
||||||
"GUI_START": "Start",
|
"GUI_START": "Start",
|
||||||
"GUI_END": "Ziel",
|
"GUI_END": "Ziel",
|
||||||
"GUI_RESET": "Reset",
|
"GUI_RESET": "Reset",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Zoom auf Route",
|
||||||
|
"GUI_ZOOM_ON_USER": "Zoom auf Anwender",
|
||||||
"GUI_SEARCH": "Zeigen",
|
"GUI_SEARCH": "Zeigen",
|
||||||
"GUI_REVERSE": "Umdrehen",
|
"GUI_REVERSE": "Umdrehen",
|
||||||
"GUI_START_TOOLTIP": "Startposition eingeben",
|
"GUI_START_TOOLTIP": "Startposition eingeben",
|
||||||
"GUI_END_TOOLTIP": "Zielposition eingeben",
|
"GUI_END_TOOLTIP": "Zielposition eingeben",
|
||||||
"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>",
|
"GUI_MAIN_WINDOW": "Hauptfenster",
|
||||||
//config
|
"GUI_ZOOM_IN": "Vergrößern",
|
||||||
|
"GUI_ZOOM_OUT": "Verkleinern",
|
||||||
|
// config
|
||||||
"GUI_CONFIGURATION": "Einstellungen",
|
"GUI_CONFIGURATION": "Einstellungen",
|
||||||
"GUI_LANGUAGE": "Sprache",
|
"GUI_LANGUAGE": "Sprache",
|
||||||
"GUI_UNITS": "Einheiten",
|
"GUI_UNITS": "Einheiten",
|
||||||
"GUI_KILOMETERS": "Kilometer",
|
"GUI_KILOMETERS": "Kilometer",
|
||||||
"GUI_MILES": "Meilen",
|
"GUI_MILES": "Meilen",
|
||||||
"GUI_DATA_TIMESTAMP": "data",
|
|
||||||
// mapping
|
// mapping
|
||||||
"GUI_MAPPING_TOOLS": "Kartenwerkzeuge",
|
"GUI_MAPPING_TOOLS": "Kartenwerkzeuge",
|
||||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Straßen hervorheben",
|
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Straßen hervorheben",
|
||||||
@@ -64,6 +68,8 @@ OSRM.Localization["de"] = {
|
|||||||
// printing
|
// printing
|
||||||
"OVERVIEW_MAP": "Übersichtskarte",
|
"OVERVIEW_MAP": "Übersichtskarte",
|
||||||
"NO_ROUTE_SELECTED": "Keine Route ausgewählt",
|
"NO_ROUTE_SELECTED": "Keine Route ausgewählt",
|
||||||
|
//routing engines
|
||||||
|
"ENGINE_0": "Auto (schnellste)",
|
||||||
// directions
|
// directions
|
||||||
"N": "Norden",
|
"N": "Norden",
|
||||||
"E": "Ost",
|
"E": "Ost",
|
||||||
@@ -83,9 +89,9 @@ OSRM.Localization["de"] = {
|
|||||||
"DIRECTION_3":"Rechts abbiegen[ auf <b>%s</b>]",
|
"DIRECTION_3":"Rechts abbiegen[ auf <b>%s</b>]",
|
||||||
"DIRECTION_4":"Scharf rechts abbiegen[ auf <b>%s</b>]",
|
"DIRECTION_4":"Scharf rechts abbiegen[ auf <b>%s</b>]",
|
||||||
"DIRECTION_5":"Wenden[ 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_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_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-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",
|
"DIRECTION_11-2":"In den Kreisverkehr einfahren und bei zweiter Möglichkeit[ in Richtung <b>%s</b>] verlassen",
|
||||||
|
|||||||
@@ -21,23 +21,27 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.Localization["dk"] = {
|
OSRM.Localization["dk"] = {
|
||||||
// own language
|
// own language
|
||||||
|
"CULTURE": "da-DK",
|
||||||
"LANGUAGE": "Dansk",
|
"LANGUAGE": "Dansk",
|
||||||
//gui
|
// gui
|
||||||
"GUI_START": "Start",
|
"GUI_START": "Start",
|
||||||
"GUI_END": "Destination",
|
"GUI_END": "Destination",
|
||||||
"GUI_RESET": "Nulstil",
|
"GUI_RESET": "Nulstil",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Zoom på Rute",
|
||||||
|
"GUI_ZOOM_ON_USER": "Zoom på Bruger",
|
||||||
"GUI_SEARCH": "Vis",
|
"GUI_SEARCH": "Vis",
|
||||||
"GUI_REVERSE": "Omvendt",
|
"GUI_REVERSE": "Omvendt",
|
||||||
"GUI_START_TOOLTIP": "Indtast start",
|
"GUI_START_TOOLTIP": "Indtast start",
|
||||||
"GUI_END_TOOLTIP": "Indtast destination",
|
"GUI_END_TOOLTIP": "Indtast destination",
|
||||||
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting af <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder af <a href='http://www.osm.org/'>OSM</a>",
|
"GUI_MAIN_WINDOW": "Hovedvinduet",
|
||||||
//config
|
"GUI_ZOOM_IN": "Zoome ind",
|
||||||
|
"GUI_ZOOM_OUT": "Zoome ud",
|
||||||
|
// config
|
||||||
"GUI_CONFIGURATION": "Konfiguration",
|
"GUI_CONFIGURATION": "Konfiguration",
|
||||||
"GUI_LANGUAGE": "Sprog",
|
"GUI_LANGUAGE": "Sprog",
|
||||||
"GUI_UNITS": "Enheder",
|
"GUI_UNITS": "Enheder",
|
||||||
"GUI_KILOMETERS": "Kilometer",
|
"GUI_KILOMETERS": "Kilometer",
|
||||||
"GUI_MILES": "Miles",
|
"GUI_MILES": "Miles",
|
||||||
"GUI_DATA_TIMESTAMP": "data",
|
|
||||||
// mapping
|
// mapping
|
||||||
"GUI_MAPPING_TOOLS": "Kortlægnings værktøjer",
|
"GUI_MAPPING_TOOLS": "Kortlægnings værktøjer",
|
||||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Fremhæv unavngivne veje",
|
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Fremhæv unavngivne veje",
|
||||||
@@ -51,7 +55,7 @@ OSRM.Localization["dk"] = {
|
|||||||
"NO_RESULTS_FOUND": "Ingen resultater",
|
"NO_RESULTS_FOUND": "Ingen resultater",
|
||||||
"NO_RESULTS_FOUND_SOURCE": "Ingen resultater for start",
|
"NO_RESULTS_FOUND_SOURCE": "Ingen resultater for start",
|
||||||
"NO_RESULTS_FOUND_TARGET": "Ingen resultater for destination",
|
"NO_RESULTS_FOUND_TARGET": "Ingen resultater for destination",
|
||||||
//routing
|
// routing
|
||||||
"ROUTE_DESCRIPTION": "Rutebeskrivelse",
|
"ROUTE_DESCRIPTION": "Rutebeskrivelse",
|
||||||
"GET_LINK_TO_ROUTE": "Lav link",
|
"GET_LINK_TO_ROUTE": "Lav link",
|
||||||
"GENERATE_LINK_TO_ROUTE": "venter på link",
|
"GENERATE_LINK_TO_ROUTE": "venter på link",
|
||||||
@@ -61,9 +65,11 @@ OSRM.Localization["dk"] = {
|
|||||||
"DURATION": "Varighed",
|
"DURATION": "Varighed",
|
||||||
"YOUR_ROUTE_IS_BEING_COMPUTED": "Din rute bliver beregnet",
|
"YOUR_ROUTE_IS_BEING_COMPUTED": "Din rute bliver beregnet",
|
||||||
"NO_ROUTE_FOUND": "Ingen mulig rute fundet",
|
"NO_ROUTE_FOUND": "Ingen mulig rute fundet",
|
||||||
//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",
|
||||||
@@ -83,9 +89,9 @@ OSRM.Localization["dk"] = {
|
|||||||
"DIRECTION_3":"Drej til højre[ ad <b>%s</b>]",
|
"DIRECTION_3":"Drej til højre[ ad <b>%s</b>]",
|
||||||
"DIRECTION_4":"Drej skarpt 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_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_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_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-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>]",
|
"DIRECTION_11-2":"Kør ind i rundkørslen og tag anden udkørsel[ ad <b>%s</b>]",
|
||||||
@@ -100,6 +106,6 @@ OSRM.Localization["dk"] = {
|
|||||||
"DIRECTION_15":"Du er ankommet til din destination"
|
"DIRECTION_15":"Du er ankommet til din destination"
|
||||||
};
|
};
|
||||||
|
|
||||||
//set GUI language on load
|
// set GUI language on load
|
||||||
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
||||||
OSRM.Localization.setLanguage("dk");
|
OSRM.Localization.setLanguage("dk");
|
||||||
|
|||||||
@@ -21,23 +21,27 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.Localization["en"] = {
|
OSRM.Localization["en"] = {
|
||||||
// own language
|
// own language
|
||||||
|
"CULTURE": "en-US",
|
||||||
"LANGUAGE": "English",
|
"LANGUAGE": "English",
|
||||||
// gui
|
// gui
|
||||||
"GUI_START": "Start",
|
"GUI_START": "Start",
|
||||||
"GUI_END": "End",
|
"GUI_END": "End",
|
||||||
"GUI_RESET": " Reset ",
|
"GUI_RESET": " Reset ",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Zoom onto Route",
|
||||||
|
"GUI_ZOOM_ON_USER": "Zoom onto User",
|
||||||
"GUI_SEARCH": " Show ",
|
"GUI_SEARCH": " Show ",
|
||||||
"GUI_REVERSE": "Reverse",
|
"GUI_REVERSE": "Reverse",
|
||||||
"GUI_START_TOOLTIP": "Enter start",
|
"GUI_START_TOOLTIP": "Enter start",
|
||||||
"GUI_END_TOOLTIP": "Enter destination",
|
"GUI_END_TOOLTIP": "Enter destination",
|
||||||
"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>",
|
"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",
|
||||||
"GUI_UNITS": "Units",
|
"GUI_UNITS": "Units",
|
||||||
"GUI_KILOMETERS": "Kilometers",
|
"GUI_KILOMETERS": "Kilometers",
|
||||||
"GUI_MILES": "Miles",
|
"GUI_MILES": "Miles",
|
||||||
"GUI_DATA_TIMESTAMP": "data",
|
|
||||||
// mapping
|
// mapping
|
||||||
"GUI_MAPPING_TOOLS": "Mapping Tools",
|
"GUI_MAPPING_TOOLS": "Mapping Tools",
|
||||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets",
|
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets",
|
||||||
@@ -64,6 +68,8 @@ OSRM.Localization["en"] = {
|
|||||||
// printing
|
// printing
|
||||||
"OVERVIEW_MAP": "Overview Map",
|
"OVERVIEW_MAP": "Overview Map",
|
||||||
"NO_ROUTE_SELECTED": "No route selected",
|
"NO_ROUTE_SELECTED": "No route selected",
|
||||||
|
// routing engines
|
||||||
|
"ENGINE_0": "Car (fastest)",
|
||||||
// directions
|
// directions
|
||||||
"N": "north",
|
"N": "north",
|
||||||
"E": "east",
|
"E": "east",
|
||||||
@@ -77,27 +83,57 @@ OSRM.Localization["en"] = {
|
|||||||
// %s: road name
|
// %s: road name
|
||||||
// %d: direction
|
// %d: direction
|
||||||
// [*]: will only be printed when there actually is a road name
|
// [*]: will only be printed when there actually is a road name
|
||||||
"DIRECTION_0":"Unknown instruction[ on <b>%s</b>]",
|
"DIRECTION_0":"Unknown instruction[ onto <b>%s</b>]",
|
||||||
"DIRECTION_1":"Continue[ on <b>%s</b>]",
|
"DIRECTION_1":"Continue[ onto <b>%s</b>]",
|
||||||
"DIRECTION_2":"Turn slight right[ on <b>%s</b>]",
|
"DIRECTION_2":"Turn slight right[ onto <b>%s</b>]",
|
||||||
"DIRECTION_3":"Turn right[ on <b>%s</b>]",
|
"DIRECTION_3":"Turn right[ onto <b>%s</b>]",
|
||||||
"DIRECTION_4":"Turn sharp right[ on <b>%s</b>]",
|
"DIRECTION_4":"Turn sharp right[ onto <b>%s</b>]",
|
||||||
"DIRECTION_5":"U-Turn[ on <b>%s</b>]",
|
"DIRECTION_5":"U-Turn[ onto <b>%s</b>]",
|
||||||
"DIRECTION_6":"Turn slight left[ on <b>%s</b>]",
|
"DIRECTION_6":"Turn sharp left[ onto <b>%s</b>]",
|
||||||
"DIRECTION_7":"Turn left[ on <b>%s</b>]",
|
"DIRECTION_7":"Turn left[ onto <b>%s</b>]",
|
||||||
"DIRECTION_8":"Turn sharp left[ on <b>%s</b>]",
|
"DIRECTION_8":"Turn slight left[ onto <b>%s</b>]",
|
||||||
"DIRECTION_10":"Head <b>%d</b>[ on <b>%s</b>]",
|
"DIRECTION_10":"Head <b>%d</b>[ onto <b>%s</b>]",
|
||||||
"DIRECTION_11-1":"Enter roundabout and leave at first exit[ on <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[ on <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[ on <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[ on <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[ on <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[ on <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[ on <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[ on <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[ on <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[ on <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"
|
"DIRECTION_15":"You have reached your destination",
|
||||||
|
// notifications
|
||||||
|
"NOTIFICATION_MAINTENANCE_HEADER": "Scheduled Maintenance",
|
||||||
|
"NOTIFICATION_MAINTENANCE_BODY": "The OSRM Website is down for a scheduled maintenance. " +
|
||||||
|
"Please be patient while required updates are performed. " +
|
||||||
|
"The site will be back online shortly." +
|
||||||
|
"<br/><br/>" +
|
||||||
|
"In the meantime you may want to go out an map a friendly neighborhood near you..." +
|
||||||
|
"<br/><br/><br/>[OSRM]",
|
||||||
|
"NOTIFICATION_LOCALIZATION_HEADER": "Did you know? You can change the display language.",
|
||||||
|
"NOTIFICATION_LOCALIZATION_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.",
|
||||||
|
"NOTIFICATION_CLICKING_HEADER": "Did you know? You can click on the map to set route markers.",
|
||||||
|
"NOTIFICATION_CLICKING_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.",
|
||||||
|
"NOTIFICATION_DRAGGING_HEADER": "Did you know? You can drag each route marker on the map.",
|
||||||
|
"NOTIFICATION_DRAGGING_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! ",
|
||||||
|
// do not translate below this line
|
||||||
|
"GUI_LEGAL_NOTICE": "Routing by <a href='http://project-osrm.org/'>Project OSRM</a> - Geocoder by <a href='http://wiki.openstreetmap.org/wiki/Nominatim/'>Nominatim</a> - OSRM hosting by <a href='http://algo2.iti.kit.edu/'>KIT</a>",
|
||||||
|
"GUI_DATA_TIMESTAMP": "data: ",
|
||||||
|
"GUI_VERSION": "gui: ",
|
||||||
|
"QR": "QR"
|
||||||
};
|
};
|
||||||
|
|
||||||
// set GUI language on load
|
// set GUI language on load
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
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
|
||||||
|
"CULTURE": "es-ES",
|
||||||
|
"LANGUAGE": "Español",
|
||||||
|
// gui
|
||||||
|
"GUI_START": "Inicio",
|
||||||
|
"GUI_END": "Destino",
|
||||||
|
"GUI_RESET": "Borrar",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Zoom en la Ruta",
|
||||||
|
"GUI_ZOOM_ON_USER": "Zoom en Usuario",
|
||||||
|
"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_MAIN_WINDOW": "Ventana principal",
|
||||||
|
"GUI_ZOOM_IN": "Ampliar",
|
||||||
|
"GUI_ZOOM_OUT": "Alejar",
|
||||||
|
// config
|
||||||
|
"GUI_CONFIGURATION": "Configuración",
|
||||||
|
"GUI_LANGUAGE": "Idioma",
|
||||||
|
"GUI_UNITS": "Unidades",
|
||||||
|
"GUI_KILOMETERS": "Kilometros",
|
||||||
|
"GUI_MILES": "Millas",
|
||||||
|
// 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",
|
||||||
|
// routing engines
|
||||||
|
"ENGINE_0": "Coche (el más rápido)",
|
||||||
|
// 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");
|
||||||
@@ -21,23 +21,27 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.Localization["fi"] = {
|
OSRM.Localization["fi"] = {
|
||||||
// own language
|
// own language
|
||||||
|
"CULTURE": "fi-FI",
|
||||||
"LANGUAGE": "Suomi",
|
"LANGUAGE": "Suomi",
|
||||||
//gui
|
// gui
|
||||||
"GUI_START": "Lähtöpaikka",
|
"GUI_START": "Lähtöpaikka",
|
||||||
"GUI_END": "Määränpää",
|
"GUI_END": "Määränpää",
|
||||||
"GUI_RESET": "Tyhjennä",
|
"GUI_RESET": "Tyhjennä",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Zoom reitillä",
|
||||||
|
"GUI_ZOOM_ON_USER": "Zoom käyttäjä",
|
||||||
"GUI_SEARCH": "Etsi",
|
"GUI_SEARCH": "Etsi",
|
||||||
"GUI_REVERSE": "Käänteinen reitti",
|
"GUI_REVERSE": "Käänteinen reitti",
|
||||||
"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_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>",
|
"GUI_MAIN_WINDOW": "Pääikkuna",
|
||||||
//config
|
"GUI_ZOOM_IN": "Lähennä",
|
||||||
|
"GUI_ZOOM_OUT": "Loitonna",
|
||||||
|
// config
|
||||||
"GUI_CONFIGURATION": "Kokoonpano",
|
"GUI_CONFIGURATION": "Kokoonpano",
|
||||||
"GUI_LANGUAGE": "Kieli",
|
"GUI_LANGUAGE": "Kieli",
|
||||||
"GUI_UNITS": "Yksiköt",
|
"GUI_UNITS": "Yksiköt",
|
||||||
"GUI_KILOMETERS": "Kilometri",
|
"GUI_KILOMETERS": "Kilometri",
|
||||||
"GUI_MILES": "Miles",
|
"GUI_MILES": "Miles",
|
||||||
"GUI_DATA_TIMESTAMP": "data",
|
|
||||||
// mapping
|
// mapping
|
||||||
"GUI_MAPPING_TOOLS": "Kartoitustyökalut",
|
"GUI_MAPPING_TOOLS": "Kartoitustyökalut",
|
||||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Korosta nimettömät tiet",
|
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Korosta nimettömät tiet",
|
||||||
@@ -51,7 +55,7 @@ OSRM.Localization["fi"] = {
|
|||||||
"NO_RESULTS_FOUND": "Ei hakutuloksia",
|
"NO_RESULTS_FOUND": "Ei hakutuloksia",
|
||||||
"NO_RESULTS_FOUND_SOURCE": "Ei hakutuloksia lähtöpaikka",
|
"NO_RESULTS_FOUND_SOURCE": "Ei hakutuloksia lähtöpaikka",
|
||||||
"NO_RESULTS_FOUND_TARGET": "Ei hakutuloksia määränpäälle",
|
"NO_RESULTS_FOUND_TARGET": "Ei hakutuloksia määränpäälle",
|
||||||
//routing
|
// routing
|
||||||
"ROUTE_DESCRIPTION": "Reittiohjeet",
|
"ROUTE_DESCRIPTION": "Reittiohjeet",
|
||||||
"GET_LINK_TO_ROUTE": "Luo linkki",
|
"GET_LINK_TO_ROUTE": "Luo linkki",
|
||||||
"GENERATE_LINK_TO_ROUTE": "odotetaan linkkiä",
|
"GENERATE_LINK_TO_ROUTE": "odotetaan linkkiä",
|
||||||
@@ -61,9 +65,11 @@ OSRM.Localization["fi"] = {
|
|||||||
"DURATION": "Aika",
|
"DURATION": "Aika",
|
||||||
"YOUR_ROUTE_IS_BEING_COMPUTED": "Reittiä lasketaan",
|
"YOUR_ROUTE_IS_BEING_COMPUTED": "Reittiä lasketaan",
|
||||||
"NO_ROUTE_FOUND": "Reittiä ei löytynyt",
|
"NO_ROUTE_FOUND": "Reittiä ei löytynyt",
|
||||||
//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",
|
||||||
@@ -83,9 +89,9 @@ OSRM.Localization["fi"] = {
|
|||||||
"DIRECTION_3":"Käänny oikealle[ tielle <b>%s</b>]",
|
"DIRECTION_3":"Käänny oikealle[ tielle <b>%s</b>]",
|
||||||
"DIRECTION_4":"Käänny jyrkästi 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_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_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_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-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>]",
|
"DIRECTION_11-2":"Aja liikenneympyrään ja poistu toisesta haarasta[ tielle <b>%s</b>]",
|
||||||
@@ -100,6 +106,6 @@ OSRM.Localization["fi"] = {
|
|||||||
"DIRECTION_15":"Saavuit määränpäähän"
|
"DIRECTION_15":"Saavuit määränpäähän"
|
||||||
};
|
};
|
||||||
|
|
||||||
//set GUI language tielle load
|
// set GUI language tielle load
|
||||||
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
||||||
OSRM.Localization.setLanguage("fi");
|
OSRM.Localization.setLanguage("fi");
|
||||||
|
|||||||
@@ -21,23 +21,27 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.Localization["fr"] = {
|
OSRM.Localization["fr"] = {
|
||||||
// own language
|
// own language
|
||||||
|
"CULTURE": "fr-FR",
|
||||||
"LANGUAGE": "Français",
|
"LANGUAGE": "Français",
|
||||||
//gui
|
//gui
|
||||||
"GUI_START": "Départ",
|
"GUI_START": "Départ",
|
||||||
"GUI_END": "Arrivée",
|
"GUI_END": "Arrivée",
|
||||||
"GUI_RESET": "Réinitialiser",
|
"GUI_RESET": "Réinitialiser",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Zoom sur la Route",
|
||||||
|
"GUI_ZOOM_ON_USER": "Zoom sur le Utilisateur",
|
||||||
"GUI_SEARCH": "Montrer",
|
"GUI_SEARCH": "Montrer",
|
||||||
"GUI_REVERSE": "Inverser",
|
"GUI_REVERSE": "Inverser",
|
||||||
"GUI_START_TOOLTIP": "Entrez le lieu de départ",
|
"GUI_START_TOOLTIP": "Entrez le lieu de départ",
|
||||||
"GUI_END_TOOLTIP": "Entrez le lieu d’arrivée",
|
"GUI_END_TOOLTIP": "Entrez le lieu d’arrivée",
|
||||||
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - hébergement par <a href='http://algo2.iti.kit.edu/'>KIT</a> - géocodage par <a href='http://www.osm.org/'>OSM</a>",
|
"GUI_MAIN_WINDOW": "Fenêtre principale",
|
||||||
//config
|
"GUI_ZOOM_IN": "Zoomer",
|
||||||
|
"GUI_ZOOM_OUT": "Rétrécir",
|
||||||
|
// config
|
||||||
"GUI_CONFIGURATION": "Configuration",
|
"GUI_CONFIGURATION": "Configuration",
|
||||||
"GUI_LANGUAGE": "Langue",
|
"GUI_LANGUAGE": "Langue",
|
||||||
"GUI_UNITS": "Unités",
|
"GUI_UNITS": "Unités",
|
||||||
"GUI_KILOMETERS": "Kilomètres",
|
"GUI_KILOMETERS": "Kilomètres",
|
||||||
"GUI_MILES": "Miles",
|
"GUI_MILES": "Miles",
|
||||||
"GUI_DATA_TIMESTAMP": "data",
|
|
||||||
// mapping
|
// mapping
|
||||||
"GUI_MAPPING_TOOLS": "Outils de cartographie",
|
"GUI_MAPPING_TOOLS": "Outils de cartographie",
|
||||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Surligner les rues sans nom",
|
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Surligner les rues sans nom",
|
||||||
@@ -51,7 +55,7 @@ OSRM.Localization["fr"] = {
|
|||||||
"NO_RESULTS_FOUND": "Aucun résultat trouvé",
|
"NO_RESULTS_FOUND": "Aucun résultat trouvé",
|
||||||
"NO_RESULTS_FOUND_SOURCE": "Aucun résultat pour le départ",
|
"NO_RESULTS_FOUND_SOURCE": "Aucun résultat pour le départ",
|
||||||
"NO_RESULTS_FOUND_TARGET": "Aucun résultat pour l'arrivée",
|
"NO_RESULTS_FOUND_TARGET": "Aucun résultat pour l'arrivée",
|
||||||
//routing
|
// routing
|
||||||
"ROUTE_DESCRIPTION": "Description de l’itinéraire",
|
"ROUTE_DESCRIPTION": "Description de l’itinéraire",
|
||||||
"GET_LINK_TO_ROUTE": "Générer un lien",
|
"GET_LINK_TO_ROUTE": "Générer un lien",
|
||||||
"GENERATE_LINK_TO_ROUTE": "en attente du lien",
|
"GENERATE_LINK_TO_ROUTE": "en attente du lien",
|
||||||
@@ -61,9 +65,11 @@ OSRM.Localization["fr"] = {
|
|||||||
"DURATION": "Durée",
|
"DURATION": "Durée",
|
||||||
"YOUR_ROUTE_IS_BEING_COMPUTED": "Votre itinéraire est en cours de calcul",
|
"YOUR_ROUTE_IS_BEING_COMPUTED": "Votre itinéraire est en cours de calcul",
|
||||||
"NO_ROUTE_FOUND": "Pas d’itinéraire possible",
|
"NO_ROUTE_FOUND": "Pas d’itinéraire possible",
|
||||||
//printing
|
// printing
|
||||||
"OVERVIEW_MAP": "Carte",
|
"OVERVIEW_MAP": "Carte",
|
||||||
"NO_ROUTE_SELECTED": "Pas d’itinéraire choisi",
|
"NO_ROUTE_SELECTED": "Pas d’itinéraire choisi",
|
||||||
|
// routing engines
|
||||||
|
"ENGINE_0": "voiture (le plus rapide)",
|
||||||
// directions
|
// directions
|
||||||
"N": "nord",
|
"N": "nord",
|
||||||
"E": "est",
|
"E": "est",
|
||||||
@@ -82,9 +88,9 @@ OSRM.Localization["fr"] = {
|
|||||||
"DIRECTION_3":"Tournez à droite[ sur <b>%s</b>]",
|
"DIRECTION_3":"Tournez à droite[ sur <b>%s</b>]",
|
||||||
"DIRECTION_4":"Tournez fortement à droite[ sur <b>%s</b>]",
|
"DIRECTION_4":"Tournez fortement à droite[ sur <b>%s</b>]",
|
||||||
"DIRECTION_5":"Faites demi-tour[ 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_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_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-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>]",
|
"DIRECTION_11-2":"Au rond-point, prenez la deuxième sortie[ sur <b>%s</b>]",
|
||||||
@@ -99,6 +105,6 @@ OSRM.Localization["fr"] = {
|
|||||||
"DIRECTION_15":"Vous êtes arrivé"
|
"DIRECTION_15":"Vous êtes arrivé"
|
||||||
};
|
};
|
||||||
|
|
||||||
//set GUI language on load
|
// set GUI language on load
|
||||||
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
||||||
OSRM.Localization.setLanguage("fr");
|
OSRM.Localization.setLanguage("fr");
|
||||||
|
|||||||
@@ -21,27 +21,31 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.Localization["it"] = {
|
OSRM.Localization["it"] = {
|
||||||
// own language
|
// own language
|
||||||
|
"CULTURE": "it-IT",
|
||||||
"LANGUAGE": "Italiano",
|
"LANGUAGE": "Italiano",
|
||||||
//gui
|
// gui
|
||||||
"GUI_START": "Partenza",
|
"GUI_START": "Partenza",
|
||||||
"GUI_END": "Destinazione",
|
"GUI_END": "Destinazione",
|
||||||
"GUI_RESET": "Reset",
|
"GUI_RESET": "Reset",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Zoom su Percorso",
|
||||||
|
"GUI_ZOOM_ON_USER": "Zoom su Utente",
|
||||||
"GUI_SEARCH": "Mostra",
|
"GUI_SEARCH": "Mostra",
|
||||||
"GUI_REVERSE": "Inverti",
|
"GUI_REVERSE": "Inverti",
|
||||||
"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_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>",
|
"GUI_MAIN_WINDOW": "Finestra principale",
|
||||||
//config
|
"GUI_ZOOM_IN": "Ingrandire",
|
||||||
|
"GUI_ZOOM_OUT": "Diminuire",
|
||||||
|
// config
|
||||||
"GUI_CONFIGURATION": "Configurazione",
|
"GUI_CONFIGURATION": "Configurazione",
|
||||||
"GUI_LANGUAGE": "Lingua",
|
"GUI_LANGUAGE": "Lingua",
|
||||||
"GUI_UNITS": "Unità",
|
"GUI_UNITS": "Unità",
|
||||||
"GUI_KILOMETERS": "Chilometri",
|
"GUI_KILOMETERS": "Chilometri",
|
||||||
"GUI_MILES": "Miles",
|
"GUI_MILES": "Miles",
|
||||||
"GUI_DATA_TIMESTAMP": "data",
|
|
||||||
// mapping
|
// mapping
|
||||||
"GUI_MAPPING_TOOLS": "Strumenti per la Mappatura",
|
"GUI_MAPPING_TOOLS": "Strumenti per la Mappatura",
|
||||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Evidenzia strade senza nome",
|
"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_JOSM": "JOSM",
|
||||||
"OPEN_OSMBUGS": "OSM Bugs",
|
"OPEN_OSMBUGS": "OSM Bugs",
|
||||||
// geocoder
|
// geocoder
|
||||||
@@ -51,7 +55,7 @@ OSRM.Localization["it"] = {
|
|||||||
"NO_RESULTS_FOUND": "Nessun risultato trovato",
|
"NO_RESULTS_FOUND": "Nessun risultato trovato",
|
||||||
"NO_RESULTS_FOUND_SOURCE": "Nessun risultato trovato per la partenza",
|
"NO_RESULTS_FOUND_SOURCE": "Nessun risultato trovato per la partenza",
|
||||||
"NO_RESULTS_FOUND_TARGET": "Nessun risultato trovato per la destinazione",
|
"NO_RESULTS_FOUND_TARGET": "Nessun risultato trovato per la destinazione",
|
||||||
//routing
|
// routing
|
||||||
"ROUTE_DESCRIPTION": "Descrizione del percorso",
|
"ROUTE_DESCRIPTION": "Descrizione del percorso",
|
||||||
"GET_LINK_TO_ROUTE": "Genera un Link",
|
"GET_LINK_TO_ROUTE": "Genera un Link",
|
||||||
"GENERATE_LINK_TO_ROUTE": "in attesa del link",
|
"GENERATE_LINK_TO_ROUTE": "in attesa del link",
|
||||||
@@ -61,8 +65,10 @@ OSRM.Localization["it"] = {
|
|||||||
"DURATION": "Durata",
|
"DURATION": "Durata",
|
||||||
"YOUR_ROUTE_IS_BEING_COMPUTED": "Sto calcolando il tuo percorso",
|
"YOUR_ROUTE_IS_BEING_COMPUTED": "Sto calcolando il tuo percorso",
|
||||||
"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",
|
||||||
@@ -82,9 +88,9 @@ OSRM.Localization["it"] = {
|
|||||||
"DIRECTION_3":"Girare a destra[ su <b>%s</b>]",
|
"DIRECTION_3":"Girare a destra[ su <b>%s</b>]",
|
||||||
"DIRECTION_4":"Girare decisamente 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_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_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_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-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>]",
|
"DIRECTION_11-2":"Immettersi nella rotonda ed abbandonarla alla seconda uscita[ su <b>%s</b>]",
|
||||||
@@ -99,6 +105,6 @@ OSRM.Localization["it"] = {
|
|||||||
"DIRECTION_15":"Hai raggiunto la tua destinazione"
|
"DIRECTION_15":"Hai raggiunto la tua destinazione"
|
||||||
};
|
};
|
||||||
|
|
||||||
//set GUI language on load
|
// set GUI language on load
|
||||||
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
||||||
OSRM.Localization.setLanguage("it");
|
OSRM.Localization.setLanguage("it");
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
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
|
||||||
|
"CULTURE": "lv-LV",
|
||||||
|
"LANGUAGE": "Latviešu",
|
||||||
|
// gui
|
||||||
|
"GUI_START": "Sākums",
|
||||||
|
"GUI_END": "Galamērķis",
|
||||||
|
"GUI_RESET": " Reset ",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Padidinti ant Route",
|
||||||
|
"GUI_ZOOM_ON_USER": "Padidinti ant Lietotājs",
|
||||||
|
"GUI_SEARCH": " Rādīt ",
|
||||||
|
"GUI_REVERSE": "Pretējā virzienā",
|
||||||
|
"GUI_START_TOOLTIP": "Izvēlieties sākumu",
|
||||||
|
"GUI_END_TOOLTIP": "Izvēlieties galamērķi",
|
||||||
|
"GUI_MAIN_WINDOW": "Galvenais logs",
|
||||||
|
"GUI_ZOOM_IN": "Palielinātu",
|
||||||
|
"GUI_ZOOM_OUT": "Attālinātu",
|
||||||
|
// config
|
||||||
|
"GUI_CONFIGURATION": "Konfigurācija",
|
||||||
|
"GUI_LANGUAGE": "Valoda",
|
||||||
|
"GUI_UNITS": "Mērvienība",
|
||||||
|
"GUI_KILOMETERS": "Kilometri",
|
||||||
|
"GUI_MILES": "Jūdzes",
|
||||||
|
// 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",
|
||||||
|
// routing engines
|
||||||
|
"ENGINE_0": "Auto (ātrākais)",
|
||||||
|
// 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");
|
||||||
@@ -21,23 +21,27 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.Localization["pl"] = {
|
OSRM.Localization["pl"] = {
|
||||||
// own language
|
// own language
|
||||||
|
"CULTURE": "pl-PL",
|
||||||
"LANGUAGE": "Polski",
|
"LANGUAGE": "Polski",
|
||||||
//gui
|
// gui
|
||||||
"GUI_START": "Początek",
|
"GUI_START": "Początek",
|
||||||
"GUI_END": "Koniec",
|
"GUI_END": "Koniec",
|
||||||
"GUI_RESET": "Reset",
|
"GUI_RESET": "Reset",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "Zoom na Trasy",
|
||||||
|
"GUI_ZOOM_ON_USER": "Zoom na Użytkownik",
|
||||||
"GUI_SEARCH": "Pokaż",
|
"GUI_SEARCH": "Pokaż",
|
||||||
"GUI_REVERSE": "Odwróć",
|
"GUI_REVERSE": "Odwróć",
|
||||||
"GUI_START_TOOLTIP": "Wprowadź początek",
|
"GUI_START_TOOLTIP": "Wprowadź początek",
|
||||||
"GUI_END_TOOLTIP": "Wprowadź koniec",
|
"GUI_END_TOOLTIP": "Wprowadź koniec",
|
||||||
"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting: <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder: <a href='http://www.osm.org/'>OSM</a>",
|
"GUI_MAIN_WINDOW": "Główne okno",
|
||||||
//config
|
"GUI_ZOOM_IN": "Powiększyć",
|
||||||
|
"GUI_ZOOM_OUT": "Pomniejszyć",
|
||||||
|
// config
|
||||||
"GUI_CONFIGURATION": "Konfiguracja",
|
"GUI_CONFIGURATION": "Konfiguracja",
|
||||||
"GUI_LANGUAGE": "Język",
|
"GUI_LANGUAGE": "Język",
|
||||||
"GUI_UNITS": "Jednostki",
|
"GUI_UNITS": "Jednostki",
|
||||||
"GUI_KILOMETERS": "Kilometrów",
|
"GUI_KILOMETERS": "Kilometrów",
|
||||||
"GUI_MILES": "Miles",
|
"GUI_MILES": "Miles",
|
||||||
"GUI_DATA_TIMESTAMP": "data",
|
|
||||||
// mapping
|
// mapping
|
||||||
"GUI_MAPPING_TOOLS": "Narzędzia mapowania",
|
"GUI_MAPPING_TOOLS": "Narzędzia mapowania",
|
||||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Zaznacz ulice bez nazwy",
|
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Zaznacz ulice bez nazwy",
|
||||||
@@ -51,7 +55,7 @@ OSRM.Localization["pl"] = {
|
|||||||
"NO_RESULTS_FOUND": "Brak wyników",
|
"NO_RESULTS_FOUND": "Brak wyników",
|
||||||
"NO_RESULTS_FOUND_SOURCE": "Brak wyników dla początku trasy",
|
"NO_RESULTS_FOUND_SOURCE": "Brak wyników dla początku trasy",
|
||||||
"NO_RESULTS_FOUND_TARGET": "Brak wyników dla końca trasy",
|
"NO_RESULTS_FOUND_TARGET": "Brak wyników dla końca trasy",
|
||||||
//routing
|
// routing
|
||||||
"ROUTE_DESCRIPTION": "Opis trasy",
|
"ROUTE_DESCRIPTION": "Opis trasy",
|
||||||
"GET_LINK_TO_ROUTE": "Generuj link",
|
"GET_LINK_TO_ROUTE": "Generuj link",
|
||||||
"GENERATE_LINK_TO_ROUTE": "oczekiwanie na link",
|
"GENERATE_LINK_TO_ROUTE": "oczekiwanie na link",
|
||||||
@@ -61,8 +65,10 @@ OSRM.Localization["pl"] = {
|
|||||||
"DURATION": "Czas",
|
"DURATION": "Czas",
|
||||||
"YOUR_ROUTE_IS_BEING_COMPUTED": "Twoja trasa została wyznaczona",
|
"YOUR_ROUTE_IS_BEING_COMPUTED": "Twoja trasa została wyznaczona",
|
||||||
"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",
|
||||||
@@ -82,9 +88,9 @@ OSRM.Localization["pl"] = {
|
|||||||
"DIRECTION_3":"Skręć w prawo[ na drogę <b>%s</b>]",
|
"DIRECTION_3":"Skręć w prawo[ na drogę <b>%s</b>]",
|
||||||
"DIRECTION_4":"Skręć ostro 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_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_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_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-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>]",
|
"DIRECTION_11-2":"Wjedź na rondo, zjedź drugim zjazdem[ na drogę <b>%s</b>]",
|
||||||
@@ -99,6 +105,6 @@ OSRM.Localization["pl"] = {
|
|||||||
"DIRECTION_15":"Cel został osiągnięty"
|
"DIRECTION_15":"Cel został osiągnięty"
|
||||||
};
|
};
|
||||||
|
|
||||||
//set GUI language on load
|
// set GUI language on load
|
||||||
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true )
|
||||||
OSRM.Localization.setLanguage("pl");
|
OSRM.Localization.setLanguage("pl");
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
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
|
||||||
|
"CULTURE": "ru-RU",
|
||||||
|
"LANGUAGE": "Русский",
|
||||||
|
// gui
|
||||||
|
"GUI_START": "Начало",
|
||||||
|
"GUI_END": "Конец",
|
||||||
|
"GUI_RESET": "Сброс",
|
||||||
|
"GUI_ZOOM_ON_ROUTE": "зум на маршрут",
|
||||||
|
"GUI_ZOOM_ON_USER": "зум на Пользователь",
|
||||||
|
"GUI_SEARCH": "Показать",
|
||||||
|
"GUI_REVERSE": "Обратно",
|
||||||
|
"GUI_START_TOOLTIP": "Укажите начальную точку",
|
||||||
|
"GUI_END_TOOLTIP": "Укажите пункт назначения",
|
||||||
|
"GUI_MAIN_WINDOW": "Главное окно",
|
||||||
|
"GUI_ZOOM_IN": "Yвеличить",
|
||||||
|
"GUI_ZOOM_OUT": "Mасштаб",
|
||||||
|
// config
|
||||||
|
"GUI_CONFIGURATION": "Настройки",
|
||||||
|
"GUI_LANGUAGE": "Язык",
|
||||||
|
"GUI_UNITS": "Единицы",
|
||||||
|
"GUI_KILOMETERS": "Километры",
|
||||||
|
"GUI_MILES": "Мили",
|
||||||
|
// 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": "Маршрут не выбран",
|
||||||
|
// routing engines
|
||||||
|
"ENGINE_0": "Aвтомобиля (быстрый)",
|
||||||
|
// 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");
|
||||||
@@ -42,29 +42,36 @@ init: function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// generate selectors
|
// generate selectors
|
||||||
OSRM.GUI.selectorInit("gui-language-toggle", options, 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.setLanguage);
|
OSRM.GUI.selectorInit("gui-language-2-toggle", options_2, selected, OSRM.Localization.setLanguageWrapper);
|
||||||
|
|
||||||
// set default language
|
// set default language
|
||||||
OSRM.Localization.setLanguage( OSRM.DEFAULTS.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) {
|
setLanguage: function(language) {
|
||||||
// change value of both language selectors
|
// change value of both language selectors
|
||||||
OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language );
|
OSRM.GUI.selectorChange( 'gui-language-toggle', language );
|
||||||
OSRM.GUI.selectorChange( document.getElementById('gui-language-2-toggle'), language );
|
OSRM.GUI.selectorChange( 'gui-language-2-toggle', language );
|
||||||
|
|
||||||
if( OSRM.Localization[language]) {
|
if( OSRM.Localization[language]) {
|
||||||
OSRM.Localization.current_language = language;
|
OSRM.Localization.current_language = language;
|
||||||
// change gui language
|
// change gui language
|
||||||
OSRM.GUI.setLabels();
|
OSRM.GUI.setLabels();
|
||||||
// change map language
|
// change map language
|
||||||
|
for(var i=0, size=OSRM.G.localizable_maps.length; i<size; i++) {
|
||||||
|
OSRM.G.localizable_maps[i].options.culture = OSRM.loc("CULTURE");
|
||||||
|
}
|
||||||
if(OSRM.G.map.layerControl.getActiveLayer().redraw)
|
if(OSRM.G.map.layerControl.getActiveLayer().redraw)
|
||||||
OSRM.G.map.layerControl.getActiveLayer().redraw();
|
OSRM.G.map.layerControl.getActiveLayer().redraw();
|
||||||
// requery data
|
// requery data
|
||||||
if( OSRM.G.markers == null )
|
if( OSRM.G.markers == null )
|
||||||
return;
|
return;
|
||||||
if( OSRM.G.markers.route.length > 1)
|
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 != "" ) {
|
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.SOURCE_LABEL, document.getElementById("gui-input-source").value );
|
||||||
OSRM.Geocoder.call( OSRM.C.TARGET_LABEL, document.getElementById("gui-input-target").value );
|
OSRM.Geocoder.call( OSRM.C.TARGET_LABEL, document.getElementById("gui-input-target").value );
|
||||||
@@ -100,4 +107,4 @@ translate: function(text) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// shorter call to translate function
|
// shorter call to translate function
|
||||||
OSRM.loc = OSRM.Localization.translate;
|
OSRM.loc = OSRM.Localization.translate;
|
||||||
|
|||||||
@@ -20,13 +20,15 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
/* fullscreen map */
|
/* fullscreen map */
|
||||||
html, body {
|
html, body
|
||||||
|
{
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
#map {
|
#map
|
||||||
|
{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
@@ -75,9 +77,9 @@ html, body {
|
|||||||
position:absolute;
|
position:absolute;
|
||||||
background-color:#ffffff;
|
background-color:#ffffff;
|
||||||
background-color:rgba(255,255,255,1);
|
background-color:rgba(255,255,255,1);
|
||||||
border-radius:10px;
|
border-radius:8px;
|
||||||
-moz-border-radius:10px;
|
-moz-border-radius:8px;
|
||||||
-webkit-border-radius:10px;
|
-webkit-border-radius:8px;
|
||||||
margin:5px;
|
margin:5px;
|
||||||
padding:5px;
|
padding:5px;
|
||||||
}
|
}
|
||||||
@@ -214,18 +216,9 @@ html, body {
|
|||||||
|
|
||||||
|
|
||||||
/* styles for main-input input-mask-options */
|
/* styles for main-input input-mask-options */
|
||||||
#gui-options-toggle
|
#gui-engine-toggle
|
||||||
{
|
{
|
||||||
cursor:pointer;
|
max-width: 200px;
|
||||||
color:#0000ff
|
|
||||||
}
|
|
||||||
#gui-options-toggle:hover
|
|
||||||
{
|
|
||||||
color:#ff0000
|
|
||||||
}
|
|
||||||
#options-box
|
|
||||||
{
|
|
||||||
visibility:hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -281,23 +274,28 @@ html, body {
|
|||||||
|
|
||||||
|
|
||||||
/* styles for main-output information-box -> workaround for invisible scrollbars in Chrome */
|
/* styles for main-output information-box -> workaround for invisible scrollbars in Chrome */
|
||||||
#information-box::-webkit-scrollbar {
|
#information-box::-webkit-scrollbar
|
||||||
|
{
|
||||||
height: 10px;
|
height: 10px;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
}
|
}
|
||||||
#information-box::-webkit-scrollbar-track {
|
#information-box::-webkit-scrollbar-track
|
||||||
|
{
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
}
|
}
|
||||||
#information-box::-webkit-scrollbar-thumb {
|
#information-box::-webkit-scrollbar-thumb
|
||||||
|
{
|
||||||
min-height: 30px;
|
min-height: 30px;
|
||||||
background: #EEEEEE;
|
background: #EEEEEE;
|
||||||
border: 1px solid #999999;
|
border: 1px solid #999999;
|
||||||
-webkit-border-radius: 5ex;
|
-webkit-border-radius: 5ex;
|
||||||
}
|
}
|
||||||
#information-box::-webkit-scrollbar-thumb:hover {
|
#information-box::-webkit-scrollbar-thumb:hover
|
||||||
|
{
|
||||||
background: #F9F9F9;
|
background: #F9F9F9;
|
||||||
}
|
}
|
||||||
#information-box::-webkit-scrollbar-thumb:active {
|
#information-box::-webkit-scrollbar-thumb:active
|
||||||
|
{
|
||||||
background: #F4F4F4;
|
background: #F4F4F4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,14 +325,14 @@ html, body {
|
|||||||
.results-body-counter
|
.results-body-counter
|
||||||
{
|
{
|
||||||
text-align:right;
|
text-align:right;
|
||||||
vertical-align:top;
|
vertical-align:middle;
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
padding:1px 5px 1px 5px;
|
padding:1px 5px 1px 5px;
|
||||||
}
|
}
|
||||||
.results-body-items
|
.results-body-items
|
||||||
{
|
{
|
||||||
text-align:left;
|
text-align:left;
|
||||||
vertical-align: middle;
|
vertical-align:top;
|
||||||
width:100%;
|
width:100%;
|
||||||
padding:1px;
|
padding:1px;
|
||||||
}
|
}
|
||||||
@@ -347,6 +345,10 @@ html, body {
|
|||||||
{
|
{
|
||||||
color:#ff0000
|
color:#ff0000
|
||||||
}
|
}
|
||||||
|
.results-body-item-remark
|
||||||
|
{
|
||||||
|
color:#999999
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* style for main-output information-box -> table (driving directions) */
|
/* style for main-output information-box -> table (driving directions) */
|
||||||
@@ -425,7 +427,7 @@ html, body {
|
|||||||
width:390px;
|
width:390px;
|
||||||
height:80px;
|
height:80px;
|
||||||
}
|
}
|
||||||
#notification-wrapper
|
#exclusive-notification-wrapper
|
||||||
{
|
{
|
||||||
width:600px;
|
width:600px;
|
||||||
height:170px;
|
height:170px;
|
||||||
@@ -434,12 +436,12 @@ html, body {
|
|||||||
margin-top:-85px;
|
margin-top:-85px;
|
||||||
margin-left:-300px;
|
margin-left:-300px;
|
||||||
}
|
}
|
||||||
#notification-content
|
#exclusive-notification-content
|
||||||
{
|
{
|
||||||
width:580px;
|
width:580px;
|
||||||
height:150px;
|
height:150px;
|
||||||
}
|
}
|
||||||
#notification-blanket
|
#exclusive-notification-blanket
|
||||||
{
|
{
|
||||||
position:absolute;
|
position:absolute;
|
||||||
top:0px;
|
top:0px;
|
||||||
@@ -451,6 +453,21 @@ html, body {
|
|||||||
z-index:100;
|
z-index:100;
|
||||||
display:none;
|
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 */
|
/* styles for content of other gui boxes */
|
||||||
@@ -475,10 +492,29 @@ html, body {
|
|||||||
{
|
{
|
||||||
width:100px;
|
width:100px;
|
||||||
}
|
}
|
||||||
.mapping-checkbox
|
#config-timestamps
|
||||||
{
|
{
|
||||||
margin: 0px 5px 3px 5px;
|
display:table;
|
||||||
|
position:absolute;
|
||||||
|
right: 5px; /* equal to box-content padding */
|
||||||
|
bottom: 5px;
|
||||||
|
}
|
||||||
|
#mapping-checkboxes
|
||||||
|
{
|
||||||
|
margin-top: -2px;
|
||||||
|
}
|
||||||
|
#mapping-checkboxes input
|
||||||
|
{
|
||||||
|
cursor:pointer;
|
||||||
|
position: relative;
|
||||||
|
margin: 0px 5px 5px 5px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
top: 3px;
|
||||||
|
}
|
||||||
|
#mapping-checkboxes label
|
||||||
|
{
|
||||||
|
display: block;
|
||||||
|
vertical-align:middle;
|
||||||
}
|
}
|
||||||
.mapping-button
|
.mapping-button
|
||||||
{
|
{
|
||||||
@@ -491,6 +527,111 @@ html, body {
|
|||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/* map buttons */
|
||||||
|
.gui-control-wrapper
|
||||||
|
{
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
.gui-control
|
||||||
|
{
|
||||||
|
cursor:pointer;
|
||||||
|
position:relative;
|
||||||
|
background-position: 50% 50%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.gui-control-inactive {
|
||||||
|
cursor:default;
|
||||||
|
position:relative;
|
||||||
|
background-position: 50% 50%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* zoom buttons */
|
||||||
|
.gui-zoom-in,
|
||||||
|
.gui-zoom-out
|
||||||
|
{
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
}
|
||||||
|
.leaflet-touch .gui-zoom-in,
|
||||||
|
.leaflet-touch .gui-zoom-out
|
||||||
|
{
|
||||||
|
width: 23px;
|
||||||
|
height: 23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* locations buttons */
|
||||||
|
.gui-locations-user,
|
||||||
|
.gui-locations-route,
|
||||||
|
.gui-locations-user-inactive,
|
||||||
|
.gui-locations-route-inactive
|
||||||
|
{
|
||||||
|
float:left;
|
||||||
|
width: 26px;
|
||||||
|
height: 26px;
|
||||||
|
}
|
||||||
|
.leaflet-touch .gui-locations-user,
|
||||||
|
.leaflet-touch .gui-locations-route,
|
||||||
|
.leaflet-touch .gui-locations-user-inactive,
|
||||||
|
.leaflet-touch .gui-locations-route-inactive
|
||||||
|
{
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* layer selection */
|
||||||
|
.gui-layers
|
||||||
|
{
|
||||||
|
width: 26px;
|
||||||
|
height: 26px;
|
||||||
|
}
|
||||||
|
.leaflet-touch .gui-layers
|
||||||
|
{
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
.gui-layers-expanded .gui-layers
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gui-layers-list
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.gui-layers-expanded .gui-layers-list
|
||||||
|
{
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.gui-layers-list input
|
||||||
|
{
|
||||||
|
cursor:pointer;
|
||||||
|
margin-top: 2px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
.gui-layers-list label
|
||||||
|
{
|
||||||
|
cursor:pointer;
|
||||||
|
display: block;
|
||||||
|
vertical-align:middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gui-layers-separator
|
||||||
|
{
|
||||||
|
height: 0;
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
margin: 5px -10px 5px -6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
/* buttons */
|
/* buttons */
|
||||||
.button
|
.button
|
||||||
{
|
{
|
||||||
@@ -517,6 +658,36 @@ html, body {
|
|||||||
background-color:#F4F4F4;
|
background-color:#F4F4F4;
|
||||||
color:#FF0000;
|
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 */
|
/* iconic buttons */
|
||||||
@@ -538,6 +709,7 @@ html, body {
|
|||||||
/* styled select */
|
/* styled select */
|
||||||
.styled-select-helper
|
.styled-select-helper
|
||||||
{
|
{
|
||||||
|
position:relative;
|
||||||
border: 0px;
|
border: 0px;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -547,6 +719,7 @@ html, body {
|
|||||||
}
|
}
|
||||||
.styled-select
|
.styled-select
|
||||||
{
|
{
|
||||||
|
text-align:left;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
background-repeat:no-repeat;
|
background-repeat:no-repeat;
|
||||||
background-position: top right;
|
background-position: top right;
|
||||||
@@ -554,17 +727,6 @@ html, body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* checkboxes */
|
|
||||||
input[type=checkbox],
|
|
||||||
{
|
|
||||||
cursor:pointer;
|
|
||||||
}
|
|
||||||
.checkbox-label
|
|
||||||
{
|
|
||||||
vertical-align:2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
/* utility styles */
|
/* utility styles */
|
||||||
@@ -574,23 +736,6 @@ input[type=checkbox],
|
|||||||
min-height:10px;
|
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 */
|
/* table styles */
|
||||||
@@ -633,23 +778,27 @@ input[type=checkbox],
|
|||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
/* fonts */
|
/* fonts */
|
||||||
.base-font {
|
.base-font
|
||||||
|
{
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
.big-font {
|
.big-font
|
||||||
|
{
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.medium-font {
|
.medium-font
|
||||||
|
{
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
font-size: 10.5px;
|
font-size: 10.5px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
.small-font {
|
.small-font
|
||||||
|
{
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,11 +37,9 @@ 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.DashedPolyline.js" type="text/javascript"></script>
|
<script src="base/leaflet/L.LabelMarkerIcon.js" type="text/javascript"></script>
|
||||||
<script src="base/leaflet/L.MouseMarker.js" type="text/javascript"></script>
|
<script src="base/leaflet/L.BingLayer.js" type="text/javascript"></script>
|
||||||
<script src="base/leaflet/L.SwitchableIcon.js" type="text/javascript"></script>
|
|
||||||
<script src="base/leaflet/L.TileLayer.Bing.js" type="text/javascript"></script>
|
|
||||||
|
|
||||||
<script src="OSRM.base.js" type="text/javascript"></script>
|
<script src="OSRM.base.js" type="text/javascript"></script>
|
||||||
<script src="OSRM.config.js" type="text/javascript"></script>
|
<script src="OSRM.config.js" type="text/javascript"></script>
|
||||||
@@ -51,7 +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.MapView.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.Zoom.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>
|
||||||
|
|
||||||
@@ -64,10 +65,13 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
<script src="gui/OSRM.GUIBoxHandle.js" type="text/javascript"></script>
|
<script src="gui/OSRM.GUIBoxHandle.js" type="text/javascript"></script>
|
||||||
<script src="gui/OSRM.Selector.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.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.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.RoutingDescription.js" type="text/javascript"></script>
|
||||||
<script src="routing/OSRM.RoutingGeometry.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>
|
<script src="gui/OSRM.RoutingGUI.js" type="text/javascript"></script>
|
||||||
|
<script src="gui/OSRM.RoutingEngineGUI.js" type="text/javascript"></script>
|
||||||
<script src="routing/OSRM.RoutingNoNames.js" type="text/javascript"></script>
|
<script src="routing/OSRM.RoutingNoNames.js" type="text/javascript"></script>
|
||||||
<script src="base/OSRM.Via.js" type="text/javascript"></script>
|
<script src="base/OSRM.Via.js" type="text/javascript"></script>
|
||||||
<script src="base/OSRM.Geocoder.js" type="text/javascript"></script>
|
<script src="base/OSRM.Geocoder.js" type="text/javascript"></script>
|
||||||
@@ -81,27 +85,41 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
|
|
||||||
<!-- body -->
|
<!-- body -->
|
||||||
<body class="base-font not-selectable">
|
<body class="base-font">
|
||||||
|
|
||||||
<!-- map -->
|
<!-- map -->
|
||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<!-- notification -->
|
<!-- exclusive notification -->
|
||||||
<div id="notification-blanket">
|
<div id="exclusive-notification-blanket">
|
||||||
<div id="notification-wrapper" class="box-wrapper not-selectable">
|
<div id="exclusive-notification-wrapper" class="box-wrapper not-selectable">
|
||||||
<div id="notification-content" class="box-content">
|
<div id="exclusive-notification-content" class="box-content">
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<div id="notification-toggle" class="iconic-button cancel-marker top-right-button"></div>
|
<div id="exclusive-notification-toggle" class="iconic-button cancel-marker top-right-button"></div>
|
||||||
<div id="notification-label" class="box-label">Notification</div>
|
<div id="exclusive-notification-label" class="box-label">Notification</div>
|
||||||
|
|
||||||
<!-- notification text -->
|
<!-- notification text -->
|
||||||
<div id="notification-box"></div>
|
<div id="exclusive-notification-box"></div>
|
||||||
</div>
|
</div>
|
||||||
</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 -->
|
<!-- 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">
|
<div id="config-content" class="box-content">
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<div id="config-toggle" class="iconic-button cancel-marker top-right-button"></div>
|
<div id="config-toggle" class="iconic-button cancel-marker top-right-button"></div>
|
||||||
@@ -119,39 +137,48 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- data timestamp -->
|
<!-- gui & data timestamps -->
|
||||||
<div class="full">
|
<div id="config-timestamps">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="right small-font"><span id="gui-data-timestamp">data: n/a</span></div>
|
<div class="right small-font"><span id="gui-timestamp-label">gui:</span></div>
|
||||||
|
<div class="right small-font"><span id="gui-timestamp">v0.0.0 010180</span></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="right small-font"><span id="gui-data-timestamp-label">data:</span></div>
|
||||||
|
<div class="right small-font"><span id="gui-data-timestamp">n/a</span></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- mapping gui -->
|
<!-- 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">
|
<div id="mapping-content" class="box-content">
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<div id="mapping-toggle" class="iconic-button cancel-marker top-right-button"></div>
|
<div id="mapping-toggle" class="iconic-button cancel-marker top-right-button"></div>
|
||||||
<div id="gui-mapping-label" class="box-label">Mapping Tools</div>
|
<div id="gui-mapping-label" class="box-label">Mapping Tools</div>
|
||||||
|
|
||||||
<!-- header -->
|
<!-- mapping options -->
|
||||||
<div class="full">
|
<form id="mapping-checkboxes" class="small-font">
|
||||||
<div class="row">
|
<div>
|
||||||
<div class="left"><input type="checkbox" id="option-highlight-nonames" value="highlight-nonames" class="mapping-checkbox"/></div>
|
<label id="gui-option-highlight-nonames-label">
|
||||||
<div class="left stretch"><span id="gui-option-highlight-nonames-label" class="checkbox-label small-font">Highlight unnamed streets</span></div>
|
<input type="checkbox" id="option-highlight-nonames" value="show-previous-routes"/>
|
||||||
</div>
|
Highlight unnamed streets
|
||||||
<div class="row">
|
</label>
|
||||||
<div class="left"><input type="checkbox" id="option-show-previous-routes" value="show-previous-routes" class="mapping-checkbox"/></div>
|
<label id="gui-option-show-previous-routes-label">
|
||||||
<div class="left stretch"><span id="gui-option-show-previous-routes-label" class="checkbox-label small-font">Show previous routes</span></div>
|
<input type="checkbox" id="option-show-previous-routes" value="show-previous-routes"/>
|
||||||
</div>
|
Show previous routes
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- off-site links -->
|
||||||
<a class="button mapping-button" id="open-osmbugs">OSM Bugs</a><span class="quad mapping-button"></span><a class="button mapping-button" id="open-josm">JOSM</a>
|
<a class="button mapping-button" id="open-osmbugs">OSM Bugs</a><span class="quad mapping-button"></span><a class="button mapping-button" id="open-josm">JOSM</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- main gui -->
|
<!-- main gui -->
|
||||||
<div id="main-wrapper" class="box-wrapper not-selectable">
|
<div id="main-wrapper" class="box-wrapper">
|
||||||
|
|
||||||
<!-- input box -->
|
<!-- input box -->
|
||||||
<div id="main-input" class="box-content">
|
<div id="main-input" class="box-content">
|
||||||
@@ -184,10 +211,13 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
<!-- action buttons -->
|
<!-- action buttons -->
|
||||||
<div class="full">
|
<div class="full">
|
||||||
|
<div class="row">
|
||||||
<div class="left"><a class="button" id="gui-reset">Reset</a></div>
|
<div class="left"><a class="button" id="gui-reset">Reset</a></div>
|
||||||
|
<div class="center"><select id="gui-engine-toggle" class="engine-select"></select></div>
|
||||||
<div class="right"><a class="button" id="gui-reverse">Reverse</a></div>
|
<div class="right"><a class="button" id="gui-reverse">Reverse</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- output box -->
|
<!-- output box -->
|
||||||
|
|||||||
@@ -29,10 +29,11 @@ OSRM.init = function() {
|
|||||||
OSRM.Map.init();
|
OSRM.Map.init();
|
||||||
OSRM.Printing.init();
|
OSRM.Printing.init();
|
||||||
OSRM.Routing.init();
|
OSRM.Routing.init();
|
||||||
|
OSRM.RoutingAlternatives.init();
|
||||||
OSRM.Localization.init();
|
OSRM.Localization.init();
|
||||||
|
|
||||||
// stop if in maintenance mode
|
// stop if in maintenance mode
|
||||||
if( OSRM.inMaintenance() == true )
|
if( OSRM.GUI.inMaintenance() == true )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// check if the URL contains some GET parameter, e.g. for showing a route
|
// check if the URL contains some GET parameter, e.g. for showing a route
|
||||||
@@ -41,6 +42,9 @@ OSRM.init = function() {
|
|||||||
// only init default position / geolocation position if GET parameters do not specify a different one
|
// only init default position / geolocation position if GET parameters do not specify a different one
|
||||||
if( OSRM.G.initial_position_override == false )
|
if( OSRM.G.initial_position_override == false )
|
||||||
OSRM.Map.initPosition();
|
OSRM.Map.initPosition();
|
||||||
|
|
||||||
|
// finalize initialization of map
|
||||||
|
OSRM.Map.initFinally();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -63,6 +67,12 @@ OSRM.prefetchImages = function() {
|
|||||||
{id:'restore', url:'images/restore.png'},
|
{id:'restore', url:'images/restore.png'},
|
||||||
{id:'restore_active', url:'images/restore_active.png'},
|
{id:'restore_active', url:'images/restore_active.png'},
|
||||||
{id:'restore_hover', url:'images/restore_hover.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', url:'images/config.png'},
|
||||||
{id:'config_active', url:'images/config_active.png'},
|
{id:'config_active', url:'images/config_active.png'},
|
||||||
{id:'config_hover', url:'images/config_hover.png'},
|
{id:'config_hover', url:'images/config_hover.png'},
|
||||||
@@ -73,15 +83,30 @@ OSRM.prefetchImages = function() {
|
|||||||
{id:'printer_active', url:'images/printer_active.png'},
|
{id:'printer_active', url:'images/printer_active.png'},
|
||||||
{id:'printer_hover', url:'images/printer_hover.png'},
|
{id:'printer_hover', url:'images/printer_hover.png'},
|
||||||
{id:'printer_inactive', url:'images/printer_inactive.png'},
|
{id:'printer_inactive', url:'images/printer_inactive.png'},
|
||||||
|
{id:'zoom_in', url:'images/zoom_in.png'},
|
||||||
|
{id:'zoom_in_active', url:'images/zoom_in_active.png'},
|
||||||
|
{id:'zoom_in_hover', url:'images/zoom_in_hover.png'},
|
||||||
|
{id:'zoom_out', url:'images/zoom_out.png'},
|
||||||
|
{id:'zoom_out_active', url:'images/zoom_out_active.png'},
|
||||||
|
{id:'zoom_out_hover', url:'images/zoom_out_hover.png'},
|
||||||
|
{id:'locations_user', url:'images/locations_user.png'},
|
||||||
|
{id:'locations_user_active', url:'images/locations_user_active.png'},
|
||||||
|
{id:'locations_user_hover', url:'images/locations_user_hover.png'},
|
||||||
|
{id:'locations_user_inactive', url:'images/locations_user_inactive.png'},
|
||||||
|
{id:'locations_route', url:'images/locations_route.png'},
|
||||||
|
{id:'locations_route_active', url:'images/locations_route_active.png'},
|
||||||
|
{id:'locations_route_hover', url:'images/locations_route_hover.png'},
|
||||||
|
{id:'locations_route_inactive', url:'images/locations_route_inactive.png'},
|
||||||
|
{id:'layers', url:'images/layers.png'},
|
||||||
{id:'direction_0', url:'images/default.png'},
|
{id:'direction_0', url:'images/default.png'},
|
||||||
{id:'direction_1', url:'images/continue.png'},
|
{id:'direction_1', url:'images/continue.png'},
|
||||||
{id:'direction_2', url:'images/slight-right.png'},
|
{id:'direction_2', url:'images/slight-right.png'},
|
||||||
{id:'direction_3', url:'images/turn-right.png'},
|
{id:'direction_3', url:'images/turn-right.png'},
|
||||||
{id:'direction_4', url:'images/sharp-right.png'},
|
{id:'direction_4', url:'images/sharp-right.png'},
|
||||||
{id:'direction_5', url:'images/u-turn.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_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_10', url:'images/head.png'},
|
||||||
{id:'direction_11', url:'images/round-about.png'},
|
{id:'direction_11', url:'images/round-about.png'},
|
||||||
{id:'direction_15', url:'images/target.png'},
|
{id:'direction_15', url:'images/target.png'},
|
||||||
@@ -109,47 +134,79 @@ OSRM.prefetchIcons = function() {
|
|||||||
{id:'marker-highlight-drag', image_id:'marker-highlight-drag'}
|
{id:'marker-highlight-drag', image_id:'marker-highlight-drag'}
|
||||||
//{id:'marker-drag', image_id:'marker-drag'} // special treatment because of size
|
//{id:'marker-drag', image_id:'marker-drag'} // special treatment because of size
|
||||||
];
|
];
|
||||||
|
|
||||||
|
var LabelMarkerIcon = L.LabelMarkerIcon.extend({
|
||||||
|
options: {
|
||||||
|
shadowUrl: OSRM.G.images["marker-shadow"].getAttribute("src"),
|
||||||
|
iconSize: [25, 41],
|
||||||
|
shadowSize: [41, 41],
|
||||||
|
iconAnchor: [13, 41],
|
||||||
|
shadowAnchor: [13, 41],
|
||||||
|
popupAnchor: [0, -33]
|
||||||
|
} });
|
||||||
for(var i=0; i<icon_list.length; i++) {
|
for(var i=0; i<icon_list.length; i++) {
|
||||||
var icon = {
|
OSRM.G.icons[icon_list[i].id] = new LabelMarkerIcon({iconUrl: OSRM.G.images[icon_list[i].image_id].getAttribute("src")});
|
||||||
iconUrl: OSRM.G.images[icon_list[i].image_id].getAttribute("src"), iconSize: new L.Point(25, 41), iconAnchor: new L.Point(13, 41),
|
|
||||||
shadowUrl: OSRM.G.images["marker-shadow"].getAttribute("src"), shadowSize: new L.Point(41, 41),
|
|
||||||
popupAnchor: new L.Point(0, -33)
|
|
||||||
};
|
|
||||||
OSRM.G.icons[icon_list[i].id] = new L.SwitchableIcon(icon);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// special values for drag marker
|
// special values for drag marker
|
||||||
OSRM.G.icons['marker-drag'] = new L.SwitchableIcon( {iconUrl: OSRM.G.images["marker-drag"].getAttribute("src"), iconSize: new L.Point(18, 18) } );
|
OSRM.G.icons['marker-drag'] = new L.LabelMarkerIcon( {iconUrl: OSRM.G.images["marker-drag"].getAttribute("src"), iconSize: new L.Point(18, 18) } );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// set css styles for images
|
// set css styles for images
|
||||||
OSRM.prefetchCSSIcons = function() {
|
OSRM.prefetchCSSIcons = function() {
|
||||||
var css_list = [
|
var css_list = [
|
||||||
{ id:'#gui-printer-inactive', image_id:'printer_inactive'},
|
{ id:'#gui-printer-inactive', image_id:'printer_inactive'},
|
||||||
{ id:'#gui-printer', image_id:'printer'},
|
{ id:'#gui-printer', image_id:'printer'},
|
||||||
{ id:'#gui-printer:hover', image_id:'printer_hover'},
|
{ id:'#gui-printer:hover', image_id:'printer_hover'},
|
||||||
{ id:'#gui-printer:active', image_id:'printer_active'},
|
{ id:'#gui-printer:active', image_id:'printer_active'},
|
||||||
|
|
||||||
|
{ id:'.gui-zoom-in', image_id:'zoom_in'},
|
||||||
|
{ id:'.gui-zoom-in:hover', image_id:'zoom_in_hover'},
|
||||||
|
{ id:'.gui-zoom-in:active', image_id:'zoom_in_active'},
|
||||||
|
|
||||||
{ id:'.cancel-marker', image_id:'cancel'},
|
{ id:'.gui-zoom-out', image_id:'zoom_out'},
|
||||||
{ id:'.cancel-marker:hover', image_id:'cancel_hover'},
|
{ id:'.gui-zoom-out:hover', image_id:'zoom_out_hover'},
|
||||||
{ id:'.cancel-marker:active', image_id:'cancel_active'},
|
{ id:'.gui-zoom-out:active', image_id:'zoom_out_active'},
|
||||||
|
|
||||||
{ id:'#input-mask-header', image_id:'osrm-logo'},
|
{ id:'.gui-locations-user-inactive', image_id:'locations_user_inactive'},
|
||||||
{ id:'.styled-select', image_id:'selector'},
|
{ id:'.gui-locations-user', image_id:'locations_user'},
|
||||||
|
{ id:'.gui-locations-user:hover', image_id:'locations_user_hover'},
|
||||||
|
{ id:'.gui-locations-user:active', image_id:'locations_user_active'},
|
||||||
|
|
||||||
{ id:'#config-handle-icon', image_id:'config'},
|
{ id:'.gui-locations-route-inactive', image_id:'locations_route_inactive'},
|
||||||
{ id:'#config-handle-icon:hover', image_id:'config_hover'},
|
{ id:'.gui-locations-route', image_id:'locations_route'},
|
||||||
{ id:'#config-handle-icon:active', image_id:'config_active'},
|
{ id:'.gui-locations-route:hover', image_id:'locations_route_hover'},
|
||||||
|
{ id:'.gui-locations-route:active', image_id:'locations_route_active'},
|
||||||
|
|
||||||
|
{ id:'.gui-layers', image_id:'layers'},
|
||||||
|
|
||||||
|
{ id:'.cancel-marker', image_id:'cancel'},
|
||||||
|
{ 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'},
|
||||||
|
|
||||||
|
{ id:'#config-handle-icon', image_id:'config'},
|
||||||
|
{ id:'#config-handle-icon:hover', image_id:'config_hover'},
|
||||||
|
{ id:'#config-handle-icon:active', image_id:'config_active'},
|
||||||
|
|
||||||
{ id:'#mapping-handle-icon', image_id:'mapping'},
|
{ id:'#mapping-handle-icon', image_id:'mapping'},
|
||||||
{ id:'#mapping-handle-icon:hover', image_id:'mapping_hover'},
|
{ id:'#mapping-handle-icon:hover', image_id:'mapping_hover'},
|
||||||
{ id:'#mapping-handle-icon:active', image_id:'mapping_active'},
|
{ id:'#mapping-handle-icon:active', image_id:'mapping_active'},
|
||||||
|
|
||||||
{ id:'#main-handle-icon', image_id:'restore'},
|
{ id:'#main-handle-icon', image_id:'restore'},
|
||||||
{ id:'#main-handle-icon:hover', image_id:'restore_hover'},
|
{ id:'#main-handle-icon:hover', image_id:'restore_hover'},
|
||||||
{ id:'#main-handle-icon:active', image_id:'restore_active'}
|
{ id:'#main-handle-icon:active', image_id:'restore_active'}
|
||||||
];
|
];
|
||||||
|
|
||||||
var stylesheet = OSRM.CSS.getStylesheet("main.css");
|
var stylesheet = OSRM.CSS.getStylesheet("main.css");
|
||||||
@@ -187,7 +244,7 @@ OSRM.parseParameters = function(){
|
|||||||
var type = parseInt(name_val[1]);
|
var type = parseInt(name_val[1]);
|
||||||
if(type != 0 && type != 1)
|
if(type != 0 && type != 1)
|
||||||
return;
|
return;
|
||||||
OSRM.Utils.setToHumanDistanceFunction(type);
|
OSRM.GUI.setDistanceFormat(type);
|
||||||
}
|
}
|
||||||
else if(name_val[0] == 'loc') {
|
else if(name_val[0] == 'loc') {
|
||||||
var coordinates = unescape(name_val[1]).split(',');
|
var coordinates = unescape(name_val[1]).split(',');
|
||||||
@@ -200,7 +257,7 @@ OSRM.parseParameters = function(){
|
|||||||
var coordinates = unescape(name_val[1]).split(',');
|
var coordinates = unescape(name_val[1]).split(',');
|
||||||
if(coordinates.length!=2 || !OSRM.Utils.isLatitude(coordinates[0]) || !OSRM.Utils.isLongitude(coordinates[1]) )
|
if(coordinates.length!=2 || !OSRM.Utils.isLatitude(coordinates[0]) || !OSRM.Utils.isLongitude(coordinates[1]) )
|
||||||
return;
|
return;
|
||||||
params.destination = new L.LatLng( coordinates[0], coordinates[1]);
|
params.destination = new L.LatLng( coordinates[0], coordinates[1] );
|
||||||
}
|
}
|
||||||
else if(name_val[0] == 'destname') {
|
else if(name_val[0] == 'destname') {
|
||||||
params.destination_name = decodeURI(name_val[1]).replace(/<\/?[^>]+(>|$)/g ,""); // discard tags
|
params.destination_name = decodeURI(name_val[1]).replace(/<\/?[^>]+(>|$)/g ,""); // discard tags
|
||||||
@@ -216,12 +273,24 @@ OSRM.parseParameters = function(){
|
|||||||
if(coordinates.length!=2 || !OSRM.Utils.isLatitude(coordinates[0]) || !OSRM.Utils.isLongitude(coordinates[1]) )
|
if(coordinates.length!=2 || !OSRM.Utils.isLatitude(coordinates[0]) || !OSRM.Utils.isLongitude(coordinates[1]) )
|
||||||
return;
|
return;
|
||||||
params.center = new L.LatLng( coordinates[0], coordinates[1]);
|
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;
|
||||||
|
}
|
||||||
|
else if(name_val[0] == 're') {
|
||||||
|
var active_routing_engine = Number(name_val[1]);
|
||||||
|
if( active_routing_engine<0 || active_routing_engine>=OSRM.DEFAULTS.ROUTING_ENGINES.length)
|
||||||
|
return;
|
||||||
|
params.active_routing_engine = active_routing_engine;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// case 1: destination given
|
// case 1: destination given
|
||||||
if( params.destination ) {
|
if( params.destination ) {
|
||||||
var index = OSRM.G.markers.setTarget( params.destination.latlng );
|
var index = OSRM.G.markers.setTarget( params.destination );
|
||||||
if( params.destination_name )
|
if( params.destination_name )
|
||||||
document.getElementById("gui-input-target").value = params.destination_name;
|
document.getElementById("gui-input-target").value = params.destination_name;
|
||||||
else
|
else
|
||||||
@@ -255,9 +324,15 @@ OSRM.parseParameters = function(){
|
|||||||
} else {
|
} else {
|
||||||
OSRM.G.map.setView(params.center, params.zoom);
|
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 || 0;
|
||||||
|
|
||||||
|
// set routing server
|
||||||
|
OSRM.GUI.setRoutingEngine( params.active_routing_engine || OSRM.DEFAULTS.ROUTING_ENGINE );
|
||||||
|
|
||||||
// compute route
|
// compute route
|
||||||
OSRM.Routing.getRoute();
|
OSRM.Routing.getRoute({keepAlternative:true});
|
||||||
OSRM.G.initial_position_override = true;
|
OSRM.G.initial_position_override = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -267,17 +342,5 @@ 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";
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// onload event
|
// onload event
|
||||||
OSRM.Browser.onLoadHandler( OSRM.init );
|
OSRM.Browser.onLoadHandler( OSRM.init );
|
||||||
|
|||||||
@@ -176,10 +176,11 @@ show: function(response) {
|
|||||||
print_window.document.getElementById('overview-map-description').innerHTML = '<table class="description medium-font">' + header + '</table>';
|
print_window.document.getElementById('overview-map-description').innerHTML = '<table class="description medium-font">' + header + '</table>';
|
||||||
|
|
||||||
// draw map
|
// draw map
|
||||||
var positions = OSRM.G.route.getPositions();
|
|
||||||
var tile_server_id = OSRM.G.map.getActiveLayerId();
|
var tile_server_id = OSRM.G.map.getActiveLayerId();
|
||||||
var zoom = print_window.OSRM.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], new L.LatLngBounds( positions ) );
|
var positions = OSRM.G.route.getPositions();
|
||||||
|
var bounds = new L.LatLngBounds( positions );
|
||||||
|
var zoom = print_window.OSRM.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], bounds );
|
||||||
|
|
||||||
// draw markers
|
// draw markers
|
||||||
print_window.OSRM.prefetchIcons( OSRM.G.images );
|
print_window.OSRM.prefetchIcons( OSRM.G.images );
|
||||||
print_window.OSRM.drawMarkers( OSRM.G.markers.route );
|
print_window.OSRM.drawMarkers( OSRM.G.markers.route );
|
||||||
@@ -187,13 +188,17 @@ show: function(response) {
|
|||||||
// draw route & query for better geometry
|
// draw route & query for better geometry
|
||||||
print_window.OSRM.drawRoute( positions );
|
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');
|
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() {},
|
timeoutRoute: function() {},
|
||||||
drawRoute: function(response) {
|
drawRoute: function(response) {
|
||||||
if(!response)
|
if(!response)
|
||||||
return;
|
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 );
|
OSRM.G.printwindow.OSRM.drawRoute( positions );
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -228,10 +233,13 @@ printWindowLoaded: function(){
|
|||||||
var stylesheet = OSRM.CSS.getStylesheet("printing.css", print_document);
|
var stylesheet = OSRM.CSS.getStylesheet("printing.css", print_document);
|
||||||
for(var i=0; i<css_list.length; i++) {
|
for(var i=0; i<css_list.length; i++) {
|
||||||
OSRM.CSS.insert( stylesheet, css_list[i].id, "background-image:url("+ OSRM.Printing.BASE_DIRECTORY + OSRM.G.images[css_list[i].image_id].getAttribute("src") + ");" );
|
OSRM.CSS.insert( stylesheet, css_list[i].id, "background-image:url("+ OSRM.Printing.BASE_DIRECTORY + OSRM.G.images[css_list[i].image_id].getAttribute("src") + ");" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// scale control
|
||||||
|
print_window.OSRM.G.active_distance_format = OSRM.G.active_distance_format;
|
||||||
|
|
||||||
// localization
|
// localization
|
||||||
print_window.OSRM.Localization.current_language = OSRM.Localization.current_language;
|
print_window.OSRM.G.Localization.culture = OSRM.loc("CULTURE");
|
||||||
print_document.getElementById('description-label').innerHTML = OSRM.loc( "ROUTE_DESCRIPTION" );
|
print_document.getElementById('description-label').innerHTML = OSRM.loc( "ROUTE_DESCRIPTION" );
|
||||||
print_document.getElementById('overview-map-label').innerHTML = OSRM.loc( "OVERVIEW_MAP" );
|
print_document.getElementById('overview-map-label').innerHTML = OSRM.loc( "OVERVIEW_MAP" );
|
||||||
if( !OSRM.G.route.isRoute() || !OSRM.G.route.isShown() ) { // error message if no route available (can trigger if user refreshes print-window)
|
if( !OSRM.G.route.isRoute() || !OSRM.G.route.isShown() ) { // error message if no route available (can trigger if user refreshes print-window)
|
||||||
|
|||||||
@@ -173,14 +173,6 @@ div.label
|
|||||||
min-width:10px;
|
min-width:10px;
|
||||||
min-height: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 {
|
@media print {
|
||||||
.pagebreak
|
.pagebreak
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,18 +36,17 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
<link rel="stylesheet" href="printing.css" type="text/css"/>
|
<link rel="stylesheet" href="printing.css" type="text/css"/>
|
||||||
|
|
||||||
<!-- scripts -->
|
<!-- scripts -->
|
||||||
<script src="printing.js" type="text/javascript"></script>
|
|
||||||
<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.DashedPolyline.js" type="text/javascript"></script>
|
<script src="printing.js" type="text/javascript"></script>
|
||||||
<script src="../base/leaflet/L.MouseMarker.js" type="text/javascript"></script>
|
<script src="../base/leaflet/L.LabelMarker.js" type="text/javascript"></script>
|
||||||
<script src="../base/leaflet/L.SwitchableIcon.js" type="text/javascript"></script>
|
<script src="../base/leaflet/L.LabelMarkerIcon.js" type="text/javascript"></script>
|
||||||
<script src="../base/leaflet/L.TileLayer.Bing.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>
|
||||||
|
|
||||||
|
|
||||||
<!-- body -->
|
<!-- body -->
|
||||||
<body class="base-font not-selectable">
|
<body class="base-font">
|
||||||
|
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<div id="printing-header" class="noprint">
|
<div id="printing-header" class="noprint">
|
||||||
|
|||||||
@@ -19,8 +19,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
// [for printing window]
|
// [for printing window]
|
||||||
|
|
||||||
OSRM = {};
|
OSRM = {};
|
||||||
|
OSRM.Control = {};
|
||||||
OSRM.GLOBALS = { main_handle:{boxVisible:function(){return false;}} }; // needed for fitBoundsUI to work
|
OSRM.GLOBALS = { main_handle:{boxVisible:function(){return false;}} }; // needed for fitBoundsUI to work
|
||||||
OSRM.Localization = { current_language:"en"}; // needed for localized map tiles
|
OSRM.GLOBALS.Localization = { culture:"en-US" }; // needed for localized map tiles
|
||||||
|
OSRM.GLOBALS.DISTANCE_FORMAT = 0; // needed for scale control
|
||||||
OSRM.G = OSRM.GLOBALS;
|
OSRM.G = OSRM.GLOBALS;
|
||||||
|
|
||||||
|
|
||||||
@@ -38,16 +40,19 @@ OSRM.prefetchIcons = function(images_list) {
|
|||||||
{id:'marker-via', image_id:'marker-via'},
|
{id:'marker-via', image_id:'marker-via'},
|
||||||
{id:'marker-highlight', image_id:'marker-highlight'}
|
{id:'marker-highlight', image_id:'marker-highlight'}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
var LabelMarkerIcon = L.LabelMarkerIcon.extend({
|
||||||
|
options: {
|
||||||
|
shadowUrl: images_list["marker-shadow"].src,
|
||||||
|
iconSize: [25, 41],
|
||||||
|
shadowSize: [41, 41],
|
||||||
|
iconAnchor: [13, 41],
|
||||||
|
shadowAnchor: [13, 41],
|
||||||
|
popupAnchor: [0, -33]
|
||||||
|
} });
|
||||||
for(var i=0; i<icon_list.length; i++) {
|
for(var i=0; i<icon_list.length; i++) {
|
||||||
var icon = {
|
OSRM.G.icons[icon_list[i].id] = new LabelMarkerIcon({iconUrl: images_list[icon_list[i].image_id].src });
|
||||||
// absolute directories used for compatibility with legacy IE (quirks mode)
|
}
|
||||||
iconUrl: images_list[icon_list[i].image_id].src, iconSize: new L.Point(25, 41), iconAnchor: new L.Point(13, 41),
|
|
||||||
shadowUrl: images_list["marker-shadow"].src, shadowSize: new L.Point(41, 41),
|
|
||||||
popupAnchor: new L.Point(0, -33)
|
|
||||||
};
|
|
||||||
OSRM.G.icons[icon_list[i].id] = new L.SwitchableIcon(icon);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -55,9 +60,10 @@ OSRM.prefetchIcons = function(images_list) {
|
|||||||
OSRM.drawMap = function(tile_server, bounds) {
|
OSRM.drawMap = function(tile_server, bounds) {
|
||||||
// setup map
|
// setup map
|
||||||
var tile_layer;
|
var tile_layer;
|
||||||
if( tile_server.bing ) tile_layer = new L.TileLayer.Bing(tile_server.apikey, tile_server.type, 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);
|
||||||
OSRM.G.map = new OSRM.MapView("overview-map", {
|
tile_layer.options.culture = OSRM.G.Localization.culture;
|
||||||
|
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,
|
||||||
@@ -71,34 +77,52 @@ OSRM.drawMap = function(tile_server, bounds) {
|
|||||||
doubleClickZoom:false
|
doubleClickZoom:false
|
||||||
});
|
});
|
||||||
|
|
||||||
OSRM.G.map.fitBoundsUI(bounds);
|
// add scale control
|
||||||
return OSRM.G.map.getBoundsZoom(bounds);
|
OSRM.G.map.scaleControl = new L.Control.Scale();
|
||||||
|
OSRM.G.map.scaleControl.options.metric = (OSRM.G.active_distance_format != 1);
|
||||||
|
OSRM.G.map.scaleControl.options.imperial = (OSRM.G.active_distance_format == 1);
|
||||||
|
OSRM.G.map.scaleControl.addTo(OSRM.G.map);
|
||||||
|
|
||||||
|
// need to rebuild objects for instanceof to work correctly
|
||||||
|
var converted_bounds = new L.LatLngBounds([bounds.getSouthWest().lat, bounds.getSouthWest().lng], [bounds.getNorthEast().lat, bounds.getNorthEast().lng]);
|
||||||
|
|
||||||
|
OSRM.G.map.fitBoundsUI(converted_bounds);
|
||||||
|
return OSRM.G.map.getBoundsZoom(converted_bounds);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// manage makers
|
// manage makers
|
||||||
OSRM.drawMarkers = function( markers ) {
|
OSRM.drawMarkers = function( markers ) {
|
||||||
OSRM.G.map.addLayer( new L.MouseMarker( markers[0].getPosition(), {draggable:false,clickable:false,icon:OSRM.G.icons['marker-source']} ) );
|
// need to rebuild objects for instanceof to work correctly
|
||||||
for(var i=1, size=markers.length-1; i<size; i++) {
|
OSRM.G.map.addLayer( new L.LabelMarker( [markers[0].getPosition().lat,markers[0].getPosition().lng] , {draggable:false,clickable:false,icon:OSRM.G.icons['marker-source']} ) );
|
||||||
var via_marker = new L.MouseMarker( markers[i].getPosition(), {draggable:false,clickable:false,icon:OSRM.G.icons['marker-via']} );
|
var last = markers.length-1;
|
||||||
|
for(var i=1; i<last; i++) {
|
||||||
|
var via_marker = new L.LabelMarker( [markers[i].getPosition().lat,markers[i].getPosition().lng], {draggable:false,clickable:false,icon:OSRM.G.icons['marker-via']} );
|
||||||
OSRM.G.map.addLayer( via_marker );
|
OSRM.G.map.addLayer( via_marker );
|
||||||
via_marker.setLabel(i);
|
via_marker.setLabel(i);
|
||||||
}
|
}
|
||||||
OSRM.G.map.addLayer( new L.MouseMarker( markers[markers.length-1].getPosition(), {draggable:false,clickable:false,icon:OSRM.G.icons['marker-target']} ) );
|
OSRM.G.map.addLayer( new L.LabelMarker( [markers[last].getPosition().lat,markers[last].getPosition().lng], {draggable:false,clickable:false,icon:OSRM.G.icons['marker-target']} ) );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// manage route
|
// manage route
|
||||||
OSRM.drawRoute = function( positions ) {
|
OSRM.drawRoute = function( positions ) {
|
||||||
if( OSRM.G.route == undefined )
|
if( OSRM.G.route == undefined )
|
||||||
OSRM.G.route = new L.DashedPolyline();
|
OSRM.G.route = new L.Polyline( [] );
|
||||||
OSRM.G.route.setLatLngs( positions );
|
|
||||||
OSRM.G.route.setStyle( {dashed:false,clickable:false,color:'#0033FF', weight:5} );
|
// need to rebuild objects for instanceof to work correctly
|
||||||
|
var converted_positions = [];
|
||||||
|
if( positions[0].lat ) // geometry returned by OSRM.G.route.getPositions -> original data
|
||||||
|
for(var i=0, size=positions.length; i<size; i++)
|
||||||
|
converted_positions.push( [positions[i].lat, positions[i].lng] );
|
||||||
|
else // geometry returned by OSRM.RoutingGeometry._decode -> requeried data
|
||||||
|
for(var i=0, size=positions.length; i<size; i++)
|
||||||
|
converted_positions.push( [positions[i][0], positions[i][1]] );
|
||||||
|
|
||||||
|
OSRM.G.route.setLatLngs( converted_positions );
|
||||||
|
OSRM.G.route.setStyle( {clickable:false,color:'#0033FF', weight:5, dashArray:""} );
|
||||||
OSRM.G.map.addLayer( OSRM.G.route );
|
OSRM.G.map.addLayer( OSRM.G.route );
|
||||||
};
|
};
|
||||||
OSRM.updateRoute = function( positions ) {
|
|
||||||
OSRM.G.route.setLatLngs( positions );
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// start populating the window when it is fully loaded - and only if it was loaded from OSRM
|
// start populating the window when it is fully loaded - and only if it was loaded from OSRM
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
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 CSS styles for qr codes */
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/* page setup */
|
||||||
|
body
|
||||||
|
{
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/* containers */
|
||||||
|
#qrcode-container
|
||||||
|
{
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
#qrcode-link
|
||||||
|
{
|
||||||
|
margin-top:10px;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* qrcode image for modern browsers */
|
||||||
|
#qrcode
|
||||||
|
{
|
||||||
|
display:block;
|
||||||
|
margin: 0px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* qrcode table for IE8 */
|
||||||
|
.qrcode
|
||||||
|
{
|
||||||
|
border-spacing:0px;
|
||||||
|
margin-left:auto;
|
||||||
|
margin-right:auto;
|
||||||
|
}
|
||||||
|
.black
|
||||||
|
{
|
||||||
|
background-color:#000000;
|
||||||
|
width:6px;
|
||||||
|
height:6px;
|
||||||
|
padding:0px;
|
||||||
|
}
|
||||||
|
.white
|
||||||
|
{
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
width:6px;
|
||||||
|
height:6px;
|
||||||
|
padding:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/* fonts */
|
||||||
|
.base-font
|
||||||
|
{
|
||||||
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- head -->
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<!-- metatags -->
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||||
|
<title>OSRM Website</title>
|
||||||
|
<meta name="description" content="OSRM Website"/>
|
||||||
|
<meta name="author" content="Dennis Schieferdecker" />
|
||||||
|
|
||||||
|
<!-- stylesheets -->
|
||||||
|
<link rel="stylesheet" href="qrcodes.css" type="text/css"/>
|
||||||
|
|
||||||
|
<!-- scripts -->
|
||||||
|
<script src="qrcodes.js" type="text/javascript"></script>
|
||||||
|
<script src="QRCode.js" type="text/javascript"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- body -->
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="qrcode-container"></div>
|
||||||
|
<div id="qrcode-link" class="base-font"></div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
The word "QR Code" is registered trademark of DENSO WAVE INCORPORATED.
|
||||||
|
http://www.denso-wave.com/qrcode/faqpatent-e.html
|
||||||
|
|
||||||
|
Coding ideas were taken from JavaScript-HTML5 QRCode Generator,
|
||||||
|
copyright (c) 2011 by Amanuel Tewolde, licensed under MIT license.
|
||||||
|
http://www.opensource.org/licenses/mit-license.php
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// initialization for QR Code window
|
||||||
|
// [qr code creation / error handling]
|
||||||
|
|
||||||
|
// build and show qr code
|
||||||
|
function createQRCode(text) {
|
||||||
|
// settings
|
||||||
|
var QRCodeVersion = 4;
|
||||||
|
var dotsize = 6;
|
||||||
|
|
||||||
|
// create qrcode
|
||||||
|
// [when storing longer strings, verify if QRCodeVersion is still sufficient -> catch errors]
|
||||||
|
var qrcode = new QRCode(QRCodeVersion, QRErrorCorrectLevel.H);
|
||||||
|
qrcode.addData(text);
|
||||||
|
qrcode.make();
|
||||||
|
var qrsize = qrcode.getModuleCount();
|
||||||
|
|
||||||
|
// HTML5 capable browsers
|
||||||
|
if( window.opener.OSRM.Browser.IE6_8 == -1 ) {
|
||||||
|
// fill canvas
|
||||||
|
var canvas = document.createElement("canvas");
|
||||||
|
canvas.setAttribute('height', dotsize*qrsize );
|
||||||
|
canvas.setAttribute('width', dotsize*qrsize );
|
||||||
|
|
||||||
|
var context = canvas.getContext('2d');
|
||||||
|
for (var x = 0; x < qrsize; x++)
|
||||||
|
for (var y = 0; y < qrsize; y++) {
|
||||||
|
if (qrcode.isDark(y, x))
|
||||||
|
context.fillStyle = "rgb(0,0,0)";
|
||||||
|
else
|
||||||
|
context.fillStyle = "rgb(255,255,255)";
|
||||||
|
context.fillRect ( x*dotsize, y*dotsize, dotsize, dotsize);
|
||||||
|
}
|
||||||
|
|
||||||
|
// create png
|
||||||
|
var image = document.createElement("img");
|
||||||
|
image.id = "qrcode";
|
||||||
|
image.src = canvas.toDataURL("image/png");
|
||||||
|
document.getElementById("qrcode-container").appendChild(image);
|
||||||
|
|
||||||
|
// IE8...
|
||||||
|
} else {
|
||||||
|
// fill table
|
||||||
|
var html = "";
|
||||||
|
html += "<table class='qrcode'>";
|
||||||
|
for (var y = 0; y < qrsize; y++) {
|
||||||
|
html += "<tr>";
|
||||||
|
for (var x = 0; x < qrsize; x++) {
|
||||||
|
if (qrcode.isDark(y, x))
|
||||||
|
html += "<td class='black'/>";
|
||||||
|
else
|
||||||
|
html += "<td class='white'/>";
|
||||||
|
}
|
||||||
|
html += "</tr>";
|
||||||
|
}
|
||||||
|
html += "</table>";
|
||||||
|
|
||||||
|
// add html to window
|
||||||
|
document.getElementById("qrcode-container").innerHTML = html;
|
||||||
|
}
|
||||||
|
document.getElementById("qrcode-link").innerHTML = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// populate window with qrcode or with error message
|
||||||
|
function onLoad() {
|
||||||
|
if( window.opener.OSRM.G.active_shortlink )
|
||||||
|
createQRCode(window.opener.OSRM.G.active_shortlink);
|
||||||
|
else
|
||||||
|
createErrorMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//start populating the window when it is fully loaded - and only if it was loaded from OSRM
|
||||||
|
if(window.opener && window.opener.OSRM)
|
||||||
|
window.opener.OSRM.Browser.onLoadHandler( onLoad, window );
|
||||||
@@ -31,9 +31,14 @@ OSRM.Routing = {
|
|||||||
|
|
||||||
// init routing data structures
|
// init routing data structures
|
||||||
init: function() {
|
init: function() {
|
||||||
|
// init variables
|
||||||
|
OSRM.GUI.setRoutingEngine( OSRM.DEFAULTS.ROUTING_ENGINE );
|
||||||
|
|
||||||
OSRM.G.markers = new OSRM.Markers();
|
OSRM.G.markers = new OSRM.Markers();
|
||||||
OSRM.G.route = new OSRM.Route();
|
OSRM.G.route = new OSRM.Route();
|
||||||
OSRM.G.response = { via_points:[] };
|
OSRM.G.response = { via_points:[] };
|
||||||
|
|
||||||
|
OSRM.RoutingDescription.init();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@@ -54,9 +59,11 @@ timeoutRoute_Reversed: function() {
|
|||||||
OSRM.G.markers.reverseMarkers();
|
OSRM.G.markers.reverseMarkers();
|
||||||
OSRM.Routing.timeoutRoute();
|
OSRM.Routing.timeoutRoute();
|
||||||
},
|
},
|
||||||
showRoute: function(response) {
|
showRoute: function(response, parameters) {
|
||||||
if(!response)
|
if(!response)
|
||||||
return;
|
return;
|
||||||
|
if( parameters.keepAlternative != true )
|
||||||
|
OSRM.G.active_alternative = 0;
|
||||||
|
|
||||||
OSRM.G.response = response; // needed for printing & history routes!
|
OSRM.G.response = response; // needed for printing & history routes!
|
||||||
if(response.status == 207) {
|
if(response.status == 207) {
|
||||||
@@ -65,12 +72,17 @@ showRoute: function(response) {
|
|||||||
OSRM.RoutingDescription.showNA( OSRM.loc("NO_ROUTE_FOUND") );
|
OSRM.RoutingDescription.showNA( OSRM.loc("NO_ROUTE_FOUND") );
|
||||||
OSRM.Routing._snapRoute();
|
OSRM.Routing._snapRoute();
|
||||||
} else {
|
} else {
|
||||||
OSRM.RoutingGeometry.show(response);
|
OSRM.RoutingAlternatives.prepare(OSRM.G.response);
|
||||||
OSRM.RoutingNoNames.show(response);
|
OSRM.RoutingGeometry.show(OSRM.G.response);
|
||||||
OSRM.RoutingDescription.show(response);
|
OSRM.RoutingNoNames.show(OSRM.G.response);
|
||||||
|
OSRM.RoutingDescription.show(OSRM.G.response);
|
||||||
OSRM.Routing._snapRoute();
|
OSRM.Routing._snapRoute();
|
||||||
}
|
}
|
||||||
OSRM.Routing._updateHints(response);
|
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) {
|
showRoute_Dragging: function(response) {
|
||||||
if(!response)
|
if(!response)
|
||||||
@@ -91,14 +103,17 @@ showRoute_Dragging: function(response) {
|
|||||||
if(OSRM.G.pending)
|
if(OSRM.G.pending)
|
||||||
setTimeout(OSRM.Routing.draggingTimeout,1);
|
setTimeout(OSRM.Routing.draggingTimeout,1);
|
||||||
},
|
},
|
||||||
showRoute_Redraw: function(response) {
|
showRoute_Redraw: function(response, parameters) {
|
||||||
if(!response)
|
if(!response)
|
||||||
return;
|
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) {
|
if(response.status != 207) {
|
||||||
OSRM.RoutingGeometry.show(response);
|
OSRM.RoutingAlternatives.prepare(OSRM.G.response);
|
||||||
OSRM.RoutingNoNames.show(response);
|
OSRM.RoutingGeometry.show(OSRM.G.response);
|
||||||
|
OSRM.RoutingNoNames.show(OSRM.G.response);
|
||||||
}
|
}
|
||||||
OSRM.Routing._updateHints(response);
|
OSRM.Routing._updateHints(response);
|
||||||
},
|
},
|
||||||
@@ -107,17 +122,19 @@ showRoute_Redraw: function(response) {
|
|||||||
//-- main function --
|
//-- main function --
|
||||||
|
|
||||||
//generate server calls to query routes
|
//generate server calls to query routes
|
||||||
getRoute: function() {
|
getRoute: function(parameters) {
|
||||||
|
|
||||||
// if source or target are not set -> hide route
|
// if source or target are not set -> hide route
|
||||||
if( OSRM.G.markers.route.length < 2 ) {
|
if( OSRM.G.markers.route.length < 2 ) {
|
||||||
OSRM.G.route.hideRoute();
|
OSRM.G.route.hideRoute();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parameters = parameters || {};
|
||||||
|
|
||||||
OSRM.JSONP.clear('dragging');
|
OSRM.JSONP.clear('dragging');
|
||||||
OSRM.JSONP.clear('redraw');
|
OSRM.JSONP.clear('redraw');
|
||||||
OSRM.JSONP.clear('route');
|
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() {
|
getRoute_Reversed: function() {
|
||||||
if( OSRM.G.markers.route.length < 2 )
|
if( OSRM.G.markers.route.length < 2 )
|
||||||
@@ -126,15 +143,17 @@ getRoute_Reversed: function() {
|
|||||||
OSRM.JSONP.clear('dragging');
|
OSRM.JSONP.clear('dragging');
|
||||||
OSRM.JSONP.clear('redraw');
|
OSRM.JSONP.clear('redraw');
|
||||||
OSRM.JSONP.clear('route');
|
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 )
|
if( OSRM.G.markers.route.length < 2 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
parameters = parameters || {};
|
||||||
|
|
||||||
OSRM.JSONP.clear('dragging');
|
OSRM.JSONP.clear('dragging');
|
||||||
OSRM.JSONP.clear('redraw');
|
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() {
|
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');;
|
OSRM.G.pending = !OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=false', OSRM.Routing.showRoute_Dragging, OSRM.Routing.timeoutRoute_Dragging, OSRM.DEFAULTS.JSONP_TIMEOUT, 'dragging');;
|
||||||
@@ -145,8 +164,8 @@ draggingTimeout: function() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_buildCall: function() {
|
_buildCall: function() {
|
||||||
var source = OSRM.DEFAULTS.HOST_ROUTING_URL;
|
var source = OSRM.G.active_routing_server_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)
|
if(OSRM.G.markers.checksum)
|
||||||
source += '&checksum=' + OSRM.G.markers.checksum;
|
source += '&checksum=' + OSRM.G.markers.checksum;
|
||||||
var markers = OSRM.G.markers.route;
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
@@ -21,6 +21,19 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
OSRM.RoutingDescription = {
|
OSRM.RoutingDescription = {
|
||||||
|
|
||||||
|
// directory with qrcodes files
|
||||||
|
QR_DIRECTORY: 'qrcodes/',
|
||||||
|
|
||||||
|
// initialization of required variables and events
|
||||||
|
init: function() {
|
||||||
|
OSRM.G.active_shortlink = null;
|
||||||
|
OSRM.Browser.onUnloadHandler( OSRM.RoutingDescription.uninit );
|
||||||
|
},
|
||||||
|
uninit: function() {
|
||||||
|
if( OSRM.G.qrcodewindow )
|
||||||
|
OSRM.G.qrcodewindow.close();
|
||||||
|
},
|
||||||
|
|
||||||
// route description events
|
// route description events
|
||||||
onClickRouteDescription: function(lat, lng) {
|
onClickRouteDescription: function(lat, lng) {
|
||||||
OSRM.G.markers.highlight.setPosition( new L.LatLng(lat, lng) );
|
OSRM.G.markers.highlight.setPosition( new L.LatLng(lat, lng) );
|
||||||
@@ -29,7 +42,9 @@ onClickRouteDescription: function(lat, lng) {
|
|||||||
},
|
},
|
||||||
onClickCreateShortcut: function(src){
|
onClickCreateShortcut: function(src){
|
||||||
src += '&z='+ OSRM.G.map.getZoom() + '¢er=' + OSRM.G.map.getCenter().lat.toFixed(6) + ',' + OSRM.G.map.getCenter().lng.toFixed(6);
|
src += '&z='+ OSRM.G.map.getZoom() + '¢er=' + OSRM.G.map.getCenter().lat.toFixed(6) + ',' + OSRM.G.map.getCenter().lng.toFixed(6);
|
||||||
src += '&df=' + OSRM.G.DISTANCE_FORMAT;
|
src += '&alt='+OSRM.G.active_alternative;
|
||||||
|
src += '&df=' + OSRM.G.active_distance_format;
|
||||||
|
src += '&re=' + OSRM.G.active_routing_engine;
|
||||||
|
|
||||||
var source = OSRM.DEFAULTS.SHORTENER_PARAMETERS.replace(/%url/, OSRM.DEFAULTS.HOST_SHORTENER_URL+src);
|
var source = OSRM.DEFAULTS.SHORTENER_PARAMETERS.replace(/%url/, OSRM.DEFAULTS.HOST_SHORTENER_URL+src);
|
||||||
|
|
||||||
@@ -37,19 +52,29 @@ onClickCreateShortcut: function(src){
|
|||||||
document.getElementById('route-link').innerHTML = '['+OSRM.loc("GENERATE_LINK_TO_ROUTE")+']';
|
document.getElementById('route-link').innerHTML = '['+OSRM.loc("GENERATE_LINK_TO_ROUTE")+']';
|
||||||
},
|
},
|
||||||
showRouteLink: function(response){
|
showRouteLink: function(response){
|
||||||
if(!response[OSRM.DEFAULTS.SHORTENER_REPLY_PARAMETER])
|
if(!response || !response[OSRM.DEFAULTS.SHORTENER_REPLY_PARAMETER]) {
|
||||||
OSRM.RoutingDescription.showRouteLink_TimeOut();
|
OSRM.RoutingDescription.showRouteLink_TimeOut();
|
||||||
else
|
return;
|
||||||
document.getElementById('route-link').innerHTML = '[<a class="route-link" href="' +response[OSRM.DEFAULTS.SHORTENER_REPLY_PARAMETER]+ '">'+response[OSRM.DEFAULTS.SHORTENER_REPLY_PARAMETER]+'</a>]';
|
}
|
||||||
|
|
||||||
|
OSRM.G.active_shortlink = response[OSRM.DEFAULTS.SHORTENER_REPLY_PARAMETER];
|
||||||
|
document.getElementById('route-link').innerHTML =
|
||||||
|
'[<a class="route-link" onClick="OSRM.RoutingDescription.showQRCode();">'+OSRM.loc("QR")+'</a>]' + ' ' +
|
||||||
|
'[<a class="route-link" href="' +OSRM.G.active_shortlink+ '">'+OSRM.G.active_shortlink.substring(7)+'</a>]';
|
||||||
},
|
},
|
||||||
showRouteLink_TimeOut: function(){
|
showRouteLink_TimeOut: function(){
|
||||||
document.getElementById('route-link').innerHTML = '['+OSRM.loc("LINK_TO_ROUTE_TIMEOUT")+']';
|
document.getElementById('route-link').innerHTML = '['+OSRM.loc("LINK_TO_ROUTE_TIMEOUT")+']';
|
||||||
},
|
},
|
||||||
|
showQRCode: function(response){
|
||||||
|
if( OSRM.G.qrcodewindow )
|
||||||
|
OSRM.G.qrcodewindow.close();
|
||||||
|
OSRM.G.qrcodewindow = window.open( OSRM.RoutingDescription.QR_DIRECTORY+"qrcodes.html","","width=280,height=250,left=100,top=100,dependent=yes,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no");
|
||||||
|
},
|
||||||
|
|
||||||
// handling of routing description
|
// handling of routing description
|
||||||
show: function(response) {
|
show: function(response) {
|
||||||
// activate printing
|
// activate GUI features that need a route
|
||||||
OSRM.Printing.activate();
|
OSRM.GUI.activateRouteFeatures();
|
||||||
|
|
||||||
// compute query string
|
// compute query string
|
||||||
var query_string = '?hl=' + OSRM.Localization.current_language;
|
var query_string = '?hl=' + OSRM.Localization.current_language;
|
||||||
@@ -60,7 +85,7 @@ show: function(response) {
|
|||||||
var route_link ='[<a class="route-link" onclick="OSRM.RoutingDescription.onClickCreateShortcut(\'' + OSRM.DEFAULTS.WEBSITE_URL + query_string + '\')">'+OSRM.loc("GET_LINK_TO_ROUTE")+'</a>]';
|
var route_link ='[<a class="route-link" onclick="OSRM.RoutingDescription.onClickCreateShortcut(\'' + OSRM.DEFAULTS.WEBSITE_URL + query_string + '\')">'+OSRM.loc("GET_LINK_TO_ROUTE")+'</a>]';
|
||||||
|
|
||||||
// create GPX link
|
// create GPX link
|
||||||
var gpx_link = '[<a class="route-link" onClick="document.location.href=\'' + OSRM.DEFAULTS.HOST_ROUTING_URL + query_string + '&output=gpx\';">'+OSRM.loc("GPX_FILE")+'</a>]';
|
var gpx_link = '[<a class="route-link" onClick="document.location.href=\'' + OSRM.G.active_routing_server_url + query_string + '&output=gpx\';">'+OSRM.loc("GPX_FILE")+'</a>]';
|
||||||
|
|
||||||
// create route description
|
// create route description
|
||||||
var positions = OSRM.G.route.getPositions();
|
var positions = OSRM.G.route.getPositions();
|
||||||
@@ -100,11 +125,14 @@ show: function(response) {
|
|||||||
body += '</table>';
|
body += '</table>';
|
||||||
|
|
||||||
// build header
|
// 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
|
// update DOM
|
||||||
document.getElementById('information-box-header').innerHTML = header;
|
document.getElementById('information-box-header').innerHTML = header;
|
||||||
document.getElementById('information-box').innerHTML = body;
|
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
|
// simple description
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ _decode: function(encoded, precision) {
|
|||||||
} while (b >= 0x20);
|
} while (b >= 0x20);
|
||||||
var dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));
|
var dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));
|
||||||
lng += dlng;
|
lng += dlng;
|
||||||
array.push( {lat: lat * precision, lng: lng * precision} );
|
//array.push( {lat: lat * precision, lng: lng * precision} );
|
||||||
|
array.push( [lat * precision, lng * precision] );
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,21 +30,11 @@ toHumanTime: function(seconds){
|
|||||||
seconds = seconds%60;
|
seconds = seconds%60;
|
||||||
hours = parseInt(minutes/60);
|
hours = parseInt(minutes/60);
|
||||||
minutes = minutes%60;
|
minutes = minutes%60;
|
||||||
if(hours==0){
|
if(hours==0 && minutes==0){ return seconds + ' ' + 's'; }
|
||||||
return minutes + ' ' + 'min';
|
else if(hours==0){ return minutes + ' ' + 'min'; }
|
||||||
}
|
else{ return hours + ' ' + 'h' + ' ' + minutes + ' ' + 'min';}
|
||||||
else{
|
|
||||||
return hours + ' ' + 'h' + ' ' + minutes + ' ' + 'min';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
//human readable distance
|
//human readable distance
|
||||||
setToHumanDistanceFunction: function(type) {
|
|
||||||
OSRM.G.DISTANCE_FORMAT = type;
|
|
||||||
if( type == 1 )
|
|
||||||
OSRM.Utils.toHumanDistance = OSRM.Utils.toHumanDistanceMiles;
|
|
||||||
else
|
|
||||||
OSRM.Utils.toHumanDistance = OSRM.Utils.toHumanDistanceMeters;
|
|
||||||
},
|
|
||||||
toHumanDistanceMeters: function(meters){
|
toHumanDistanceMeters: function(meters){
|
||||||
var distance = parseInt(meters);
|
var distance = parseInt(meters);
|
||||||
|
|
||||||
@@ -80,6 +70,9 @@ isLongitude: function(value) {
|
|||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
},
|
||||||
|
isNumber: function(n) {
|
||||||
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -46,7 +46,7 @@ OSRM.debug.init = function() {
|
|||||||
|
|
||||||
var clear = document.createElement('a');
|
var clear = document.createElement('a');
|
||||||
clear.id = "OSRM.debug-clear";
|
clear.id = "OSRM.debug-clear";
|
||||||
clear.className = "button not-selectable";
|
clear.className = "button";
|
||||||
clear.innerHTML = "clear";
|
clear.innerHTML = "clear";
|
||||||
clear.onclick = OSRM.debug.clear;
|
clear.onclick = OSRM.debug.clear;
|
||||||
|
|
||||||
|
|||||||