No Access-Control-Allow-Origin Header is Present

6 posts / 0 new
Last post
ricemb
No Access-Control-Allow-Origin Header is Present

I are trying to switch our application from direct tile access to using the Leaflet API, but am getting a "No 'Access-Control-Allow-Origin' header is present on the requested resource." error when I load the page.

Here is the code which loads the map:
map = L.map('map', {fullscreenControl: false, layers: [defaultLayer], continuousWorld: false, dragging: false, maxBounds: bounds, noWrap: true}).setView([0,0], 2);

What I am currently using for the defaultLayer variable:
var defaultLayer = MQ.mapLayer();

What was the defaultLayer variable when direct tile access was enabled:
var defaultLayer = L.tileLayer('http://oatile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg', {attribution: 'Maps &copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, Data &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', subdomains: '1234', minZoom:2, maxZoom:8});

 

Am I incorrect in thinking that I can just replace the defaultLayer variable with the mapLayer method or is there something else going on which I am missing?

Thanks for the help!


MQBrianCoakley
What resource are you getting
What resource are you getting the access control error from? Is there a url where we can see this happening?

ricemb
Here is a link to the test

Here is a link to the test version of our application.

http://www.oceanfirsteducation.com:4000


MQBrianCoakley
I don't see any resources
I don't see any resources getting the access control issue in Chrome on Windows 7. Is there a specific browser/OS combination that is producing the error?

ricemb
It looks like the error

It looks like the error occurs if you just type in the url rather than following the link.  Now the data is loading, but the MapQuest maps aren't.  I have the sample on the leaflet plugin documentation page working in a stand alone page, so now the trouble is integrating the leaflet API with our application.


MQBrianCoakley
I still don't see the access
I still don't see the access control issue but I don't ever get the MapQuest tiles to load either. I'm not sure what's going on their yet, but the attribution control and legend have some sort of styling/placement issue too.