<p>This is a basic routing interface for osm.org implemented in JavaScript. Routing is provided by external services (in this commit, OSRM, GraphHopper, and MapQuest Open).</p>
<p>The initial aim is to provide A-B routing functionality with a coherent UI. There is much more that could be implemented, of course, but the focus has been on the simplest possible service for now.</p>
<p>There are two obvious omissions:</p>
<ul>
<li>Routes do not have permalinks and the URL history is never changed.</li>
<li>Directions are not translated.</li>
</ul><p>Both of these are some way outside my knowledge / comfort zone and I suspect others would be more efficient at coding them! Translation is expected to be done by the external service, so should be largely a matter of the routing engine passing the current locale.</p>
<p>Otherwise this should largely be ready. Comments/suggestions <em>within the existing scope</em> welcome: "wouldn't it be nice if it did this..." requests are probably best left for after an initial launch.</p>
<p>Thanks hugely to <a href="https://github.com/apmon" class="user-mention">@apmon</a>, <a href="https://github.com/danstowell" class="user-mention">@danstowell</a> and <a href="https://github.com/karussell" class="user-mention">@karussell</a> for patches and suggestions so far.</p>
<hr>
<h4>You can merge this Pull Request by running</h4>
<pre> git pull https://github.com/systemed/openstreetmap-website routing</pre>
<p>Or view, comment on, or merge it at:</p>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/716'>https://github.com/openstreetmap/openstreetmap-website/pull/716</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Beginning of JavaScript-only routing UI</li>
<li>Presentation work</li>
<li>Precompile routing JS</li>
<li>Presentation of directions</li>
<li>Query options presentation</li>
<li>Close directions</li>
<li>Start to make turn-by-turn instructions clickable</li>
<li>Show little popup on click</li>
<li>Start work on second engine</li>
<li>Move routing engines into their own files</li>
<li>Simplify usage, fix closures</li>
<li>Start MapQuest Open support</li>
<li>Move more engine-specific stuff out of main .js</li>
<li>Parse MapQuest directions</li>
<li>Parse CloudMade directions</li>
<li>Allow user to click Go before geocode result</li>
<li>Remove logging</li>
<li>Start work on drag-and-drop start/end markers</li>
<li>More work on draggable markers</li>
<li>More draggable routes work</li>
<li>Add GraphHopper engine (thanks @karussell!)</li>
<li>Integrate marker & geocoding behaviours</li>
<li>Apparently 'final' is a reserved word in JS...</li>
<li>Repair Go button</li>
<li>Remove a couple of TODOs</li>
<li>Remove some repeated-query funkiness</li>
<li>Make more of the javascript routing functions internationalizable</li>
<li>Merge pull request #6 from apmon/jsroute</li>
<li>Fiiiix siiiiilly direeeeections</li>
<li>add a credits line for each routing service</li>
<li>remove the todo that I addressed</li>
<li>refresh search if showing and user changes provider</li>
<li>Merge pull request #10 from danstowell/jsrouting-credits</li>
<li>Merge pull request #11 from danstowell/jsrouting-pulldownchange</li>
<li>jsrouting: zoom to bbox on getting fresh geocoded route, but not on drag etc</li>
<li>Merge pull request #12 from danstowell/jsrouting-bboxzoom</li>
<li>Reformat string to avoid long line</li>
<li>fix firefox behaviour when dragging pointer from the tray to the map</li>
<li>Add spinner while awaiting route</li>
<li>Improve error-handling</li>
<li>Merge pull request #13 from danstowell/jsrouting-ffoxdragok</li>
<li>Use generic GraphHopper engine</li>
<li>Remove CloudMade foot engine</li>
<li>Refactor MQ/OSRM engines a la @karussell patch</li>
<li>Add CORS for engines that support it</li>
<li>Pass on routing failures from MapQuest</li>
<li>Put marker at exact position user dragged it to</li>
<li>Add distance/time summary</li>
<li>Zoom to fit when submitting form</li>
<li>Convert tabs to spaces</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-0">app/assets/images/routing-sprite.png</a>
(0)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-1">app/assets/images/searching-small.gif</a>
(0)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-2">app/assets/javascripts/index.js</a>
(48)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-3">app/assets/javascripts/routing.js.erb</a>
(290)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-4">app/assets/javascripts/routing_engines/graphhopper.js</a>
(63)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-5">app/assets/javascripts/routing_engines/mapquest.js</a>
(81)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-6">app/assets/javascripts/routing_engines/osrm.js</a>
(54)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-7">app/assets/stylesheets/common.css.scss</a>
(59)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-8">app/views/layouts/_search.html.erb</a>
(23)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-9">config/environments/production.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-10">config/locales/de.yml</a>
(32)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-11">config/locales/en.yml</a>
(39)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/716/files#diff-12">vendor/assets/leaflet/leaflet.polyline.js</a>
(127)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/716.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/716.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/716.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/716.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/openstreetmap/openstreetmap-website/pull/716'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/1419053__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwOTkxNjkzNSwiZGF0YSI6eyJpZCI6MjcyNTIxNjJ9fQ==--565b0cb4cb35d46e435b1262ba4124493e2d1403.gif' height='1' width='1'></p>