link shortener parameters now changeable in config file
This commit is contained in:
parent
4b1c4068f2
commit
7ad253732a
@ -35,6 +35,8 @@ OSRM.DEFAULTS = {
|
|||||||
GEOCODER_BOUNDS: '', // the world is not enough!
|
GEOCODER_BOUNDS: '', // the world is not enough!
|
||||||
//GEOCODER_BOUNDS: '&bounded=1&viewbox=-27.0,72.0,46.0,36.0', // bounds for Europe
|
//GEOCODER_BOUNDS: '&bounded=1&viewbox=-27.0,72.0,46.0,36.0', // bounds for Europe
|
||||||
|
|
||||||
|
SHORTENER_PARAMETERS: '%url&jsonp=%jsonp',
|
||||||
|
|
||||||
LANGUAGE: "en",
|
LANGUAGE: "en",
|
||||||
LANGUAGE_FILES_DIRECTORY: "localization/",
|
LANGUAGE_FILES_DIRECTORY: "localization/",
|
||||||
LANUGAGE_ONDEMAND_RELOADING: true,
|
LANUGAGE_ONDEMAND_RELOADING: true,
|
||||||
|
@ -31,7 +31,10 @@ onClickRouteDescription: function(geometry_index) {
|
|||||||
},
|
},
|
||||||
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);
|
||||||
OSRM.JSONP.call(OSRM.DEFAULTS.HOST_SHORTENER_URL+src, OSRM.RoutingDescription.showRouteLink, OSRM.RoutingDescription.showRouteLink_TimeOut, OSRM.DEFAULTS.JSONP_TIMEOUT, 'shortener');
|
|
||||||
|
var source = OSRM.DEFAULTS.SHORTENER_PARAMETERS.replace(/%url/, OSRM.DEFAULTS.HOST_SHORTENER_URL+src);
|
||||||
|
|
||||||
|
OSRM.JSONP.call(source, OSRM.RoutingDescription.showRouteLink, OSRM.RoutingDescription.showRouteLink_TimeOut, OSRM.DEFAULTS.JSONP_TIMEOUT, 'shortener');
|
||||||
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){
|
||||||
|
Loading…
Reference in New Issue
Block a user