[OSRM-talk] URL parameters for http://map.project-osrm.org - supporting end point only?

Daniel Patterson daniel at mapbox.com
Wed Nov 11 17:54:10 UTC 2015

Hi Robert,

  http://map.project-orsm.org/ <http://map.project-orsm.org/> isn't really intended for linking to like your'e describing.  It's more of a demo interface to OSRM itself.

  Have you explored using LRM (Leaflet Routing Machine) http://www.liedman.net/leaflet-routing-machine/ <http://www.liedman.net/leaflet-routing-machine/> and drawing routes on your own Leaflet <div> ?


> On Nov 11, 2015, at 12:47 PM, MapsMarker.com <info at mapsmarker.com> wrote:
> Hello,
> I am the developer of the WordPress mapping plugins Leaflet Maps Marker (https://wordpress.org/plugins/leaflet-maps-marker/ <https://wordpress.org/plugins/leaflet-maps-marker/>) and Maps Marker Pro (https://www.mapsmarker.com <https://www.mapsmarker.com/>). Both plugins include support for different directions providers - one of them is OSRM and directions links are linking directly to map.project-osrm.org <http://map.project-osrm.org/>. I noticed that the URL schema I used so far seemed to have changed and the map is now always centered on Washington (example link produced by my plugin currently: http://map.project-osrm.org/?hl=en&loc=48.292787,16.092911&df=0 <http://map.project-osrm.org/?hl=en&loc=48.292787,16.092911&df=0>)
> I did some research and found that the URL parameters have changed and that new parameters like "center" are required.
> Anyway I am having issues supporting the new URL scheme, because I only want to set the end point for directions as I do not know where the user wants to start. I tried this by using the following URL for example:
> http://map.project-osrm.org/?z=13&center=48.242330%2C16.433030&loc=48.242330%2C16.433030&loc=&hl=en&ly=&alt=&df=&srv= <http://map.project-osrm.org/?z=13&center=48.242330%2C16.433030&loc=48.242330%2C16.433030&loc=&hl=en&ly=&alt=&df=&srv=>
> The main issue is that if only 1 loc parameter is set, the input form field for start point remains empty, resulting in a non usable link for my plugin users.
> The current workaround for this issue is to set both loc parameters to the same lat+lon values (like http://map.project-osrm.org/?z=13&center=48.242330%2C16.433030&loc=48.242330%2C16.433030&loc=48.242330%2C16.433030&hl=en&ly=&alt=&df=&srv= <http://map.project-osrm.org/?z=13&center=48.242330%2C16.433030&loc=48.242330%2C16.433030&loc=48.242330%2C16.433030&hl=en&ly=&alt=&df=&srv=>) - this results in start+end point form fields being populated - anyway this is suboptimal, as the user has to delete the start form field and enter where he wants to start.
> I searched the wiki but couldnt find a way how this could be solved. Is there a way to use a URL like http://map.project-osrm.org/?z=13&center=48.242330%2C16.433030&loc=48.242330%2C16.433030&loc=&hl=en&ly=&alt=&df=&srv= <http://map.project-osrm.org/?z=13&center=48.242330%2C16.433030&loc=48.242330%2C16.433030&loc=&hl=en&ly=&alt=&df=&srv=> with only 1 loc parameter set which prefills the endpoint for directions so that the user only has to set the start point for directions? If not, is there a chance that the site gets updated to support that?
> Any help would really be appreciated!
> best,
> Robert
> _______________________________________________
> OSRM-talk mailing list
> OSRM-talk at openstreetmap.org <mailto:OSRM-talk at openstreetmap.org>
> https://lists.openstreetmap.org/listinfo/osrm-talk <https://lists.openstreetmap.org/listinfo/osrm-talk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osrm-talk/attachments/20151111/e52cde01/attachment-0001.html>

More information about the OSRM-talk mailing list