npm.io
4.0.2 • Published 2 weeks ago

@nextgis/qms-core

Licence
MIT
Version
4.0.2
Deps
0
Size
704 kB
Vulns
0
Weekly
0
Stars
31

QMS Core

version

Map-independent client, catalog, and shared control UI for NextGIS QMS. Use an engine-specific package instead when adding QMS services directly to a Leaflet, OpenLayers, or MapLibre GL JS map.

Installation

npm install @nextgis/qms-core
import { QmsClient } from '@nextgis/qms-core';

const qms = new QmsClient();
const layer = await qms.getLayer(448);

To use a custom QMS server, set the global URL before creating a client:

QmsClient.url = 'http://localhost:8000';

Get a service extent as [west, south, east, north] in EPSG

import { getQmsServiceExtent } from '@nextgis/qms-core';

const extent = await getQmsServiceExtent(4646);

Search for services by name or description:

const services = await qms.searchServices('OpenStreetMap', { type: 'tms' });

The bundled catalog is generated from quickmapservices_contrib. The catalog is generated automatically before the package build. To update it manually, run:

yarn workspace @nextgis/qms-core catalog:update

QmsControlElement provides the shared search and catalog UI used by the map adapters. Search and catalog can be enabled independently. Its nextgis-qms-control classes and CSS custom properties can be overridden by the host interface.

Built-in control languages are en, de, es, fr, it, pt, and ru. Select one with lang (en by default):

import { QmsControlElement } from '@nextgis/qms-core';

const control = new QmsControlElement({
  lang: 'ru',
  messages: {
    title: 'Подложки',
  },
});

messages can override search panel labels.

See the API Documentation and the package architecture guide.

Commercial support

Need to fix a bug or add a feature to NextGIS Frontend? We provide custom development and support for this software. Contact us to discuss options!

http://nextgis.com

Keywords