I am using Leaflet 1.4.0 and a beginner with Leaflet and JavaScript.
I try to display shapefile data on my webmap with Leaflet. But it doesn't work. All the data (.shp, index.html... ) in WGS84 are on my computer, in the same directory.
My JavaScript code is:
var shapeLayer = new L.Shapefile("data/QualiAgro.zip");
I get the following Console message:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://some-url-here. (Reason: additional information here).
If I understood this is a CORS problem (url). But I don't know how to do? Does any one have any idea?
I also try the shapefile data with: http://leaflet.calvinmetcalf.com/#3/32.69/10.55 There's no display.
I have installed "Wampserver2" on my computer to run my html from a local server.
I changed the JavaScript code :
var shapeLayer = new L.Shapefile("http//localhost:80/data/QualiAgro.zip");
But I still have the same problem with no message Console for the mistake.