I'm using the layer tree control to manage the display of layers. When I add WMS services, it works fine. But when I add WFS, this is not loaded.
I'm using the Leaflet layer tree plugin code and GeoServer.
Below is the part of the code I use to add WFS layer on my main page:
...{
"code": "space",
"name": "space 1",
"active": true,
"selectedByDefault": false,
"openByDefault": null,
"childLayers": [],
"selectType": null,
"serviceType":"WFS",
"params": {
"request": "GetFeature",
"service": "WFS",
"styles":'',
"outputformat": "application/json",
"typeName": "rbrava:space_1",
"url": "http://10.11.15.170:8080/geoserver/rbrava/wfs"
}
...
I used the Chrome inspector and when I click on the layer checkbox to load that it gives me the following error:
"XMLHttpRequest cannot load...
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'null' is therefore not allowed access".