OSMR routing blocked by CORS policy: No 'Access-Control-Allow-Origin'

Phoca Maps - displaying maps in Joomla! CMS
athco
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 19 Oct 2019, 18:11

OSMR routing blocked by CORS policy: No 'Access-Control-Allow-Origin'

Post by athco » 19 Oct 2019, 20:44

Hi,

I try to use OSM routing, but no success. I have a valid access token from Mapbox, use "http://map.project-osrm.org" as Router Service, but I get the following error:

Access to XMLHttpRequest at 'https://router.project-osrm.org/route/v ... rue&hints=;' from origin 'https://tokrimini.gr' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Website is developed on a provider and I don't have access to setup my own OSMR server, or even use a proxy.
What can I do?

Thank you very much in advance...

Tags:

athco
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 19 Oct 2019, 18:11

Re: OSMR routing blocked by CORS policy: No 'Access-Control-Allow-Origin'

Post by athco » 19 Oct 2019, 21:21

Hi,

Finally solved it by myself.
Mapbox is not needed. Used openrouteservice.org as Router Service and applied the key I got from https://openrouteservice.org.

Thank you all...

User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 7179
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: OSMR routing blocked by CORS policy: No 'Access-Control-Allow-Origin'

Post by Benno » 19 Oct 2019, 23:45

Ok.

Kind regards,
Benno

Post Reply