Replies: 2 comments 2 replies
-
Leaflet is using img html element, which doesn't need CORS enabled on the server. |
Beta Was this translation helpful? Give feedback.
-
And another question : I complete the second solution, but I have a layer with tiles index. How disable this layer ? It's a parameter I have to disable server side ? (ie when I make my WMS layer with qgis ?) Thks. Sylvain |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I know that question asked many times but I didn't find solution.
I work with MapboxGL/MaplibreGL and when I add WMS layer, the console returns all time
Access to fetch at 'https://wms.myurl.fr/qgis?map=projects/test_wms1.qgs&bbox=136975.15468703583,5371382.851655904,146759.09430753812,5381166.7912764065&format=image/png&service=WMS&version=1.3.0&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=carte_moissac' from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
For information, this problem come from MaplibreGL (and lonely) because my WMS layer works with LeafletJS.
Headers are present ahead to my php file like that :
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: *");
header("Access-Control-Allow-Credentials: true");
?>
How do you go about it?
Thanks
Sylvain
Beta Was this translation helpful? Give feedback.
All reactions