[OSM-dev] cross-domain xmlhttprequest
balrogg at gmail.com
Tue Dec 22 13:49:45 GMT 2009
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
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