Le repo des sources pour le site web des JM2L
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

5300 lines
174 KiB

  1. (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
  2. function corslite(url, callback, cors) {
  3. var sent = false;
  4. if (typeof window.XMLHttpRequest === 'undefined') {
  5. return callback(Error('Browser not supported'));
  6. }
  7. if (typeof cors === 'undefined') {
  8. var m = url.match(/^\s*https?:\/\/[^\/]*/);
  9. cors = m && (m[0] !== location.protocol + '//' + location.hostname +
  10. (location.port ? ':' + location.port : ''));
  11. }
  12. var x = new window.XMLHttpRequest();
  13. function isSuccessful(status) {
  14. return status >= 200 && status < 300 || status === 304;
  15. }
  16. if (cors && !('withCredentials' in x)) {
  17. // IE8-9
  18. x = new window.XDomainRequest();
  19. // Ensure callback is never called synchronously, i.e., before
  20. // x.send() returns (this has been observed in the wild).
  21. // See https://github.com/mapbox/mapbox.js/issues/472
  22. var original = callback;
  23. callback = function() {
  24. if (sent) {
  25. original.apply(this, arguments);
  26. } else {
  27. var that = this, args = arguments;
  28. setTimeout(function() {
  29. original.apply(that, args);
  30. }, 0);
  31. }
  32. }
  33. }
  34. function loaded() {
  35. if (
  36. // XDomainRequest
  37. x.status === undefined ||
  38. // modern browsers
  39. isSuccessful(x.status)) callback.call(x, null, x);
  40. else callback.call(x, x, null);
  41. }
  42. // Both `onreadystatechange` and `onload` can fire. `onreadystatechange`
  43. // has [been supported for longer](http://stackoverflow.com/a/9181508/229001).
  44. if ('onload' in x) {
  45. x.onload = loaded;
  46. } else {
  47. x.onreadystatechange = function readystate() {
  48. if (x.readyState === 4) {
  49. loaded();
  50. }
  51. };
  52. }
  53. // Call the callback with the XMLHttpRequest object as an error and prevent
  54. // it from ever being called again by reassigning it to `noop`
  55. x.onerror = function error(evt) {
  56. // XDomainRequest provides no evt parameter
  57. callback.call(this, evt || true, null);
  58. callback = function() { };
  59. };
  60. // IE9 must have onprogress be set to a unique function.
  61. x.onprogress = function() { };
  62. x.ontimeout = function(evt) {
  63. callback.call(this, evt, null);
  64. callback = function() { };
  65. };
  66. x.onabort = function(evt) {
  67. callback.call(this, evt, null);
  68. callback = function() { };
  69. };
  70. // GET is the only supported HTTP Verb by XDomainRequest and is the
  71. // only one supported here.
  72. x.open('GET', url, true);
  73. // Send the request. Sending data is not supported.
  74. x.send(null);
  75. sent = true;
  76. return x;
  77. }
  78. if (typeof module !== 'undefined') module.exports = corslite;
  79. },{}],2:[function(_dereq_,module,exports){
  80. module.exports = function(version, language, options) {
  81. // load instructions
  82. var instructions = _dereq_('./instructions').get(language);
  83. if (Object !== instructions.constructor) throw 'instructions must be object';
  84. if (!instructions[version]) { throw 'invalid version ' + version; }
  85. return {
  86. capitalizeFirstLetter: function(string) {
  87. return string.charAt(0).toUpperCase() + string.slice(1);
  88. },
  89. ordinalize: function(number) {
  90. // Transform numbers to their translated ordinalized value
  91. return instructions[version].constants.ordinalize[number.toString()] || '';
  92. },
  93. directionFromDegree: function(degree) {
  94. // Transform degrees to their translated compass direction
  95. if (!degree && degree !== 0) {
  96. // step had no bearing_after degree, ignoring
  97. return '';
  98. } else if (degree >= 0 && degree <= 20) {
  99. return instructions[version].constants.direction.north;
  100. } else if (degree > 20 && degree < 70) {
  101. return instructions[version].constants.direction.northeast;
  102. } else if (degree >= 70 && degree < 110) {
  103. return instructions[version].constants.direction.east;
  104. } else if (degree >= 110 && degree <= 160) {
  105. return instructions[version].constants.direction.southeast;
  106. } else if (degree > 160 && degree <= 200) {
  107. return instructions[version].constants.direction.south;
  108. } else if (degree > 200 && degree < 250) {
  109. return instructions[version].constants.direction.southwest;
  110. } else if (degree >= 250 && degree <= 290) {
  111. return instructions[version].constants.direction.west;
  112. } else if (degree > 290 && degree < 340) {
  113. return instructions[version].constants.direction.northwest;
  114. } else if (degree >= 340 && degree <= 360) {
  115. return instructions[version].constants.direction.north;
  116. } else {
  117. throw new Error('Degree ' + degree + ' invalid');
  118. }
  119. },
  120. laneConfig: function(step) {
  121. // Reduce any lane combination down to a contracted lane diagram
  122. if (!step.intersections || !step.intersections[0].lanes) throw new Error('No lanes object');
  123. var config = [];
  124. var currentLaneValidity = null;
  125. step.intersections[0].lanes.forEach(function (lane) {
  126. if (currentLaneValidity === null || currentLaneValidity !== lane.valid) {
  127. if (lane.valid) {
  128. config.push('o');
  129. } else {
  130. config.push('x');
  131. }
  132. currentLaneValidity = lane.valid;
  133. }
  134. });
  135. return config.join('');
  136. },
  137. compile: function(step) {
  138. if (!step.maneuver) throw new Error('No step maneuver provided');
  139. var type = step.maneuver.type;
  140. var modifier = step.maneuver.modifier;
  141. var mode = step.mode;
  142. if (!type) { throw new Error('Missing step maneuver type'); }
  143. if (type !== 'depart' && type !== 'arrive' && !modifier) { throw new Error('Missing step maneuver modifier'); }
  144. if (!instructions[version][type]) {
  145. // Log for debugging
  146. console.log('Encountered unknown instruction type: ' + type); // eslint-disable-line no-console
  147. // OSRM specification assumes turn types can be added without
  148. // major version changes. Unknown types are to be treated as
  149. // type `turn` by clients
  150. type = 'turn';
  151. }
  152. // Use special instructions if available, otherwise `defaultinstruction`
  153. var instructionObject;
  154. if (instructions[version].modes[mode]) {
  155. instructionObject = instructions[version].modes[mode];
  156. } else if (instructions[version][type][modifier]) {
  157. instructionObject = instructions[version][type][modifier];
  158. } else {
  159. instructionObject = instructions[version][type].default;
  160. }
  161. // Special case handling
  162. var laneInstruction;
  163. switch (type) {
  164. case 'use lane':
  165. laneInstruction = instructions[version].constants.lanes[this.laneConfig(step)];
  166. if (!laneInstruction) {
  167. // If the lane combination is not found, default to continue straight
  168. instructionObject = instructions[version]['use lane'].no_lanes;
  169. }
  170. break;
  171. case 'rotary':
  172. case 'roundabout':
  173. if (step.rotary_name && step.maneuver.exit && instructionObject.name_exit) {
  174. instructionObject = instructionObject.name_exit;
  175. } else if (step.rotary_name && instructionObject.name) {
  176. instructionObject = instructionObject.name;
  177. } else if (step.maneuver.exit && instructionObject.exit) {
  178. instructionObject = instructionObject.exit;
  179. } else {
  180. instructionObject = instructionObject.default;
  181. }
  182. break;
  183. default:
  184. // NOOP, since no special logic for that type
  185. }
  186. // Decide way_name with special handling for name and ref
  187. var wayName;
  188. var name = step.name || '';
  189. var ref = (step.ref || '').split(';')[0];
  190. // Remove hacks from Mapbox Directions mixing ref into name
  191. if (name === step.ref) {
  192. // if both are the same we assume that there used to be an empty name, with the ref being filled in for it
  193. // we only need to retain the ref then
  194. name = '';
  195. }
  196. name = name.replace(' (' + step.ref + ')', '');
  197. if (name && ref && name !== ref) {
  198. wayName = name + ' (' + ref + ')';
  199. } else if (!name && ref) {
  200. wayName = ref;
  201. } else {
  202. wayName = name;
  203. }
  204. // Decide which instruction string to use
  205. // Destination takes precedence over name
  206. var instruction;
  207. if (step.destinations && instructionObject.destination) {
  208. instruction = instructionObject.destination;
  209. } else if (wayName && instructionObject.name) {
  210. instruction = instructionObject.name;
  211. } else {
  212. instruction = instructionObject.default;
  213. }
  214. var tokenizedInstructionHook = ((options || {}).hooks || {}).tokenizedInstruction;
  215. if (tokenizedInstructionHook) {
  216. instruction = tokenizedInstructionHook(instruction);
  217. }
  218. // Replace tokens
  219. // NOOP if they don't exist
  220. var nthWaypoint = ''; // TODO, add correct waypoint counting
  221. instruction = instruction
  222. .replace('{way_name}', wayName)
  223. .replace('{destination}', (step.destinations || '').split(',')[0])
  224. .replace('{exit_number}', this.ordinalize(step.maneuver.exit || 1))
  225. .replace('{rotary_name}', step.rotary_name)
  226. .replace('{lane_instruction}', laneInstruction)
  227. .replace('{modifier}', instructions[version].constants.modifier[modifier])
  228. .replace('{direction}', this.directionFromDegree(step.maneuver.bearing_after))
  229. .replace('{nth}', nthWaypoint)
  230. .replace(/ {2}/g, ' '); // remove excess spaces
  231. if (instructions.meta.capitalizeFirstLetter) {
  232. instruction = this.capitalizeFirstLetter(instruction);
  233. }
  234. return instruction;
  235. }
  236. };
  237. };
  238. },{"./instructions":3}],3:[function(_dereq_,module,exports){
  239. var instructionsDe = _dereq_('./instructions/de.json');
  240. var instructionsEn = _dereq_('./instructions/en.json');
  241. var instructionsFr = _dereq_('./instructions/fr.json');
  242. var instructionsNl = _dereq_('./instructions/nl.json');
  243. var instructionsZhHans = _dereq_('./instructions/zh-Hans.json');
  244. module.exports = {
  245. get: function(language) {
  246. switch (language) {
  247. case 'en':
  248. return instructionsEn;
  249. case 'de':
  250. return instructionsDe;
  251. case 'fr':
  252. return instructionsFr;
  253. case 'nl':
  254. return instructionsNl;
  255. case 'zh':
  256. case 'zh-Hans':
  257. return instructionsZhHans;
  258. default:
  259. throw 'invalid language ' + language;
  260. }
  261. }
  262. };
  263. },{"./instructions/de.json":4,"./instructions/en.json":5,"./instructions/fr.json":6,"./instructions/nl.json":7,"./instructions/zh-Hans.json":8}],4:[function(_dereq_,module,exports){
  264. module.exports={
  265. "meta": {
  266. "capitalizeFirstLetter": true
  267. },
  268. "v5": {
  269. "constants": {
  270. "ordinalize": {
  271. "1": "erste",
  272. "2": "zweite",
  273. "3": "dritte",
  274. "4": "vierte",
  275. "5": "fünfte",
  276. "6": "sechste",
  277. "7": "siebente",
  278. "8": "achte",
  279. "9": "neunte",
  280. "10": "zehnte"
  281. },
  282. "direction": {
  283. "north": "Norden",
  284. "northeast": "Nordosten",
  285. "east": "Osten",
  286. "southeast": "Südosten",
  287. "south": "Süden",
  288. "southwest": "Südwesten",
  289. "west": "Westen",
  290. "northwest": "Nordwesten"
  291. },
  292. "modifier": {
  293. "left": "links",
  294. "right": "rechts",
  295. "sharp left": "scharf links",
  296. "sharp right": "scharf rechts",
  297. "slight left": "leicht links",
  298. "slight right": "leicht rechts",
  299. "straight": "geradeaus",
  300. "uturn": "180°-Wendung"
  301. },
  302. "lanes": {
  303. "xo": "Rechts halten",
  304. "ox": "Links halten",
  305. "xox": "Mittlere Spur nutzen",
  306. "oxo": "Rechts oder links halten"
  307. }
  308. },
  309. "modes": {
  310. "ferry": {
  311. "default": "Fähre nehmen",
  312. "name": "Fähre nehmen {way_name}",
  313. "destination": "Fähre nehmen Richtung {destination}"
  314. }
  315. },
  316. "arrive": {
  317. "default": {
  318. "default": "Sie haben Ihr {nth} Ziel erreicht"
  319. },
  320. "left": {
  321. "default": "Sie haben Ihr {nth} Ziel erreicht, es befindet sich links von Ihnen"
  322. },
  323. "right": {
  324. "default": "Sie haben Ihr {nth} Ziel erreicht, es befindet sich rechts von Ihnen"
  325. },
  326. "sharp left": {
  327. "default": "Sie haben Ihr {nth} Ziel erreicht, es befindet sich links von Ihnen"
  328. },
  329. "sharp right": {
  330. "default": "Sie haben Ihr {nth} Ziel erreicht, es befindet sich rechts von Ihnen"
  331. },
  332. "slight right": {
  333. "default": "Sie haben Ihr {nth} Ziel erreicht, es befindet sich rechts von Ihnen"
  334. },
  335. "slight left": {
  336. "default": "Sie haben Ihr {nth} Ziel erreicht, es befindet sich links von Ihnen"
  337. },
  338. "straight": {
  339. "default": "Sie haben Ihr {nth} Ziel erreicht, es befindet sich direkt vor Ihnen"
  340. }
  341. },
  342. "continue": {
  343. "default": {
  344. "default": "{modifier} weiterfahren",
  345. "name": "{modifier} weiterfahren auf {way_name}",
  346. "destination": "{modifier} weiterfahren Richtung {destination}"
  347. },
  348. "slight left": {
  349. "default": "Leicht links weiter",
  350. "name": "Leicht links weiter auf {way_name}",
  351. "destination": "Leicht links weiter Richtung {destination}"
  352. },
  353. "slight right": {
  354. "default": "Leicht rechts weiter",
  355. "name": "Leicht rechts weiter auf {way_name}",
  356. "destination": "Leicht rechts weiter Richtung {destination}"
  357. },
  358. "uturn": {
  359. "default": "180°-Wendung",
  360. "name": "180°-Wendung auf {way_name}",
  361. "destination": "180°-Wendung Richtung {destination}"
  362. }
  363. },
  364. "depart": {
  365. "default": {
  366. "default": "Fahren Sie Richtung {direction}",
  367. "name": "Fahren Sie Richtung {direction} auf {way_name}"
  368. }
  369. },
  370. "end of road": {
  371. "default": {
  372. "default": "{modifier} abbiegen",
  373. "name": "{modifier} abbiegen auf {way_name}",
  374. "destination": "{modifier} abbiegen Richtung {destination}"
  375. },
  376. "straight": {
  377. "default": "Geradeaus weiterfahren",
  378. "name": "Geradeaus weiterfahren auf {way_name}",
  379. "destination": "Geradeaus weiterfahren Richtung {destination}"
  380. },
  381. "uturn": {
  382. "default": "180°-Wendung am Ende der Straße",
  383. "name": "180°-Wendung auf {way_name} am Ende der Straße",
  384. "destination": "180°-Wendung Richtung {destination} am Ende der Straße"
  385. }
  386. },
  387. "fork": {
  388. "default": {
  389. "default": "{modifier} halten an der Gabelung",
  390. "name": "{modifier} halten an der Gabelung auf {way_name}",
  391. "destination": "{modifier} halten an der Gabelung Richtung {destination}"
  392. },
  393. "slight left": {
  394. "default": "Links halten an der Gabelung",
  395. "name": "Links halten an der Gabelung auf {way_name}",
  396. "destination": "Links halten an der Gabelung Richtung {destination}"
  397. },
  398. "slight right": {
  399. "default": "Rechts halten an der Gabelung",
  400. "name": "Rechts halten an der Gabelung auf {way_name}",
  401. "destination": "Rechts halten an der Gabelung Richtung {destination}"
  402. },
  403. "sharp left": {
  404. "default": "Scharf links abbiegen an der Gabelung",
  405. "name": "Scharf links abbiegen an der Gabelung auf {way_name}",
  406. "destination": "Scharf links abbiegen an der Gabelung Richtung {destination}"
  407. },
  408. "sharp right": {
  409. "default": "Scharf rechts abbiegen an der Gabelung",
  410. "name": "Scharf rechts abbiegen an der Gabelung auf {way_name}",
  411. "destination": "Scharf rechts abbiegen an der Gabelung Richtung {destination}"
  412. },
  413. "uturn": {
  414. "default": "180°-Wendung",
  415. "name": "180°-Wendung auf {way_name}",
  416. "destination": "180°-Wendung Richtung {destination}"
  417. }
  418. },
  419. "merge": {
  420. "default": {
  421. "default": "{modifier} auffahren",
  422. "name": "{modifier} auffahren auf {way_name}",
  423. "destination": "{modifier} auffahren Richtung {destination}"
  424. },
  425. "slight left": {
  426. "default": "Leicht links auffahren",
  427. "name": "Leicht links auffahren auf {way_name}",
  428. "destination": "Leicht links auffahren Richtung {destination}"
  429. },
  430. "slight right": {
  431. "default": "Leicht rechts auffahren",
  432. "name": "Leicht rechts auffahren auf {way_name}",
  433. "destination": "Leicht rechts auffahren Richtung {destination}"
  434. },
  435. "sharp left": {
  436. "default": "Scharf links auffahren",
  437. "name": "Scharf links auffahren auf {way_name}",
  438. "destination": "Scharf links auffahren Richtung {destination}"
  439. },
  440. "sharp right": {
  441. "default": "Scharf rechts auffahren",
  442. "name": "Scharf rechts auffahren auf {way_name}",
  443. "destination": "Scharf rechts auffahren Richtung {destination}"
  444. },
  445. "uturn": {
  446. "default": "180°-Wendung",
  447. "name": "180°-Wendung auf {way_name}",
  448. "destination": "180°-Wendung Richtung {destination}"
  449. }
  450. },
  451. "new name": {
  452. "default": {
  453. "default": "{modifier} weiterfahren",
  454. "name": "{modifier} weiterfahren auf {way_name}",
  455. "destination": "{modifier} weiterfahren Richtung {destination}"
  456. },
  457. "sharp left": {
  458. "default": "Scharf links",
  459. "name": "Scharf links auf {way_name}",
  460. "destination": "Scharf links Richtung {destination}"
  461. },
  462. "sharp right": {
  463. "default": "Scharf rechts",
  464. "name": "Scharf rechts auf {way_name}",
  465. "destination": "Scharf rechts Richtung {destination}"
  466. },
  467. "slight left": {
  468. "default": "Leicht links weiter",
  469. "name": "Leicht links weiter auf {way_name}",
  470. "destination": "Leicht links weiter Richtung {destination}"
  471. },
  472. "slight right": {
  473. "default": "Leicht rechts weiter",
  474. "name": "Leicht rechts weiter auf {way_name}",
  475. "destination": "Leicht rechts weiter Richtung {destination}"
  476. },
  477. "uturn": {
  478. "default": "180°-Wendung",
  479. "name": "180°-Wendung auf {way_name}",
  480. "destination": "180°-Wendung Richtung {destination}"
  481. }
  482. },
  483. "notification": {
  484. "default": {
  485. "default": "{modifier} weiterfahren",
  486. "name": "{modifier} weiterfahren auf {way_name}",
  487. "destination" : "{modifier} weiterfahren Richtung {destination}"
  488. },
  489. "uturn": {
  490. "default": "180°-Wendung",
  491. "name": "180°-Wendung auf {way_name}",
  492. "destination": "180°-Wendung Richtung {destination}"
  493. }
  494. },
  495. "off ramp": {
  496. "default": {
  497. "default": "Rampe nehmen",
  498. "name": "Rampe nehmen auf {way_name}",
  499. "destination": "Rampe nehmen Richtung {destination}"
  500. },
  501. "left": {
  502. "default": "Rampe auf der linken Seite nehmen",
  503. "name": "Rampe auf der linken Seite nehmen auf {way_name}",
  504. "destination": "Rampe auf der linken Seite nehmen Richtung {destination}"
  505. },
  506. "right": {
  507. "default": "Rampe auf der rechten Seite nehmen",
  508. "name": "Rampe auf der rechten Seite nehmen auf {way_name}",
  509. "destination": "Rampe auf der rechten Seite nehmen Richtung {destination}"
  510. },
  511. "sharp left": {
  512. "default": "Rampe auf der linken Seite nehmen",
  513. "name": "Rampe auf der linken Seite nehmen auf {way_name}",
  514. "destination": "Rampe auf der linken Seite nehmen Richtung {destination}"
  515. },
  516. "sharp right": {
  517. "default": "Rampe auf der rechten Seite nehmen",
  518. "name": "Rampe auf der rechten Seite nehmen auf {way_name}",
  519. "destination": "Rampe auf der rechten Seite nehmen Richtung {destination}"
  520. },
  521. "slight left": {
  522. "default": "Rampe auf der linken Seite nehmen",
  523. "name": "Rampe auf der linken Seite nehmen auf {way_name}",
  524. "destination": "Rampe auf der linken Seite nehmen Richtung {destination}"
  525. },
  526. "slight right": {
  527. "default": "Rampe auf der rechten Seite nehmen",
  528. "name": "Rampe auf der rechten Seite nehmen auf {way_name}",
  529. "destination": "Rampe auf der rechten Seite nehmen Richtung {destination}"
  530. }
  531. },
  532. "on ramp": {
  533. "default": {
  534. "default": "Rampe nehmen",
  535. "name": "Rampe nehmen auf {way_name}",
  536. "destination": "Rampe nehmen Richtung {destination}"
  537. },
  538. "left": {
  539. "default": "Rampe auf der linken Seite nehmen",
  540. "name": "Rampe auf der linken Seite nehmen auf {way_name}",
  541. "destination": "Rampe auf der linken Seite nehmen Richtung {destination}"
  542. },
  543. "right": {
  544. "default": "Rampe auf der rechten Seite nehmen",
  545. "name": "Rampe auf der rechten Seite nehmen auf {way_name}",
  546. "destination": "Rampe auf der rechten Seite nehmen Richtung {destination}"
  547. },
  548. "sharp left": {
  549. "default": "Rampe auf der linken Seite nehmen",
  550. "name": "Rampe auf der linken Seite nehmen auf {way_name}",
  551. "destination": "Rampe auf der linken Seite nehmen Richtung {destination}"
  552. },
  553. "sharp right": {
  554. "default": "Rampe auf der rechten Seite nehmen",
  555. "name": "Rampe auf der rechten Seite nehmen auf {way_name}",
  556. "destination": "Rampe auf der rechten Seite nehmen Richtung {destination}"
  557. },
  558. "slight left": {
  559. "default": "Rampe auf der linken Seite nehmen",
  560. "name": "Rampe auf der linken Seite nehmen auf {way_name}",
  561. "destination": "Rampe auf der linken Seite nehmen Richtung {destination}"
  562. },
  563. "slight right": {
  564. "default": "Rampe auf der rechten Seite nehmen",
  565. "name": "Rampe auf der rechten Seite nehmen auf {way_name}",
  566. "destination": "Rampe auf der rechten Seite nehmen Richtung {destination}"
  567. }
  568. },
  569. "rotary": {
  570. "default": {
  571. "default": {
  572. "default": "In den Kreisverkehr fahren",
  573. "name": "In den Kreisverkehr fahren und auf {way_name} verlassen",
  574. "destination": "In den Kreisverkehr fahren und Richtung {destination} verlassen"
  575. },
  576. "name": {
  577. "default": "In {rotary_name} fahren",
  578. "name": "In {rotary_name} fahren und auf {way_name} verlassen",
  579. "destination": "In {rotary_name} fahren und Richtung {destination} verlassen"
  580. },
  581. "exit": {
  582. "default": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen",
  583. "name": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen auf {way_name}",
  584. "destination": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen Richtung {destination}"
  585. },
  586. "name_exit": {
  587. "default": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen",
  588. "name": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen auf {way_name}",
  589. "destination": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen Richtung {destination}"
  590. }
  591. }
  592. },
  593. "roundabout": {
  594. "default": {
  595. "exit": {
  596. "default": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen",
  597. "name": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen auf {way_name}",
  598. "destination": "In den Kreisverkehr fahren und {exit_number} Ausfahrt nehmen Richtung {destination}"
  599. },
  600. "default": {
  601. "default": "In den Kreisverkehr fahren",
  602. "name": "In den Kreisverkehr fahren und auf {way_name} verlassen",
  603. "destination": "In den Kreisverkehr fahren und Richtung {destination} verlassen"
  604. }
  605. }
  606. },
  607. "roundabout turn": {
  608. "default": {
  609. "default": "Am Kreisverkehr {modifier}",
  610. "name": "Am Kreisverkehr {modifier} auf {way_name}",
  611. "destination": "Am Kreisverkehr {modifier} Richtung {destination}"
  612. },
  613. "left": {
  614. "default": "Am Kreisverkehr links",
  615. "name": "Am Kreisverkehr links auf {way_name}",
  616. "destination": "Am Kreisverkehr links Richtung {destination}"
  617. },
  618. "right": {
  619. "default": "Am Kreisverkehr rechts",
  620. "name": "Am Kreisverkehr rechts auf {way_name}",
  621. "destination": "Am Kreisverkehr rechts Richtung {destination}"
  622. },
  623. "straight": {
  624. "default": "Am Kreisverkehr geradeaus weiterfahren",
  625. "name": "Am Kreisverkehr geradeaus weiterfahren auf {way_name}",
  626. "destination": "Am Kreisverkehr geradeaus weiterfahren Richtung {destination}"
  627. }
  628. },
  629. "turn": {
  630. "default": {
  631. "default": "{modifier} abbiegen",
  632. "name": "{modifier} abbiegen auf {way_name}",
  633. "destination": "{modifier} abbiegen Richtung {destination}"
  634. },
  635. "left": {
  636. "default": "Links abbiegen",
  637. "name": "Links abbiegen auf {way_name}",
  638. "destination": "Links abbiegen Richtung {destination}"
  639. },
  640. "right": {
  641. "default": "Rechts abbiegen",
  642. "name": "Rechts abbiegen auf {way_name}",
  643. "destination": "Rechts abbiegen Richtung {destination}"
  644. },
  645. "straight": {
  646. "default": "Geradeaus weiterfahren",
  647. "name": "Geradeaus weiterfahren auf {way_name}",
  648. "destination": "Geradeaus weiterfahren Richtung {destination}"
  649. }
  650. },
  651. "use lane": {
  652. "no_lanes": {
  653. "default": "Geradeaus weiterfahren"
  654. },
  655. "default": {
  656. "default": "{lane_instruction}"
  657. }
  658. }
  659. }
  660. }
  661. },{}],5:[function(_dereq_,module,exports){
  662. module.exports={
  663. "meta": {
  664. "capitalizeFirstLetter": true
  665. },
  666. "v5": {
  667. "constants": {
  668. "ordinalize": {
  669. "1": "1st",
  670. "2": "2nd",
  671. "3": "3rd",
  672. "4": "4th",
  673. "5": "5th",
  674. "6": "6th",
  675. "7": "7th",
  676. "8": "8th",
  677. "9": "9th",
  678. "10": "10th"
  679. },
  680. "direction": {
  681. "north": "north",
  682. "northeast": "northeast",
  683. "east": "east",
  684. "southeast": "southeast",
  685. "south": "south",
  686. "southwest": "southwest",
  687. "west": "west",
  688. "northwest": "northwest"
  689. },
  690. "modifier": {
  691. "left": "left",
  692. "right": "right",
  693. "sharp left": "sharp left",
  694. "sharp right": "sharp right",
  695. "slight left": "slight left",
  696. "slight right": "slight right",
  697. "straight": "straight",
  698. "uturn": "U-turn"
  699. },
  700. "lanes": {
  701. "xo": "Keep right",
  702. "ox": "Keep left",
  703. "xox": "Keep in the middle",
  704. "oxo": "Keep left or right"
  705. }
  706. },
  707. "modes": {
  708. "ferry": {
  709. "default": "Take the ferry",
  710. "name": "Take the ferry {way_name}",
  711. "destination": "Take the ferry towards {destination}"
  712. }
  713. },
  714. "arrive": {
  715. "default": {
  716. "default": "You have arrived at your {nth} destination"
  717. },
  718. "left": {
  719. "default": "You have arrived at your {nth} destination, on the left"
  720. },
  721. "right": {
  722. "default": "You have arrived at your {nth} destination, on the right"
  723. },
  724. "sharp left": {
  725. "default": "You have arrived at your {nth} destination, on the left"
  726. },
  727. "sharp right": {
  728. "default": "You have arrived at your {nth} destination, on the right"
  729. },
  730. "slight right": {
  731. "default": "You have arrived at your {nth} destination, on the right"
  732. },
  733. "slight left": {
  734. "default": "You have arrived at your {nth} destination, on the left"
  735. },
  736. "straight": {
  737. "default": "You have arrived at your {nth} destination, straight ahead"
  738. }
  739. },
  740. "continue": {
  741. "default": {
  742. "default": "Continue {modifier}",
  743. "name": "Continue {modifier} onto {way_name}",
  744. "destination": "Continue {modifier} towards {destination}"
  745. },
  746. "slight left": {
  747. "default": "Continue slightly left",
  748. "name": "Continue slightly left onto {way_name}",
  749. "destination": "Continue slightly left towards {destination}"
  750. },
  751. "slight right": {
  752. "default": "Continue slightly right",
  753. "name": "Continue slightly right onto {way_name}",
  754. "destination": "Continue slightly right towards {destination}"
  755. },
  756. "uturn": {
  757. "default": "Make a U-turn",
  758. "name": "Make a U-turn onto {way_name}",
  759. "destination": "Make a U-turn towards {destination}"
  760. }
  761. },
  762. "depart": {
  763. "default": {
  764. "default": "Head {direction}",
  765. "name": "Head {direction} on {way_name}"
  766. }
  767. },
  768. "end of road": {
  769. "default": {
  770. "default": "Turn {modifier}",
  771. "name": "Turn {modifier} onto {way_name}",
  772. "destination": "Turn {modifier} towards {destination}"
  773. },
  774. "straight": {
  775. "default": "Continue straight",
  776. "name": "Continue straight onto {way_name}",
  777. "destination": "Continue straight towards {destination}"
  778. },
  779. "uturn": {
  780. "default": "Make a U-turn at the end of the road",
  781. "name": "Make a U-turn onto {way_name} at the end of the road",
  782. "destination": "Make a U-turn towards {destination} at the end of the road"
  783. }
  784. },
  785. "fork": {
  786. "default": {
  787. "default": "Keep {modifier} at the fork",
  788. "name": "Keep {modifier} at the fork onto {way_name}",
  789. "destination": "Keep {modifier} at the fork towards {destination}"
  790. },
  791. "slight left": {
  792. "default": "Keep left at the fork",
  793. "name": "Keep left at the fork onto {way_name}",
  794. "destination": "Keep left at the fork towards {destination}"
  795. },
  796. "slight right": {
  797. "default": "Keep right at the fork",
  798. "name": "Keep right at the fork onto {way_name}",
  799. "destination": "Keep right at the fork towards {destination}"
  800. },
  801. "sharp left": {
  802. "default": "Take a sharp left at the fork",
  803. "name": "Take a sharp left at the fork onto {way_name}",
  804. "destination": "Take a sharp left at the fork towards {destination}"
  805. },
  806. "sharp right": {
  807. "default": "Take a sharp right at the fork",
  808. "name": "Take a sharp right at the fork onto {way_name}",
  809. "destination": "Take a sharp right at the fork towards {destination}"
  810. },
  811. "uturn": {
  812. "default": "Make a U-turn",
  813. "name": "Make a U-turn onto {way_name}",
  814. "destination": "Make a U-turn towards {destination}"
  815. }
  816. },
  817. "merge": {
  818. "default": {
  819. "default": "Merge {modifier}",
  820. "name": "Merge {modifier} onto {way_name}",
  821. "destination": "Merge {modifier} towards {destination}"
  822. },
  823. "slight left": {
  824. "default": "Merge left",
  825. "name": "Merge left onto {way_name}",
  826. "destination": "Merge left towards {destination}"
  827. },
  828. "slight right": {
  829. "default": "Merge right",
  830. "name": "Merge right onto {way_name}",
  831. "destination": "Merge right towards {destination}"
  832. },
  833. "sharp left": {
  834. "default": "Merge left",
  835. "name": "Merge left onto {way_name}",
  836. "destination": "Merge left towards {destination}"
  837. },
  838. "sharp right": {
  839. "default": "Merge right",
  840. "name": "Merge right onto {way_name}",
  841. "destination": "Merge right towards {destination}"
  842. },
  843. "uturn": {
  844. "default": "Make a U-turn",
  845. "name": "Make a U-turn onto {way_name}",
  846. "destination": "Make a U-turn towards {destination}"
  847. }
  848. },
  849. "new name": {
  850. "default": {
  851. "default": "Continue {modifier}",
  852. "name": "Continue {modifier} onto {way_name}",
  853. "destination": "Continue {modifier} towards {destination}"
  854. },
  855. "sharp left": {
  856. "default": "Take a sharp left",
  857. "name": "Take a sharp left onto {way_name}",
  858. "destination": "Take a sharp left towards {destination}"
  859. },
  860. "sharp right": {
  861. "default": "Take a sharp right",
  862. "name": "Take a sharp right onto {way_name}",
  863. "destination": "Take a sharp right towards {destination}"
  864. },
  865. "slight left": {
  866. "default": "Continue slightly left",
  867. "name": "Continue slightly left onto {way_name}",
  868. "destination": "Continue slightly left towards {destination}"
  869. },
  870. "slight right": {
  871. "default": "Continue slightly right",
  872. "name": "Continue slightly right onto {way_name}",
  873. "destination": "Continue slightly right towards {destination}"
  874. },
  875. "uturn": {
  876. "default": "Make a U-turn",
  877. "name": "Make a U-turn onto {way_name}",
  878. "destination": "Make a U-turn towards {destination}"
  879. }
  880. },
  881. "notification": {
  882. "default": {
  883. "default": "Continue {modifier}",
  884. "name": "Continue {modifier} onto {way_name}",
  885. "destination" : "Continue {modifier} towards {destination}"
  886. },
  887. "uturn": {
  888. "default": "Make a U-turn",
  889. "name": "Make a U-turn onto {way_name}",
  890. "destination": "Make a U-turn towards {destination}"
  891. }
  892. },
  893. "off ramp": {
  894. "default": {
  895. "default": "Take the ramp",
  896. "name": "Take the ramp onto {way_name}",
  897. "destination": "Take the ramp towards {destination}"
  898. },
  899. "left": {
  900. "default": "Take the ramp on the left",
  901. "name": "Take the ramp on the left onto {way_name}",
  902. "destination": "Take the ramp on the left towards {destination}"
  903. },
  904. "right": {
  905. "default": "Take the ramp on the right",
  906. "name": "Take the ramp on the right onto {way_name}",
  907. "destination": "Take the ramp on the right towards {destination}"
  908. },
  909. "sharp left": {
  910. "default": "Take the ramp on the left",
  911. "name": "Take the ramp on the left onto {way_name}",
  912. "destination": "Take the ramp on the left towards {destination}"
  913. },
  914. "sharp right": {
  915. "default": "Take the ramp on the right",
  916. "name": "Take the ramp on the right onto {way_name}",
  917. "destination": "Take the ramp on the right towards {destination}"
  918. },
  919. "slight left": {
  920. "default": "Take the ramp on the left",
  921. "name": "Take the ramp on the left onto {way_name}",
  922. "destination": "Take the ramp on the left towards {destination}"
  923. },
  924. "slight right": {
  925. "default": "Take the ramp on the right",
  926. "name": "Take the ramp on the right onto {way_name}",
  927. "destination": "Take the ramp on the right towards {destination}"
  928. }
  929. },
  930. "on ramp": {
  931. "default": {
  932. "default": "Take the ramp",
  933. "name": "Take the ramp onto {way_name}",
  934. "destination": "Take the ramp towards {destination}"
  935. },
  936. "left": {
  937. "default": "Take the ramp on the left",
  938. "name": "Take the ramp on the left onto {way_name}",
  939. "destination": "Take the ramp on the left towards {destination}"
  940. },
  941. "right": {
  942. "default": "Take the ramp on the right",
  943. "name": "Take the ramp on the right onto {way_name}",
  944. "destination": "Take the ramp on the right towards {destination}"
  945. },
  946. "sharp left": {
  947. "default": "Take the ramp on the left",
  948. "name": "Take the ramp on the left onto {way_name}",
  949. "destination": "Take the ramp on the left towards {destination}"
  950. },
  951. "sharp right": {
  952. "default": "Take the ramp on the right",
  953. "name": "Take the ramp on the right onto {way_name}",
  954. "destination": "Take the ramp on the right towards {destination}"
  955. },
  956. "slight left": {
  957. "default": "Take the ramp on the left",
  958. "name": "Take the ramp on the left onto {way_name}",
  959. "destination": "Take the ramp on the left towards {destination}"
  960. },
  961. "slight right": {
  962. "default": "Take the ramp on the right",
  963. "name": "Take the ramp on the right onto {way_name}",
  964. "destination": "Take the ramp on the right towards {destination}"
  965. }
  966. },
  967. "rotary": {
  968. "default": {
  969. "default": {
  970. "default": "Enter the rotary",
  971. "name": "Enter the rotary and exit onto {way_name}",
  972. "destination": "Enter the rotary and exit towards {destination}"
  973. },
  974. "name": {
  975. "default": "Enter {rotary_name}",
  976. "name": "Enter {rotary_name} and exit onto {way_name}",
  977. "destination": "Enter {rotary_name} and exit towards {destination}"
  978. },
  979. "exit": {
  980. "default": "Enter the rotary and take the {exit_number} exit",
  981. "name": "Enter the rotary and take the {exit_number} exit onto {way_name}",
  982. "destination": "Enter the rotary and take the {exit_number} exit towards {destination}"
  983. },
  984. "name_exit": {
  985. "default": "Enter {rotary_name} and take the {exit_number} exit",
  986. "name": "Enter {rotary_name} and take the {exit_number} exit onto {way_name}",
  987. "destination": "Enter {rotary_name} and take the {exit_number} exit towards {destination}"
  988. }
  989. }
  990. },
  991. "roundabout": {
  992. "default": {
  993. "exit": {
  994. "default": "Enter the roundabout and take the {exit_number} exit",
  995. "name": "Enter the roundabout and take the {exit_number} exit onto {way_name}",
  996. "destination": "Enter the roundabout and take the {exit_number} exit towards {destination}"
  997. },
  998. "default": {
  999. "default": "Enter the roundabout",
  1000. "name": "Enter the roundabout and exit onto {way_name}",
  1001. "destination": "Enter the roundabout and exit towards {destination}"
  1002. }
  1003. }
  1004. },
  1005. "roundabout turn": {
  1006. "default": {
  1007. "default": "At the roundabout make a {modifier}",
  1008. "name": "At the roundabout make a {modifier} onto {way_name}",
  1009. "destination": "At the roundabout make a {modifier} towards {destination}"
  1010. },
  1011. "left": {
  1012. "default": "At the roundabout turn left",
  1013. "name": "At the roundabout turn left onto {way_name}",
  1014. "destination": "At the roundabout turn left towards {destination}"
  1015. },
  1016. "right": {
  1017. "default": "At the roundabout turn right",
  1018. "name": "At the roundabout turn right onto {way_name}",
  1019. "destination": "At the roundabout turn right towards {destination}"
  1020. },
  1021. "straight": {
  1022. "default": "At the roundabout continue straight",
  1023. "name": "At the roundabout continue straight onto {way_name}",
  1024. "destination": "At the roundabout continue straight towards {destination}"
  1025. }
  1026. },
  1027. "turn": {
  1028. "default": {
  1029. "default": "Make a {modifier}",
  1030. "name": "Make a {modifier} onto {way_name}",
  1031. "destination": "Make a {modifier} towards {destination}"
  1032. },
  1033. "left": {
  1034. "default": "Turn left",
  1035. "name": "Turn left onto {way_name}",
  1036. "destination": "Turn left towards {destination}"
  1037. },
  1038. "right": {
  1039. "default": "Turn right",
  1040. "name": "Turn right onto {way_name}",
  1041. "destination": "Turn right towards {destination}"
  1042. },
  1043. "straight": {
  1044. "default": "Go straight",
  1045. "name": "Go straight onto {way_name}",
  1046. "destination": "Go straight towards {destination}"
  1047. }
  1048. },
  1049. "use lane": {
  1050. "no_lanes": {
  1051. "default": "Continue straight"
  1052. },
  1053. "default": {
  1054. "default": "{lane_instruction}"
  1055. }
  1056. }
  1057. }
  1058. }
  1059. },{}],6:[function(_dereq_,module,exports){
  1060. module.exports={
  1061. "meta": {
  1062. "capitalizeFirstLetter": true
  1063. },
  1064. "v5": {
  1065. "constants": {
  1066. "ordinalize": {
  1067. "1": "première",
  1068. "2": "seconde",
  1069. "3": "troisième",
  1070. "4": "quatrième",
  1071. "5": "cinquième",
  1072. "6": "sixième",
  1073. "7": "setpième",
  1074. "8": "huitième",
  1075. "9": "neuvième",
  1076. "10": "dixième"
  1077. },
  1078. "direction": {
  1079. "north": "le nord",
  1080. "northeast": "le nord-est",
  1081. "east": "l'est",
  1082. "southeast": "le sud-est",
  1083. "south": "le sud",
  1084. "southwest": "le sud-ouest",
  1085. "west": "l'ouest",
  1086. "northwest": "le nord-ouest"
  1087. },
  1088. "modifier": {
  1089. "left": "à gauche",
  1090. "right": "à droite",
  1091. "sharp left": "franchement à gauche",
  1092. "sharp right": "franchement à droite",
  1093. "slight left": "légèrement à gauche",
  1094. "slight right": "légèrement à droite",
  1095. "straight": "tout droit",
  1096. "uturn": "demi-tour"
  1097. },
  1098. "lanes": {
  1099. "xo": "Serrer à droite",
  1100. "ox": "Serrer à gauche",
  1101. "xox": "Rester au milieu",
  1102. "oxo": "Rester à gauche ou à droite"
  1103. }
  1104. },
  1105. "modes": {
  1106. "ferry": {
  1107. "default": "Prendre le ferry",
  1108. "name": "Prendre le ferry {way_name}",
  1109. "destination": "Prendre le ferry en direction de {destination}"
  1110. }
  1111. },
  1112. "arrive": {
  1113. "default": {
  1114. "default": "Vous êtes arrivés à votre {nth} destination"
  1115. },
  1116. "left": {
  1117. "default": "Vous êtes arrivés à votre {nth} destination, sur la gauche"
  1118. },
  1119. "right": {
  1120. "default": "Vous êtes arrivés à votre {nth} destination, sur la droite"
  1121. },
  1122. "sharp left": {
  1123. "default": "Vous êtes arrivés à votre {nth} destination, sur la gauche"
  1124. },
  1125. "sharp right": {
  1126. "default": "Vous êtes arrivés à votre {nth} destination, sur la droite"
  1127. },
  1128. "slight right": {
  1129. "default": "Vous êtes arrivés à votre {nth} destination, sur la droite"
  1130. },
  1131. "slight left": {
  1132. "default": "Vous êtes arrivés à votre {nth} destination, sur la gauche"
  1133. },
  1134. "straight": {
  1135. "default": "Vous êtes arrivés à votre {nth} destination, droit devant"
  1136. }
  1137. },
  1138. "continue": {
  1139. "default": {
  1140. "default": "Continuer {modifier}",
  1141. "name": "Continuer {modifier} sur {way_name}",
  1142. "destination": "Continuer {modifier} en direction de {destination}"
  1143. },
  1144. "slight left": {
  1145. "default": "Continuer légèrement à gauche",
  1146. "name": "Continuer légèrement à gauche sur {way_name}",
  1147. "destination": "Continuer légèrement à gauche en direction de {destination}"
  1148. },
  1149. "slight right": {
  1150. "default": "Continuer légèrement à droite",
  1151. "name": "Continuer légèrement à droite sur {way_name}",
  1152. "destination": "Continuer légèrement à droite en direction de {destination}"
  1153. },
  1154. "uturn": {
  1155. "default": "Faire demi-tour",
  1156. "name": "Faire demi-tour sur {way_name}",
  1157. "destination": "Faire demi-tour en direction de {destination}"
  1158. }
  1159. },
  1160. "depart": {
  1161. "default": {
  1162. "default": "Rouler vers {direction}",
  1163. "name": "Rouler vers {direction} sur {way_name}"
  1164. }
  1165. },
  1166. "end of road": {
  1167. "default": {
  1168. "default": "Tourner {modifier}",
  1169. "name": "Tourner {modifier} sur {way_name}",
  1170. "destination": "Tourner {modifier} en direction de {destination}"
  1171. },
  1172. "straight": {
  1173. "default": "Continuer tout droit",
  1174. "name": "Continuer tout droit sur {way_name}",
  1175. "destination": "Continuer tout droit en direction de {destination}"
  1176. },
  1177. "uturn": {
  1178. "default": "Faire demi-tour à la fin de la route",
  1179. "name": "Faire demi-tour à la fin de la route {way_name}",
  1180. "destination": "Faire demi-tour à la fin de la route en direction de {destination}"
  1181. }
  1182. },
  1183. "fork": {
  1184. "default": {
  1185. "default": "Rester {modifier} à l'embranchement",
  1186. "name": "Rester {modifier} à l'embranchement sur {way_name}",
  1187. "destination": "Rester {modifier} à l'embranchement en direction de {destination}"
  1188. },
  1189. "slight left": {
  1190. "default": "Rester à gauche à l'embranchement",
  1191. "name": "Rester à gauche à l'embranchement sur {way_name}",
  1192. "destination": "Rester à gauche à l'embranchement en direction de {destination}"
  1193. },
  1194. "slight right": {
  1195. "default": "Rester à droite à l'embranchement",
  1196. "name": "Rester à droite à l'embranchement sur {way_name}",
  1197. "destination": "Rester à droite à l'embranchement en direction de {destination}"
  1198. },
  1199. "sharp left": {
  1200. "default": "Prendre à gauche à l'embranchement",
  1201. "name": "Prendre à gauche à l'embranchement sur {way_name}",
  1202. "destination": "Prendre à gauche à l'embranchement en direction de {destination}"
  1203. },
  1204. "sharp right": {
  1205. "default": "Prendre à droite à l'embranchement",
  1206. "name": "Prendre à droite à l'embranchement sur {way_name}",
  1207. "destination": "Prendre à droite à l'embranchement en direction de {destination}"
  1208. },
  1209. "uturn": {
  1210. "default": "Faire demi-tour",
  1211. "name": "Faire demi-tour sur {way_name}",
  1212. "destination": "Faire demi-tour en direction de {destination}"
  1213. }
  1214. },
  1215. "merge": {
  1216. "default": {
  1217. "default": "Rejoindre {modifier}",
  1218. "name": "Rejoindre {modifier} sur {way_name}",
  1219. "destination": "Rejoindre {modifier} en direction de {destination}"
  1220. },
  1221. "slight left": {
  1222. "default": "Rejoindre légèrement par la gauche",
  1223. "name": "Rejoindre {way_name} légèrement par la gauche",
  1224. "destination": "Rejoindre légèrement par la gauche la route en direction de {destination}"
  1225. },
  1226. "slight right": {
  1227. "default": "Rejoindre légèrement par la droite",
  1228. "name": "Rejoindre {way_name} légèrement par la droite",
  1229. "destination": "Rejoindre légèrement par la droite la route en direction de {destination}"
  1230. },
  1231. "sharp left": {
  1232. "default": "Rejoindre par la gauche",
  1233. "name": "Rejoindre {way_name} par la gauche",
  1234. "destination": "Rejoindre par la gauche la route en direction de {destination}"
  1235. },
  1236. "sharp right": {
  1237. "default": "Rejoindre par la droite",
  1238. "name": "Rejoindre {way_name} par la droite",
  1239. "destination": "Rejoindre par la droite la route en direction de {destination}"
  1240. },
  1241. "uturn": {
  1242. "default": "Fair demi-tour",
  1243. "name": "Fair demi-tour sur {way_name}",
  1244. "destination": "Fair demi-tour en direction de {destination}"
  1245. }
  1246. },
  1247. "new name": {
  1248. "default": {
  1249. "default": "Continuer {modifier}",
  1250. "name": "Continuer {modifier} sur {way_name}",
  1251. "destination": "Continuer {modifier} en direction de {destination}"
  1252. },
  1253. "sharp left": {
  1254. "default": "Prendre à gauche",
  1255. "name": "Prendre à gauche sur {way_name}",
  1256. "destination": "Prendre à gauche en direction de {destination}"
  1257. },
  1258. "sharp right": {
  1259. "default": "Prendre à droite",
  1260. "name": "Prendre à droite sur {way_name}",
  1261. "destination": "Prendre à droite en direction de {destination}"
  1262. },
  1263. "slight left": {
  1264. "default": "Continuer légèrement à gauche",
  1265. "name": "Continuer légèrement à gauche sur {way_name}",
  1266. "destination": "Continuer légèrement à gauche en direction de {destination}"
  1267. },
  1268. "slight right": {
  1269. "default": "Continuer légèrement à droite",
  1270. "name": "Continuer légèrement à droite sur {way_name}",
  1271. "destination": "Continuer légèrement à droite en direction de {destination}"
  1272. },
  1273. "uturn": {
  1274. "default": "Fair demi-tour",
  1275. "name": "Fair demi-tour sur {way_name}",
  1276. "destination": "Fair demi-tour en direction de {destination}"
  1277. }
  1278. },
  1279. "notification": {
  1280. "default": {
  1281. "default": "Continuer {modifier}",
  1282. "name": "Continuer {modifier} sur {way_name}",
  1283. "destination" : "Continuer {modifier} en direction de {destination}"
  1284. },
  1285. "uturn": {
  1286. "default": "Fair demi-tour",
  1287. "name": "Fair demi-tour sur {way_name}",
  1288. "destination": "Fair demi-tour en direction de {destination}"
  1289. }
  1290. },
  1291. "off ramp": {
  1292. "default": {
  1293. "default": "Prendre la sortie",
  1294. "name": "Prendre la sortie sur {way_name}",
  1295. "destination": "Prendre la sortie en direction de {destination}"
  1296. },
  1297. "left": {
  1298. "default": "Prendre la sortie à gauche",
  1299. "name": "Prendre la sortie à gauche sur {way_name}",
  1300. "destination": "Prendre la sortie à gauche en direction de {destination}"
  1301. },
  1302. "right": {
  1303. "default": "Prendre la sortie à droite",
  1304. "name": "Prendre la sortie à droite sur {way_name}",
  1305. "destination": "Prendre la sortie à droite en direction de {destination}"
  1306. },
  1307. "sharp left": {
  1308. "default": "Prendre la sortie à gauche",
  1309. "name": "Prendre la sortie à gauche sur {way_name}",
  1310. "destination": "Prendre la sortie à gauche en direction de {destination}"
  1311. },
  1312. "sharp right": {
  1313. "default": "Prendre la sortie à droite",
  1314. "name": "Prendre la sortie à droite sur {way_name}",
  1315. "destination": "Prendre la sortie à droite en direction de {destination}"
  1316. },
  1317. "slight left": {
  1318. "default": "Prendre la sortie à gauche",
  1319. "name": "Prendre la sortie à gauche sur {way_name}",
  1320. "destination": "Prendre la sortie à gauche en direction de {destination}"
  1321. },
  1322. "slight right": {
  1323. "default": "Prendre la sortie à droite",
  1324. "name": "Prendre la sortie à droite sur {way_name}",
  1325. "destination": "Prendre la sortie à droite en direction de {destination}"
  1326. }
  1327. },
  1328. "on ramp": {
  1329. "default": {
  1330. "default": "Prendre la sortie",
  1331. "name": "Prendre la sortie sur {way_name}",
  1332. "destination": "Prendre la sortie en direction de {destination}"
  1333. },
  1334. "left": {
  1335. "default": "Prendre la sortie à gauche",
  1336. "name": "Prendre la sortie à gauche sur {way_name}",
  1337. "destination": "Prendre la sortie à gauche en direction de {destination}"
  1338. },
  1339. "right": {
  1340. "default": "Prendre la sortie à droite",
  1341. "name": "Prendre la sortie à droite sur {way_name}",
  1342. "destination": "Prendre la sortie à droite en direction de {destination}"
  1343. },
  1344. "sharp left": {
  1345. "default": "Prendre la sortie à gauche",
  1346. "name": "Prendre la sortie à gauche sur {way_name}",
  1347. "destination": "Prendre la sortie à gauche en direction de {destination}"
  1348. },
  1349. "sharp right": {
  1350. "default": "Prendre la sortie à droite",
  1351. "name": "Prendre la sortie à droite sur {way_name}",
  1352. "destination": "Prendre la sortie à droite en direction de {destination}"
  1353. },
  1354. "slight left": {
  1355. "default": "Prendre la sortie à gauche",
  1356. "name": "Prendre la sortie à gauche sur {way_name}",
  1357. "destination": "Prendre la sortie à gauche en direction de {destination}"
  1358. },
  1359. "slight right": {
  1360. "default": "Prendre la sortie à droite",
  1361. "name": "Prendre la sortie à droite sur {way_name}",
  1362. "destination": "Prendre la sortie à droite en direction de {destination}"
  1363. }
  1364. },
  1365. "rotary": {
  1366. "default": {
  1367. "default": {
  1368. "default": "Entrer dans le rond-point",
  1369. "name": "Entrer dans le rond-point et sortir par {way_name}",
  1370. "destination": "Entrer dans le rond-point et sortir en direction de {destination}"
  1371. },
  1372. "name": {
  1373. "default": "Entrer dans le rond-point {rotary_name}",
  1374. "name": "Entrer dans le rond-point {rotary_name} et sortir par {way_name}",
  1375. "destination": "Entrer dans le rond-point {rotary_name} et sortir en direction de {destination}"
  1376. },
  1377. "exit": {
  1378. "default": "Entrer dans le rond-point et prendre la {exit_number} sortie",
  1379. "name": "Entrer dans le rond-point et prendre la {exit_number} sortie sur {way_name}",
  1380. "destination": "Entrer dans le rond-point et prendre la {exit_number} sortie en direction de {destination}"
  1381. },
  1382. "name_exit": {
  1383. "default": "Entrer dans le rond-point {rotary_name} et prendre la {exit_number} sortie",
  1384. "name": "Entrer dans le rond-point {rotary_name} et prendre la {exit_number} sortie sur {way_name}",
  1385. "destination": "Entrer dans le rond-point {rotary_name} et prendre la {exit_number} sortie en direction de {destination}"
  1386. }
  1387. }
  1388. },
  1389. "roundabout": {
  1390. "default": {
  1391. "exit": {
  1392. "default": "Entrer dans le rond-point et prendre la {exit_number} sortie",
  1393. "name": "Entrer dans le rond-point et prendre la {exit_number} sortie sur {way_name}",
  1394. "destination": "Entrer dans le rond-point et prendre la {exit_number} sortie en direction de {destination}"
  1395. },
  1396. "default": {
  1397. "default": "Entrer dans le rond-point",
  1398. "name": "Entrer dans le rond-point et sortir par {way_name}",
  1399. "destination": "Entrer dans le rond-point et sortir en direction de {destination}"
  1400. }
  1401. }
  1402. },
  1403. "roundabout turn": {
  1404. "default": {
  1405. "default": "Au rond-point, tourner {modifier}",
  1406. "name": "Au rond-point, tourner {modifier} sur {way_name}",
  1407. "destination": "Au rond-point, tourner {modifier} en direction de {destination}"
  1408. },
  1409. "left": {
  1410. "default": "Au rond-point, tourner à gauche",
  1411. "name": "Au rond-point, tourner à gauche sur {way_name}",
  1412. "destination": "Au rond-point, tourner à gauche en direction de {destination}"
  1413. },
  1414. "right": {
  1415. "default": "Au rond-point, tourner à droite",
  1416. "name": "Au rond-point, tourner à droite sur {way_name}",
  1417. "destination": "Au rond-point, tourner à droite en direction de {destination}"
  1418. },
  1419. "straight": {
  1420. "default": "Au rond-point, continuer tout droit",
  1421. "name": "Au rond-point, continuer tout droit sur {way_name}",
  1422. "destination": "Au rond-point, continuer tout droit en direction de {destination}"
  1423. }
  1424. },
  1425. "turn": {
  1426. "default": {
  1427. "default": "Tourner {modifier}",
  1428. "name": "Tourner {modifier} sur {way_name}",
  1429. "destination": "Tourner {modifier} en direction de {destination}"
  1430. },
  1431. "left": {
  1432. "default": "Tourner à gauche",
  1433. "name": "Tourner à gauche sur {way_name}",
  1434. "destination": "Tourner à gauche en direction de {destination}"
  1435. },
  1436. "right": {
  1437. "default": "Tourner à droite",
  1438. "name": "Tourner à droite sur {way_name}",
  1439. "destination": "Tourner à droite en direction de {destination}"
  1440. },
  1441. "straight": {
  1442. "default": "Aller tout droit",
  1443. "name": "Aller tout droit sur {way_name}",
  1444. "destination": "Aller tout droit en direction de {destination}"
  1445. }
  1446. },
  1447. "use lane": {
  1448. "no_lanes": {
  1449. "default": "Continuer tout droit"
  1450. },
  1451. "default": {
  1452. "default": "{lane_instruction} pour continuer {modifier}"
  1453. },
  1454. "straight": {
  1455. "default": "{lane_instruction}"
  1456. },
  1457. "left": {
  1458. "default": "{lane_instruction} pour tourner à gauche"
  1459. },
  1460. "right": {
  1461. "default": "{lane_instruction} pour tourner à droite"
  1462. }
  1463. }
  1464. }
  1465. }
  1466. },{}],7:[function(_dereq_,module,exports){
  1467. module.exports={
  1468. "meta": {
  1469. "capitalizeFirstLetter": true
  1470. },
  1471. "v5": {
  1472. "constants": {
  1473. "ordinalize": {
  1474. "1": "eerste",
  1475. "2": "tweede",
  1476. "3": "derde",
  1477. "4": "vierde",
  1478. "5": "vijfde",
  1479. "6": "zesde",
  1480. "7": "zevende",
  1481. "8": "achtste",
  1482. "9": "negende",
  1483. "10": "tiende"
  1484. },
  1485. "direction": {
  1486. "north": "noord",
  1487. "northeast": "noordoost",
  1488. "east": "oost",
  1489. "southeast": "zuidoost",
  1490. "south": "zuid",
  1491. "southwest": "zuidwest",
  1492. "west": "west",
  1493. "northwest": "noordwest"
  1494. },
  1495. "modifier": {
  1496. "left": "links",
  1497. "right": "rechts",
  1498. "sharp left": "linksaf",
  1499. "sharp right": "rechtsaf",
  1500. "slight left": "links",
  1501. "slight right": "rechts",
  1502. "straight": "rechtdoor",
  1503. "uturn": "omkeren"
  1504. },
  1505. "lanes": {
  1506. "xo": "Rechts aanhouden",
  1507. "ox": "Links aanhouden",
  1508. "xox": "In het midden blijven",
  1509. "oxo": "Links of rechts blijven"
  1510. }
  1511. },
  1512. "modes": {
  1513. "ferry": {
  1514. "default": "Neem het veer",
  1515. "name": "Neem het veer {way_name}",
  1516. "destination": "Neem het veer naar {destination}"
  1517. }
  1518. },
  1519. "arrive": {
  1520. "default": {
  1521. "default": "Je bent gearriveerd op de {nth} bestemming."
  1522. },
  1523. "left": {
  1524. "default": "Je bent gearriveerd. De {nth} bestemming bevindt zich links."
  1525. },
  1526. "right": {
  1527. "default": "Je bent gearriveerd. De {nth} bestemming bevindt zich rechts."
  1528. },
  1529. "sharp left": {
  1530. "default": "Je bent gearriveerd. De {nth} bestemming bevindt zich links."
  1531. },
  1532. "sharp right": {
  1533. "default": "Je bent gearriveerd. De {nth} bestemming bevindt zich rechts."
  1534. },
  1535. "slight right": {
  1536. "default": "Je bent gearriveerd. De {nth} bestemming bevindt zich rechts."
  1537. },
  1538. "slight left": {
  1539. "default": "Je bent gearriveerd. De {nth} bestemming bevindt zich links."
  1540. },
  1541. "straight": {
  1542. "default": "Je bent gearriveerd. De {nth} bestemming bevindt zich voor je."
  1543. }
  1544. },
  1545. "continue": {
  1546. "default": {
  1547. "default": "Ga {modifier}",
  1548. "name": "Ga {modifier} naar {way_name}",
  1549. "destination": "Ga {modifier} richting {destination}"
  1550. },
  1551. "slight left": {
  1552. "default": "Links aanhouden",
  1553. "name": "Links aanhouden naar {way_name}",
  1554. "destination": "Links aanhouden richting {destination}"
  1555. },
  1556. "slight right": {
  1557. "default": "Rechts aanhouden",
  1558. "name": "Rechts aanhouden naar {way_name}",
  1559. "destination": "Rechts aanhouden richting {destination}"
  1560. },
  1561. "uturn": {
  1562. "default": "Keer om",
  1563. "name": "Keer om naar {way_name}",
  1564. "destination": "Keer om richting {destination}"
  1565. }
  1566. },
  1567. "depart": {
  1568. "default": {
  1569. "default": "Vertrek in {direction}elijke richting",
  1570. "name": "Neem {way_name} in {direction}elijke richting"
  1571. }
  1572. },
  1573. "end of road": {
  1574. "default": {
  1575. "default": "Ga {modifier}",
  1576. "name": "Ga {modifier} naar {way_name}",
  1577. "destination": "Ga {modifier} richting {destination}"
  1578. },
  1579. "straight": {
  1580. "default": "Ga in de aangegeven richting",
  1581. "name": "Ga naar {way_name}",
  1582. "destination": "Ga richting {destination}"
  1583. },
  1584. "uturn": {
  1585. "default": "Keer om",
  1586. "name": "Keer om naar {way_name}",
  1587. "destination": "Keer om richting {destination}"
  1588. }
  1589. },
  1590. "fork": {
  1591. "default": {
  1592. "default": "Ga {modifier} op de splitsing",
  1593. "name": "Ga {modifier} op de splitsing naar {way_name}",
  1594. "destination": "Ga {modifier} op de splitsing richting {destination}"
  1595. },
  1596. "slight left": {
  1597. "default": "Links aanhouden op de splitsing",
  1598. "name": "Links aanhouden op de splitsing naar {way_name}",
  1599. "destination": "Links aanhouden op de splitsing richting {destination}"
  1600. },
  1601. "slight right": {
  1602. "default": "Rechts aanhouden op de splitsing",
  1603. "name": "Rechts aanhouden op de splitsing naar {way_name}",
  1604. "destination": "Rechts aanhouden op de splitsing richting {destination}"
  1605. },
  1606. "sharp left": {
  1607. "default": "Linksaf op de splitsing",
  1608. "name": "Linksaf op de splitsing naar {way_name}",
  1609. "destination": "Linksaf op de splitsing richting {destination}"
  1610. },
  1611. "sharp right": {
  1612. "default": "Rechtsaf op de splitsing",
  1613. "name": "Rechtsaf op de splitsing naar {way_name}",
  1614. "destination": "Rechtsaf op de splitsing richting {destination}"
  1615. },
  1616. "uturn": {
  1617. "default": "Keer om",
  1618. "name": "Keer om naar {way_name}",
  1619. "destination": "Keer om richting {destination}"
  1620. }
  1621. },
  1622. "merge": {
  1623. "default": {
  1624. "default": "Bij de splitsing {modifier}",
  1625. "name": "Bij de splitsing {modifier} naar {way_name}",
  1626. "destination": "Bij de splitsing {modifier} richting {destination}"
  1627. },
  1628. "slight left": {
  1629. "default": "Bij de splitsing links aanhouden",
  1630. "name": "Bij de splitsing links aanhouden naar {way_name}",
  1631. "destination": "Bij de splitsing links aanhouden richting {destination}"
  1632. },
  1633. "slight right": {
  1634. "default": "Bij de splitsing rechts aanhouden",
  1635. "name": "Bij de splitsing rechts aanhouden naar {way_name}",
  1636. "destination": "Bij de splitsing rechts aanhouden richting {destination}"
  1637. },
  1638. "sharp left": {
  1639. "default": "Bij de splitsing linksaf",
  1640. "name": "Bij de splitsing linksaf naar {way_name}",
  1641. "destination": "Bij de splitsing linksaf richting {destination}"
  1642. },
  1643. "sharp right": {
  1644. "default": "Bij de splitsing rechtsaf",
  1645. "name": "Bij de splitsing rechtsaf naar {way_name}",
  1646. "destination": "Bij de splitsing rechtsaf richting {destination}"
  1647. },
  1648. "uturn": {
  1649. "default": "Keer om",
  1650. "name": "Keer om naar {way_name}",
  1651. "destination": "Keer om richting {destination}"
  1652. }
  1653. },
  1654. "new name": {
  1655. "default": {
  1656. "default": "Ga {modifier}",
  1657. "name": "Ga {modifier} naar {way_name}",
  1658. "destination": "Ga {modifier} richting {destination}"
  1659. },
  1660. "sharp left": {
  1661. "default": "Linksaf",
  1662. "name": "Linksaf naar {way_name}",
  1663. "destination": "Linksaf richting {destination}"
  1664. },
  1665. "sharp right": {
  1666. "default": "Rechtsaf",
  1667. "name": "Rechtsaf naar {way_name}",
  1668. "destination": "Rechtsaf richting {destination}"
  1669. },
  1670. "slight left": {
  1671. "default": "Links aanhouden",
  1672. "name": "Links aanhouden naar {way_name}",
  1673. "destination": "Links aanhouden richting {destination}"
  1674. },
  1675. "slight right": {
  1676. "default": "Rechts aanhouden",
  1677. "name": "Rechts aanhouden naar {way_name}",
  1678. "destination": "Rechts aanhouden richting {destination}"
  1679. },
  1680. "uturn": {
  1681. "default": "Keer om",
  1682. "name": "Keer om naar {way_name}",
  1683. "destination": "Keer om richting {destination}"
  1684. }
  1685. },
  1686. "notification": {
  1687. "default": {
  1688. "default": "Ga {modifier}",
  1689. "name": "Ga {modifier} naar {way_name}",
  1690. "destination" : "Ga {modifier} richting {destination}"
  1691. },
  1692. "uturn": {
  1693. "default": "Keer om",
  1694. "name": "Keer om naar {way_name}",
  1695. "destination": "Keer om richting {destination}"
  1696. }
  1697. },
  1698. "off ramp": {
  1699. "default": {
  1700. "default": "Neem de afrit",
  1701. "name": "Neem de afrit naar {way_name}",
  1702. "destination": "Neem de afrit richting {destination}"
  1703. },
  1704. "left": {
  1705. "default": "Neem de afrit links",
  1706. "name": "Neem de afrit links naar {way_name}",
  1707. "destination": "Neem de afrit links richting {destination}"
  1708. },
  1709. "right": {
  1710. "default": "Neem de afrit rechts",
  1711. "name": "Neem de afrit rechts naar {way_name}",
  1712. "destination": "Neem de afrit rechts richting {destination}"
  1713. },
  1714. "sharp left": {
  1715. "default": "Neem de afrit links",
  1716. "name": "Neem de afrit links naar {way_name}",
  1717. "destination": "Neem de afrit links richting {destination}"
  1718. },
  1719. "sharp right": {
  1720. "default": "Neem de afrit rechts",
  1721. "name": "Neem de afrit rechts naar {way_name}",
  1722. "destination": "Neem de afrit rechts richting {destination}"
  1723. },
  1724. "slight left": {
  1725. "default": "Neem de afrit links",
  1726. "name": "Neem de afrit links naar {way_name}",
  1727. "destination": "Neem de afrit links richting {destination}"
  1728. },
  1729. "slight right": {
  1730. "default": "Neem de afrit rechts",
  1731. "name": "Neem de afrit rechts naar {way_name}",
  1732. "destination": "Neem de afrit rechts richting {destination}"
  1733. }
  1734. },
  1735. "on ramp": {
  1736. "default": {
  1737. "default": "Neem de oprit",
  1738. "name": "Neem de oprit naar {way_name}",
  1739. "destination": "Neem de oprit richting {destination}"
  1740. },
  1741. "left": {
  1742. "default": "Neem de oprit links",
  1743. "name": "Neem de oprit links naar {way_name}",
  1744. "destination": "Neem de oprit links richting {destination}"
  1745. },
  1746. "right": {
  1747. "default": "Neem de oprit rechts",
  1748. "name": "Neem de oprit rechts naar {way_name}",
  1749. "destination": "Neem de oprit rechts richting {destination}"
  1750. },
  1751. "sharp left": {
  1752. "default": "Neem de oprit links",
  1753. "name": "Neem de oprit links naar {way_name}",
  1754. "destination": "Neem de oprit links richting {destination}"
  1755. },
  1756. "sharp right": {
  1757. "default": "Neem de oprit rechts",
  1758. "name": "Neem de oprit rechts naar {way_name}",
  1759. "destination": "Neem de oprit rechts richting {destination}"
  1760. },
  1761. "slight left": {
  1762. "default": "Neem de oprit links",
  1763. "name": "Neem de oprit links naar {way_name}",
  1764. "destination": "Neem de oprit links richting {destination}"
  1765. },
  1766. "slight right": {
  1767. "default": "Neem de oprit rechts",
  1768. "name": "Neem de oprit rechts naar {way_name}",
  1769. "destination": "Neem de oprit rechts richting {destination}"
  1770. }
  1771. },
  1772. "rotary": {
  1773. "default": {
  1774. "default": {
  1775. "default": "Ga het knooppunt op",
  1776. "name": "Verlaat het knooppunt naar {way_name}",
  1777. "destination": "Verlaat het knooppunt richting {destination}"
  1778. },
  1779. "name": {
  1780. "default": "Ga het knooppunt {rotary_name} op",
  1781. "name": "Verlaat het knooppunt {rotary_name} naar {way_name}",
  1782. "destination": "Verlaat het knooppunt {rotary_name} richting {destination}"
  1783. },
  1784. "exit": {
  1785. "default": "Ga het knooppunt op en neem afslag {exit_number}",
  1786. "name": "Ga het knooppunt op en neem afslag {exit_number} naar {way_name}",
  1787. "destination": "Ga het knooppunt op en neem afslag {exit_number} richting {destination}"
  1788. },
  1789. "name_exit": {
  1790. "default": "Ga het knooppunt {rotary_name} op en neem afslag {exit_number}",
  1791. "name": "Ga het knooppunt {rotary_name} op en neem afslag {exit_number} naar {way_name}",
  1792. "destination": "Ga het knooppunt {rotary_name} op en neem afslag {exit_number} richting {destination}"
  1793. }
  1794. }
  1795. },
  1796. "roundabout": {
  1797. "default": {
  1798. "exit": {
  1799. "default": "Ga de rotonde op en neem afslag {exit_number}",
  1800. "name": "Ga de rotonde op en neem afslag {exit_number} naar {way_name}",
  1801. "destination": "Ga de rotonde op en neem afslag {exit_number} richting {destination}"
  1802. },
  1803. "default": {
  1804. "default": "Ga de rotonde op",
  1805. "name": "Verlaat de rotonde naar {way_name}",
  1806. "destination": "Verlaat de rotonde richting {destination}"
  1807. }
  1808. }
  1809. },
  1810. "roundabout turn": {
  1811. "default": {
  1812. "default": "Ga {modifier} op de rotonde",
  1813. "name": "Ga {modifier} op de rotonde naar {way_name}",
  1814. "destination": "Ga {modifier} op de rotonde richting {destination}"
  1815. },
  1816. "left": {
  1817. "default": "Ga links op de rotonde",
  1818. "name": "Ga links op de rotonde naar {way_name}",
  1819. "destination": "Ga links op de rotonde richting {destination}"
  1820. },
  1821. "right": {
  1822. "default": "Ga rechts op de rotonde",
  1823. "name": "Ga rechts op de rotonde naar {way_name}",
  1824. "destination": "Ga rechts op de rotonde richting {destination}"
  1825. },
  1826. "straight": {
  1827. "default": "Rechtdoor op de rotonde",
  1828. "name": "Rechtdoor op de rotonde naar {way_name}",
  1829. "destination": "Rechtdoor op de rotonde richting {destination}"
  1830. }
  1831. },
  1832. "turn": {
  1833. "default": {
  1834. "default": "Ga {modifier}",
  1835. "name": "Ga {modifier} naar {way_name}",
  1836. "destination": "Ga {modifier} richting {destination}"
  1837. },
  1838. "left": {
  1839. "default": "Ga linksaf",
  1840. "name": "Ga linksaf naar {way_name}",
  1841. "destination": "Ga linksaf richting {destination}"
  1842. },
  1843. "right": {
  1844. "default": "Ga rechtsaf",
  1845. "name": "Ga rechtsaf naar {way_name}",
  1846. "destination": "Ga rechtsaf richting {destination}"
  1847. },
  1848. "straight": {
  1849. "default": "Ga rechtdoor",
  1850. "name": "Ga rechtdoor naar {way_name}",
  1851. "destination": "Ga rechtdoor richting {destination}"
  1852. }
  1853. },
  1854. "use lane": {
  1855. "no_lanes": {
  1856. "default": "Rechtdoor"
  1857. },
  1858. "default": {
  1859. "default": "{lane_instruction} ga {modifier}"
  1860. },
  1861. "straight": {
  1862. "default": "{lane_instruction}"
  1863. },
  1864. "left": {
  1865. "default": "{lane_instruction} om links te gaan"
  1866. },
  1867. "right": {
  1868. "default": "{lane_instruction} om rechts te gaan"
  1869. }
  1870. }
  1871. }
  1872. }
  1873. },{}],8:[function(_dereq_,module,exports){
  1874. module.exports={
  1875. "meta": {
  1876. "capitalizeFirstLetter": false
  1877. },
  1878. "v5": {
  1879. "constants": {
  1880. "ordinalize": {
  1881. "1": "第一",
  1882. "2": "第二",
  1883. "3": "第三",
  1884. "4": "第四",
  1885. "5": "第五",
  1886. "6": "第六",
  1887. "7": "第七",
  1888. "8": "第八",
  1889. "9": "第九",
  1890. "10": "第十"
  1891. },
  1892. "direction": {
  1893. "north": "北",
  1894. "northeast": "东北",
  1895. "east": "东",
  1896. "southeast": "东南",
  1897. "south": "南",
  1898. "southwest": "西南",
  1899. "west": "西",
  1900. "northwest": "西北"
  1901. },
  1902. "modifier": {
  1903. "left": "向左",
  1904. "right": "向右",
  1905. "sharp left": "向左",
  1906. "sharp right": "向右",
  1907. "slight left": "向左",
  1908. "slight right": "向右",
  1909. "straight": "直行",
  1910. "uturn": "调头"
  1911. },
  1912. "lanes": {
  1913. "xo": "靠右直行",
  1914. "ox": "靠左直行",
  1915. "xox": "保持在道路中间直行",
  1916. "oxo": "保持在道路两侧直行"
  1917. }
  1918. },
  1919. "modes": {
  1920. "ferry": {
  1921. "default": "乘坐轮渡",
  1922. "name": "乘坐{way_name}轮渡",
  1923. "destination": "乘坐开往{destination}的轮渡"
  1924. }
  1925. },
  1926. "arrive": {
  1927. "default": {
  1928. "default": "您已经到达您的{nth}个目的地"
  1929. },
  1930. "left": {
  1931. "default": "您已经到达您的{nth}个目的地,在道路左侧"
  1932. },
  1933. "right": {
  1934. "default": "您已经到达您的{nth}个目的地,在道路右侧"
  1935. },
  1936. "sharp left": {
  1937. "default": "您已经到达您的{nth}个目的地,在道路左侧"
  1938. },
  1939. "sharp right": {
  1940. "default": "您已经到达您的{nth}个目的地,在道路右侧"
  1941. },
  1942. "slight right": {
  1943. "default": "您已经到达您的{nth}个目的地,在道路右侧"
  1944. },
  1945. "slight left": {
  1946. "default": "您已经到达您的{nth}个目的地,在道路左侧"
  1947. },
  1948. "straight": {
  1949. "default": "您已经到达您的{nth}个目的地,在您正前方"
  1950. }
  1951. },
  1952. "continue": {
  1953. "default": {
  1954. "default": "继续{modifier}",
  1955. "name": "继续{modifier},上{way_name}",
  1956. "destination": "继续{modifier}行驶,前往{destination}"
  1957. },
  1958. "uturn": {
  1959. "default": "调头",
  1960. "name": "调头上{way_name}",
  1961. "destination": "调头后前往{destination}"
  1962. }
  1963. },
  1964. "depart": {
  1965. "default": {
  1966. "default": "出发向{direction}",
  1967. "name": "出发向{direction},上{way_name}"
  1968. }
  1969. },
  1970. "end of road": {
  1971. "default": {
  1972. "default": "{modifier}行驶",
  1973. "name": "{modifier}行驶,上{way_name}",
  1974. "destination": "{modifier}行驶,前往{destination}"
  1975. },
  1976. "straight": {
  1977. "default": "继续直行",
  1978. "name": "继续直行,上{way_name}",
  1979. "destination": "继续直行,前往{destination}"
  1980. },
  1981. "uturn": {
  1982. "default": "在道路尽头调头",
  1983. "name": "在道路尽头调头上{way_name}",
  1984. "destination": "在道路尽头调头,前往{destination}"
  1985. }
  1986. },
  1987. "fork": {
  1988. "default": {
  1989. "default": "在岔道保持{modifier}",
  1990. "name": "在岔道保持{modifier},上{way_name}",
  1991. "destination": "在岔道保持{modifier},前往{destination}"
  1992. },
  1993. "uturn": {
  1994. "default": "调头",
  1995. "name": "调头,上{way_name}",
  1996. "destination": "调头,前往{destination}"
  1997. }
  1998. },
  1999. "merge": {
  2000. "default": {
  2001. "default": "{modifier}并道",
  2002. "name": "{modifier}并道,上{way_name}",
  2003. "destination": "{modifier}并道,前往{destination}"
  2004. },
  2005. "uturn": {
  2006. "default": "调头",
  2007. "name": "调头,上{way_name}",
  2008. "destination": "调头,前往{destination}"
  2009. }
  2010. },
  2011. "new name": {
  2012. "default": {
  2013. "default": "继续{modifier}",
  2014. "name": "继续{modifier},上{way_name}",
  2015. "destination": "继续{modifier},前往{destination}"
  2016. },
  2017. "uturn": {
  2018. "default": "调头",
  2019. "name": "调头,上{way_name}",
  2020. "destination": "调头,前往{destination}"
  2021. }
  2022. },
  2023. "notification": {
  2024. "default": {
  2025. "default": "继续{modifier}",
  2026. "name": "继续{modifier},上{way_name}",
  2027. "destination" : "继续{modifier},前往{destination}"
  2028. },
  2029. "uturn": {
  2030. "default": "调头",
  2031. "name": "调头,上{way_name}",
  2032. "destination": "调头,前往{destination}"
  2033. }
  2034. },
  2035. "off ramp": {
  2036. "default": {
  2037. "default": "上匝道",
  2038. "name": "通过匝道驶入{way_name}",
  2039. "destination": "通过匝道前往{destination}"
  2040. },
  2041. "left": {
  2042. "default": "通过左边的匝道",
  2043. "name": "通过左边的匝道驶入{way_name}",
  2044. "destination": "通过左边的匝道前往{destination}"
  2045. },
  2046. "right": {
  2047. "default": "通过右边的匝道",
  2048. "name": "通过右边的匝道驶入{way_name}",
  2049. "destination": "通过右边的匝道前往{destination}"
  2050. }
  2051. },
  2052. "on ramp": {
  2053. "default": {
  2054. "default": "通过匝道",
  2055. "name": "通过匝道驶入{way_name}",
  2056. "destination": "通过匝道前往{destination}"
  2057. },
  2058. "left": {
  2059. "default": "通过左边的匝道",
  2060. "name": "通过左边的匝道驶入{way_name}",
  2061. "destination": "通过左边的匝道前往{destination}"
  2062. },
  2063. "right": {
  2064. "default": "通过右边的匝道",
  2065. "name": "通过右边的匝道驶入{way_name}",
  2066. "destination": "通过右边的匝道前往{destination}"
  2067. }
  2068. },
  2069. "rotary": {
  2070. "default": {
  2071. "default": {
  2072. "default": "进入环岛",
  2073. "name": "通过环岛后驶入{way_name}",
  2074. "destination": "通过环岛前往{destination}"
  2075. },
  2076. "name": {
  2077. "default": "进入{rotary_name}环岛",
  2078. "name": "通过{rotary_name}环岛后驶入{way_name}",
  2079. "destination": "通过{rotary_name}环岛后前往{destination}"
  2080. },
  2081. "exit": {
  2082. "default": "进入环岛并从{exit_number}出口驶出",
  2083. "name": "进入环岛后从{exit_number}出口驶出进入{way_name}",
  2084. "destination": "进入环岛后从{exit_number}出口驶出前往{destination}"
  2085. },
  2086. "name_exit": {
  2087. "default": "进入{rotary_name}环岛后从{exit_number}出口驶出",
  2088. "name": "进入{rotary_name}环岛后从{exit_number}出口驶出进入{way_name}",
  2089. "destination": "进入{rotary_name}环岛后从{exit_number}出口驶出前往{destination}"
  2090. }
  2091. }
  2092. },
  2093. "roundabout": {
  2094. "default": {
  2095. "exit": {
  2096. "default": "进入环岛后从{exit_number}出口驶出",
  2097. "name": "进入环岛后从{exit_number}出口驶出前往{way_name}",
  2098. "destination": "进入环岛后从{exit_number}出口驶出前往{destination}"
  2099. },
  2100. "default": {
  2101. "default": "进入环岛",
  2102. "name": "通过环岛后驶入{way_name}",
  2103. "destination": "通过环岛后前往{destination}"
  2104. }
  2105. }
  2106. },
  2107. "roundabout turn": {
  2108. "default": {
  2109. "default": "在环岛{modifier}行驶",
  2110. "name": "在环岛{modifier}行驶,上{way_name}",
  2111. "destination": "在环岛{modifier}行驶,前往{destination}"
  2112. },
  2113. "left": {
  2114. "default": "在环岛左转",
  2115. "name": "在环岛左转,上{way_name}",
  2116. "destination": "在环岛左转,前往{destination}"
  2117. },
  2118. "right": {
  2119. "default": "在环岛右转",
  2120. "name": "在环岛右转,上{way_name}",
  2121. "destination": "在环岛右转,前往{destination}"
  2122. },
  2123. "straight": {
  2124. "default": "在环岛继续直行",
  2125. "name": "在环岛继续直行,上{way_name}",
  2126. "destination": "在环岛继续直行,前往{destination}"
  2127. }
  2128. },
  2129. "turn": {
  2130. "default": {
  2131. "default": "{modifier}转弯",
  2132. "name": "{modifier}转弯,上{way_name}",
  2133. "destination": "{modifier}转弯,前往{destination}"
  2134. },
  2135. "left": {
  2136. "default": "左转",
  2137. "name": "左转,上{way_name}",
  2138. "destination": "左转,前往{destination}"
  2139. },
  2140. "right": {
  2141. "default": "右转",
  2142. "name": "右转,上{way_name}",
  2143. "destination": "右转,前往{destination}"
  2144. },
  2145. "straight": {
  2146. "default": "直行",
  2147. "name": "直行,上{way_name}",
  2148. "destination": "直行,前往{destination}"
  2149. }
  2150. },
  2151. "use lane": {
  2152. "no_lanes": {
  2153. "default": "继续直行"
  2154. },
  2155. "default": {
  2156. "default": "{lane_instruction}然后{modifier}"
  2157. },
  2158. "straight": {
  2159. "default": "{lane_instruction}"
  2160. },
  2161. "left": {
  2162. "default": "{lane_instruction}然后左转"
  2163. },
  2164. "right": {
  2165. "default": "{lane_instruction}然后右转"
  2166. }
  2167. }
  2168. }
  2169. }
  2170. },{}],9:[function(_dereq_,module,exports){
  2171. 'use strict';
  2172. /**
  2173. * Based off of [the offical Google document](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
  2174. *
  2175. * Some parts from [this implementation](http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/PolylineEncoder.js)
  2176. * by [Mark McClure](http://facstaff.unca.edu/mcmcclur/)
  2177. *
  2178. * @module polyline
  2179. */
  2180. var polyline = {};
  2181. function encode(coordinate, factor) {
  2182. coordinate = Math.round(coordinate * factor);
  2183. coordinate <<= 1;
  2184. if (coordinate < 0) {
  2185. coordinate = ~coordinate;
  2186. }
  2187. var output = '';
  2188. while (coordinate >= 0x20) {
  2189. output += String.fromCharCode((0x20 | (coordinate & 0x1f)) + 63);
  2190. coordinate >>= 5;
  2191. }
  2192. output += String.fromCharCode(coordinate + 63);
  2193. return output;
  2194. }
  2195. /**
  2196. * Decodes to a [latitude, longitude] coordinates array.
  2197. *
  2198. * This is adapted from the implementation in Project-OSRM.
  2199. *
  2200. * @param {String} str
  2201. * @param {Number} precision
  2202. * @returns {Array}
  2203. *
  2204. * @see https://github.com/Project-OSRM/osrm-frontend/blob/master/WebContent/routing/OSRM.RoutingGeometry.js
  2205. */
  2206. polyline.decode = function(str, precision) {
  2207. var index = 0,
  2208. lat = 0,
  2209. lng = 0,
  2210. coordinates = [],
  2211. shift = 0,
  2212. result = 0,
  2213. byte = null,
  2214. latitude_change,
  2215. longitude_change,
  2216. factor = Math.pow(10, precision || 5);
  2217. // Coordinates have variable length when encoded, so just keep
  2218. // track of whether we've hit the end of the string. In each
  2219. // loop iteration, a single coordinate is decoded.
  2220. while (index < str.length) {
  2221. // Reset shift, result, and byte
  2222. byte = null;
  2223. shift = 0;
  2224. result = 0;
  2225. do {
  2226. byte = str.charCodeAt(index++) - 63;
  2227. result |= (byte & 0x1f) << shift;
  2228. shift += 5;
  2229. } while (byte >= 0x20);
  2230. latitude_change = ((result & 1) ? ~(result >> 1) : (result >> 1));
  2231. shift = result = 0;
  2232. do {
  2233. byte = str.charCodeAt(index++) - 63;
  2234. result |= (byte & 0x1f) << shift;
  2235. shift += 5;
  2236. } while (byte >= 0x20);
  2237. longitude_change = ((result & 1) ? ~(result >> 1) : (result >> 1));
  2238. lat += latitude_change;
  2239. lng += longitude_change;
  2240. coordinates.push([lat / factor, lng / factor]);
  2241. }
  2242. return coordinates;
  2243. };
  2244. /**
  2245. * Encodes the given [latitude, longitude] coordinates array.
  2246. *
  2247. * @param {Array.<Array.<Number>>} coordinates
  2248. * @param {Number} precision
  2249. * @returns {String}
  2250. */
  2251. polyline.encode = function(coordinates, precision) {
  2252. if (!coordinates.length) { return ''; }
  2253. var factor = Math.pow(10, precision || 5),
  2254. output = encode(coordinates[0][0], factor) + encode(coordinates[0][1], factor);
  2255. for (var i = 1; i < coordinates.length; i++) {
  2256. var a = coordinates[i], b = coordinates[i - 1];
  2257. output += encode(a[0] - b[0], factor);
  2258. output += encode(a[1] - b[1], factor);
  2259. }
  2260. return output;
  2261. };
  2262. function flipped(coords) {
  2263. var flipped = [];
  2264. for (var i = 0; i < coords.length; i++) {
  2265. flipped.push(coords[i].slice().reverse());
  2266. }
  2267. return flipped;
  2268. }
  2269. /**
  2270. * Encodes a GeoJSON LineString feature/geometry.
  2271. *
  2272. * @param {Object} geojson
  2273. * @param {Number} precision
  2274. * @returns {String}
  2275. */
  2276. polyline.fromGeoJSON = function(geojson, precision) {
  2277. if (geojson && geojson.type === 'Feature') {
  2278. geojson = geojson.geometry;
  2279. }
  2280. if (!geojson || geojson.type !== 'LineString') {
  2281. throw new Error('Input must be a GeoJSON LineString');
  2282. }
  2283. return polyline.encode(flipped(geojson.coordinates), precision);
  2284. };
  2285. /**
  2286. * Decodes to a GeoJSON LineString geometry.
  2287. *
  2288. * @param {String} str
  2289. * @param {Number} precision
  2290. * @returns {Object}
  2291. */
  2292. polyline.toGeoJSON = function(str, precision) {
  2293. var coords = polyline.decode(str, precision);
  2294. return {
  2295. type: 'LineString',
  2296. coordinates: flipped(coords)
  2297. };
  2298. };
  2299. if (typeof module === 'object' && module.exports) {
  2300. module.exports = polyline;
  2301. }
  2302. },{}],10:[function(_dereq_,module,exports){
  2303. (function (global){
  2304. (function() {
  2305. 'use strict';
  2306. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  2307. module.exports = L.Class.extend({
  2308. options: {
  2309. timeout: 500,
  2310. blurTimeout: 100,
  2311. noResultsMessage: 'No results found.'
  2312. },
  2313. initialize: function(elem, callback, context, options) {
  2314. L.setOptions(this, options);
  2315. this._elem = elem;
  2316. this._resultFn = options.resultFn ? L.Util.bind(options.resultFn, options.resultContext) : null;
  2317. this._autocomplete = options.autocompleteFn ? L.Util.bind(options.autocompleteFn, options.autocompleteContext) : null;
  2318. this._selectFn = L.Util.bind(callback, context);
  2319. this._container = L.DomUtil.create('div', 'leaflet-routing-geocoder-result');
  2320. this._resultTable = L.DomUtil.create('table', '', this._container);
  2321. // TODO: looks a bit like a kludge to register same for input and keypress -
  2322. // browsers supporting both will get duplicate events; just registering
  2323. // input will not catch enter, though.
  2324. L.DomEvent.addListener(this._elem, 'input', this._keyPressed, this);
  2325. L.DomEvent.addListener(this._elem, 'keypress', this._keyPressed, this);
  2326. L.DomEvent.addListener(this._elem, 'keydown', this._keyDown, this);
  2327. L.DomEvent.addListener(this._elem, 'blur', function() {
  2328. if (this._isOpen) {
  2329. this.close();
  2330. }
  2331. }, this);
  2332. },
  2333. close: function() {
  2334. L.DomUtil.removeClass(this._container, 'leaflet-routing-geocoder-result-open');
  2335. this._isOpen = false;
  2336. },
  2337. _open: function() {
  2338. var rect = this._elem.getBoundingClientRect();
  2339. if (!this._container.parentElement) {
  2340. // See notes section under https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX
  2341. // This abomination is required to support all flavors of IE
  2342. var scrollX = (window.pageXOffset !== undefined) ? window.pageXOffset
  2343. : (document.documentElement || document.body.parentNode || document.body).scrollLeft;
  2344. var scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset
  2345. : (document.documentElement || document.body.parentNode || document.body).scrollTop;
  2346. this._container.style.left = (rect.left + scrollX) + 'px';
  2347. this._container.style.top = (rect.bottom + scrollY) + 'px';
  2348. this._container.style.width = (rect.right - rect.left) + 'px';
  2349. document.body.appendChild(this._container);
  2350. }
  2351. L.DomUtil.addClass(this._container, 'leaflet-routing-geocoder-result-open');
  2352. this._isOpen = true;
  2353. },
  2354. _setResults: function(results) {
  2355. var i,
  2356. tr,
  2357. td,
  2358. text;
  2359. delete this._selection;
  2360. this._results = results;
  2361. while (this._resultTable.firstChild) {
  2362. this._resultTable.removeChild(this._resultTable.firstChild);
  2363. }
  2364. for (i = 0; i < results.length; i++) {
  2365. tr = L.DomUtil.create('tr', '', this._resultTable);
  2366. tr.setAttribute('data-result-index', i);
  2367. td = L.DomUtil.create('td', '', tr);
  2368. text = document.createTextNode(results[i].name);
  2369. td.appendChild(text);
  2370. // mousedown + click because:
  2371. // http://stackoverflow.com/questions/10652852/jquery-fire-click-before-blur-event
  2372. L.DomEvent.addListener(td, 'mousedown', L.DomEvent.preventDefault);
  2373. L.DomEvent.addListener(td, 'click', this._createClickListener(results[i]));
  2374. }
  2375. if (!i) {
  2376. tr = L.DomUtil.create('tr', '', this._resultTable);
  2377. td = L.DomUtil.create('td', 'leaflet-routing-geocoder-no-results', tr);
  2378. td.innerHTML = this.options.noResultsMessage;
  2379. }
  2380. this._open();
  2381. if (results.length > 0) {
  2382. // Select the first entry
  2383. this._select(1);
  2384. }
  2385. },
  2386. _createClickListener: function(r) {
  2387. var resultSelected = this._resultSelected(r);
  2388. return L.bind(function() {
  2389. this._elem.blur();
  2390. resultSelected();
  2391. }, this);
  2392. },
  2393. _resultSelected: function(r) {
  2394. return L.bind(function() {
  2395. this.close();
  2396. this._elem.value = r.name;
  2397. this._lastCompletedText = r.name;
  2398. this._selectFn(r);
  2399. }, this);
  2400. },
  2401. _keyPressed: function(e) {
  2402. var index;
  2403. if (this._isOpen && e.keyCode === 13 && this._selection) {
  2404. index = parseInt(this._selection.getAttribute('data-result-index'), 10);
  2405. this._resultSelected(this._results[index])();
  2406. L.DomEvent.preventDefault(e);
  2407. return;
  2408. }
  2409. if (e.keyCode === 13) {
  2410. this._complete(this._resultFn, true);
  2411. return;
  2412. }
  2413. if (this._autocomplete && document.activeElement === this._elem) {
  2414. if (this._timer) {
  2415. clearTimeout(this._timer);
  2416. }
  2417. this._timer = setTimeout(L.Util.bind(function() { this._complete(this._autocomplete); }, this),
  2418. this.options.timeout);
  2419. return;
  2420. }
  2421. this._unselect();
  2422. },
  2423. _select: function(dir) {
  2424. var sel = this._selection;
  2425. if (sel) {
  2426. L.DomUtil.removeClass(sel.firstChild, 'leaflet-routing-geocoder-selected');
  2427. sel = sel[dir > 0 ? 'nextSibling' : 'previousSibling'];
  2428. }
  2429. if (!sel) {
  2430. sel = this._resultTable[dir > 0 ? 'firstChild' : 'lastChild'];
  2431. }
  2432. if (sel) {
  2433. L.DomUtil.addClass(sel.firstChild, 'leaflet-routing-geocoder-selected');
  2434. this._selection = sel;
  2435. }
  2436. },
  2437. _unselect: function() {
  2438. if (this._selection) {
  2439. L.DomUtil.removeClass(this._selection.firstChild, 'leaflet-routing-geocoder-selected');
  2440. }
  2441. delete this._selection;
  2442. },
  2443. _keyDown: function(e) {
  2444. if (this._isOpen) {
  2445. switch (e.keyCode) {
  2446. // Escape
  2447. case 27:
  2448. this.close();
  2449. L.DomEvent.preventDefault(e);
  2450. return;
  2451. // Up
  2452. case 38:
  2453. this._select(-1);
  2454. L.DomEvent.preventDefault(e);
  2455. return;
  2456. // Down
  2457. case 40:
  2458. this._select(1);
  2459. L.DomEvent.preventDefault(e);
  2460. return;
  2461. }
  2462. }
  2463. },
  2464. _complete: function(completeFn, trySelect) {
  2465. var v = this._elem.value;
  2466. function completeResults(results) {
  2467. this._lastCompletedText = v;
  2468. if (trySelect && results.length === 1) {
  2469. this._resultSelected(results[0])();
  2470. } else {
  2471. this._setResults(results);
  2472. }
  2473. }
  2474. if (!v) {
  2475. return;
  2476. }
  2477. if (v !== this._lastCompletedText) {
  2478. completeFn(v, completeResults, this);
  2479. } else if (trySelect) {
  2480. completeResults.call(this, this._results);
  2481. }
  2482. }
  2483. });
  2484. })();
  2485. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2486. },{}],11:[function(_dereq_,module,exports){
  2487. (function (global){
  2488. (function() {
  2489. 'use strict';
  2490. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  2491. var Itinerary = _dereq_('./itinerary');
  2492. var Line = _dereq_('./line');
  2493. var Plan = _dereq_('./plan');
  2494. var OSRMv1 = _dereq_('./osrm-v1');
  2495. module.exports = Itinerary.extend({
  2496. options: {
  2497. fitSelectedRoutes: 'smart',
  2498. routeLine: function(route, options) { return new Line(route, options); },
  2499. autoRoute: true,
  2500. routeWhileDragging: false,
  2501. routeDragInterval: 500,
  2502. waypointMode: 'connect',
  2503. showAlternatives: false,
  2504. defaultErrorHandler: function(e) {
  2505. console.error('Routing error:', e.error);
  2506. }
  2507. },
  2508. initialize: function(options) {
  2509. L.Util.setOptions(this, options);
  2510. this._router = this.options.router || new OSRMv1(options);
  2511. this._plan = this.options.plan || new Plan(this.options.waypoints, options);
  2512. this._requestCount = 0;
  2513. Itinerary.prototype.initialize.call(this, options);
  2514. this.on('routeselected', this._routeSelected, this);
  2515. if (this.options.defaultErrorHandler) {
  2516. this.on('routingerror', this.options.defaultErrorHandler);
  2517. }
  2518. this._plan.on('waypointschanged', this._onWaypointsChanged, this);
  2519. if (options.routeWhileDragging) {
  2520. this._setupRouteDragging();
  2521. }
  2522. if (this.options.autoRoute) {
  2523. this.route();
  2524. }
  2525. },
  2526. _onZoomEnd: function() {
  2527. if (!this._selectedRoute ||
  2528. !this._router.requiresMoreDetail) {
  2529. return;
  2530. }
  2531. var map = this._map;
  2532. if (this._router.requiresMoreDetail(this._selectedRoute,
  2533. map.getZoom(), map.getBounds())) {
  2534. this.route({
  2535. callback: L.bind(function(err, routes) {
  2536. var i;
  2537. if (!err) {
  2538. for (i = 0; i < routes.length; i++) {
  2539. this._routes[i].properties = routes[i].properties;
  2540. }
  2541. this._updateLineCallback(err, routes);
  2542. }
  2543. }, this),
  2544. simplifyGeometry: false,
  2545. geometryOnly: true
  2546. });
  2547. }
  2548. },
  2549. onAdd: function(map) {
  2550. var container = Itinerary.prototype.onAdd.call(this, map);
  2551. this._map = map;
  2552. this._map.addLayer(this._plan);
  2553. this._map.on('zoomend', this._onZoomEnd, this);
  2554. if (this._plan.options.geocoder) {
  2555. container.insertBefore(this._plan.createGeocoders(), container.firstChild);
  2556. }
  2557. return container;
  2558. },
  2559. onRemove: function(map) {
  2560. map.off('zoomend', this._onZoomEnd, this);
  2561. if (this._line) {
  2562. map.removeLayer(this._line);
  2563. }
  2564. map.removeLayer(this._plan);
  2565. if (this._alternatives && this._alternatives.length > 0) {
  2566. for (var i = 0, len = this._alternatives.length; i < len; i++) {
  2567. map.removeLayer(this._alternatives[i]);
  2568. }
  2569. }
  2570. return Itinerary.prototype.onRemove.call(this, map);
  2571. },
  2572. getWaypoints: function() {
  2573. return this._plan.getWaypoints();
  2574. },
  2575. setWaypoints: function(waypoints) {
  2576. this._plan.setWaypoints(waypoints);
  2577. return this;
  2578. },
  2579. spliceWaypoints: function() {
  2580. var removed = this._plan.spliceWaypoints.apply(this._plan, arguments);
  2581. return removed;
  2582. },
  2583. getPlan: function() {
  2584. return this._plan;
  2585. },
  2586. getRouter: function() {
  2587. return this._router;
  2588. },
  2589. _routeSelected: function(e) {
  2590. var route = this._selectedRoute = e.route,
  2591. alternatives = this.options.showAlternatives && e.alternatives,
  2592. fitMode = this.options.fitSelectedRoutes,
  2593. fitBounds =
  2594. (fitMode === 'smart' && !this._waypointsVisible()) ||
  2595. (fitMode !== 'smart' && fitMode);
  2596. this._updateLines({route: route, alternatives: alternatives});
  2597. if (fitBounds) {
  2598. this._map.fitBounds(this._line.getBounds());
  2599. }
  2600. if (this.options.waypointMode === 'snap') {
  2601. this._plan.off('waypointschanged', this._onWaypointsChanged, this);
  2602. this.setWaypoints(route.waypoints);
  2603. this._plan.on('waypointschanged', this._onWaypointsChanged, this);
  2604. }
  2605. },
  2606. _waypointsVisible: function() {
  2607. var wps = this.getWaypoints(),
  2608. mapSize,
  2609. bounds,
  2610. boundsSize,
  2611. i,
  2612. p;
  2613. try {
  2614. mapSize = this._map.getSize();
  2615. for (i = 0; i < wps.length; i++) {
  2616. p = this._map.latLngToLayerPoint(wps[i].latLng);
  2617. if (bounds) {
  2618. bounds.extend(p);
  2619. } else {
  2620. bounds = L.bounds([p]);
  2621. }
  2622. }
  2623. boundsSize = bounds.getSize();
  2624. return (boundsSize.x > mapSize.x / 5 ||
  2625. boundsSize.y > mapSize.y / 5) && this._waypointsInViewport();
  2626. } catch (e) {
  2627. return false;
  2628. }
  2629. },
  2630. _waypointsInViewport: function() {
  2631. var wps = this.getWaypoints(),
  2632. mapBounds,
  2633. i;
  2634. try {
  2635. mapBounds = this._map.getBounds();
  2636. } catch (e) {
  2637. return false;
  2638. }
  2639. for (i = 0; i < wps.length; i++) {
  2640. if (mapBounds.contains(wps[i].latLng)) {
  2641. return true;
  2642. }
  2643. }
  2644. return false;
  2645. },
  2646. _updateLines: function(routes) {
  2647. var addWaypoints = this.options.addWaypoints !== undefined ?
  2648. this.options.addWaypoints : true;
  2649. this._clearLines();
  2650. // add alternatives first so they lie below the main route
  2651. this._alternatives = [];
  2652. if (routes.alternatives) routes.alternatives.forEach(function(alt, i) {
  2653. this._alternatives[i] = this.options.routeLine(alt,
  2654. L.extend({
  2655. isAlternative: true
  2656. }, this.options.altLineOptions || this.options.lineOptions));
  2657. this._alternatives[i].addTo(this._map);
  2658. this._hookAltEvents(this._alternatives[i]);
  2659. }, this);
  2660. this._line = this.options.routeLine(routes.route,
  2661. L.extend({
  2662. addWaypoints: addWaypoints,
  2663. extendToWaypoints: this.options.waypointMode === 'connect'
  2664. }, this.options.lineOptions));
  2665. this._line.addTo(this._map);
  2666. this._hookEvents(this._line);
  2667. },
  2668. _hookEvents: function(l) {
  2669. l.on('linetouched', function(e) {
  2670. this._plan.dragNewWaypoint(e);
  2671. }, this);
  2672. },
  2673. _hookAltEvents: function(l) {
  2674. l.on('linetouched', function(e) {
  2675. var alts = this._routes.slice();
  2676. var selected = alts.splice(e.target._route.routesIndex, 1)[0];
  2677. this.fire('routeselected', {route: selected, alternatives: alts});
  2678. }, this);
  2679. },
  2680. _onWaypointsChanged: function(e) {
  2681. if (this.options.autoRoute) {
  2682. this.route({});
  2683. }
  2684. if (!this._plan.isReady()) {
  2685. this._clearLines();
  2686. this._clearAlts();
  2687. }
  2688. this.fire('waypointschanged', {waypoints: e.waypoints});
  2689. },
  2690. _setupRouteDragging: function() {
  2691. var timer = 0,
  2692. waypoints;
  2693. this._plan.on('waypointdrag', L.bind(function(e) {
  2694. waypoints = e.waypoints;
  2695. if (!timer) {
  2696. timer = setTimeout(L.bind(function() {
  2697. this.route({
  2698. waypoints: waypoints,
  2699. geometryOnly: true,
  2700. callback: L.bind(this._updateLineCallback, this)
  2701. });
  2702. timer = undefined;
  2703. }, this), this.options.routeDragInterval);
  2704. }
  2705. }, this));
  2706. this._plan.on('waypointdragend', function() {
  2707. if (timer) {
  2708. clearTimeout(timer);
  2709. timer = undefined;
  2710. }
  2711. this.route();
  2712. }, this);
  2713. },
  2714. _updateLineCallback: function(err, routes) {
  2715. if (!err) {
  2716. routes = routes.slice();
  2717. var selected = routes.splice(this._selectedRoute.routesIndex, 1)[0];
  2718. this._updateLines({route: selected, alternatives: routes });
  2719. } else if (err.type !== 'abort') {
  2720. this._clearLines();
  2721. }
  2722. },
  2723. route: function(options) {
  2724. var ts = ++this._requestCount,
  2725. wps;
  2726. if (this._pendingRequest && this._pendingRequest.abort) {
  2727. this._pendingRequest.abort();
  2728. this._pendingRequest = null;
  2729. }
  2730. options = options || {};
  2731. if (this._plan.isReady()) {
  2732. if (this.options.useZoomParameter) {
  2733. options.z = this._map && this._map.getZoom();
  2734. }
  2735. wps = options && options.waypoints || this._plan.getWaypoints();
  2736. this.fire('routingstart', {waypoints: wps});
  2737. this._pendingRequest = this._router.route(wps, function(err, routes) {
  2738. this._pendingRequest = null;
  2739. if (options.callback) {
  2740. return options.callback.call(this, err, routes);
  2741. }
  2742. // Prevent race among multiple requests,
  2743. // by checking the current request's count
  2744. // against the last request's; ignore result if
  2745. // this isn't the last request.
  2746. if (ts === this._requestCount) {
  2747. this._clearLines();
  2748. this._clearAlts();
  2749. if (err && err.type !== 'abort') {
  2750. this.fire('routingerror', {error: err});
  2751. return;
  2752. }
  2753. routes.forEach(function(route, i) { route.routesIndex = i; });
  2754. if (!options.geometryOnly) {
  2755. this.fire('routesfound', {waypoints: wps, routes: routes});
  2756. this.setAlternatives(routes);
  2757. } else {
  2758. var selectedRoute = routes.splice(0,1)[0];
  2759. this._routeSelected({route: selectedRoute, alternatives: routes});
  2760. }
  2761. }
  2762. }, this, options);
  2763. }
  2764. },
  2765. _clearLines: function() {
  2766. if (this._line) {
  2767. this._map.removeLayer(this._line);
  2768. delete this._line;
  2769. }
  2770. if (this._alternatives && this._alternatives.length) {
  2771. for (var i in this._alternatives) {
  2772. this._map.removeLayer(this._alternatives[i]);
  2773. }
  2774. this._alternatives = [];
  2775. }
  2776. }
  2777. });
  2778. })();
  2779. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2780. },{"./itinerary":17,"./line":18,"./osrm-v1":21,"./plan":22}],12:[function(_dereq_,module,exports){
  2781. (function (global){
  2782. (function() {
  2783. 'use strict';
  2784. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  2785. module.exports = L.Control.extend({
  2786. options: {
  2787. header: 'Routing error',
  2788. formatMessage: function(error) {
  2789. if (error.status < 0) {
  2790. return 'Calculating the route caused an error. Technical description follows: <code><pre>' +
  2791. error.message + '</pre></code';
  2792. } else {
  2793. return 'The route could not be calculated. ' +
  2794. error.message;
  2795. }
  2796. }
  2797. },
  2798. initialize: function(routingControl, options) {
  2799. L.Control.prototype.initialize.call(this, options);
  2800. routingControl
  2801. .on('routingerror', L.bind(function(e) {
  2802. if (this._element) {
  2803. this._element.children[1].innerHTML = this.options.formatMessage(e.error);
  2804. this._element.style.visibility = 'visible';
  2805. }
  2806. }, this))
  2807. .on('routingstart', L.bind(function() {
  2808. if (this._element) {
  2809. this._element.style.visibility = 'hidden';
  2810. }
  2811. }, this));
  2812. },
  2813. onAdd: function() {
  2814. var header,
  2815. message;
  2816. this._element = L.DomUtil.create('div', 'leaflet-bar leaflet-routing-error');
  2817. this._element.style.visibility = 'hidden';
  2818. header = L.DomUtil.create('h3', null, this._element);
  2819. message = L.DomUtil.create('span', null, this._element);
  2820. header.innerHTML = this.options.header;
  2821. return this._element;
  2822. },
  2823. onRemove: function() {
  2824. delete this._element;
  2825. }
  2826. });
  2827. })();
  2828. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2829. },{}],13:[function(_dereq_,module,exports){
  2830. (function (global){
  2831. (function() {
  2832. 'use strict';
  2833. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  2834. var Localization = _dereq_('./localization');
  2835. module.exports = L.Class.extend({
  2836. options: {
  2837. units: 'metric',
  2838. unitNames: null,
  2839. language: 'en',
  2840. roundingSensitivity: 1,
  2841. distanceTemplate: '{value} {unit}'
  2842. },
  2843. initialize: function(options) {
  2844. L.setOptions(this, options);
  2845. var langs = L.Util.isArray(this.options.language) ?
  2846. this.options.language :
  2847. [this.options.language, 'en'];
  2848. this._localization = new Localization(langs);
  2849. },
  2850. formatDistance: function(d /* Number (meters) */, sensitivity) {
  2851. var un = this.options.unitNames || this._localization.localize('units'),
  2852. simpleRounding = sensitivity <= 0,
  2853. round = simpleRounding ? function(v) { return v; } : L.bind(this._round, this),
  2854. v,
  2855. yards,
  2856. data,
  2857. pow10;
  2858. if (this.options.units === 'imperial') {
  2859. yards = d / 0.9144;
  2860. if (yards >= 1000) {
  2861. data = {
  2862. value: round(d / 1609.344, sensitivity),
  2863. unit: un.miles
  2864. };
  2865. } else {
  2866. data = {
  2867. value: round(yards, sensitivity),
  2868. unit: un.yards
  2869. };
  2870. }
  2871. } else {
  2872. v = round(d, sensitivity);
  2873. data = {
  2874. value: v >= 1000 ? (v / 1000) : v,
  2875. unit: v >= 1000 ? un.kilometers : un.meters
  2876. };
  2877. }
  2878. if (simpleRounding) {
  2879. data.value = data.value.toFixed(-sensitivity);
  2880. }
  2881. return L.Util.template(this.options.distanceTemplate, data);
  2882. },
  2883. _round: function(d, sensitivity) {
  2884. var s = sensitivity || this.options.roundingSensitivity,
  2885. pow10 = Math.pow(10, (Math.floor(d / s) + '').length - 1),
  2886. r = Math.floor(d / pow10),
  2887. p = (r > 5) ? pow10 : pow10 / 2;
  2888. return Math.round(d / p) * p;
  2889. },
  2890. formatTime: function(t /* Number (seconds) */) {
  2891. var un = this.options.unitNames || this._localization.localize('units');
  2892. // More than 30 seconds precision looks ridiculous
  2893. t = Math.round(t / 30) * 30;
  2894. if (t > 86400) {
  2895. return Math.round(t / 3600) + ' ' + un.hours;
  2896. } else if (t > 3600) {
  2897. return Math.floor(t / 3600) + ' ' + un.hours + ' ' +
  2898. Math.round((t % 3600) / 60) + ' ' + un.minutes;
  2899. } else if (t > 300) {
  2900. return Math.round(t / 60) + ' ' + un.minutes;
  2901. } else if (t > 60) {
  2902. return Math.floor(t / 60) + ' ' + un.minutes +
  2903. (t % 60 !== 0 ? ' ' + (t % 60) + ' ' + un.seconds : '');
  2904. } else {
  2905. return t + ' ' + un.seconds;
  2906. }
  2907. },
  2908. formatInstruction: function(instr, i) {
  2909. if (instr.text === undefined) {
  2910. return this.capitalize(L.Util.template(this._getInstructionTemplate(instr, i),
  2911. L.extend({}, instr, {
  2912. exitStr: instr.exit ? this._localization.localize('formatOrder')(instr.exit) : '',
  2913. dir: this._localization.localize(['directions', instr.direction]),
  2914. modifier: this._localization.localize(['directions', instr.modifier])
  2915. })));
  2916. } else {
  2917. return instr.text;
  2918. }
  2919. },
  2920. getIconName: function(instr, i) {
  2921. switch (instr.type) {
  2922. case 'Head':
  2923. if (i === 0) {
  2924. return 'depart';
  2925. }
  2926. break;
  2927. case 'WaypointReached':
  2928. return 'via';
  2929. case 'Roundabout':
  2930. return 'enter-roundabout';
  2931. case 'DestinationReached':
  2932. return 'arrive';
  2933. }
  2934. switch (instr.modifier) {
  2935. case 'Straight':
  2936. return 'continue';
  2937. case 'SlightRight':
  2938. return 'bear-right';
  2939. case 'Right':
  2940. return 'turn-right';
  2941. case 'SharpRight':
  2942. return 'sharp-right';
  2943. case 'TurnAround':
  2944. case 'Uturn':
  2945. return 'u-turn';
  2946. case 'SharpLeft':
  2947. return 'sharp-left';
  2948. case 'Left':
  2949. return 'turn-left';
  2950. case 'SlightLeft':
  2951. return 'bear-left';
  2952. }
  2953. },
  2954. capitalize: function(s) {
  2955. return s.charAt(0).toUpperCase() + s.substring(1);
  2956. },
  2957. _getInstructionTemplate: function(instr, i) {
  2958. var type = instr.type === 'Straight' ? (i === 0 ? 'Head' : 'Continue') : instr.type,
  2959. strings = this._localization.localize(['instructions', type]);
  2960. if (!strings) {
  2961. strings = [
  2962. this._localization.localize(['directions', type]),
  2963. ' ' + this._localization.localize(['instructions', 'Onto'])
  2964. ];
  2965. }
  2966. return strings[0] + (strings.length > 1 && instr.road ? strings[1] : '');
  2967. }
  2968. });
  2969. })();
  2970. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2971. },{"./localization":19}],14:[function(_dereq_,module,exports){
  2972. (function (global){
  2973. (function() {
  2974. 'use strict';
  2975. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  2976. var Autocomplete = _dereq_('./autocomplete');
  2977. var Localization = _dereq_('./localization');
  2978. function selectInputText(input) {
  2979. if (input.setSelectionRange) {
  2980. // On iOS, select() doesn't work
  2981. input.setSelectionRange(0, 9999);
  2982. } else {
  2983. // On at least IE8, setSeleectionRange doesn't exist
  2984. input.select();
  2985. }
  2986. }
  2987. module.exports = L.Class.extend({
  2988. includes: L.Mixin.Events,
  2989. options: {
  2990. createGeocoder: function(i, nWps, options) {
  2991. var container = L.DomUtil.create('div', 'leaflet-routing-geocoder'),
  2992. input = L.DomUtil.create('input', '', container),
  2993. remove = options.addWaypoints ? L.DomUtil.create('span', 'leaflet-routing-remove-waypoint', container) : undefined;
  2994. input.disabled = !options.addWaypoints;
  2995. return {
  2996. container: container,
  2997. input: input,
  2998. closeButton: remove
  2999. };
  3000. },
  3001. geocoderPlaceholder: function(i, numberWaypoints, geocoderElement) {
  3002. var l = new Localization(geocoderElement.options.language).localize('ui');
  3003. return i === 0 ?
  3004. l.startPlaceholder :
  3005. (i < numberWaypoints - 1 ?
  3006. L.Util.template(l.viaPlaceholder, {viaNumber: i}) :
  3007. l.endPlaceholder);
  3008. },
  3009. geocoderClass: function() {
  3010. return '';
  3011. },
  3012. waypointNameFallback: function(latLng) {
  3013. var ns = latLng.lat < 0 ? 'S' : 'N',
  3014. ew = latLng.lng < 0 ? 'W' : 'E',
  3015. lat = (Math.round(Math.abs(latLng.lat) * 10000) / 10000).toString(),
  3016. lng = (Math.round(Math.abs(latLng.lng) * 10000) / 10000).toString();
  3017. return ns + lat + ', ' + ew + lng;
  3018. },
  3019. maxGeocoderTolerance: 200,
  3020. autocompleteOptions: {},
  3021. language: 'en',
  3022. },
  3023. initialize: function(wp, i, nWps, options) {
  3024. L.setOptions(this, options);
  3025. var g = this.options.createGeocoder(i, nWps, this.options),
  3026. closeButton = g.closeButton,
  3027. geocoderInput = g.input;
  3028. geocoderInput.setAttribute('placeholder', this.options.geocoderPlaceholder(i, nWps, this));
  3029. geocoderInput.className = this.options.geocoderClass(i, nWps);
  3030. this._element = g;
  3031. this._waypoint = wp;
  3032. this.update();
  3033. // This has to be here, or geocoder's value will not be properly
  3034. // initialized.
  3035. // TODO: look into why and make _updateWaypointName fix this.
  3036. geocoderInput.value = wp.name;
  3037. L.DomEvent.addListener(geocoderInput, 'click', function() {
  3038. selectInputText(this);
  3039. }, geocoderInput);
  3040. if (closeButton) {
  3041. L.DomEvent.addListener(closeButton, 'click', function() {
  3042. this.fire('delete', { waypoint: this._waypoint });
  3043. }, this);
  3044. }
  3045. new Autocomplete(geocoderInput, function(r) {
  3046. geocoderInput.value = r.name;
  3047. wp.name = r.name;
  3048. wp.latLng = r.center;
  3049. this.fire('geocoded', { waypoint: wp, value: r });
  3050. }, this, L.extend({
  3051. resultFn: this.options.geocoder.geocode,
  3052. resultContext: this.options.geocoder,
  3053. autocompleteFn: this.options.geocoder.suggest,
  3054. autocompleteContext: this.options.geocoder
  3055. }, this.options.autocompleteOptions));
  3056. },
  3057. getContainer: function() {
  3058. return this._element.container;
  3059. },
  3060. setValue: function(v) {
  3061. this._element.input.value = v;
  3062. },
  3063. update: function(force) {
  3064. var wp = this._waypoint,
  3065. wpCoords;
  3066. wp.name = wp.name || '';
  3067. if (wp.latLng && (force || !wp.name)) {
  3068. wpCoords = this.options.waypointNameFallback(wp.latLng);
  3069. if (this.options.geocoder && this.options.geocoder.reverse) {
  3070. this.options.geocoder.reverse(wp.latLng, 67108864 /* zoom 18 */, function(rs) {
  3071. if (rs.length > 0 && rs[0].center.distanceTo(wp.latLng) < this.options.maxGeocoderTolerance) {
  3072. wp.name = rs[0].name;
  3073. } else {
  3074. wp.name = wpCoords;
  3075. }
  3076. this._update();
  3077. }, this);
  3078. } else {
  3079. wp.name = wpCoords;
  3080. this._update();
  3081. }
  3082. }
  3083. },
  3084. focus: function() {
  3085. var input = this._element.input;
  3086. input.focus();
  3087. selectInputText(input);
  3088. },
  3089. _update: function() {
  3090. var wp = this._waypoint,
  3091. value = wp && wp.name ? wp.name : '';
  3092. this.setValue(value);
  3093. this.fire('reversegeocoded', {waypoint: wp, value: value});
  3094. }
  3095. });
  3096. })();
  3097. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3098. },{"./autocomplete":10,"./localization":19}],15:[function(_dereq_,module,exports){
  3099. (function (global){
  3100. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null),
  3101. Control = _dereq_('./control'),
  3102. Itinerary = _dereq_('./itinerary'),
  3103. Line = _dereq_('./line'),
  3104. OSRMv1 = _dereq_('./osrm-v1'),
  3105. Plan = _dereq_('./plan'),
  3106. Waypoint = _dereq_('./waypoint'),
  3107. Autocomplete = _dereq_('./autocomplete'),
  3108. Formatter = _dereq_('./formatter'),
  3109. GeocoderElement = _dereq_('./geocoder-element'),
  3110. Localization = _dereq_('./localization'),
  3111. ItineraryBuilder = _dereq_('./itinerary-builder'),
  3112. Mapbox = _dereq_('./mapbox'),
  3113. ErrorControl = _dereq_('./error-control');
  3114. L.routing = {
  3115. control: function(options) { return new Control(options); },
  3116. itinerary: function(options) {
  3117. return Itinerary(options);
  3118. },
  3119. line: function(route, options) {
  3120. return new Line(route, options);
  3121. },
  3122. plan: function(waypoints, options) {
  3123. return new Plan(waypoints, options);
  3124. },
  3125. waypoint: function(latLng, name, options) {
  3126. return new Waypoint(latLng, name, options);
  3127. },
  3128. osrmv1: function(options) {
  3129. return new OSRMv1(options);
  3130. },
  3131. localization: function(options) {
  3132. return new Localization(options);
  3133. },
  3134. formatter: function(options) {
  3135. return new Formatter(options);
  3136. },
  3137. geocoderElement: function(wp, i, nWps, plan) {
  3138. return new L.Routing.GeocoderElement(wp, i, nWps, plan);
  3139. },
  3140. itineraryBuilder: function(options) {
  3141. return new ItineraryBuilder(options);
  3142. },
  3143. mapbox: function(accessToken, options) {
  3144. return new Mapbox(accessToken, options);
  3145. },
  3146. errorControl: function(routingControl, options) {
  3147. return new ErrorControl(routingControl, options);
  3148. },
  3149. autocomplete: function(elem, callback, context, options) {
  3150. return new Autocomplete(elem, callback, context, options);
  3151. }
  3152. };
  3153. module.exports = L.Routing = {
  3154. Control: Control,
  3155. Itinerary: Itinerary,
  3156. Line: Line,
  3157. OSRMv1: OSRMv1,
  3158. Plan: Plan,
  3159. Waypoint: Waypoint,
  3160. Autocomplete: Autocomplete,
  3161. Formatter: Formatter,
  3162. GeocoderElement: GeocoderElement,
  3163. Localization: Localization,
  3164. Formatter: Formatter,
  3165. ItineraryBuilder: ItineraryBuilder,
  3166. // Legacy; remove these in next major release
  3167. control: L.routing.control,
  3168. itinerary: L.routing.itinerary,
  3169. line: L.routing.line,
  3170. plan: L.routing.plan,
  3171. waypoint: L.routing.waypoint,
  3172. osrmv1: L.routing.osrmv1,
  3173. geocoderElement: L.routing.geocoderElement,
  3174. mapbox: L.routing.mapbox,
  3175. errorControl: L.routing.errorControl,
  3176. };
  3177. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3178. },{"./autocomplete":10,"./control":11,"./error-control":12,"./formatter":13,"./geocoder-element":14,"./itinerary":17,"./itinerary-builder":16,"./line":18,"./localization":19,"./mapbox":20,"./osrm-v1":21,"./plan":22,"./waypoint":23}],16:[function(_dereq_,module,exports){
  3179. (function (global){
  3180. (function() {
  3181. 'use strict';
  3182. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  3183. module.exports = L.Class.extend({
  3184. options: {
  3185. containerClassName: ''
  3186. },
  3187. initialize: function(options) {
  3188. L.setOptions(this, options);
  3189. },
  3190. createContainer: function(className) {
  3191. var table = L.DomUtil.create('table', className || ''),
  3192. colgroup = L.DomUtil.create('colgroup', '', table);
  3193. L.DomUtil.create('col', 'leaflet-routing-instruction-icon', colgroup);
  3194. L.DomUtil.create('col', 'leaflet-routing-instruction-text', colgroup);
  3195. L.DomUtil.create('col', 'leaflet-routing-instruction-distance', colgroup);
  3196. return table;
  3197. },
  3198. createStepsContainer: function() {
  3199. return L.DomUtil.create('tbody', '');
  3200. },
  3201. createStep: function(text, distance, icon, steps) {
  3202. var row = L.DomUtil.create('tr', '', steps),
  3203. span,
  3204. td;
  3205. td = L.DomUtil.create('td', '', row);
  3206. span = L.DomUtil.create('span', 'leaflet-routing-icon leaflet-routing-icon-'+icon, td);
  3207. td.appendChild(span);
  3208. td = L.DomUtil.create('td', '', row);
  3209. td.appendChild(document.createTextNode(text));
  3210. td = L.DomUtil.create('td', '', row);
  3211. td.appendChild(document.createTextNode(distance));
  3212. return row;
  3213. }
  3214. });
  3215. })();
  3216. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3217. },{}],17:[function(_dereq_,module,exports){
  3218. (function (global){
  3219. (function() {
  3220. 'use strict';
  3221. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  3222. var Formatter = _dereq_('./formatter');
  3223. var ItineraryBuilder = _dereq_('./itinerary-builder');
  3224. module.exports = L.Control.extend({
  3225. includes: L.Mixin.Events,
  3226. options: {
  3227. pointMarkerStyle: {
  3228. radius: 5,
  3229. color: '#03f',
  3230. fillColor: 'white',
  3231. opacity: 1,
  3232. fillOpacity: 0.7
  3233. },
  3234. summaryTemplate: '<h2>{name}</h2><h3>{distance}, {time}</h3>',
  3235. timeTemplate: '{time}',
  3236. containerClassName: '',
  3237. alternativeClassName: '',
  3238. minimizedClassName: '',
  3239. itineraryClassName: '',
  3240. totalDistanceRoundingSensitivity: -1,
  3241. show: true,
  3242. collapsible: undefined,
  3243. collapseBtn: function(itinerary) {
  3244. var collapseBtn = L.DomUtil.create('span', itinerary.options.collapseBtnClass);
  3245. L.DomEvent.on(collapseBtn, 'click', itinerary._toggle, itinerary);
  3246. itinerary._container.insertBefore(collapseBtn, itinerary._container.firstChild);
  3247. },
  3248. collapseBtnClass: 'leaflet-routing-collapse-btn'
  3249. },
  3250. initialize: function(options) {
  3251. L.setOptions(this, options);
  3252. this._formatter = this.options.formatter || new Formatter(this.options);
  3253. this._itineraryBuilder = this.options.itineraryBuilder || new ItineraryBuilder({
  3254. containerClassName: this.options.itineraryClassName
  3255. });
  3256. },
  3257. onAdd: function(map) {
  3258. var collapsible = this.options.collapsible;
  3259. collapsible = collapsible || (collapsible === undefined && map.getSize().x <= 640);
  3260. this._container = L.DomUtil.create('div', 'leaflet-routing-container leaflet-bar ' +
  3261. (!this.options.show ? 'leaflet-routing-container-hide ' : '') +
  3262. (collapsible ? 'leaflet-routing-collapsible ' : '') +
  3263. this.options.containerClassName);
  3264. this._altContainer = this.createAlternativesContainer();
  3265. this._container.appendChild(this._altContainer);
  3266. L.DomEvent.disableClickPropagation(this._container);
  3267. L.DomEvent.addListener(this._container, 'mousewheel', function(e) {
  3268. L.DomEvent.stopPropagation(e);
  3269. });
  3270. if (collapsible) {
  3271. this.options.collapseBtn(this);
  3272. }
  3273. return this._container;
  3274. },
  3275. onRemove: function() {
  3276. },
  3277. createAlternativesContainer: function() {
  3278. return L.DomUtil.create('div', 'leaflet-routing-alternatives-container');
  3279. },
  3280. setAlternatives: function(routes) {
  3281. var i,
  3282. alt,
  3283. altDiv;
  3284. this._clearAlts();
  3285. this._routes = routes;
  3286. for (i = 0; i < this._routes.length; i++) {
  3287. alt = this._routes[i];
  3288. altDiv = this._createAlternative(alt, i);
  3289. this._altContainer.appendChild(altDiv);
  3290. this._altElements.push(altDiv);
  3291. }
  3292. this._selectRoute({route: this._routes[0], alternatives: this._routes.slice(1)});
  3293. return this;
  3294. },
  3295. show: function() {
  3296. L.DomUtil.removeClass(this._container, 'leaflet-routing-container-hide');
  3297. },
  3298. hide: function() {
  3299. L.DomUtil.addClass(this._container, 'leaflet-routing-container-hide');
  3300. },
  3301. _toggle: function() {
  3302. var collapsed = L.DomUtil.hasClass(this._container, 'leaflet-routing-container-hide');
  3303. this[collapsed ? 'show' : 'hide']();
  3304. },
  3305. _createAlternative: function(alt, i) {
  3306. var altDiv = L.DomUtil.create('div', 'leaflet-routing-alt ' +
  3307. this.options.alternativeClassName +
  3308. (i > 0 ? ' leaflet-routing-alt-minimized ' + this.options.minimizedClassName : '')),
  3309. template = this.options.summaryTemplate,
  3310. data = L.extend({
  3311. name: alt.name,
  3312. distance: this._formatter.formatDistance(alt.summary.totalDistance, this.options.totalDistanceRoundingSensitivity),
  3313. time: this._formatter.formatTime(alt.summary.totalTime)
  3314. }, alt);
  3315. altDiv.innerHTML = typeof(template) === 'function' ? template(data) : L.Util.template(template, data);
  3316. L.DomEvent.addListener(altDiv, 'click', this._onAltClicked, this);
  3317. this.on('routeselected', this._selectAlt, this);
  3318. altDiv.appendChild(this._createItineraryContainer(alt));
  3319. return altDiv;
  3320. },
  3321. _clearAlts: function() {
  3322. var el = this._altContainer;
  3323. while (el && el.firstChild) {
  3324. el.removeChild(el.firstChild);
  3325. }
  3326. this._altElements = [];
  3327. },
  3328. _createItineraryContainer: function(r) {
  3329. var container = this._itineraryBuilder.createContainer(),
  3330. steps = this._itineraryBuilder.createStepsContainer(),
  3331. i,
  3332. instr,
  3333. step,
  3334. distance,
  3335. text,
  3336. icon;
  3337. container.appendChild(steps);
  3338. for (i = 0; i < r.instructions.length; i++) {
  3339. instr = r.instructions[i];
  3340. text = this._formatter.formatInstruction(instr, i);
  3341. distance = this._formatter.formatDistance(instr.distance);
  3342. icon = this._formatter.getIconName(instr, i);
  3343. step = this._itineraryBuilder.createStep(text, distance, icon, steps);
  3344. this._addRowListeners(step, r.coordinates[instr.index]);
  3345. }
  3346. return container;
  3347. },
  3348. _addRowListeners: function(row, coordinate) {
  3349. L.DomEvent.addListener(row, 'mouseover', function() {
  3350. this._marker = L.circleMarker(coordinate,
  3351. this.options.pointMarkerStyle).addTo(this._map);
  3352. }, this);
  3353. L.DomEvent.addListener(row, 'mouseout', function() {
  3354. if (this._marker) {
  3355. this._map.removeLayer(this._marker);
  3356. delete this._marker;
  3357. }
  3358. }, this);
  3359. L.DomEvent.addListener(row, 'click', function(e) {
  3360. this._map.panTo(coordinate);
  3361. L.DomEvent.stopPropagation(e);
  3362. }, this);
  3363. },
  3364. _onAltClicked: function(e) {
  3365. var altElem = e.target || window.event.srcElement;
  3366. while (!L.DomUtil.hasClass(altElem, 'leaflet-routing-alt')) {
  3367. altElem = altElem.parentElement;
  3368. }
  3369. var j = this._altElements.indexOf(altElem);
  3370. var alts = this._routes.slice();
  3371. var route = alts.splice(j, 1)[0];
  3372. this.fire('routeselected', {
  3373. route: route,
  3374. alternatives: alts
  3375. });
  3376. },
  3377. _selectAlt: function(e) {
  3378. var altElem,
  3379. j,
  3380. n,
  3381. classFn;
  3382. altElem = this._altElements[e.route.routesIndex];
  3383. if (L.DomUtil.hasClass(altElem, 'leaflet-routing-alt-minimized')) {
  3384. for (j = 0; j < this._altElements.length; j++) {
  3385. n = this._altElements[j];
  3386. classFn = j === e.route.routesIndex ? 'removeClass' : 'addClass';
  3387. L.DomUtil[classFn](n, 'leaflet-routing-alt-minimized');
  3388. if (this.options.minimizedClassName) {
  3389. L.DomUtil[classFn](n, this.options.minimizedClassName);
  3390. }
  3391. if (j !== e.route.routesIndex) n.scrollTop = 0;
  3392. }
  3393. }
  3394. L.DomEvent.stop(e);
  3395. },
  3396. _selectRoute: function(routes) {
  3397. if (this._marker) {
  3398. this._map.removeLayer(this._marker);
  3399. delete this._marker;
  3400. }
  3401. this.fire('routeselected', routes);
  3402. }
  3403. });
  3404. })();
  3405. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3406. },{"./formatter":13,"./itinerary-builder":16}],18:[function(_dereq_,module,exports){
  3407. (function (global){
  3408. (function() {
  3409. 'use strict';
  3410. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  3411. module.exports = L.LayerGroup.extend({
  3412. includes: L.Mixin.Events,
  3413. options: {
  3414. styles: [
  3415. {color: 'black', opacity: 0.15, weight: 9},
  3416. {color: 'white', opacity: 0.8, weight: 6},
  3417. {color: 'red', opacity: 1, weight: 2}
  3418. ],
  3419. missingRouteStyles: [
  3420. {color: 'black', opacity: 0.15, weight: 7},
  3421. {color: 'white', opacity: 0.6, weight: 4},
  3422. {color: 'gray', opacity: 0.8, weight: 2, dashArray: '7,12'}
  3423. ],
  3424. addWaypoints: true,
  3425. extendToWaypoints: true,
  3426. missingRouteTolerance: 10
  3427. },
  3428. initialize: function(route, options) {
  3429. L.setOptions(this, options);
  3430. L.LayerGroup.prototype.initialize.call(this, options);
  3431. this._route = route;
  3432. if (this.options.extendToWaypoints) {
  3433. this._extendToWaypoints();
  3434. }
  3435. this._addSegment(
  3436. route.coordinates,
  3437. this.options.styles,
  3438. this.options.addWaypoints);
  3439. },
  3440. getBounds: function() {
  3441. return L.latLngBounds(this._route.coordinates);
  3442. },
  3443. _findWaypointIndices: function() {
  3444. var wps = this._route.inputWaypoints,
  3445. indices = [],
  3446. i;
  3447. for (i = 0; i < wps.length; i++) {
  3448. indices.push(this._findClosestRoutePoint(wps[i].latLng));
  3449. }
  3450. return indices;
  3451. },
  3452. _findClosestRoutePoint: function(latlng) {
  3453. var minDist = Number.MAX_VALUE,
  3454. minIndex,
  3455. i,
  3456. d;
  3457. for (i = this._route.coordinates.length - 1; i >= 0 ; i--) {
  3458. // TODO: maybe do this in pixel space instead?
  3459. d = latlng.distanceTo(this._route.coordinates[i]);
  3460. if (d < minDist) {
  3461. minIndex = i;
  3462. minDist = d;
  3463. }
  3464. }
  3465. return minIndex;
  3466. },
  3467. _extendToWaypoints: function() {
  3468. var wps = this._route.inputWaypoints,
  3469. wpIndices = this._getWaypointIndices(),
  3470. i,
  3471. wpLatLng,
  3472. routeCoord;
  3473. for (i = 0; i < wps.length; i++) {
  3474. wpLatLng = wps[i].latLng;
  3475. routeCoord = L.latLng(this._route.coordinates[wpIndices[i]]);
  3476. if (wpLatLng.distanceTo(routeCoord) >
  3477. this.options.missingRouteTolerance) {
  3478. this._addSegment([wpLatLng, routeCoord],
  3479. this.options.missingRouteStyles);
  3480. }
  3481. }
  3482. },
  3483. _addSegment: function(coords, styles, mouselistener) {
  3484. var i,
  3485. pl;
  3486. for (i = 0; i < styles.length; i++) {
  3487. pl = L.polyline(coords, styles[i]);
  3488. this.addLayer(pl);
  3489. if (mouselistener) {
  3490. pl.on('mousedown', this._onLineTouched, this);
  3491. }
  3492. }
  3493. },
  3494. _findNearestWpBefore: function(i) {
  3495. var wpIndices = this._getWaypointIndices(),
  3496. j = wpIndices.length - 1;
  3497. while (j >= 0 && wpIndices[j] > i) {
  3498. j--;
  3499. }
  3500. return j;
  3501. },
  3502. _onLineTouched: function(e) {
  3503. var afterIndex = this._findNearestWpBefore(this._findClosestRoutePoint(e.latlng));
  3504. this.fire('linetouched', {
  3505. afterIndex: afterIndex,
  3506. latlng: e.latlng
  3507. });
  3508. },
  3509. _getWaypointIndices: function() {
  3510. if (!this._wpIndices) {
  3511. this._wpIndices = this._route.waypointIndices || this._findWaypointIndices();
  3512. }
  3513. return this._wpIndices;
  3514. }
  3515. });
  3516. })();
  3517. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3518. },{}],19:[function(_dereq_,module,exports){
  3519. (function() {
  3520. 'use strict';
  3521. var spanish = {
  3522. directions: {
  3523. N: 'norte',
  3524. NE: 'noreste',
  3525. E: 'este',
  3526. SE: 'sureste',
  3527. S: 'sur',
  3528. SW: 'suroeste',
  3529. W: 'oeste',
  3530. NW: 'noroeste',
  3531. SlightRight: 'leve giro a la derecha',
  3532. Right: 'derecha',
  3533. SharpRight: 'giro pronunciado a la derecha',
  3534. SlightLeft: 'leve giro a la izquierda',
  3535. Left: 'izquierda',
  3536. SharpLeft: 'giro pronunciado a la izquierda',
  3537. Uturn: 'media vuelta'
  3538. },
  3539. instructions: {
  3540. // instruction, postfix if the road is named
  3541. 'Head':
  3542. ['Derecho {dir}', ' sobre {road}'],
  3543. 'Continue':
  3544. ['Continuar {dir}', ' en {road}'],
  3545. 'TurnAround':
  3546. ['Dar vuelta'],
  3547. 'WaypointReached':
  3548. ['Llegó a un punto del camino'],
  3549. 'Roundabout':
  3550. ['Tomar {exitStr} salida en la rotonda', ' en {road}'],
  3551. 'DestinationReached':
  3552. ['Llegada a destino'],
  3553. 'Fork': ['En el cruce gira a {modifier}', ' hacia {road}'],
  3554. 'Merge': ['Incorpórate {modifier}', ' hacia {road}'],
  3555. 'OnRamp': ['Gira {modifier} en la salida', ' hacia {road}'],
  3556. 'OffRamp': ['Toma la salida {modifier}', ' hacia {road}'],
  3557. 'EndOfRoad': ['Gira {modifier} al final de la carretera', ' hacia {road}'],
  3558. 'Onto': 'hacia {road}'
  3559. },
  3560. formatOrder: function(n) {
  3561. return n + 'º';
  3562. },
  3563. ui: {
  3564. startPlaceholder: 'Inicio',
  3565. viaPlaceholder: 'Via {viaNumber}',
  3566. endPlaceholder: 'Destino'
  3567. },
  3568. units: {
  3569. meters: 'm',
  3570. kilometers: 'km',
  3571. yards: 'yd',
  3572. miles: 'mi',
  3573. hours: 'h',
  3574. minutes: 'min',
  3575. seconds: 's'
  3576. }
  3577. };
  3578. L.Routing = L.Routing || {};
  3579. var Localization = L.Class.extend({
  3580. initialize: function(langs) {
  3581. this._langs = L.Util.isArray(langs) ? langs : [langs, 'en'];
  3582. for (var i = 0, l = this._langs.length; i < l; i++) {
  3583. if (!Localization[this._langs[i]]) {
  3584. throw new Error('No localization for language "' + this._langs[i] + '".');
  3585. }
  3586. }
  3587. },
  3588. localize: function(keys) {
  3589. var dict,
  3590. key,
  3591. value;
  3592. keys = L.Util.isArray(keys) ? keys : [keys];
  3593. for (var i = 0, l = this._langs.length; i < l; i++) {
  3594. dict = Localization[this._langs[i]];
  3595. for (var j = 0, nKeys = keys.length; dict && j < nKeys; j++) {
  3596. key = keys[j];
  3597. value = dict[key];
  3598. dict = value;
  3599. }
  3600. if (value) {
  3601. return value;
  3602. }
  3603. }
  3604. }
  3605. });
  3606. module.exports = L.extend(Localization, {
  3607. 'en': {
  3608. directions: {
  3609. N: 'north',
  3610. NE: 'northeast',
  3611. E: 'east',
  3612. SE: 'southeast',
  3613. S: 'south',
  3614. SW: 'southwest',
  3615. W: 'west',
  3616. NW: 'northwest',
  3617. SlightRight: 'slight right',
  3618. Right: 'right',
  3619. SharpRight: 'sharp right',
  3620. SlightLeft: 'slight left',
  3621. Left: 'left',
  3622. SharpLeft: 'sharp left',
  3623. Uturn: 'Turn around'
  3624. },
  3625. instructions: {
  3626. // instruction, postfix if the road is named
  3627. 'Head':
  3628. ['Head {dir}', ' on {road}'],
  3629. 'Continue':
  3630. ['Continue {dir}'],
  3631. 'TurnAround':
  3632. ['Turn around'],
  3633. 'WaypointReached':
  3634. ['Waypoint reached'],
  3635. 'Roundabout':
  3636. ['Take the {exitStr} exit in the roundabout', ' onto {road}'],
  3637. 'DestinationReached':
  3638. ['Destination reached'],
  3639. 'Fork': ['At the fork, turn {modifier}', ' onto {road}'],
  3640. 'Merge': ['Merge {modifier}', ' onto {road}'],
  3641. 'OnRamp': ['Turn {modifier} on the ramp', ' onto {road}'],
  3642. 'OffRamp': ['Take the ramp on the {modifier}', ' onto {road}'],
  3643. 'EndOfRoad': ['Turn {modifier} at the end of the road', ' onto {road}'],
  3644. 'Onto': 'onto {road}'
  3645. },
  3646. formatOrder: function(n) {
  3647. var i = n % 10 - 1,
  3648. suffix = ['st', 'nd', 'rd'];
  3649. return suffix[i] ? n + suffix[i] : n + 'th';
  3650. },
  3651. ui: {
  3652. startPlaceholder: 'Start',
  3653. viaPlaceholder: 'Via {viaNumber}',
  3654. endPlaceholder: 'End'
  3655. },
  3656. units: {
  3657. meters: 'm',
  3658. kilometers: 'km',
  3659. yards: 'yd',
  3660. miles: 'mi',
  3661. hours: 'h',
  3662. minutes: 'min',
  3663. seconds: 's'
  3664. }
  3665. },
  3666. 'de': {
  3667. directions: {
  3668. N: 'Norden',
  3669. NE: 'Nordosten',
  3670. E: 'Osten',
  3671. SE: 'Südosten',
  3672. S: 'Süden',
  3673. SW: 'Südwesten',
  3674. W: 'Westen',
  3675. NW: 'Nordwesten',
  3676. SlightRight: 'leicht rechts',
  3677. Right: 'rechts',
  3678. SharpRight: 'scharf rechts',
  3679. SlightLeft: 'leicht links',
  3680. Left: 'links',
  3681. SharpLeft: 'scharf links',
  3682. Uturn: 'Wenden'
  3683. },
  3684. instructions: {
  3685. // instruction, postfix if the road is named
  3686. 'Head':
  3687. ['Richtung {dir}', ' auf {road}'],
  3688. 'Continue':
  3689. ['Geradeaus Richtung {dir}', ' auf {road}'],
  3690. 'SlightRight':
  3691. ['Leicht rechts abbiegen', ' auf {road}'],
  3692. 'Right':
  3693. ['Rechts abbiegen', ' auf {road}'],
  3694. 'SharpRight':
  3695. ['Scharf rechts abbiegen', ' auf {road}'],
  3696. 'TurnAround':
  3697. ['Wenden'],
  3698. 'SharpLeft':
  3699. ['Scharf links abbiegen', ' auf {road}'],
  3700. 'Left':
  3701. ['Links abbiegen', ' auf {road}'],
  3702. 'SlightLeft':
  3703. ['Leicht links abbiegen', ' auf {road}'],
  3704. 'WaypointReached':
  3705. ['Zwischenhalt erreicht'],
  3706. 'Roundabout':
  3707. ['Nehmen Sie die {exitStr} Ausfahrt im Kreisverkehr', ' auf {road}'],
  3708. 'DestinationReached':
  3709. ['Sie haben ihr Ziel erreicht'],
  3710. 'Fork': ['An der Kreuzung {modifier}', ' auf {road}'],
  3711. 'Merge': ['Fahren Sie {modifier} weiter', ' auf {road}'],
  3712. 'OnRamp': ['Fahren Sie {modifier} auf die Auffahrt', ' auf {road}'],
  3713. 'OffRamp': ['Nehmen Sie die Ausfahrt {modifier}', ' auf {road}'],
  3714. 'EndOfRoad': ['Fahren Sie {modifier} am Ende der Straße', ' auf {road}'],
  3715. 'Onto': 'auf {road}'
  3716. },
  3717. formatOrder: function(n) {
  3718. return n + '.';
  3719. },
  3720. ui: {
  3721. startPlaceholder: 'Start',
  3722. viaPlaceholder: 'Via {viaNumber}',
  3723. endPlaceholder: 'Ziel'
  3724. }
  3725. },
  3726. 'sv': {
  3727. directions: {
  3728. N: 'norr',
  3729. NE: 'nordost',
  3730. E: 'öst',
  3731. SE: 'sydost',
  3732. S: 'syd',
  3733. SW: 'sydväst',
  3734. W: 'väst',
  3735. NW: 'nordväst',
  3736. SlightRight: 'svagt höger',
  3737. Right: 'höger',
  3738. SharpRight: 'skarpt höger',
  3739. SlightLeft: 'svagt vänster',
  3740. Left: 'vänster',
  3741. SharpLeft: 'skarpt vänster',
  3742. Uturn: 'Vänd'
  3743. },
  3744. instructions: {
  3745. // instruction, postfix if the road is named
  3746. 'Head':
  3747. ['Åk åt {dir}', ' till {road}'],
  3748. 'Continue':
  3749. ['Fortsätt {dir}'],
  3750. 'SlightRight':
  3751. ['Svagt höger', ' till {road}'],
  3752. 'Right':
  3753. ['Sväng höger', ' till {road}'],
  3754. 'SharpRight':
  3755. ['Skarpt höger', ' till {road}'],
  3756. 'TurnAround':
  3757. ['Vänd'],
  3758. 'SharpLeft':
  3759. ['Skarpt vänster', ' till {road}'],
  3760. 'Left':
  3761. ['Sväng vänster', ' till {road}'],
  3762. 'SlightLeft':
  3763. ['Svagt vänster', ' till {road}'],
  3764. 'WaypointReached':
  3765. ['Viapunkt nådd'],
  3766. 'Roundabout':
  3767. ['Tag {exitStr} avfarten i rondellen', ' till {road}'],
  3768. 'DestinationReached':
  3769. ['Framme vid resans mål'],
  3770. 'Fork': ['Tag av {modifier}', ' till {road}'],
  3771. 'Merge': ['Anslut {modifier} ', ' till {road}'],
  3772. 'OnRamp': ['Tag påfarten {modifier}', ' till {road}'],
  3773. 'OffRamp': ['Tag avfarten {modifier}', ' till {road}'],
  3774. 'EndOfRoad': ['Sväng {modifier} vid vägens slut', ' till {road}'],
  3775. 'Onto': 'till {road}'
  3776. },
  3777. formatOrder: function(n) {
  3778. return ['första', 'andra', 'tredje', 'fjärde', 'femte',
  3779. 'sjätte', 'sjunde', 'åttonde', 'nionde', 'tionde'
  3780. /* Can't possibly be more than ten exits, can there? */][n - 1];
  3781. },
  3782. ui: {
  3783. startPlaceholder: 'Från',
  3784. viaPlaceholder: 'Via {viaNumber}',
  3785. endPlaceholder: 'Till'
  3786. }
  3787. },
  3788. 'es': spanish,
  3789. 'sp': spanish,
  3790. 'nl': {
  3791. directions: {
  3792. N: 'noordelijke',
  3793. NE: 'noordoostelijke',
  3794. E: 'oostelijke',
  3795. SE: 'zuidoostelijke',
  3796. S: 'zuidelijke',
  3797. SW: 'zuidewestelijke',
  3798. W: 'westelijke',
  3799. NW: 'noordwestelijke'
  3800. },
  3801. instructions: {
  3802. // instruction, postfix if the road is named
  3803. 'Head':
  3804. ['Vertrek in {dir} richting', ' de {road} op'],
  3805. 'Continue':
  3806. ['Ga in {dir} richting', ' de {road} op'],
  3807. 'SlightRight':
  3808. ['Volg de weg naar rechts', ' de {road} op'],
  3809. 'Right':
  3810. ['Ga rechtsaf', ' de {road} op'],
  3811. 'SharpRight':
  3812. ['Ga scherpe bocht naar rechts', ' de {road} op'],
  3813. 'TurnAround':
  3814. ['Keer om'],
  3815. 'SharpLeft':
  3816. ['Ga scherpe bocht naar links', ' de {road} op'],
  3817. 'Left':
  3818. ['Ga linksaf', ' de {road} op'],
  3819. 'SlightLeft':
  3820. ['Volg de weg naar links', ' de {road} op'],
  3821. 'WaypointReached':
  3822. ['Aangekomen bij tussenpunt'],
  3823. 'Roundabout':
  3824. ['Neem de {exitStr} afslag op de rotonde', ' de {road} op'],
  3825. 'DestinationReached':
  3826. ['Aangekomen op eindpunt'],
  3827. },
  3828. formatOrder: function(n) {
  3829. if (n === 1 || n >= 20) {
  3830. return n + 'ste';
  3831. } else {
  3832. return n + 'de';
  3833. }
  3834. },
  3835. ui: {
  3836. startPlaceholder: 'Vertrekpunt',
  3837. viaPlaceholder: 'Via {viaNumber}',
  3838. endPlaceholder: 'Bestemming'
  3839. }
  3840. },
  3841. 'fr': {
  3842. directions: {
  3843. N: 'nord',
  3844. NE: 'nord-est',
  3845. E: 'est',
  3846. SE: 'sud-est',
  3847. S: 'sud',
  3848. SW: 'sud-ouest',
  3849. W: 'ouest',
  3850. NW: 'nord-ouest'
  3851. },
  3852. instructions: {
  3853. // instruction, postfix if the road is named
  3854. 'Head':
  3855. ['Tout droit au {dir}', ' sur {road}'],
  3856. 'Continue':
  3857. ['Continuer au {dir}', ' sur {road}'],
  3858. 'SlightRight':
  3859. ['Légèrement à droite', ' sur {road}'],
  3860. 'Right':
  3861. ['A droite', ' sur {road}'],
  3862. 'SharpRight':
  3863. ['Complètement à droite', ' sur {road}'],
  3864. 'TurnAround':
  3865. ['Faire demi-tour'],
  3866. 'SharpLeft':
  3867. ['Complètement à gauche', ' sur {road}'],
  3868. 'Left':
  3869. ['A gauche', ' sur {road}'],
  3870. 'SlightLeft':
  3871. ['Légèrement à gauche', ' sur {road}'],
  3872. 'WaypointReached':
  3873. ['Point d\'étape atteint'],
  3874. 'Roundabout':
  3875. ['Au rond-point, prenez la {exitStr} sortie', ' sur {road}'],
  3876. 'DestinationReached':
  3877. ['Destination atteinte'],
  3878. },
  3879. formatOrder: function(n) {
  3880. return n + 'º';
  3881. },
  3882. ui: {
  3883. startPlaceholder: 'Départ',
  3884. viaPlaceholder: 'Intermédiaire {viaNumber}',
  3885. endPlaceholder: 'Arrivée'
  3886. }
  3887. },
  3888. 'it': {
  3889. directions: {
  3890. N: 'nord',
  3891. NE: 'nord-est',
  3892. E: 'est',
  3893. SE: 'sud-est',
  3894. S: 'sud',
  3895. SW: 'sud-ovest',
  3896. W: 'ovest',
  3897. NW: 'nord-ovest'
  3898. },
  3899. instructions: {
  3900. // instruction, postfix if the road is named
  3901. 'Head':
  3902. ['Dritto verso {dir}', ' su {road}'],
  3903. 'Continue':
  3904. ['Continuare verso {dir}', ' su {road}'],
  3905. 'SlightRight':
  3906. ['Mantenere la destra', ' su {road}'],
  3907. 'Right':
  3908. ['A destra', ' su {road}'],
  3909. 'SharpRight':
  3910. ['Strettamente a destra', ' su {road}'],
  3911. 'TurnAround':
  3912. ['Fare inversione di marcia'],
  3913. 'SharpLeft':
  3914. ['Strettamente a sinistra', ' su {road}'],
  3915. 'Left':
  3916. ['A sinistra', ' sur {road}'],
  3917. 'SlightLeft':
  3918. ['Mantenere la sinistra', ' su {road}'],
  3919. 'WaypointReached':
  3920. ['Punto di passaggio raggiunto'],
  3921. 'Roundabout':
  3922. ['Alla rotonda, prendere la {exitStr} uscita'],
  3923. 'DestinationReached':
  3924. ['Destinazione raggiunta'],
  3925. },
  3926. formatOrder: function(n) {
  3927. return n + 'º';
  3928. },
  3929. ui: {
  3930. startPlaceholder: 'Partenza',
  3931. viaPlaceholder: 'Intermedia {viaNumber}',
  3932. endPlaceholder: 'Destinazione'
  3933. }
  3934. },
  3935. 'pt': {
  3936. directions: {
  3937. N: 'norte',
  3938. NE: 'nordeste',
  3939. E: 'leste',
  3940. SE: 'sudeste',
  3941. S: 'sul',
  3942. SW: 'sudoeste',
  3943. W: 'oeste',
  3944. NW: 'noroeste',
  3945. SlightRight: 'curva ligeira a direita',
  3946. Right: 'direita',
  3947. SharpRight: 'curva fechada a direita',
  3948. SlightLeft: 'ligeira a esquerda',
  3949. Left: 'esquerda',
  3950. SharpLeft: 'curva fechada a esquerda',
  3951. Uturn: 'Meia volta'
  3952. },
  3953. instructions: {
  3954. // instruction, postfix if the road is named
  3955. 'Head':
  3956. ['Siga {dir}', ' na {road}'],
  3957. 'Continue':
  3958. ['Continue {dir}', ' na {road}'],
  3959. 'SlightRight':
  3960. ['Curva ligeira a direita', ' na {road}'],
  3961. 'Right':
  3962. ['Curva a direita', ' na {road}'],
  3963. 'SharpRight':
  3964. ['Curva fechada a direita', ' na {road}'],
  3965. 'TurnAround':
  3966. ['Retorne'],
  3967. 'SharpLeft':
  3968. ['Curva fechada a esquerda', ' na {road}'],
  3969. 'Left':
  3970. ['Curva a esquerda', ' na {road}'],
  3971. 'SlightLeft':
  3972. ['Curva ligueira a esquerda', ' na {road}'],
  3973. 'WaypointReached':
  3974. ['Ponto de interesse atingido'],
  3975. 'Roundabout':
  3976. ['Pegue a {exitStr} saída na rotatória', ' na {road}'],
  3977. 'DestinationReached':
  3978. ['Destino atingido'],
  3979. 'Fork': ['Na encruzilhada, vire a {modifier}', ' na {road}'],
  3980. 'Merge': ['Entre à {modifier}', ' na {road}'],
  3981. 'OnRamp': ['Vire {modifier} na rampa', ' na {road}'],
  3982. 'OffRamp': ['Entre na rampa na {modifier}', ' na {road}'],
  3983. 'EndOfRoad': ['Vire {modifier} no fim da rua', ' na {road}'],
  3984. 'Onto': 'na {road}'
  3985. },
  3986. formatOrder: function(n) {
  3987. return n + 'º';
  3988. },
  3989. ui: {
  3990. startPlaceholder: 'Origem',
  3991. viaPlaceholder: 'Intermédio {viaNumber}',
  3992. endPlaceholder: 'Destino'
  3993. }
  3994. },
  3995. 'sk': {
  3996. directions: {
  3997. N: 'sever',
  3998. NE: 'serverovýchod',
  3999. E: 'východ',
  4000. SE: 'juhovýchod',
  4001. S: 'juh',
  4002. SW: 'juhozápad',
  4003. W: 'západ',
  4004. NW: 'serverozápad'
  4005. },
  4006. instructions: {
  4007. // instruction, postfix if the road is named
  4008. 'Head':
  4009. ['Mierte na {dir}', ' na {road}'],
  4010. 'Continue':
  4011. ['Pokračujte na {dir}', ' na {road}'],
  4012. 'SlightRight':
  4013. ['Mierne doprava', ' na {road}'],
  4014. 'Right':
  4015. ['Doprava', ' na {road}'],
  4016. 'SharpRight':
  4017. ['Prudko doprava', ' na {road}'],
  4018. 'TurnAround':
  4019. ['Otočte sa'],
  4020. 'SharpLeft':
  4021. ['Prudko doľava', ' na {road}'],
  4022. 'Left':
  4023. ['Doľava', ' na {road}'],
  4024. 'SlightLeft':
  4025. ['Mierne doľava', ' na {road}'],
  4026. 'WaypointReached':
  4027. ['Ste v prejazdovom bode.'],
  4028. 'Roundabout':
  4029. ['Odbočte na {exitStr} výjazde', ' na {road}'],
  4030. 'DestinationReached':
  4031. ['Prišli ste do cieľa.'],
  4032. },
  4033. formatOrder: function(n) {
  4034. var i = n % 10 - 1,
  4035. suffix = ['.', '.', '.'];
  4036. return suffix[i] ? n + suffix[i] : n + '.';
  4037. },
  4038. ui: {
  4039. startPlaceholder: 'Začiatok',
  4040. viaPlaceholder: 'Cez {viaNumber}',
  4041. endPlaceholder: 'Koniec'
  4042. }
  4043. },
  4044. 'el': {
  4045. directions: {
  4046. N: 'βόρεια',
  4047. NE: 'βορειοανατολικά',
  4048. E: 'ανατολικά',
  4049. SE: 'νοτιοανατολικά',
  4050. S: 'νότια',
  4051. SW: 'νοτιοδυτικά',
  4052. W: 'δυτικά',
  4053. NW: 'βορειοδυτικά'
  4054. },
  4055. instructions: {
  4056. // instruction, postfix if the road is named
  4057. 'Head':
  4058. ['Κατευθυνθείτε {dir}', ' στην {road}'],
  4059. 'Continue':
  4060. ['Συνεχίστε {dir}', ' στην {road}'],
  4061. 'SlightRight':
  4062. ['Ελαφρώς δεξιά', ' στην {road}'],
  4063. 'Right':
  4064. ['Δεξιά', ' στην {road}'],
  4065. 'SharpRight':
  4066. ['Απότομη δεξιά στροφή', ' στην {road}'],
  4067. 'TurnAround':
  4068. ['Κάντε αναστροφή'],
  4069. 'SharpLeft':
  4070. ['Απότομη αριστερή στροφή', ' στην {road}'],
  4071. 'Left':
  4072. ['Αριστερά', ' στην {road}'],
  4073. 'SlightLeft':
  4074. ['Ελαφρώς αριστερά', ' στην {road}'],
  4075. 'WaypointReached':
  4076. ['Φτάσατε στο σημείο αναφοράς'],
  4077. 'Roundabout':
  4078. ['Ακολουθήστε την {exitStr} έξοδο στο κυκλικό κόμβο', ' στην {road}'],
  4079. 'DestinationReached':
  4080. ['Φτάσατε στον προορισμό σας'],
  4081. },
  4082. formatOrder: function(n) {
  4083. return n + 'º';
  4084. },
  4085. ui: {
  4086. startPlaceholder: 'Αφετηρία',
  4087. viaPlaceholder: 'μέσω {viaNumber}',
  4088. endPlaceholder: 'Προορισμός'
  4089. }
  4090. },
  4091. 'ca': {
  4092. directions: {
  4093. N: 'nord',
  4094. NE: 'nord-est',
  4095. E: 'est',
  4096. SE: 'sud-est',
  4097. S: 'sud',
  4098. SW: 'sud-oest',
  4099. W: 'oest',
  4100. NW: 'nord-oest',
  4101. SlightRight: 'lleu gir a la dreta',
  4102. Right: 'dreta',
  4103. SharpRight: 'gir pronunciat a la dreta',
  4104. SlightLeft: 'gir pronunciat a l\'esquerra',
  4105. Left: 'esquerra',
  4106. SharpLeft: 'lleu gir a l\'esquerra',
  4107. Uturn: 'mitja volta'
  4108. },
  4109. instructions: {
  4110. 'Head':
  4111. ['Recte {dir}', ' sobre {road}'],
  4112. 'Continue':
  4113. ['Continuar {dir}'],
  4114. 'TurnAround':
  4115. ['Donar la volta'],
  4116. 'WaypointReached':
  4117. ['Ha arribat a un punt del camí'],
  4118. 'Roundabout':
  4119. ['Agafar {exitStr} sortida a la rotonda', ' a {road}'],
  4120. 'DestinationReached':
  4121. ['Arribada al destí'],
  4122. 'Fork': ['A la cruïlla gira a la {modifier}', ' cap a {road}'],
  4123. 'Merge': ['Incorpora\'t {modifier}', ' a {road}'],
  4124. 'OnRamp': ['Gira {modifier} a la sortida', ' cap a {road}'],
  4125. 'OffRamp': ['Pren la sortida {modifier}', ' cap a {road}'],
  4126. 'EndOfRoad': ['Gira {modifier} al final de la carretera', ' cap a {road}'],
  4127. 'Onto': 'cap a {road}'
  4128. },
  4129. formatOrder: function(n) {
  4130. return n + 'º';
  4131. },
  4132. ui: {
  4133. startPlaceholder: 'Origen',
  4134. viaPlaceholder: 'Via {viaNumber}',
  4135. endPlaceholder: 'Destí'
  4136. },
  4137. units: {
  4138. meters: 'm',
  4139. kilometers: 'km',
  4140. yards: 'yd',
  4141. miles: 'mi',
  4142. hours: 'h',
  4143. minutes: 'min',
  4144. seconds: 's'
  4145. }
  4146. },
  4147. 'ru': {
  4148. directions: {
  4149. N: 'север',
  4150. NE: 'северовосток',
  4151. E: 'восток',
  4152. SE: 'юговосток',
  4153. S: 'юг',
  4154. SW: 'югозапад',
  4155. W: 'запад',
  4156. NW: 'северозапад',
  4157. SlightRight: 'плавно направо',
  4158. Right: 'направо',
  4159. SharpRight: 'резко направо',
  4160. SlightLeft: 'плавно налево',
  4161. Left: 'налево',
  4162. SharpLeft: 'резко налево',
  4163. Uturn: 'развернуться'
  4164. },
  4165. instructions: {
  4166. 'Head':
  4167. ['Начать движение на {dir}', ' по {road}'],
  4168. 'Continue':
  4169. ['Продолжать движение на {dir}', ' по {road}'],
  4170. 'SlightRight':
  4171. ['Плавный поворот направо', ' на {road}'],
  4172. 'Right':
  4173. ['Направо', ' на {road}'],
  4174. 'SharpRight':
  4175. ['Резкий поворот направо', ' на {road}'],
  4176. 'TurnAround':
  4177. ['Развернуться'],
  4178. 'SharpLeft':
  4179. ['Резкий поворот налево', ' на {road}'],
  4180. 'Left':
  4181. ['Поворот налево', ' на {road}'],
  4182. 'SlightLeft':
  4183. ['Плавный поворот налево', ' на {road}'],
  4184. 'WaypointReached':
  4185. ['Точка достигнута'],
  4186. 'Roundabout':
  4187. ['{exitStr} съезд с кольца', ' на {road}'],
  4188. 'DestinationReached':
  4189. ['Окончание маршрута'],
  4190. 'Fork': ['На развилке поверните {modifier}', ' на {road}'],
  4191. 'Merge': ['Перестройтесь {modifier}', ' на {road}'],
  4192. 'OnRamp': ['Поверните {modifier} на съезд', ' на {road}'],
  4193. 'OffRamp': ['Съезжайте на {modifier}', ' на {road}'],
  4194. 'EndOfRoad': ['Поверните {modifier} в конце дороги', ' на {road}'],
  4195. 'Onto': 'на {road}'
  4196. },
  4197. formatOrder: function(n) {
  4198. return n + '-й';
  4199. },
  4200. ui: {
  4201. startPlaceholder: 'Начало',
  4202. viaPlaceholder: 'Через {viaNumber}',
  4203. endPlaceholder: 'Конец'
  4204. },
  4205. units: {
  4206. meters: 'м',
  4207. kilometers: 'км',
  4208. yards: 'ярд',
  4209. miles: 'ми',
  4210. hours: 'ч',
  4211. minutes: 'м',
  4212. seconds: 'с'
  4213. }
  4214. }
  4215. });
  4216. })();
  4217. },{}],20:[function(_dereq_,module,exports){
  4218. (function (global){
  4219. (function() {
  4220. 'use strict';
  4221. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  4222. var OSRMv1 = _dereq_('./osrm-v1');
  4223. /**
  4224. * Works against OSRM's new API in version 5.0; this has
  4225. * the API version v1.
  4226. */
  4227. module.exports = OSRMv1.extend({
  4228. options: {
  4229. serviceUrl: 'https://api.mapbox.com/directions/v5',
  4230. profile: 'mapbox/driving',
  4231. useHints: false
  4232. },
  4233. initialize: function(accessToken, options) {
  4234. L.Routing.OSRMv1.prototype.initialize.call(this, options);
  4235. this.options.requestParameters = this.options.requestParameters || {};
  4236. /* jshint camelcase: false */
  4237. this.options.requestParameters.access_token = accessToken;
  4238. /* jshint camelcase: true */
  4239. }
  4240. });
  4241. })();
  4242. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  4243. },{"./osrm-v1":21}],21:[function(_dereq_,module,exports){
  4244. (function (global){
  4245. (function() {
  4246. 'use strict';
  4247. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null),
  4248. corslite = _dereq_('corslite'),
  4249. polyline = _dereq_('polyline'),
  4250. osrmTextInstructions = _dereq_('osrm-text-instructions');
  4251. // Ignore camelcase naming for this file, since OSRM's API uses
  4252. // underscores.
  4253. /* jshint camelcase: false */
  4254. var Waypoint = _dereq_('./waypoint');
  4255. /**
  4256. * Works against OSRM's new API in version 5.0; this has
  4257. * the API version v1.
  4258. */
  4259. module.exports = L.Class.extend({
  4260. options: {
  4261. serviceUrl: 'http://145.239.81.96:5000/route/v1',
  4262. profile: 'driving',
  4263. timeout: 30 * 1000,
  4264. routingOptions: {
  4265. alternatives: true,
  4266. steps: true
  4267. },
  4268. polylinePrecision: 5,
  4269. useHints: true,
  4270. suppressDemoServerWarning: false,
  4271. language: 'en'
  4272. },
  4273. initialize: function(options) {
  4274. L.Util.setOptions(this, options);
  4275. this._hints = {
  4276. locations: {}
  4277. };
  4278. if (!this.options.suppressDemoServerWarning &&
  4279. this.options.serviceUrl.indexOf('//router.project-osrm.org') >= 0) {
  4280. console.warn('You are using OSRM\'s demo server. ' +
  4281. 'Please note that it is **NOT SUITABLE FOR PRODUCTION USE**.\n' +
  4282. 'Refer to the demo server\'s usage policy: ' +
  4283. 'https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy\n\n' +
  4284. 'To change, set the serviceUrl option.\n\n' +
  4285. 'Please do not report issues with this server to neither ' +
  4286. 'Leaflet Routing Machine or OSRM - it\'s for\n' +
  4287. 'demo only, and will sometimes not be available, or work in ' +
  4288. 'unexpected ways.\n\n' +
  4289. 'Please set up your own OSRM server, or use a paid service ' +
  4290. 'provider for production.');
  4291. }
  4292. },
  4293. route: function(waypoints, callback, context, options) {
  4294. var timedOut = false,
  4295. wps = [],
  4296. url,
  4297. timer,
  4298. wp,
  4299. i,
  4300. xhr;
  4301. options = L.extend({}, this.options.routingOptions, options);
  4302. url = this.buildRouteUrl(waypoints, options);
  4303. if (this.options.requestParameters) {
  4304. url += L.Util.getParamString(this.options.requestParameters, url);
  4305. }
  4306. timer = setTimeout(function() {
  4307. timedOut = true;
  4308. callback.call(context || callback, {
  4309. status: -1,
  4310. message: 'OSRM request timed out.'
  4311. });
  4312. }, this.options.timeout);
  4313. // Create a copy of the waypoints, since they
  4314. // might otherwise be asynchronously modified while
  4315. // the request is being processed.
  4316. for (i = 0; i < waypoints.length; i++) {
  4317. wp = waypoints[i];
  4318. wps.push(new Waypoint(wp.latLng, wp.name, wp.options));
  4319. }
  4320. return xhr = corslite(url, L.bind(function(err, resp) {
  4321. var data,
  4322. error = {};
  4323. clearTimeout(timer);
  4324. if (!timedOut) {
  4325. if (!err) {
  4326. try {
  4327. data = JSON.parse(resp.responseText);
  4328. try {
  4329. return this._routeDone(data, wps, options, callback, context);
  4330. } catch (ex) {
  4331. error.status = -3;
  4332. error.message = ex.toString();
  4333. }
  4334. } catch (ex) {
  4335. error.status = -2;
  4336. error.message = 'Error parsing OSRM response: ' + ex.toString();
  4337. }
  4338. } else {
  4339. error.message = 'HTTP request failed: ' + err.type +
  4340. (err.target && err.target.status ? ' HTTP ' + err.target.status + ': ' + err.target.statusText : '');
  4341. error.url = url;
  4342. error.status = -1;
  4343. error.target = err;
  4344. }
  4345. callback.call(context || callback, error);
  4346. } else {
  4347. xhr.abort();
  4348. }
  4349. }, this));
  4350. },
  4351. requiresMoreDetail: function(route, zoom, bounds) {
  4352. if (!route.properties.isSimplified) {
  4353. return false;
  4354. }
  4355. var waypoints = route.inputWaypoints,
  4356. i;
  4357. for (i = 0; i < waypoints.length; ++i) {
  4358. if (!bounds.contains(waypoints[i].latLng)) {
  4359. return true;
  4360. }
  4361. }
  4362. return false;
  4363. },
  4364. _routeDone: function(response, inputWaypoints, options, callback, context) {
  4365. var alts = [],
  4366. actualWaypoints,
  4367. i,
  4368. route;
  4369. context = context || callback;
  4370. if (response.code !== 'Ok') {
  4371. callback.call(context, {
  4372. status: response.code
  4373. });
  4374. return;
  4375. }
  4376. actualWaypoints = this._toWaypoints(inputWaypoints, response.waypoints);
  4377. for (i = 0; i < response.routes.length; i++) {
  4378. route = this._convertRoute(response.routes[i]);
  4379. route.inputWaypoints = inputWaypoints;
  4380. route.waypoints = actualWaypoints;
  4381. route.properties = {isSimplified: !options || !options.geometryOnly || options.simplifyGeometry};
  4382. alts.push(route);
  4383. }
  4384. this._saveHintData(response.waypoints, inputWaypoints);
  4385. callback.call(context, null, alts);
  4386. },
  4387. _convertRoute: function(responseRoute) {
  4388. var result = {
  4389. name: '',
  4390. coordinates: [],
  4391. instructions: [],
  4392. summary: {
  4393. totalDistance: responseRoute.distance,
  4394. totalTime: responseRoute.duration
  4395. }
  4396. },
  4397. legNames = [],
  4398. waypointIndices = [],
  4399. index = 0,
  4400. legCount = responseRoute.legs.length,
  4401. hasSteps = responseRoute.legs[0].steps.length > 0,
  4402. i,
  4403. j,
  4404. leg,
  4405. step,
  4406. geometry,
  4407. type,
  4408. modifier,
  4409. text,
  4410. stepToText;
  4411. if (this.options.stepToText) {
  4412. stepToText = this.options.stepToText;
  4413. } else {
  4414. var textInstructions = osrmTextInstructions('v5', this.options.language);
  4415. stepToText = textInstructions.compile.bind(textInstructions);
  4416. }
  4417. for (i = 0; i < legCount; i++) {
  4418. leg = responseRoute.legs[i];
  4419. legNames.push(leg.summary && leg.summary.charAt(0).toUpperCase() + leg.summary.substring(1));
  4420. for (j = 0; j < leg.steps.length; j++) {
  4421. step = leg.steps[j];
  4422. geometry = this._decodePolyline(step.geometry);
  4423. result.coordinates.push.apply(result.coordinates, geometry);
  4424. type = this._maneuverToInstructionType(step.maneuver, i === legCount - 1);
  4425. modifier = this._maneuverToModifier(step.maneuver);
  4426. text = stepToText(step);
  4427. if (type) {
  4428. if ((i == 0 && step.maneuver.type == 'depart') || step.maneuver.type == 'arrive') {
  4429. waypointIndices.push(index);
  4430. }
  4431. result.instructions.push({
  4432. type: type,
  4433. distance: step.distance,
  4434. time: step.duration,
  4435. road: step.name,
  4436. direction: this._bearingToDirection(step.maneuver.bearing_after),
  4437. exit: step.maneuver.exit,
  4438. index: index,
  4439. mode: step.mode,
  4440. modifier: modifier,
  4441. text: text
  4442. });
  4443. }
  4444. index += geometry.length;
  4445. }
  4446. }
  4447. result.name = legNames.join(', ');
  4448. if (!hasSteps) {
  4449. result.coordinates = this._decodePolyline(responseRoute.geometry);
  4450. } else {
  4451. result.waypointIndices = waypointIndices;
  4452. }
  4453. return result;
  4454. },
  4455. _bearingToDirection: function(bearing) {
  4456. var oct = Math.round(bearing / 45) % 8;
  4457. return ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'][oct];
  4458. },
  4459. _maneuverToInstructionType: function(maneuver, lastLeg) {
  4460. switch (maneuver.type) {
  4461. case 'new name':
  4462. return 'Continue';
  4463. case 'depart':
  4464. return 'Head';
  4465. case 'arrive':
  4466. return lastLeg ? 'DestinationReached' : 'WaypointReached';
  4467. case 'roundabout':
  4468. case 'rotary':
  4469. return 'Roundabout';
  4470. case 'merge':
  4471. case 'fork':
  4472. case 'on ramp':
  4473. case 'off ramp':
  4474. case 'end of road':
  4475. return this._camelCase(maneuver.type);
  4476. // These are all reduced to the same instruction in the current model
  4477. //case 'turn':
  4478. //case 'ramp': // deprecated in v5.1
  4479. default:
  4480. return this._camelCase(maneuver.modifier);
  4481. }
  4482. },
  4483. _maneuverToModifier: function(maneuver) {
  4484. var modifier = maneuver.modifier;
  4485. switch (maneuver.type) {
  4486. case 'merge':
  4487. case 'fork':
  4488. case 'on ramp':
  4489. case 'off ramp':
  4490. case 'end of road':
  4491. modifier = this._leftOrRight(modifier);
  4492. }
  4493. return modifier && this._camelCase(modifier);
  4494. },
  4495. _camelCase: function(s) {
  4496. var words = s.split(' '),
  4497. result = '';
  4498. for (var i = 0, l = words.length; i < l; i++) {
  4499. result += words[i].charAt(0).toUpperCase() + words[i].substring(1);
  4500. }
  4501. return result;
  4502. },
  4503. _leftOrRight: function(d) {
  4504. return d.indexOf('left') >= 0 ? 'Left' : 'Right';
  4505. },
  4506. _decodePolyline: function(routeGeometry) {
  4507. var cs = polyline.decode(routeGeometry, this.options.polylinePrecision),
  4508. result = new Array(cs.length),
  4509. i;
  4510. for (i = cs.length - 1; i >= 0; i--) {
  4511. result[i] = L.latLng(cs[i]);
  4512. }
  4513. return result;
  4514. },
  4515. _toWaypoints: function(inputWaypoints, vias) {
  4516. var wps = [],
  4517. i,
  4518. viaLoc;
  4519. for (i = 0; i < vias.length; i++) {
  4520. viaLoc = vias[i].location;
  4521. wps.push(new Waypoint(L.latLng(viaLoc[1], viaLoc[0]),
  4522. inputWaypoints[i].name,
  4523. inputWaypoints[i].options));
  4524. }
  4525. return wps;
  4526. },
  4527. buildRouteUrl: function(waypoints, options) {
  4528. var locs = [],
  4529. hints = [],
  4530. wp,
  4531. latLng,
  4532. computeInstructions,
  4533. computeAlternative = true;
  4534. for (var i = 0; i < waypoints.length; i++) {
  4535. wp = waypoints[i];
  4536. latLng = wp.latLng;
  4537. locs.push(latLng.lng + ',' + latLng.lat);
  4538. hints.push(this._hints.locations[this._locationKey(latLng)] || '');
  4539. }
  4540. computeInstructions =
  4541. true;
  4542. return this.options.serviceUrl + '/' + this.options.profile + '/' +
  4543. locs.join(';') + '?' +
  4544. (options.geometryOnly ? (options.simplifyGeometry ? '' : 'overview=full') : 'overview=false') +
  4545. '&alternatives=' + computeAlternative.toString() +
  4546. '&steps=' + computeInstructions.toString() +
  4547. (this.options.useHints ? '&hints=' + hints.join(';') : '') +
  4548. (options.allowUTurns ? '&continue_straight=' + !options.allowUTurns : '');
  4549. },
  4550. _locationKey: function(location) {
  4551. return location.lat + ',' + location.lng;
  4552. },
  4553. _saveHintData: function(actualWaypoints, waypoints) {
  4554. var loc;
  4555. this._hints = {
  4556. locations: {}
  4557. };
  4558. for (var i = actualWaypoints.length - 1; i >= 0; i--) {
  4559. loc = waypoints[i].latLng;
  4560. this._hints.locations[this._locationKey(loc)] = actualWaypoints[i].hint;
  4561. }
  4562. },
  4563. });
  4564. })();
  4565. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  4566. },{"./waypoint":23,"corslite":1,"osrm-text-instructions":2,"polyline":9}],22:[function(_dereq_,module,exports){
  4567. (function (global){
  4568. (function() {
  4569. 'use strict';
  4570. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  4571. var GeocoderElement = _dereq_('./geocoder-element');
  4572. var Waypoint = _dereq_('./waypoint');
  4573. module.exports = (L.Layer || L.Class).extend({
  4574. includes: L.Mixin.Events,
  4575. options: {
  4576. dragStyles: [
  4577. {color: 'black', opacity: 0.15, weight: 9},
  4578. {color: 'white', opacity: 0.8, weight: 6},
  4579. {color: 'red', opacity: 1, weight: 2, dashArray: '7,12'}
  4580. ],
  4581. draggableWaypoints: true,
  4582. routeWhileDragging: false,
  4583. addWaypoints: true,
  4584. reverseWaypoints: false,
  4585. addButtonClassName: '',
  4586. language: 'en',
  4587. createGeocoderElement: function(wp, i, nWps, plan) {
  4588. return new GeocoderElement(wp, i, nWps, plan);
  4589. },
  4590. createMarker: function(i, wp) {
  4591. var options = {
  4592. draggable: this.draggableWaypoints
  4593. },
  4594. marker = L.marker(wp.latLng, options);
  4595. return marker;
  4596. },
  4597. geocodersClassName: ''
  4598. },
  4599. initialize: function(waypoints, options) {
  4600. L.Util.setOptions(this, options);
  4601. this._waypoints = [];
  4602. this.setWaypoints(waypoints);
  4603. },
  4604. isReady: function() {
  4605. var i;
  4606. for (i = 0; i < this._waypoints.length; i++) {
  4607. if (!this._waypoints[i].latLng) {
  4608. return false;
  4609. }
  4610. }
  4611. return true;
  4612. },
  4613. getWaypoints: function() {
  4614. var i,
  4615. wps = [];
  4616. for (i = 0; i < this._waypoints.length; i++) {
  4617. wps.push(this._waypoints[i]);
  4618. }
  4619. return wps;
  4620. },
  4621. setWaypoints: function(waypoints) {
  4622. var args = [0, this._waypoints.length].concat(waypoints);
  4623. this.spliceWaypoints.apply(this, args);
  4624. return this;
  4625. },
  4626. spliceWaypoints: function() {
  4627. var args = [arguments[0], arguments[1]],
  4628. i;
  4629. for (i = 2; i < arguments.length; i++) {
  4630. args.push(arguments[i] && arguments[i].hasOwnProperty('latLng') ? arguments[i] : new Waypoint(arguments[i]));
  4631. }
  4632. [].splice.apply(this._waypoints, args);
  4633. // Make sure there's always at least two waypoints
  4634. while (this._waypoints.length < 2) {
  4635. this.spliceWaypoints(this._waypoints.length, 0, null);
  4636. }
  4637. this._updateMarkers();
  4638. this._fireChanged.apply(this, args);
  4639. },
  4640. onAdd: function(map) {
  4641. this._map = map;
  4642. this._updateMarkers();
  4643. },
  4644. onRemove: function() {
  4645. var i;
  4646. this._removeMarkers();
  4647. if (this._newWp) {
  4648. for (i = 0; i < this._newWp.lines.length; i++) {
  4649. this._map.removeLayer(this._newWp.lines[i]);
  4650. }
  4651. }
  4652. delete this._map;
  4653. },
  4654. createGeocoders: function() {
  4655. var container = L.DomUtil.create('div', 'leaflet-routing-geocoders ' + this.options.geocodersClassName),
  4656. waypoints = this._waypoints,
  4657. addWpBtn,
  4658. reverseBtn;
  4659. this._geocoderContainer = container;
  4660. this._geocoderElems = [];
  4661. if (this.options.addWaypoints) {
  4662. addWpBtn = L.DomUtil.create('button', 'leaflet-routing-add-waypoint ' + this.options.addButtonClassName, container);
  4663. addWpBtn.setAttribute('type', 'button');
  4664. L.DomEvent.addListener(addWpBtn, 'click', function() {
  4665. this.spliceWaypoints(waypoints.length, 0, null);
  4666. }, this);
  4667. }
  4668. if (this.options.reverseWaypoints) {
  4669. reverseBtn = L.DomUtil.create('button', 'leaflet-routing-reverse-waypoints', container);
  4670. reverseBtn.setAttribute('type', 'button');
  4671. L.DomEvent.addListener(reverseBtn, 'click', function() {
  4672. this._waypoints.reverse();
  4673. this.setWaypoints(this._waypoints);
  4674. }, this);
  4675. }
  4676. this._updateGeocoders();
  4677. this.on('waypointsspliced', this._updateGeocoders);
  4678. return container;
  4679. },
  4680. _createGeocoder: function(i) {
  4681. var geocoder = this.options.createGeocoderElement(this._waypoints[i], i, this._waypoints.length, this.options);
  4682. geocoder
  4683. .on('delete', function() {
  4684. if (i > 0 || this._waypoints.length > 2) {
  4685. this.spliceWaypoints(i, 1);
  4686. } else {
  4687. this.spliceWaypoints(i, 1, new Waypoint());
  4688. }
  4689. }, this)
  4690. .on('geocoded', function(e) {
  4691. this._updateMarkers();
  4692. this._fireChanged();
  4693. this._focusGeocoder(i + 1);
  4694. this.fire('waypointgeocoded', {
  4695. waypointIndex: i,
  4696. waypoint: e.waypoint
  4697. });
  4698. }, this)
  4699. .on('reversegeocoded', function(e) {
  4700. this.fire('waypointgeocoded', {
  4701. waypointIndex: i,
  4702. waypoint: e.waypoint
  4703. });
  4704. }, this);
  4705. return geocoder;
  4706. },
  4707. _updateGeocoders: function() {
  4708. var elems = [],
  4709. i,
  4710. geocoderElem;
  4711. for (i = 0; i < this._geocoderElems.length; i++) {
  4712. this._geocoderContainer.removeChild(this._geocoderElems[i].getContainer());
  4713. }
  4714. for (i = this._waypoints.length - 1; i >= 0; i--) {
  4715. geocoderElem = this._createGeocoder(i);
  4716. this._geocoderContainer.insertBefore(geocoderElem.getContainer(), this._geocoderContainer.firstChild);
  4717. elems.push(geocoderElem);
  4718. }
  4719. this._geocoderElems = elems.reverse();
  4720. },
  4721. _removeMarkers: function() {
  4722. var i;
  4723. if (this._markers) {
  4724. for (i = 0; i < this._markers.length; i++) {
  4725. if (this._markers[i]) {
  4726. this._map.removeLayer(this._markers[i]);
  4727. }
  4728. }
  4729. }
  4730. this._markers = [];
  4731. },
  4732. _updateMarkers: function() {
  4733. var i,
  4734. m;
  4735. if (!this._map) {
  4736. return;
  4737. }
  4738. this._removeMarkers();
  4739. for (i = 0; i < this._waypoints.length; i++) {
  4740. if (this._waypoints[i].latLng) {
  4741. m = this.options.createMarker(i, this._waypoints[i], this._waypoints.length);
  4742. if (m) {
  4743. m.addTo(this._map);
  4744. if (this.options.draggableWaypoints) {
  4745. this._hookWaypointEvents(m, i);
  4746. }
  4747. }
  4748. } else {
  4749. m = null;
  4750. }
  4751. this._markers.push(m);
  4752. }
  4753. },
  4754. _fireChanged: function() {
  4755. this.fire('waypointschanged', {waypoints: this.getWaypoints()});
  4756. if (arguments.length >= 2) {
  4757. this.fire('waypointsspliced', {
  4758. index: Array.prototype.shift.call(arguments),
  4759. nRemoved: Array.prototype.shift.call(arguments),
  4760. added: arguments
  4761. });
  4762. }
  4763. },
  4764. _hookWaypointEvents: function(m, i, trackMouseMove) {
  4765. var eventLatLng = function(e) {
  4766. return trackMouseMove ? e.latlng : e.target.getLatLng();
  4767. },
  4768. dragStart = L.bind(function(e) {
  4769. this.fire('waypointdragstart', {index: i, latlng: eventLatLng(e)});
  4770. }, this),
  4771. drag = L.bind(function(e) {
  4772. this._waypoints[i].latLng = eventLatLng(e);
  4773. this.fire('waypointdrag', {index: i, latlng: eventLatLng(e)});
  4774. }, this),
  4775. dragEnd = L.bind(function(e) {
  4776. this._waypoints[i].latLng = eventLatLng(e);
  4777. this._waypoints[i].name = '';
  4778. if (this._geocoderElems) {
  4779. this._geocoderElems[i].update(true);
  4780. }
  4781. this.fire('waypointdragend', {index: i, latlng: eventLatLng(e)});
  4782. this._fireChanged();
  4783. }, this),
  4784. mouseMove,
  4785. mouseUp;
  4786. if (trackMouseMove) {
  4787. mouseMove = L.bind(function(e) {
  4788. this._markers[i].setLatLng(e.latlng);
  4789. drag(e);
  4790. }, this);
  4791. mouseUp = L.bind(function(e) {
  4792. this._map.dragging.enable();
  4793. this._map.off('mouseup', mouseUp);
  4794. this._map.off('mousemove', mouseMove);
  4795. dragEnd(e);
  4796. }, this);
  4797. this._map.dragging.disable();
  4798. this._map.on('mousemove', mouseMove);
  4799. this._map.on('mouseup', mouseUp);
  4800. dragStart({latlng: this._waypoints[i].latLng});
  4801. } else {
  4802. m.on('dragstart', dragStart);
  4803. m.on('drag', drag);
  4804. m.on('dragend', dragEnd);
  4805. }
  4806. },
  4807. dragNewWaypoint: function(e) {
  4808. var newWpIndex = e.afterIndex + 1;
  4809. if (this.options.routeWhileDragging) {
  4810. this.spliceWaypoints(newWpIndex, 0, e.latlng);
  4811. this._hookWaypointEvents(this._markers[newWpIndex], newWpIndex, true);
  4812. } else {
  4813. this._dragNewWaypoint(newWpIndex, e.latlng);
  4814. }
  4815. },
  4816. _dragNewWaypoint: function(newWpIndex, initialLatLng) {
  4817. var wp = new Waypoint(initialLatLng),
  4818. prevWp = this._waypoints[newWpIndex - 1],
  4819. nextWp = this._waypoints[newWpIndex],
  4820. marker = this.options.createMarker(newWpIndex, wp, this._waypoints.length + 1),
  4821. lines = [],
  4822. draggingEnabled = this._map.dragging.enabled(),
  4823. mouseMove = L.bind(function(e) {
  4824. var i,
  4825. latLngs;
  4826. if (marker) {
  4827. marker.setLatLng(e.latlng);
  4828. }
  4829. for (i = 0; i < lines.length; i++) {
  4830. latLngs = lines[i].getLatLngs();
  4831. latLngs.splice(1, 1, e.latlng);
  4832. lines[i].setLatLngs(latLngs);
  4833. }
  4834. L.DomEvent.stop(e);
  4835. }, this),
  4836. mouseUp = L.bind(function(e) {
  4837. var i;
  4838. if (marker) {
  4839. this._map.removeLayer(marker);
  4840. }
  4841. for (i = 0; i < lines.length; i++) {
  4842. this._map.removeLayer(lines[i]);
  4843. }
  4844. this._map.off('mousemove', mouseMove);
  4845. this._map.off('mouseup', mouseUp);
  4846. this.spliceWaypoints(newWpIndex, 0, e.latlng);
  4847. if (draggingEnabled) {
  4848. this._map.dragging.enable();
  4849. }
  4850. }, this),
  4851. i;
  4852. if (marker) {
  4853. marker.addTo(this._map);
  4854. }
  4855. for (i = 0; i < this.options.dragStyles.length; i++) {
  4856. lines.push(L.polyline([prevWp.latLng, initialLatLng, nextWp.latLng],
  4857. this.options.dragStyles[i]).addTo(this._map));
  4858. }
  4859. if (draggingEnabled) {
  4860. this._map.dragging.disable();
  4861. }
  4862. this._map.on('mousemove', mouseMove);
  4863. this._map.on('mouseup', mouseUp);
  4864. },
  4865. _focusGeocoder: function(i) {
  4866. if (this._geocoderElems[i]) {
  4867. this._geocoderElems[i].focus();
  4868. } else {
  4869. document.activeElement.blur();
  4870. }
  4871. }
  4872. });
  4873. })();
  4874. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  4875. },{"./geocoder-element":14,"./waypoint":23}],23:[function(_dereq_,module,exports){
  4876. (function (global){
  4877. (function() {
  4878. 'use strict';
  4879. var L = (typeof window !== "undefined" ? window.L : typeof global !== "undefined" ? global.L : null);
  4880. module.exports = L.Class.extend({
  4881. options: {
  4882. allowUTurn: false,
  4883. },
  4884. initialize: function(latLng, name, options) {
  4885. L.Util.setOptions(this, options);
  4886. this.latLng = L.latLng(latLng);
  4887. this.name = name;
  4888. }
  4889. });
  4890. })();
  4891. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  4892. },{}]},{},[15]);