+ list[num].requestCORS=function(url) {
+ $.ajax({ url: url, method: "GET", data: {}, dataType: 'json', success: r['gotRoute'+num] });
+ };
+ r['gotRoute'+num]=function(data) {
+ r.awaitingRoute=false;
+ $(".query_wrapper.routing .spinner").hide();
+ if (!list[num].gotRoute(r,data)) {
+ // No route found
+ if (r.polyline) {
+ map.removeLayer(r.polyline);
+ r.polyline=null;
+ }
+ if (!r.dragging) { alert(I18n.t('javascripts.directions.errors.no_route')); }
+ }
+ };