I am new to Geoserver and geographical work so I am struggling to fetch more than one geo-location data (WFS) by one POST request. I want multiple geoJSON location data on one fetch.
My Current Code,
var featureRequest = new WFS().writeGetFeature({
srsName: "EPSG:4326",
featureNS: "https://geo",
featurePrefix: "geo",
featureTypes: ['odisha'],
outputFormat: "application/json",
filter: equalTo("name", 'Location1') // I want to fetch data like 'Location1', 'Location2', 'Location 3'
});
fetch(geoserver + "/geo/wfs", {
method: "POST",
body: new XMLSerializer().serializeToString(featureRequest),
})
.then(function (response) {
return response.json();
})
.then(function (json) {
setGeoJson(json);
let geojsonData = {
"geoJson": json,
"color": 'red'
}
//dispatch({type: geoGSONState.json, data:[geojsonData]})
});
Please help me with this. Any suggestion will help.