Currently, I am utilizing the reverse geocoding mapbox webservice to retrieve addresses based on latitude and longitude coordinates.
When using mapbox (
http://api.tiles.mapbox.com/v3/mykey/geocode/{mylong},{mylat}.json
) with an Ajax callback function for obtaining JSON data, everything works smoothly.
However, when applying the same approach to openstreetmaps nominatim (
http://nominatim.openstreetmap.org/reverse?format=json&lat={mylat}&lon={mylong}
), I encounter a JavaScript error:
The requested resource does not have an 'Access-Control-Allow-Origin' header. Hence, access from the origin 'localhost' is restricted.
I wonder why the JSON data retrieval is successful in mapbox but not in nominatim. Although it doesn't seem related to the Access-Control-Allow-Origin parameter in Apache headers. If mapbox functions correctly, shouldn't nominatim work as well?
The reason I am exploring nominatim is due to its broader range of referenced coordinates.
Your assistance would be greatly appreciated.
Thank you,
Miguel