4

I am getting the CORS error

 XMLHttpRequest cannot load http://services.arcgisonline.com/ArcGIS/rest/info?f=json. 
 No 'Access-Control-Allow-Origin' header is present on the requested resource. 
 Origin 'http://myserver.com' is therefore not allowed access.

when I use the ESRI topo base map in my ArcGIS JSAPI application. The application is hosted on IIS8 (Windows Server 2012 R2)

I am reading the ESRI ArcGIS API for JavaScript Samples CORS buffer There is a suggestion to add the root URL for CORS enabled servers to

esri.config.defaults.io.corsEnabledServers

Can you provide example how to do that?

I am not sure if the problem is on my server/application or the ESRI map server

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Feb 4, 2014 at 21:53

1 Answer 1

4

You shouldn't worry about this error. The ESRI JSAPI is just testing whether the server at services.arcgisonline.com supports CORS.

It currently doesn't support CORS, and hence the JSAPI throws an error in the console. This error doesn't indicate any problem at all. Most of your users will never see this error, and you shouldn't worry about it.

If you are interested, here is a ArcGIS Idea, which you could vote up: http://services.arcgisonline.com should support CORS

answered Feb 5, 2014 at 6:24
2
  • So I guess I just need to set up correctly the proxy.config file. I would expect ESRI ArcGIS JSAPI to have to some fail check if the server supports CORS and fall back to proxy if it is not. Seeing the XMLHttpRequest error is annoying. Commented Feb 6, 2014 at 15:40
  • You don't need the proxy if you are just using the base map from arcgis online. Commented Feb 6, 2014 at 16:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.