1

To get familiar with GeoJSON / Openlayers , I tried to use this example

http://gis-lab.info/share/DR/sandbox/geojson.html (found it here on stackoverflow)

first step was to copy the html locally a and change the url to the geojson file from

"./data/l1.geojson" 

to

"http://gis-lab.info/share/DR/sandbox/data/l1.geojson"

no other changes made, but it didn't work ..

2nd try was to just put the geojson file locally.

didn't work either

What am I missing ?

Community
  • 1
  • 1
Graphileon
  • 5,275
  • 3
  • 17
  • 31

1 Answers1

1

Try copying that data locally to "./data/l1.geojson" to avoid Cross-domain issues. Be aware of the browser's same origin policy.

If calling the that exists on a seperate domain is a requirement, then get the data first using Ajax, JSONP or back-end proxy then feed it into openlayers. read up on this.

capdragon
  • 14,565
  • 24
  • 107
  • 153