How to use @nextgis/qms-kit - 2 common examples

To help you get started, we’ve selected a few @nextgis/qms-kit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nextgis / nextgisweb_frontend / packages / ngw-kit / src / createAsyncAdapter.ts View on Github external
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') {
github nextgis / nextgisweb_frontend / packages / ngw-map / src / utils.ts View on Github external
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

@nextgis/qms-kit

Build webmap with QuickMapServices

MIT
Latest version published 20 days ago

Package Health Score

69 / 100
Full package analysis

Popular @nextgis/qms-kit functions