Select to view content in your preferred language

Unable to recreate a map in javascript using jsapi for some tiled map services.

4278
3
08-06-2014 10:17 PM
MandeepChauhan
Deactivated User

I have a custom app that read layer url and its associated properties from a table that exist in my own database and render a map for that layer on a html page. I have some interface that I can use to change some properties of the map and save it back to my own database. In my logic when I save map properties I need to destroy the map and create it again and this is throwing error for me.

"Error: Unable to load http://gisservices.scc.qld.gov.au/arcgis/rest/services/ImageryBaseMapsEarthCover/StreetMap_SCRC/MapS... status: 0↵ at Error (native)↵ at new m (http://js.arcgis.com/3.10/init.js:223:16)↵ at XMLHttpRequest.g (http://js.arcgis.com/3.10/init.js:161:17)"

 

I have replicated the issue in ArcGIS API for JavaScript Sandbox and the code is attached. The map loaded int first go. When reload button (on top left cornor) is clicked I got above error.

 

As a requirement of my custom application I need to recreate the map and unable to use some map services e.g.: http://gisservices.scc.qld.gov.au/arcgis/rest/services/ImageryBaseMapsEarthCover/StreetMap_SCRC/MapS....

0 Kudos
3 Replies
OwenEarley
Frequent Contributor

When I run this in IE 11 it gives the error you mention. The IE console log also shows some more information:

SEC7128: Multiple Access-Control-Allow-Origin headers are not allowed for CORS response.

When I look this error up the following MSDN site has more information:

Console error messages in F12 developer tools (Windows)

SEC7129

"Multiple Access-Control-Allow-Credentials headers are not allowed for CORS response. "

The response header contained multiple Access-Control-Allow-Credentials headers.

This is a server-side error. The server should return a single Access-Control-Allow-Credentials header. Report this error to the developer in charge of the server-side resource.

This appears to be an issue with your server setup.

Interestingly, running your file locally in Chrome gives no errors.

Owen

Spatial XP

0 Kudos
MandeepChauhan
Deactivated User

The attached file ran successfully in 1st go. The issue comes up when you click on reload button. So just want to confirm if you clicked reload button?

0 Kudos
OwenEarley
Frequent Contributor

Yes - the SEC7128 error only happens after clicking on the reload button. The first page load shows the map.

0 Kudos