0

Using just a simple test case, I cannot load GeoJSON into OpenLayers. I've used a base case, with a simple polygon and yet cannot load it.

If anyone has any ideas please let me know. I have created a fiddle for it, but can't see anything wrong.

I am trying to add it within an angular project, but this fiddle doesn't use it, as I did it as a simple test case.

https://jsfiddle.net/phallett64/jmzfagyv/10/

  • routeJSON is a JSON not a url (plus you need to add the vectorLayer to your map). Option 1 is read the features from the JSON directly jsfiddle.net/t3mfajq0 Option 2 is create a data url from the JSON jsfiddle.net/6enodzuj (sometimes useful for testing when you are planning to use real urls later) – Mike Sep 17 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.