Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let dataSource;
switch (context.type.toLowerCase()) {
case 'osm':
dataSource = this.createOSMDataSource(context as OSMDataSourceOptions);
break;
case 'vector':
dataSource = this.createFeatureDataSource(
context as FeatureDataSourceOptions
);
break;
case 'wfs':
dataSource = this.createWFSDataSource(context as WFSDataSourceOptions);
break;
case 'wms':
const wmsContext = context as WMSDataSourceOptions;
ObjectUtils.removeDuplicateCaseInsensitive(wmsContext.params);
dataSource = this.createWMSDataSource(wmsContext);
break;
case 'wmts':
dataSource = this.createWMTSDataSource(
context as WMTSDataSourceOptions
);
break;
case 'xyz':
dataSource = this.createXYZDataSource(context as XYZDataSourceOptions);
break;
case 'carto':
dataSource = this.createCartoDataSource(
context as CartoDataSourceOptions
);
break;
case 'arcgisrest':