Hi all!

We implemented OpenStreetMap.org and it works great, but we get a CORS error, see below, after searching. We added the below code to the htacces, but it does'nt seem to work. We just can't find the solution and hope someone can help us :-)

ERROR Access to XMLHttpRequest at 'https://nominatim.openstreetmap.org/search?format=json&q=President%20Allendelaan%202,%201064GW%20Amsterdam' from origin 'https://www.frituurvetrecyclehet.nl' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

HTACCESS <ifmodule mod_headers.c=""> Header set Access-Control-Allow-Origin https://nominatim.openstreetmap.org Header set Access-Control-Allow-Credentials true </ifmodule>

Any help is appreciated!

asked 21 Oct, 09:14

Internetbureau%20Jun-E-Jay's gravatar image

accept rate: 0%

When you see a CORS issue like that with nominatim.openstreetmap.org then the underlying issue is likely that you have been blocked for some reason. The site sends proper CORS headers with normal responses but it does not send them when returning a HTTP 403 or 429. Check your logs for HTTP errors.

permanent link

answered 21 Oct, 09:51

lonvia's gravatar image

accept rate: 40%

Ah, thanks, but is there a way to check? We notice that we get 10 results without the error, and the 11th result gives the error. Any suggestion on how to fix this?

(22 Oct, 09:14) Internetbure...

The simplest way to fix this is to respect the Usage policy of the service and make sure to not send more than 1req/s. If that is not enough for you you will need to run your own instance of Nominatim.

(22 Oct, 10:29) lonvia
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 21 Oct, 09:14

question was seen: 195 times

last updated: 22 Oct, 10:29

powered by OSQA