Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


I'm working on a jsFiddle with a openlayers example in it.

At the moment it's not working because it's not getting a response for the http request to get data. How do I fix that?

The jsFiddle is here: Go to the line "// create three vector layers" in the script. There are 3 requests for data. If you type the URLs in your browser you get the JSON, but my firebug gives 3 errors when I run the jsFiddle.

I tried fixing with jsFiddle echo, but that didn't work. I don't know how to change the script to load the data otherwise.

Why can't I get the json by these URLs? What are good sollutions?

share|improve this question

You are referencing to '' for Openlayers but the example is using '' which is different to your openlayers.js and missing all the libraries [Single File Library] that are required.

share|improve this answer
oh, oops, I fixed that in the next version and I gave the map some width and height. The problem is the jsons containing all the poly's, lines and points. How do I fix that. See: – Jeroen Jun 22 '12 at 17:14
jsFiddle it won't get the data because the URL doesn't conform to -… – Mapperz Jun 22 '12 at 17:20
Adding '&callback=?' to the URL didn't solve it. Since you can just view those jsons in your browser, I tried to put them into a var in the code and 'load' them that way in the Vector layer, but I'm not sure how to do that. I also tried the Script protocol to fix the same origin issue. But it gives some errors on the returned object. – Jeroen Jun 23 '12 at 16:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.