[OSM-dev] cross-domain xmlhttprequest

andrzej zaborowski balrogg at gmail.com
Tue Dec 22 13:49:45 GMT 2009

Hi Stephan,

2009/12/22 Stephan Plepelits <skunk at xover.htu.tuwien.ac.at>:
> I just ran into a problem ... I'd like to access OpenStreetMap data
> directly from a web application via a XMLHttpRequest. Unfortunately
> cross-domain XMLHttpRequests are not allowed unless the foreign web server
> replies with a special HTTP-header (Access-Control-Allow-Origin) and you
> are using a modern browser (e.g. Firefox >=3).

Wikipedia API and others support JSON-P, this lets you load query
results (only GET requests) through simple <script source="..." /> and
works cross-domain.  It would require that we support returning JSON
instead of XML and adding the "callback" parameter to calls, but
receiving JSON would be an additional gain for any javascript code
using the API.  I'd find that very useful, either on the main api or a
separate service that syncs through planet diffs.


More information about the dev mailing list