Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((xmlString) => {
const capabilities = new WMSCapabilities(xmlString).toJSON()
if (capabilities.Capability === undefined) {
throw new Error('Error with WMS endpoint')
}
return {
id,
url,
capabilities,
subtype: CUSTOM_LAYERS_SUBTYPES.raster,
}
})
return promise
.then((xmlString) => {
const capabilities = new WMSCapabilities(xmlString).toJSON();
if (capabilities.Capability === undefined) {
throw new Error('Error with WMS endpoint');
}
return {
id,
url,
capabilities,
subtype: CUSTOM_LAYERS_SUBTYPES.raster
};
});
return promise;