[openstreetmap-website] Please add a way to share a route (#905)

Aditya Prakash notifications at github.com
Fri Nov 20 04:42:10 UTC 2015


[index/directions.js](https://github.com/openstreetmap/openstreetmap-website/blob/509f07b32e00174588081aca64b9ec1446948c8d/app/assets/javascripts/index/directions.js) sets up all the endpoint marks and polyline when a `directions` request is made. So one way to getUrl of route can be that we can check if endpoint marks and ployline [exists in layer](https://github.com/openstreetmap/openstreetmap-website/blob/447fef40cf9b213ec4c019cc84be5597c26edcb9/vendor/assets/leaflet/leaflet.js#L1719).
However. is that really necessary?  Why can't we use `window.location.href`  instead of `OSM.SERVER_URL` as starting point when preparing the share url? (Check [this line](https://github.com/openstreetmap/openstreetmap-website/blob/36cbda3c80beac9496316389d4f082383ed4322a/app/assets/javascripts/leaflet.map.js#L103))

If window url is used then sharing of things like `node` can will be make more sense. If you use `share` button you would get this link: http://www.openstreetmap.org/#map=10/23.4563/87.3029
When window url makes more sense: http://www.openstreetmap.org/node/813334049#map=10/23.4563/87.3029

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/905#issuecomment-158277561
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20151119/1672635c/attachment.html>


More information about the rails-dev mailing list