Following exactly the example of the openlayers site in:
https://openlayers.org/en/latest/examples/box-selection.html?q=feature
Locally I have the following error:
Uncaught SyntaxError: Unexpected token <in JSON at position 0
at JSON.parse (<anonymous>)
at getObject (JSONFeature.js: 197)
at GeoJSON.JSONFeature.readFeatures (JSONFeature.js: 53)
at VectorSource. <anonymous> (featureloader.js: 94)
I believe the error comes from trying to load a geojson file locally.
var vectorSource = new VectorSource ({
url: 'data/geojson/countries.geojson',
format: new GeoJSON ()
});
countries.geojson: https://r68tk.csb.app/data/geojson/countries.geojson
How to solve?