New User Frustrations

I am trying to create a small web app using javascript. Ive got my account, token etc and went to the api playground. I successfully ran the javascript location and directions examples both in the api playground and on my webserver. yay.

When I run the javascript on the api playground it shows me a map as well as the geojson results in a different tab.

Maybe I just havent found it yet, but there doesnt appear to be instructions on how to actually display a map. All I get when I run this on a web server is the geojson or coordinates.

Im assuming now, maybe incorrectly, that all you provide is the data and then I am to use this with some other service like leaflet. If correct, this is exceptionally frustrating when Im looking at the api playground with exactly what Im trying to do with no instructions or help on how to actually show a map.

My apologies if Im mistaken and theres documentation Im simply missing.


yes, you assume correctly.
The openrouteservice documentation only documents the openrouteservice API, not any means of visualization.

The rendered map in the playground is an additional service to help users understand what the response actually means, since geojson is technically human-readable, but very hard to visualize on a mental map (and encoded polylines are even worse^^).

I can somewhat relate to your frustration, but I don’t think it is something the openrouteservice documentation will ever provide. Any visualization heavily depends on the usecase of the API user, their programming language, … and is not provided by the openrouteservice.

In your case, for using the api and visualizing in javascript, we use leaflet in our client. Refer to their quick-start guide for the basics and their example on how to use geojson for visualizing ors replies :))
Be aware that there are probably more js-libraries for visualizing maps and geojson out there, and others might be better suited to your particular use-case.

Best regards,

Thank you for your prompt reply. I will have to look into visualizations.

1 Like