fix to route link generator and parser
This commit is contained in:
		
							parent
							
								
									eed22b343a
								
							
						
					
					
						commit
						f4c6ec90ce
					
				@ -211,7 +211,7 @@ function checkURL(){
 | 
			
		||||
		else if(name_val[0] == 'destname') {
 | 
			
		||||
			destination_name = decodeURI(name_val[1]).replace(/<\/?[^>]+(>|$)/g ,"");	// discard tags	
 | 
			
		||||
		}
 | 
			
		||||
		else if(name_val[0] == 'zoom') {
 | 
			
		||||
		else if(name_val[0] == 'z') {
 | 
			
		||||
			zoom = name_val[1];
 | 
			
		||||
			if( zoom<0 || zoom > 18)
 | 
			
		||||
				return;
 | 
			
		||||
 | 
			
		||||
@ -125,7 +125,8 @@ function onClickRouteDescription(geometry_index) {
 | 
			
		||||
	OSRM.G.markers.highlight.centerView(OSRM.DEFAULTS.HIGHLIGHT_ZOOM_LEVEL);	
 | 
			
		||||
}
 | 
			
		||||
function onClickCreateShortcut(src){
 | 
			
		||||
	OSRM.JSONP.call(OSRM.DEFAULTS.HOST_SHORTENER_URL+src+'&jsonp=showRouteLink', showRouteLink, showRouteLink_TimeOut, 2000, 'shortener');
 | 
			
		||||
	src += '&z='+ OSRM.G.map.getZoom() + '¢er=' + OSRM.G.map.getCenter().lat + ',' + OSRM.G.map.getCenter().lng;
 | 
			
		||||
	OSRM.JSONP.call(OSRM.DEFAULTS.HOST_SHORTENER_URL+src, showRouteLink, showRouteLink_TimeOut, 2000, 'shortener');
 | 
			
		||||
	document.getElementById('route-prelink').innerHTML = '['+OSRM.loc("GENERATE_LINK_TO_ROUTE")+']';
 | 
			
		||||
}
 | 
			
		||||
function showRouteLink(response){
 | 
			
		||||
@ -136,8 +137,7 @@ function showRouteLink_TimeOut(){
 | 
			
		||||
}
 | 
			
		||||
function showRouteDescription(response) {
 | 
			
		||||
	// compute query string
 | 
			
		||||
	var query_string = '?z='+ OSRM.G.map.getZoom();
 | 
			
		||||
	query_string += '¢er=' + OSRM.G.map.getCenter().lat + ',' + OSRM.G.map.getCenter().lng;
 | 
			
		||||
	var query_string = '?rebuild=1';
 | 
			
		||||
	for(var i=0; i<OSRM.G.markers.route.length; i++)
 | 
			
		||||
		query_string += '&loc=' + OSRM.G.markers.route[i].getLat() + ',' + OSRM.G.markers.route[i].getLng(); 
 | 
			
		||||
 						
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user