Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connector
);
}
} else {
adapter = createGeoJsonAdapter(_options, webMap, connector);
}
} else if (item.resource.cls === 'raster_layer') {
return createAdapterFromFirstStyle(
item.resource.id,
_options,
webMap,
baseUrl,
connector
);
} else if (item.basemap_layer && item.basemap_layer.qms) {
adapter = Promise.resolve(QmsKit.utils.createQmsAdapter(webMap));
adapter.then(x => {
if (x && item && item.basemap_layer && item.basemap_layer.qms) {
const qms = JSON.parse(item.basemap_layer.qms);
x.prototype.qms = qms;
x.prototype.baseLayer = true;
}
});
}
} else {
throw new Error(
"Can't add NGW layer because Resource item is not found"
);
}
}
} catch (er) {
// if (options.adapter === 'GEOJSON') {
export function prepareWebMapOptions(
mapAdapter: MapAdapter,
options: NgwMapOptions
) {
const kits: StarterKit[] = [new QmsKit()];
if (!options.connector && options.baseUrl) {
options.connector = new NgwConnector({
baseUrl: options.baseUrl,
auth: options.auth
});
} else if (options.connector) {
options.baseUrl = options.connector.options.baseUrl;
}
const opt: NgwMapOptions = deepmerge(OPTIONS, options);
if (opt.connector) {
kits.push(
new NgwKit({
connector: opt.connector,
auth: opt.auth,
identification: opt.identification