# NextGIS Frontend: full LLM overview > Architecture, usage guides, and export indexes for the main NextGIS Frontend packages. This file intentionally omits individual API member pages to keep the context manageable. Follow the absolute links in each package index for detailed methods, parameters, interfaces, and types. ## Documentation index ### NextGIS Frontend > TypeScript libraries for building NextGIS Web maps with Leaflet, OpenLayers, MapLibre GL JS, React, and NextGIS QMS. Most applications should start with an engine-specific `ngw-*` or `react-ngw-*` package. These packages share the `NgwMap` and `WebMap` APIs. Use `ngw-connector` without a map and generate server-specific route declarations with `ngw-types-loader`. Detailed API pages are generated from the TypeScript source. The full overview contains the architecture guide and export indexes for the packages listed below. #### Architecture and overview - [Package architecture](https://code-api.nextgis.com/markdown/documents/PACKAGES.md): Package selection, inheritance, composition, and API boundaries. - [Full LLM overview](https://code-api.nextgis.com/llms-full.txt): Architecture, usage guides, and export indexes for the main packages. #### NextGIS Web maps and API - [@nextgis/ngw-leaflet](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/README.md): Ready-to-use NextGIS Web map based on Leaflet. - [@nextgis/ngw-ol](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/README.md): Ready-to-use NextGIS Web map based on OpenLayers. - [@nextgis/ngw-maplibre-gl](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/README.md): Ready-to-use NextGIS Web map based on MapLibre GL JS. - [@nextgis/ngw-kit](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/README.md): NextGIS Web layer adapters, feature requests, identification, legends, and resource utilities. - [@nextgis/ngw-connector](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/README.md): Map-independent NextGIS Web HTTP client and typed route API. - [@nextgis/ngw-types-loader](https://code-api.nextgis.com/markdown/@nextgis/ngw-types-loader/README.md): Installs deployment-specific @nextgisweb TypeScript declarations. #### React integration - [@nextgis/react-ngw-leaflet](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-leaflet/README.md): Ready-to-use Leaflet-based React map component. - [@nextgis/react-ngw-ol](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-ol/README.md): Ready-to-use OpenLayers-based React map component. - [@nextgis/react-ngw-maplibre-gl](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-maplibre-gl/README.md): Ready-to-use MapLibre GL JS-based React map component. - [@nextgis/react-ngw-map](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/README.md): Common React component, context, hooks, layers, and controls for custom adapters. #### QuickMapServices - [@nextgis/qms-leaflet](https://code-api.nextgis.com/markdown/@nextgis/qms-leaflet/README.md): QMS layers and search control for a native Leaflet map. - [@nextgis/qms-ol](https://code-api.nextgis.com/markdown/@nextgis/qms-ol/README.md): QMS layers and search control for a native OpenLayers map. - [@nextgis/qms-maplibre-gl](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/README.md): QMS layers and search control for a native MapLibre GL JS map. - [@nextgis/qms-core](https://code-api.nextgis.com/markdown/@nextgis/qms-core/README.md): Map-independent QMS client, catalog, and shared control UI. - [@nextgis/qms-kit](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/README.md): QMS layer adapter for libraries built on WebMap. #### Library foundations - [@nextgis/ngw-map](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/README.md): Framework-independent NextGIS Web map class underlying the ready-to-use maps. - [@nextgis/webmap](https://code-api.nextgis.com/markdown/@nextgis/webmap/README.md): Framework-independent map engine, common API, and adapter contracts. #### Optional - [HTML API documentation](https://code-api.nextgis.com/): Human-readable TypeDoc site. - [Live examples](https://code.nextgis.com): Runnable examples for the supported map engines. - [GitHub repository](https://github.com/nextgis/nextgis_frontend): Source code, package README files, and development history. - [NextGIS Web HTTP API](https://demo.nextgis.com/doc/api): Server route reference for the public demo deployment. ## Package architecture [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / PACKAGES ### Package architecture NextGIS Frontend is a monorepo of composable mapping libraries. Most applications should start with one of the ready-to-use NextGIS Web map packages. Lower-level packages are available for applications that need to assemble or extend the map stack themselves. #### NextGIS Web packages | Package | Use it when | | --- | --- | | `@nextgis/ngw-leaflet` | You need a ready-to-use NextGIS Web map based on Leaflet. | | `@nextgis/ngw-ol` | You need a ready-to-use NextGIS Web map based on OpenLayers. | | `@nextgis/ngw-maplibre-gl` | You need a ready-to-use NextGIS Web map based on MapLibre GL JS. | | `@nextgis/ngw-kit` | You need NextGIS Web layer adapters, identification helpers, feature requests, legends, or other map-related utilities. | | `@nextgis/ngw-connector` | You need to call the NextGIS Web HTTP API without creating a map. | | `@nextgis/ngw-types-loader` | You need TypeScript declarations generated by a particular NextGIS Web deployment. | The three `ngw-*` map packages expose the same common map API. Choose between them according to the rendering engine and its ecosystem. They configure the corresponding map adapter and include the styles needed by that adapter. ```ts import NgwMap from '@nextgis/ngw-leaflet'; // Or import NgwMap from '@nextgis/ngw-ol'; // Or import NgwMap from '@nextgis/ngw-maplibre-gl'; const ngwMap = await NgwMap.create({ baseUrl: 'https://demo.nextgis.com', target: 'map', resources: [{ resource: 2011, fit: true }], }); ``` Use `new NgwMap(options)` when the instance is needed immediately. Use `NgwMap.create(options)` when subsequent code requires a fully initialized map. #### React packages | Package | Use it when | | --- | --- | | `@nextgis/react-ngw-leaflet` | A React application needs a ready-to-use Leaflet-based NextGIS Web map. | | `@nextgis/react-ngw-ol` | A React application needs a ready-to-use OpenLayers-based NextGIS Web map. | | `@nextgis/react-ngw-maplibre-gl` | A React application needs a ready-to-use MapLibre GL JS-based NextGIS Web map. | | `@nextgis/react-ngw-map` | A React library or application supplies its own map adapter or uses map context, layer, control, and hook exports directly. | The three engine-specific components configure their adapter and render the common `ReactNgwMap` component. Map options are passed as component props. Use `whenCreated` when application code needs the initialized `NgwMap` instance. ```tsx import ReactNgwMap from '@nextgis/react-ngw-leaflet'; export function Map() { return ( ); } ``` #### QuickMapServices packages | Package | Use it when | | --- | --- | | `@nextgis/qms-leaflet` | Add QMS TMS/WMS layers or the QMS search control to an existing Leaflet map. | | `@nextgis/qms-ol` | Add QMS TMS/WMS layers or the QMS search control to an existing OpenLayers map. | | `@nextgis/qms-maplibre-gl` | Add QMS TMS/WMS layers or the QMS search control to an existing MapLibre GL JS map. | | `@nextgis/qms-core` | Search and resolve QMS services without a map, or build a custom QMS integration. | | `@nextgis/qms-kit` | Register QMS as a layer adapter in a `webmap`-based library. | The engine-specific QMS packages work with native map instances and expose `addQmsLayer()`, `fitQmsService()`, and `createQmsControl()`. They are separate from the `ngw-*` facade packages; an `NgwMap` application can usually add a QMS basemap through the `qmsId` map option instead. #### Packages for library development ##### `@nextgis/ngw-map` `NgwMap` adds NextGIS Web resources, requests, identification, selection, and the `NgwConnector` instance to the framework-independent map API. The ready-to-use `ngw-leaflet`, `ngw-ol`, and `ngw-maplibre-gl` classes extend this class and inject their map adapters. Use `@nextgis/ngw-map` directly when building another ready-to-use map package or when an application must provide its own map adapter configuration. ##### `@nextgis/webmap` `WebMap` is the framework-independent map engine. It owns the common lifecycle, layer registry, controls, events, view operations, selection, filtering, and adapter contracts. It does not know how to access NextGIS Web. Use it directly when building a map that is not tied to NextGIS Web, creating a new map adapter, or extending the common map behavior. #### How the packages compose For a typical application the calls pass through these layers: 1. `ngw-leaflet`, `ngw-ol`, or `ngw-maplibre-gl` creates the native map adapter. 2. `ngw-map` provides the common `NgwMap` class and initializes NextGIS Web integration. 3. `ngw-kit` converts NextGIS Web resources into map layer adapters and provides resource-specific utilities. 4. `webmap` manages common map, layer, control, and event behavior. 5. The selected map adapter translates common operations to Leaflet, OpenLayers, or MapLibre GL JS. 6. `ngw-connector` performs NextGIS Web HTTP requests used by the higher layers or by application code directly. React wrappers sit above the ready-to-use `ngw-*` maps. QMS packages form a separate integration path: `qms-core` provides map-independent data and shared UI, the engine packages integrate with native maps, and `qms-kit` integrates with `webmap`. This means an instance imported from a ready-to-use map package includes: - NextGIS Web methods from `NgwMap`, such as `addNgwLayer()`, `fitResource()`, feature requests, identification, and `connector`; - common methods inherited from `WebMap`, such as `addLayer()`, `removeLayer()`, `showLayer()`, `hideLayer()`, `fitBounds()`, view methods, controls, and events; - adapter-specific options and native objects where an operation cannot be represented by the common API. #### Choosing the correct level - Start with a ready-to-use `ngw-*` map package for an end-user map. - Start with the matching `react-ngw-*` package in a React application. - Use `ngw-connector` for resource and feature API calls without a map. - Use utilities from `ngw-kit` when an application needs an operation that is not exposed as an `NgwMap` convenience method. - Use `ngw-map` to build a new NextGIS Web map distribution or supply a custom adapter. - Use `webmap` to build framework-independent mapping infrastructure. - Use an engine-specific `qms-*` package with an existing native map, or `qms-core` when no map integration is needed. Prefer the common API when it provides the required operation. Keep framework-specific work in the corresponding adapter or ready-to-use package; behavior working in the other adapters should not be changed to fix a problem specific to one rendering engine. #### NextGIS Web API types The available NextGIS Web routes and types depend on the server version and installed components. Generate declarations from the deployment used by the application: ```bash npx @nextgis/ngw-types-loader https://your-ngw-server.com ``` The loader installs resolvable declaration packages under `node_modules/@nextgisweb`. No generated declaration file needs to be added to `tsconfig.json`. #### Further reading - [Live examples](https://code.nextgis.com) - [API documentation](https://code-api.nextgis.com) - [LLM documentation index](https://code-api.nextgis.com/llms.txt) - [NextGIS Web API documentation](https://demo.nextgis.com/doc/api) - [NGW Types Loader](https://code-api.nextgis.com/markdown/@nextgis/ngw-types-loader/README.md) ## NextGIS Web maps and API ### @nextgis/ngw-leaflet [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/ngw-leaflet ### NgwLeaflet ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/ngw-leaflet) ![version](https://img.shields.io/npm/v/@nextgis/ngw-leaflet) Ready-to-use [Leaflet](https://leafletjs.com)-based map for NextGIS Web. This package configures the Leaflet map adapter and includes its styles and marker images. Its default export extends `NgwMap`, so the common APIs from [`@nextgis/ngw-map`](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/README.md) and [`@nextgis/webmap`](https://code-api.nextgis.com/markdown/@nextgis/webmap/README.md) are available on the map instance. #### Installation ##### In Browser ###### Include assets Simply download and include with a script tag, `NgwLeaflet` and `NgwMap` will be registered as a global variable. ```html
``` ###### CDN unpkg ```html ``` jsdelivr ```html ``` We recommend linking to a specific version number `/ngw-leaflet@[version]` ###### ES module ```html ``` ##### In Node.js ```bash npm install leaflet @nextgis/ngw-leaflet ``` #### Usage ```javascript import NgwMap from '@nextgis/ngw-leaflet'; const ngwMap = await NgwMap.create({ baseUrl: 'https://demo.nextgis.com', target: 'map', qmsId: 448, webmapId: 3985, }); ``` Use `new NgwMap(options)` when the instance is needed before initialization is complete. Use `NgwMap.create(options)` when subsequent code requires a ready map. TypeScript users should generate declarations for the NextGIS Web deployment used by the application: ```bash npx @nextgis/ngw-types-loader https://your-ngw-server.com ``` Check out the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_ngw-leaflet.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/ngw-leaflet`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [default](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/classes/default.md) - [NgwMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/classes/NgwMap.md) - [WebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/classes/WebMap.md) - [WebMapControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/classes/WebMapControls.md) - [WebMapLayers](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/classes/WebMapLayers.md) - [WebMapMain](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/classes/WebMapMain.md) #### Interfaces - [AdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/AdapterOptions.md) - [AddControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/AddControlOptions.md) - [AttributionControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/AttributionControlOptions.md) - [ButtonControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ButtonControlOptions.md) - [ContribControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ContribControlsOptions.md) - [ControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ControlOptions.md) - [CreateControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/CreateControlOptions.md) - [CreatePopupContentProps](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/CreatePopupContentProps.md) - [DataLoadError](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/DataLoadError.md) - [FeaturePosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/FeaturePosition.md) - [FilterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/FilterOptions.md) - [FitOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/FitOptions.md) - [GeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/GeoJsonAdapterOptions.md) - [GeoJsonLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/GeoJsonLayerAdapter.md) - [GetAttributionsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/GetAttributionsOptions.md) - [GetLegendOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/GetLegendOptions.md) - [HtmlToggle](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/HtmlToggle.md) - [ImageAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ImageAdapterOptions.md) - [LayerAdapterCreators](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/LayerAdapterCreators.md) - [LayerAdapters](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/LayerAdapters.md) - [LayerAdaptersOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/LayerAdaptersOptions.md) - [LayerDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/LayerDefinition.md) - [LayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/LayerRequestOptions.md) - [Locate](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/Locate.md) - [LocateOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/LocateOptions.md) - [LocationEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/LocationEvent.md) - [LocationEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/LocationEvents.md) - [MainLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MainLayerAdapter.md) - [MainMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MainMapEvents.md) - [MapAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MapAdapter.md) - [MapAdapterEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MapAdapterEvents.md) - [MapClickEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MapClickEvent.md) - [MapControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MapControl.md) - [MapControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MapControls.md) - [MapOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MapOptions.md) - [Model3DOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/Model3DOptions.md) - [MvtAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/MvtAdapterOptions.md) - [NgwLayers](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/NgwLayers.md) - [NgwLayersMem](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/NgwLayersMem.md) - [NgwMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/NgwMapEvents.md) - [NgwMapOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/NgwMapOptions.md) - [OnLayerClickOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/OnLayerClickOptions.md) - [OnLayerMouseOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/OnLayerMouseOptions.md) - [OnLayerSelectOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/OnLayerSelectOptions.md) - [Pixel](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/Pixel.md) - [PopupOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/PopupOptions.md) - [RasterAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/RasterAdapterOptions.md) - [RuntimeParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/RuntimeParams.md) - [StarterKit](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/StarterKit.md) - [TileAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/TileAdapterOptions.md) - [Tileset3DAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/Tileset3DAdapterOptions.md) - [TitleToggle](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/TitleToggle.md) - [ToggleControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ToggleControl.md) - [ToggleControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ToggleControlOptions.md) - [ToggleLayerOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ToggleLayerOptions.md) - [UpdateLayerAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/UpdateLayerAdapterOptions.md) - [VectorAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/VectorAdapterOptions.md) - [VectorLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/VectorLayerAdapter.md) - [ViewOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ViewOptions.md) - [WebMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/WebMapEvents.md) - [WmsAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/WmsAdapterOptions.md) - [ZoomControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/interfaces/ZoomControlOptions.md) #### Type Aliases - [AdapterConstructor](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/AdapterConstructor.md) - [CallbackFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/CallbackFilter.md) - [ControlPosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/ControlPosition.md) - [~~ControlPositions~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/ControlPositions.md) - [ControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/ControlsOptions.md) - [ControlTargetPosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/ControlTargetPosition.md) - [CreatePopupContent](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/CreatePopupContent.md) - [Cursor](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/Cursor.md) - [DataLayerFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/DataLayerFilter.md) - [FeatureLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/FeatureLayerAdapter.md) - [GeoJsonAdapterFeature](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/GeoJsonAdapterFeature.md) - [HtmlDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/HtmlDef.md) - [LayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/LayerAdapter.md) - [LayerAdapterDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/LayerAdapterDefinition.md) - [LayerDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/LayerDef.md) - [NgwIdentifyEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/NgwIdentifyEvent.md) - [NgwResourceDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/NgwResourceDefinition.md) - [OnBeforeLayerAdd](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/OnBeforeLayerAdd.md) - [OnLayerSelectType](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/OnLayerSelectType.md) - [PopupOnCloseFunction](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/PopupOnCloseFunction.md) - [ToggleStatusChangeListener](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/ToggleStatusChangeListener.md) - [VectorAdapterLayerType](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/type-aliases/VectorAdapterLayerType.md) #### Variables - [paintTypeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/variables/paintTypeAlias.md) - [typeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/variables/typeAlias.md) #### Functions - [applyLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/applyLayerRequestOptions.md) - [createNgwMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/createNgwMap.md) - [createToggleControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/createToggleControl.md) - [createWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/createWebMap.md) - [detectGeometryType](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/detectGeometryType.md) - [findMostFrequentGeomType](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/findMostFrequentGeomType.md) - [getDefaultControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/getDefaultControls.md) - [getLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/getLayerRequestOptions.md) - [getWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/getWebMap.md) - [normalizeLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/normalizeLayerRequestOptions.md) - [setWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/setWebMap.md) - [updateGeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-leaflet/functions/updateGeoJsonAdapterOptions.md) ### @nextgis/ngw-ol [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/ngw-ol ### NgwOl ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/ngw-ol) ![version](https://img.shields.io/npm/v/@nextgis/ngw-ol) Ready-to-use [OpenLayers](https://openlayers.org/)-based map for NextGIS Web. This package configures the OpenLayers map adapter and includes the required styles. Its default export extends `NgwMap`, so the common APIs from [`@nextgis/ngw-map`](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/README.md) and [`@nextgis/webmap`](https://code-api.nextgis.com/markdown/@nextgis/webmap/README.md) are available on the map instance. #### Installation ##### In Browser ###### Include assets Simply download and include with a script tag, `NgwOl` and `NgwMap` will be registered as a global variable. ```html
``` ###### CDN unpkg ```html ``` jsdelivr ```html ``` We recommend linking to a specific version number `/ngw-ol@[version]` ###### ES module ```html ``` ##### In Node.js ```bash npm install ol @nextgis/ngw-ol ``` #### Usage ```javascript import NgwMap from '@nextgis/ngw-ol'; const ngwMap = await NgwMap.create({ baseUrl: 'https://demo.nextgis.com', target: 'map', qmsId: 448, webmapId: 3985, }); ``` Use `new NgwMap(options)` when the instance is needed before initialization is complete. Use `NgwMap.create(options)` when subsequent code requires a ready map. TypeScript users should generate declarations for the NextGIS Web deployment used by the application: ```bash npx @nextgis/ngw-types-loader https://your-ngw-server.com ``` Check out the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_ngw-ol.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/ngw-ol`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [default](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/classes/default.md) - [NgwMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/classes/NgwMap.md) - [WebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/classes/WebMap.md) - [WebMapControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/classes/WebMapControls.md) - [WebMapLayers](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/classes/WebMapLayers.md) - [WebMapMain](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/classes/WebMapMain.md) #### Interfaces - [AdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/AdapterOptions.md) - [AddControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/AddControlOptions.md) - [AttributionControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/AttributionControlOptions.md) - [ButtonControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ButtonControlOptions.md) - [ContribControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ContribControlsOptions.md) - [ControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ControlOptions.md) - [CreateControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/CreateControlOptions.md) - [CreatePopupContentProps](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/CreatePopupContentProps.md) - [DataLoadError](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/DataLoadError.md) - [FeaturePosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/FeaturePosition.md) - [FilterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/FilterOptions.md) - [FitOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/FitOptions.md) - [GeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/GeoJsonAdapterOptions.md) - [GeoJsonLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/GeoJsonLayerAdapter.md) - [GetAttributionsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/GetAttributionsOptions.md) - [GetLegendOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/GetLegendOptions.md) - [HtmlToggle](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/HtmlToggle.md) - [ImageAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ImageAdapterOptions.md) - [LayerAdapterCreators](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/LayerAdapterCreators.md) - [LayerAdapters](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/LayerAdapters.md) - [LayerAdaptersOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/LayerAdaptersOptions.md) - [LayerDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/LayerDefinition.md) - [LayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/LayerRequestOptions.md) - [Locate](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/Locate.md) - [LocateOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/LocateOptions.md) - [LocationEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/LocationEvent.md) - [LocationEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/LocationEvents.md) - [MainLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MainLayerAdapter.md) - [MainMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MainMapEvents.md) - [MapAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MapAdapter.md) - [MapAdapterEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MapAdapterEvents.md) - [MapClickEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MapClickEvent.md) - [MapControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MapControl.md) - [MapControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MapControls.md) - [MapOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MapOptions.md) - [Model3DOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/Model3DOptions.md) - [MvtAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/MvtAdapterOptions.md) - [NgwLayers](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/NgwLayers.md) - [NgwLayersMem](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/NgwLayersMem.md) - [NgwMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/NgwMapEvents.md) - [NgwMapOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/NgwMapOptions.md) - [OnLayerClickOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/OnLayerClickOptions.md) - [OnLayerMouseOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/OnLayerMouseOptions.md) - [OnLayerSelectOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/OnLayerSelectOptions.md) - [Pixel](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/Pixel.md) - [PopupOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/PopupOptions.md) - [RasterAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/RasterAdapterOptions.md) - [RuntimeParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/RuntimeParams.md) - [StarterKit](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/StarterKit.md) - [TileAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/TileAdapterOptions.md) - [Tileset3DAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/Tileset3DAdapterOptions.md) - [TitleToggle](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/TitleToggle.md) - [ToggleControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ToggleControl.md) - [ToggleControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ToggleControlOptions.md) - [ToggleLayerOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ToggleLayerOptions.md) - [UpdateLayerAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/UpdateLayerAdapterOptions.md) - [VectorAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/VectorAdapterOptions.md) - [VectorLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/VectorLayerAdapter.md) - [ViewOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ViewOptions.md) - [WebMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/WebMapEvents.md) - [WmsAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/WmsAdapterOptions.md) - [ZoomControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/interfaces/ZoomControlOptions.md) #### Type Aliases - [AdapterConstructor](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/AdapterConstructor.md) - [CallbackFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/CallbackFilter.md) - [ControlPosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/ControlPosition.md) - [~~ControlPositions~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/ControlPositions.md) - [ControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/ControlsOptions.md) - [ControlTargetPosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/ControlTargetPosition.md) - [CreatePopupContent](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/CreatePopupContent.md) - [Cursor](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/Cursor.md) - [DataLayerFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/DataLayerFilter.md) - [FeatureLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/FeatureLayerAdapter.md) - [GeoJsonAdapterFeature](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/GeoJsonAdapterFeature.md) - [HtmlDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/HtmlDef.md) - [LayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/LayerAdapter.md) - [LayerAdapterDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/LayerAdapterDefinition.md) - [LayerDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/LayerDef.md) - [NgwIdentifyEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/NgwIdentifyEvent.md) - [NgwResourceDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/NgwResourceDefinition.md) - [OnBeforeLayerAdd](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/OnBeforeLayerAdd.md) - [OnLayerSelectType](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/OnLayerSelectType.md) - [PopupOnCloseFunction](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/PopupOnCloseFunction.md) - [ToggleStatusChangeListener](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/ToggleStatusChangeListener.md) - [VectorAdapterLayerType](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/type-aliases/VectorAdapterLayerType.md) #### Variables - [paintTypeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/variables/paintTypeAlias.md) - [typeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/variables/typeAlias.md) #### Functions - [applyLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/applyLayerRequestOptions.md) - [createNgwMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/createNgwMap.md) - [createToggleControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/createToggleControl.md) - [createWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/createWebMap.md) - [detectGeometryType](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/detectGeometryType.md) - [findMostFrequentGeomType](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/findMostFrequentGeomType.md) - [getDefaultControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/getDefaultControls.md) - [getLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/getLayerRequestOptions.md) - [getWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/getWebMap.md) - [normalizeLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/normalizeLayerRequestOptions.md) - [setWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/setWebMap.md) - [updateGeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-ol/functions/updateGeoJsonAdapterOptions.md) ### @nextgis/ngw-maplibre-gl [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/ngw-maplibre-gl ### NgwMaplibreGL ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/ngw-maplibre-gl) ![version](https://img.shields.io/npm/v/@nextgis/ngw-maplibre-gl) Browser bundle for rapid deployment of [Maplibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) based web-gis applications with NextGIS services. Its default export extends `NgwMap`, so the common APIs from [`@nextgis/ngw-map`](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/README.md) and [`@nextgis/webmap`](https://code-api.nextgis.com/markdown/@nextgis/webmap/README.md) are available on the map instance. Styles and images are included in the bundle. MapLibre GL JS 6 also requires worker modules for processing GeoJSON and vector tiles. #### Installation ##### In Browser ###### Include browser files Keep `maplibre-gl-worker.mjs` and `maplibre-gl-shared.mjs` next to the browser bundle. They are copied to `lib` during the package build. `NgwMaplibreGL` and `NgwMap` will be registered as global variables. ```text lib/ ├── ngw-maplibre-gl.global.prod.js ├── maplibre-gl-worker.mjs └── maplibre-gl-shared.mjs ``` ```html
``` ###### CDN unpkg ```html ``` jsdelivr ```html ``` The explicit bundle path is required so MapLibre can resolve the worker modules from the same `lib` directory. Replace `VERSION` with a specific package version. When a strict Content Security Policy is enabled for a cross-origin CDN, follow the `worker-src` guidance in the migration guide linked below. ##### In Node.js ```bash npm install maplibre-gl @nextgis/ngw-maplibre-gl ``` ##### MapLibre GL JS 6 worker The `esm-bundler` build leaves MapLibre as a peer dependency, so the final application bundler must provide the worker URL before creating a map. For Vite, use its worker pipeline so the worker and its shared module are emitted together: ```ts import { setWorkerUrl } from 'maplibre-gl'; import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'; setWorkerUrl(workerUrl); ``` For other bundlers, copy both `maplibre-gl-worker.mjs` and `maplibre-gl-shared.mjs` from `maplibre-gl/dist` to the same public directory, then configure the URL: ```ts import { setWorkerUrl } from 'maplibre-gl'; setWorkerUrl('/maplibre/maplibre-gl-worker.mjs'); ``` See the official MapLibre documentation: - [ESM and bundler setup](https://github.com/maplibre/maplibre-gl-js/blob/main/docs/index.md#esm) - [MapLibre GL JS 5 to 6 migration guide](https://maplibre.org/maplibre-gl-js/docs/guides/v5-to-v6-migration-guide/) - [`setWorkerUrl()` API](https://maplibre.org/maplibre-gl-js/docs/API/functions/setWorkerUrl/) #### Usage ```javascript import NgwMap from '@nextgis/ngw-maplibre-gl'; const ngwMap = await NgwMap.create({ baseUrl: 'https://demo.nextgis.com', target: 'map', qmsId: 448, webmapId: 3985, }); ``` Use `new NgwMap(options)` when the instance is needed before initialization is complete. Use `NgwMap.create(options)` when subsequent code requires a ready map. TypeScript users should generate declarations for the NextGIS Web deployment used by the application: ```bash npx @nextgis/ngw-types-loader https://your-ngw-server.com ``` Check out the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_ngw-maplibre-gl.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/ngw-maplibre-gl`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [default](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/classes/default.md) - [NgwMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/classes/NgwMap.md) - [WebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/classes/WebMap.md) - [WebMapControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/classes/WebMapControls.md) - [WebMapLayers](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/classes/WebMapLayers.md) - [WebMapMain](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/classes/WebMapMain.md) #### Interfaces - [AdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/AdapterOptions.md) - [AddControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/AddControlOptions.md) - [AttributionControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/AttributionControlOptions.md) - [ButtonControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ButtonControlOptions.md) - [ContribControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ContribControlsOptions.md) - [ControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ControlOptions.md) - [CreateControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/CreateControlOptions.md) - [CreatePopupContentProps](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/CreatePopupContentProps.md) - [DataLoadError](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/DataLoadError.md) - [FeaturePosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/FeaturePosition.md) - [FilterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/FilterOptions.md) - [FitOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/FitOptions.md) - [GeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/GeoJsonAdapterOptions.md) - [GeoJsonLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/GeoJsonLayerAdapter.md) - [GetAttributionsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/GetAttributionsOptions.md) - [GetLegendOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/GetLegendOptions.md) - [HtmlToggle](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/HtmlToggle.md) - [ImageAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ImageAdapterOptions.md) - [LayerAdapterCreators](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/LayerAdapterCreators.md) - [LayerAdapters](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/LayerAdapters.md) - [LayerAdaptersOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/LayerAdaptersOptions.md) - [LayerDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/LayerDefinition.md) - [LayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/LayerRequestOptions.md) - [Locate](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/Locate.md) - [LocateOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/LocateOptions.md) - [LocationEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/LocationEvent.md) - [LocationEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/LocationEvents.md) - [MainLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MainLayerAdapter.md) - [MainMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MainMapEvents.md) - [MapAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MapAdapter.md) - [MapAdapterEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MapAdapterEvents.md) - [MapClickEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MapClickEvent.md) - [MapControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MapControl.md) - [MapControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MapControls.md) - [MapOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MapOptions.md) - [Model3DOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/Model3DOptions.md) - [MvtAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/MvtAdapterOptions.md) - [NgwLayers](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/NgwLayers.md) - [NgwLayersMem](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/NgwLayersMem.md) - [NgwMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/NgwMapEvents.md) - [NgwMapOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/NgwMapOptions.md) - [OnLayerClickOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/OnLayerClickOptions.md) - [OnLayerMouseOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/OnLayerMouseOptions.md) - [OnLayerSelectOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/OnLayerSelectOptions.md) - [Pixel](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/Pixel.md) - [PopupOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/PopupOptions.md) - [RasterAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/RasterAdapterOptions.md) - [RuntimeParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/RuntimeParams.md) - [StarterKit](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/StarterKit.md) - [TileAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/TileAdapterOptions.md) - [Tileset3DAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/Tileset3DAdapterOptions.md) - [TitleToggle](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/TitleToggle.md) - [ToggleControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ToggleControl.md) - [ToggleControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ToggleControlOptions.md) - [ToggleLayerOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ToggleLayerOptions.md) - [UpdateLayerAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/UpdateLayerAdapterOptions.md) - [VectorAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/VectorAdapterOptions.md) - [VectorLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/VectorLayerAdapter.md) - [ViewOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ViewOptions.md) - [WebMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/WebMapEvents.md) - [WmsAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/WmsAdapterOptions.md) - [ZoomControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/interfaces/ZoomControlOptions.md) #### Type Aliases - [AdapterConstructor](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/AdapterConstructor.md) - [CallbackFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/CallbackFilter.md) - [ControlPosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/ControlPosition.md) - [~~ControlPositions~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/ControlPositions.md) - [ControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/ControlsOptions.md) - [ControlTargetPosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/ControlTargetPosition.md) - [CreatePopupContent](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/CreatePopupContent.md) - [Cursor](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/Cursor.md) - [DataLayerFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/DataLayerFilter.md) - [FeatureLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/FeatureLayerAdapter.md) - [GeoJsonAdapterFeature](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/GeoJsonAdapterFeature.md) - [HtmlDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/HtmlDef.md) - [LayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/LayerAdapter.md) - [LayerAdapterDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/LayerAdapterDefinition.md) - [LayerDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/LayerDef.md) - [NgwIdentifyEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/NgwIdentifyEvent.md) - [NgwResourceDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/NgwResourceDefinition.md) - [OnBeforeLayerAdd](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/OnBeforeLayerAdd.md) - [OnLayerSelectType](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/OnLayerSelectType.md) - [PopupOnCloseFunction](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/PopupOnCloseFunction.md) - [ToggleStatusChangeListener](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/ToggleStatusChangeListener.md) - [VectorAdapterLayerType](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/type-aliases/VectorAdapterLayerType.md) #### Variables - [paintTypeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/variables/paintTypeAlias.md) - [typeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/variables/typeAlias.md) #### Functions - [applyLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/applyLayerRequestOptions.md) - [createNgwMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/createNgwMap.md) - [createToggleControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/createToggleControl.md) - [createWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/createWebMap.md) - [detectGeometryType](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/detectGeometryType.md) - [findMostFrequentGeomType](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/findMostFrequentGeomType.md) - [getDefaultControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/getDefaultControls.md) - [getLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/getLayerRequestOptions.md) - [getWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/getWebMap.md) - [normalizeLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/normalizeLayerRequestOptions.md) - [setWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/setWebMap.md) - [updateGeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/functions/updateGeoJsonAdapterOptions.md) ### @nextgis/ngw-kit [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/ngw-kit ### NgwKit ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/ngw-kit) ![version](https://img.shields.io/npm/v/@nextgis/ngw-kit) NextGIS Web integration for [`@nextgis/webmap`](https://code-api.nextgis.com/markdown/@nextgis/webmap/README.md), including resource adapters, feature requests, identification, extents, legends, and other map-related utilities. Applications using `ngw-leaflet`, `ngw-ol`, or `ngw-maplibre-gl` already use this package through `NgwMap`. Import `ngw-kit` directly when a utility is not available as an `NgwMap` convenience method or when assembling a custom map stack. Make sure CORS is registered in the [NextGIS Web settings](https://docs.nextgis.com/docs_ngcom/source/CORS.html) to be able to send requests. #### Installation ```bash npm install @nextgis/ngw-kit ``` #### Add a NextGIS Web map to WebMap ```ts import { NgwKit } from '@nextgis/ngw-kit'; import { createWebMap } from '@nextgis/webmap'; import LeafletMapAdapter from '@nextgis/leaflet-map-adapter'; import 'leaflet/dist/leaflet.css'; const webMap = await createWebMap({ target: 'map', mapAdapter: new LeafletMapAdapter(), starterKits: [ new NgwKit({ baseUrl: 'https://demo.nextgis.com', resourceId: 3985, }), ], }); ``` For end-user applications, prefer a ready-to-use `ngw-*` map package instead of assembling this stack manually. #### Request vector features ```ts import { fetchNgwLayerItems } from '@nextgis/ngw-kit'; import NgwConnector from '@nextgis/ngw-connector'; const connector = new NgwConnector({ baseUrl: 'https://demo.nextgis.com', }); const items = await fetchNgwLayerItems({ connector, resourceId: 2011, offset: 10, limit: 300, fields: ['name', 'year'], orderBy: ['year'], }); ``` The package also exports helpers for resource extents, feature counts, identification results, field conversion, attachments, legends, and NextGIS Web layer adapter creation. See the generated API documentation for the full exported surface. TypeScript users should generate declarations for the NextGIS Web deployment used by the application: ```bash npx @nextgis/ngw-types-loader https://your-ngw-server.com ``` Check out the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_ngw-kit.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/ngw-kit`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [BookmarkItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/classes/BookmarkItem.md) - [IdentifyItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/classes/IdentifyItem.md) - [Legend](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/classes/Legend.md) - [NgwKit](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/classes/NgwKit.md) - [NgwResource](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/classes/NgwResource.md) - [NgwWebmapItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/classes/NgwWebmapItem.md) - [NgwWebmapLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/classes/NgwWebmapLayerAdapter.md) #### Interfaces - [AppSettings](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/AppSettings.md) - [CompanyLogoOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/CompanyLogoOptions.md) - [ExtendNgwWebmapLayerAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/ExtendNgwWebmapLayerAdapterOptions.md) - [FeatureIdentifyRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/FeatureIdentifyRequestOptions.md) - [FeatureLayerIdentifyOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/FeatureLayerIdentifyOptions.md) - [FetchNgwLayerCountOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/FetchNgwLayerCountOptions.md) - [FetchNgwLayerExtentOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/FetchNgwLayerExtentOptions.md) - [FetchNgwLayerItemExtentOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/FetchNgwLayerItemExtentOptions.md) - [FetchNgwResourceExtent](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/FetchNgwResourceExtent.md) - [GetClassAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/GetClassAdapterOptions.md) - [GetIdentifyGeoJsonOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/GetIdentifyGeoJsonOptions.md) - [GetImageAdapterOptionsParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/GetImageAdapterOptionsParams.md) - [GetLayerAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/GetLayerAdapterOptions.md) - [GetNgwItemOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/GetNgwItemOptions.md) - [GetNgwItemsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/GetNgwItemsOptions.md) - [IdentifyEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/IdentifyEvent.md) - [IdentifyItemOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/IdentifyItemOptions.md) - [IdentifyRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/IdentifyRequestOptions.md) - [MapFeatureDisplayNameOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/MapFeatureDisplayNameOptions.md) - [MapSelectNgwLayerDistinctOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/MapSelectNgwLayerDistinctOptions.md) - [NgwConfig](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwConfig.md) - [NgwFeatureItemResponse](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwFeatureItemResponse.md) - [NgwFeatureRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwFeatureRequestOptions.md) - [NgwGeoJsonAdapterEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwGeoJsonAdapterEvents.md) - [NgwIdentifyItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwIdentifyItem.md) - [NgwKitOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwKitOptions.md) - [NgwLayerOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwLayerOptions.md) - [NgwWebmapAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwWebmapAdapterOptions.md) - [NgwWebmapItemOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwWebmapItemOptions.md) - [NgwWebmapLayerAdapterEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/NgwWebmapLayerAdapterEvents.md) - [ResourceAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/ResourceAdapter.md) - [TreeGroup](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/TreeGroup.md) - [TreeLayer](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/TreeLayer.md) - [TreeRoot](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/TreeRoot.md) - [UploadFeatureAttachmentOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/interfaces/UploadFeatureAttachmentOptions.md) #### Type Aliases - [ClassAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/ClassAdapter.md) - [FeatureRequestParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/FeatureRequestParams.md) - [FetchNgwItemOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/FetchNgwItemOptions.md) - [FetchNgwItemsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/FetchNgwItemsOptions.md) - [GeomFormat](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/GeomFormat.md) - [GetClassAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/GetClassAdapter.md) - [GetClassAdapterByType](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/GetClassAdapterByType.md) - [GetClassAdapterCallback](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/GetClassAdapterCallback.md) - [LegendSymbols](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/LegendSymbols.md) - [NgwGeoJsonLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/NgwGeoJsonLayerAdapter.md) - [NgwGeoJsonLayerOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/NgwGeoJsonLayerOptions.md) - [NgwIdentify](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/NgwIdentify.md) - [NgwLayerAdapterType](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/NgwLayerAdapterType.md) - [NgwRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/NgwRequestOptions.md) - [PropertiesForNgwFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/PropertiesForNgwFilter.md) - [ResourceIdDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/ResourceIdDef.md) - [~~ResourceNgwLayerOptions~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/ResourceNgwLayerOptions.md) - [TileNoData](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/TileNoData.md) - [TreeChildItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/TreeChildItem.md) - [TreeItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/TreeItem.md) - [VectorResourceAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/type-aliases/VectorResourceAdapter.md) #### Variables - [FEATURE\_REQUEST\_PARAMS](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/variables/FEATURE_REQUEST_PARAMS.md) - [vectorLayerGeomToPaintTypeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/variables/vectorLayerGeomToPaintTypeAlias.md) - [WEBMAP\_BASELAYER\_ID\_PREFIX](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/variables/WEBMAP_BASELAYER_ID_PREFIX.md) #### Functions - [addFeatureAttachment](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/addFeatureAttachment.md) - [~~addNgwLayer~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/addNgwLayer.md) - [createGeoJsonAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createGeoJsonAdapter.md) - [createGeoJsonFeature](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createGeoJsonFeature.md) - [createIdentifyItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createIdentifyItem.md) - [createLayerSymbolParam](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createLayerSymbolParam.md) - [createNgwLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createNgwLayerAdapter.md) - [createOnFirstShowAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createOnFirstShowAdapter.md) - [createOnFirstShowNgwAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createOnFirstShowNgwAdapter.md) - [createPopupContent](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createPopupContent.md) - [createRasterAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/createRasterAdapter.md) - [deleteFeatureAttachment](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/deleteFeatureAttachment.md) - [extendNgwWebmapLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/extendNgwWebmapLayerAdapter.md) - [featureLayerIdentify](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/featureLayerIdentify.md) - [fetchIdentifyGeoJson](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchIdentifyGeoJson.md) - [fetchIdentifyItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchIdentifyItem.md) - [fetchNgwExtent](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwExtent.md) - [fetchNgwLayerCount](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerCount.md) - [fetchNgwLayerExtent](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerExtent.md) - [fetchNgwLayerFeature](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerFeature.md) - [fetchNgwLayerFeatureCollection](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerFeatureCollection.md) - [fetchNgwLayerFeatures](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerFeatures.md) - [fetchNgwLayerItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerItem.md) - [fetchNgwLayerItemExtent](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerItemExtent.md) - [fetchNgwLayerItems](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerItems.md) - [fetchNgwLayerItemsRequest](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwLayerItemsRequest.md) - [~~fetchNgwResourceExtent~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/fetchNgwResourceExtent.md) - [getCompanyLogo](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/getCompanyLogo.md) - [~~getIdentifyGeoJson~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/getIdentifyGeoJson.md) - [getIdentifyItems](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/getIdentifyItems.md) - [getImageAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/getImageAdapterOptions.md) - [~~getLayerAdapterOptions~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/getLayerAdapterOptions.md) - [getMapWidthForLanInMeters](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/getMapWidthForLanInMeters.md) - [getNgwWebmapExtent](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/getNgwWebmapExtent.md) - [getZoomFromScale](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/getZoomFromScale.md) - [mapFeatureDisplayName](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/mapFeatureDisplayName.md) - [ngwApiToAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/ngwApiToAdapterOptions.md) - [parseDate](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/parseDate.md) - [parseDateFromNgw](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/parseDateFromNgw.md) - [pixelsInMeterWidth](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/pixelsInMeterWidth.md) - [prepareFieldsToNgw](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/prepareFieldsToNgw.md) - [prepareNgwFieldsToPropertiesFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/prepareNgwFieldsToPropertiesFilter.md) - [resourceIdFromLayerOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/resourceIdFromLayerOptions.md) - [selectNgwLayerDistinct](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/selectNgwLayerDistinct.md) - [sendIdentifyRequest](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/sendIdentifyRequest.md) - [setScaleRatio](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/setScaleRatio.md) - [updateImageParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/updateImageParams.md) - [updateItemRequestParam](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/updateItemRequestParam.md) - [uploadFeatureAttachment](https://code-api.nextgis.com/markdown/@nextgis/ngw-kit/functions/uploadFeatureAttachment.md) ### @nextgis/ngw-connector [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/ngw-connector ### NgwConnector ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/ngw-connector) ![version](https://img.shields.io/npm/v/@nextgis/ngw-connector) A lightweight HTTP client optimized for use with [NextGIS Web](http://docs.nextgis.com/docs_ngweb_dev/doc/developer/toc.html) API. Use this package when an application needs NextGIS Web resources, features, or other HTTP API operations without a map. Ready-to-use `ngw-*` map packages expose an initialized connector as `ngwMap.connector`. > [!IMPORTANT] > The typed `NgwConnector.route()` API requires declarations generated for your NextGIS Web deployment. Install `@nextgis/ngw-types-loader` and run it before using `route()`. The declarations depend on the components and extensions installed on that server. > > ```bash > npx @nextgis/ngw-types-loader https://your-ngw-server.com > ``` > > See the [NGW Types Loader documentation](https://github.com/nextgis/nextgis_frontend/tree/master/packages/ngw-types-loader#readme) for detailed instructions. Make sure CORS is registered in the [NextGIS Web settings](https://docs.nextgis.com/docs_ngcom/source/CORS.html) to be able to send requests. #### Installation ##### In Browser ###### Include assets Simply download and include with a script tag, `NgwConnector` will be registered as a global variable. ```html ``` ###### CDN unpkg ```html ``` jsdelivr ```html ``` We recommend linking to a specific version number `/ngw-connector@[version]` ##### In Node.js ```bash npm install @nextgis/ngw-connector ``` #### TypeScript Support `NgwConnector.route()` uses declarations generated by NextGIS Web itself. Install the loader as a development dependency: ```bash npm install --save-dev @nextgis/ngw-types-loader ``` Then generate types from the NextGIS Web deployment your application connects to: ```bash npx @nextgis/ngw-types-loader https://your-ngw-server.com ``` If the URL is omitted, the loader uses `https://demo.nextgis.com`: ```bash npx @nextgis/ngw-types-loader ``` The declarations are installed as resolvable packages under `node_modules/@nextgisweb`; no `tsconfig.json` changes are required. Run the loader again after changing the NextGIS Web version, components, or extensions. For more details, refer to the [NGW Types Loader](https://www.npmjs.com/package/@nextgis/ngw-types-loader). #### Usage ```javascript import NgwConnector from '@nextgis/ngw-connector'; const ngwConnector = new NgwConnector({ baseUrl: 'https://demo.nextgis.com', // auth: {login, password} }); ngwConnector .route('resource.item', { id: 485 }) .get() .then((data) => { console.log(data); }); ngwConnector.route('resource.collection').patch({ json: RESOURCE }); ngwConnector.route('feature_layer.feature.collection', { id }).patch({ json: ITEMS, query: { srs: 4326, geom_format: 'geojson', }, }); ngwConnector .route('feature_layer.feature.item', { id, fid }) .put({ json: ITEM }); ngwConnector.route('feature_layer.feature.item', { id, fid }).delete(); // Shortcuts methods to find resources ngwConnector.getResource(2011); // by id ngwConnector.getResource('keyname'); // by keyname ngwConnector.getResources({ cls: 'vector_layer', parent__id: 0 }); // find resources by partial resource params ngwConnector.getResource({ display_name: 'My layer', parent__id: 0 }); // get first ``` #### Typed routes and compatibility methods Prefer `route()` for API endpoints represented by the declarations generated by your NextGIS Web deployment. Route names, path parameters, query parameters, and response bodies are derived from `@nextgisweb` modules. Methods such as `getResource()` and `getResources()` use the compatibility types shipped with `ngw-connector`. They remain useful for established code and for operations without a generated route declaration. These two type sources are intentionally separate because available server routes depend on installed NextGIS Web components and extensions. Check out the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_ngw-connector.html) #### NGW API [NextGIS Web API Doc](http://docs.nextgis.com/docs_ngweb_dev/doc/developer/toc.html) ```javascript ngwConnector.get(request_name, request_options, arguments); ``` [request_options](https://code-api.nextgis.com/interfaces/ngw_connector.RequestOptions.html) [API request names](https://demo.nextgis.com/doc/api) See also the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/ngw-connector`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [default](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/classes/default.md) #### Interfaces - [BasemapResource](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/BasemapResource.md) - [~~BasemapWebmap~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/BasemapWebmap.md) - [~~BasemapWebmapItem~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/BasemapWebmapItem.md) - [BaseRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/BaseRequestOptions.md) - [BookmarkProperties](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/BookmarkProperties.md) - [CreatedResource](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/CreatedResource.md) - [Credentials](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/Credentials.md) - [DeleteRequestItemsResponseMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/DeleteRequestItemsResponseMap.md) - [FeatureItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FeatureItem.md) - [FeatureItemAttachment](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FeatureItemAttachment.md) - [FeatureItemExtensions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FeatureItemExtensions.md) - [FeatureLayerCount](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FeatureLayerCount.md) - [FeatureLayerField](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FeatureLayerField.md) - [FeatureLayersIdentify](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FeatureLayersIdentify.md) - [FeatureLayersIdentifyItems](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FeatureLayersIdentifyItems.md) - [~~FeatureResource~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FeatureResource.md) - [FileBucket](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FileBucket.md) - [FileMeta](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FileMeta.md) - [FileUploadResp](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/FileUploadResp.md) - [GetChildrenOfOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/GetChildrenOfOptions.md) - [GetRequestItemsResponseMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/GetRequestItemsResponseMap.md) - [GetRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/GetRequestOptions.md) - [IdOnly](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/IdOnly.md) - [LayerFeature](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/LayerFeature.md) - [LayerLegend](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/LayerLegend.md) - [LoadingQueue](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/LoadingQueue.md) - [LookupTableResource](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/LookupTableResource.md) - [LunkwillData](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/LunkwillData.md) - [MethodRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/MethodRequestOptions.md) - [NgwConnectorEmitter](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/NgwConnectorEmitter.md) - [NgwConnectorOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/NgwConnectorOptions.md) - [NgwDateFormat](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/NgwDateFormat.md) - [NgwExtent](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/NgwExtent.md) - [NgwFile](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/NgwFile.md) - [NgwLayerIdentifyError](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/NgwLayerIdentifyError.md) - [NgwTimeFormat](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/NgwTimeFormat.md) - [Params](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/Params.md) - [PatchRequestItemsResponseMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/PatchRequestItemsResponseMap.md) - [Permission](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/Permission.md) - [PostRequestItemsResponseMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/PostRequestItemsResponseMap.md) - [PutRequestItemsResponseMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/PutRequestItemsResponseMap.md) - [PyramidRoute](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/PyramidRoute.md) - [PyramidSettingsPyramid](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/PyramidSettingsPyramid.md) - [PyramidSettingsPyramidCompanyLogo](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/PyramidSettingsPyramidCompanyLogo.md) - [RequestHeaders](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/RequestHeaders.md) - [RequestItemsParamsMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/RequestItemsParamsMap.md) - [RequestItemsResponseMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/RequestItemsResponseMap.md) - [RequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/RequestOptions.md) - [RequestOptionsBody](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/RequestOptionsBody.md) - [RequestOptionsJSON](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/RequestOptionsJSON.md) - [Resmeta](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/Resmeta.md) - [~~Resource~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/Resource.md) - [ResourceHierarchy](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/ResourceHierarchy.md) - [~~ResourceItem~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/ResourceItem.md) - [ResourceItemMain](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/ResourceItemMain.md) - [ResourceStoreItemDefault](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/ResourceStoreItemDefault.md) - [RouteMethods](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/RouteMethods.md) - [RouteRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/RouteRequestOptions.md) - [SrsItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/SrsItem.md) - [TreeGroup](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/TreeGroup.md) - [TreeItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/TreeItem.md) - [TreeLayer](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/TreeLayer.md) - [UserInfo](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/UserInfo.md) - [~~VectorLayer~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/VectorLayer.md) - [VectorLayerResourceItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/VectorLayerResourceItem.md) - [~~WebmapResource~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/WebmapResource.md) - [WmsClientConnection](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/WmsClientConnection.md) - [WmsClientLayer](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/WmsClientLayer.md) - [WmsServerService](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/WmsServerService.md) - [WmsServerServiceLayer](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/interfaces/WmsServerServiceLayer.md) #### Type Aliases - [ApiRouteParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ApiRouteParams.md) - [CompositeFor](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/CompositeFor.md) - [DeleteRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/DeleteRequestOptions.md) - [FeatureItemToNgw](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/FeatureItemToNgw.md) - [GeometryType](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/GeometryType.md) - [GetRouteParam](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/GetRouteParam.md) - [KeysWithMethodAndPath](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/KeysWithMethodAndPath.md) - [KeysWithMethods](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/KeysWithMethods.md) - [KeysWithPaths](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/KeysWithPaths.md) - [Method](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/Method.md) - [MethodAvailable](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/MethodAvailable.md) - [NgwDateTimeFormat](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/NgwDateTimeFormat.md) - [NgwExceptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/NgwExceptions.md) - [PatchRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/PatchRequestOptions.md) - [PostRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/PostRequestOptions.md) - [PutRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/PutRequestOptions.md) - [PyramidSettings](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/PyramidSettings.md) - [RequestItemAdditionalParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RequestItemAdditionalParams.md) - [RequestItemKeys](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RequestItemKeys.md) - [RequestItemsParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RequestItemsParams.md) - [RequestMethod](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RequestMethod.md) - [RequestMethods](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RequestMethods.md) - [RequestOptionsByMethod](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RequestOptionsByMethod.md) - [RequestTransformFunction](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RequestTransformFunction.md) - [~~ResourceCls~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ResourceCls.md) - [ResourceDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ResourceDefinition.md) - [ResourceIdKeynameDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ResourceIdKeynameDef.md) - [~~ResourceItemDatatype~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ResourceItemDatatype.md) - [ResourceStoreItem](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ResourceStoreItem.md) - [ResourceStoreItemProperties](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ResourceStoreItemProperties.md) - [ResponseType](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ResponseType.md) - [RouteBody](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RouteBody.md) - [RouteName](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RouteName.md) - [RouteParameters](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RouteParameters.md) - [RouteQuery](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RouteQuery.md) - [Router](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/Router.md) - [RouteResp](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RouteResp.md) - [RouteResults](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/RouteResults.md) - [ToReturn](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/ToReturn.md) - [VectorFieldDatatype](https://code-api.nextgis.com/markdown/@nextgis/ngw-connector/type-aliases/VectorFieldDatatype.md) ### @nextgis/ngw-types-loader [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/ngw-types-loader ### NGW Types Loader ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/ngw-types-loader) ![version](https://img.shields.io/npm/v/@nextgis/ngw-types-loader) A CLI tool that downloads TypeScript declarations from a NextGIS Web deployment and installs them as resolvable packages. Use it when consuming the typed `NgwConnector.route()` API or other declarations that import `@nextgisweb/*` modules. #### Installation ```bash npm install --save-dev @nextgis/ngw-types-loader ``` #### Usage Run the loader without installing it: ```bash npx @nextgis/ngw-types-loader ``` For a custom NextGIS Web deployment: ```bash npx @nextgis/ngw-types-loader https://your-ngw-server.com ``` If the loader is installed in the project, you can use its executable directly. By default, the loader downloads declarations from `https://demo.nextgis.com`: ```bash ngw-types-loader ``` For a custom NextGIS Web deployment, pass its URL: ```bash ngw-types-loader https://your-ngw-server.com ``` The declarations are installed under `node_modules/@nextgisweb`. Imports such as `@nextgisweb/resource/type/api` are resolved by TypeScript without adding a generated file to `tsconfig.json`. Run the loader from `postinstall` when the declarations should be regenerated after installing dependencies: ```json { "scripts": { "postinstall": "ngw-types-loader" } } ``` Package managers and deployment environments may skip lifecycle scripts. Keep the explicit `npx @nextgis/ngw-types-loader ...` command in project setup and CI documentation even when `postinstall` is configured. Use the URL of your own server when its installed components or version differ from NextGIS Cloud. Run the loader again after changing the NextGIS Web version, installed components or extensions, or after recreating `node_modules`. #### API documentation See the [NextGIS Web API documentation](https://demo.nextgis.com/doc/api). See also the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need help with `@nextgis/ngw-types-loader`? [Contact NextGIS](http://nextgis.com/contact/). ## React integration ### @nextgis/react-ngw-leaflet [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/react-ngw-leaflet ### ReactNgwLeaflet ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/react-ngw-leaflet) ![version](https://img.shields.io/npm/v/@nextgis/react-ngw-leaflet) Ready-to-use React component for a Leaflet-based NextGIS Web map. It configures the Leaflet adapter for the common component from `@nextgis/react-ngw-map`. #### Installation ```bash npm install leaflet @nextgis/react-ngw-leaflet ``` #### Usage ```tsx import { createRoot } from 'react-dom/client'; import ReactNgwMap from '@nextgis/react-ngw-leaflet'; function App() { return ( ); } createRoot(document.getElementById('app')!).render(); ``` The component accepts the common `ReactNgwMap` props, including `whenCreated`, `placeholder`, and `children`. See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_react-ngw-leaflet.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/react-ngw-leaflet`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Functions - [default](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-leaflet/functions/default.md) ### @nextgis/react-ngw-ol [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/react-ngw-ol ### ReactNgwOl ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/react-ngw-ol) ![version](https://img.shields.io/npm/v/@nextgis/react-ngw-ol) Ready-to-use React component for an OpenLayers-based NextGIS Web map. It configures the OpenLayers adapter for the common component from `@nextgis/react-ngw-map`. #### Installation ```bash npm install ol @nextgis/react-ngw-ol ``` #### Usage ```tsx import { createRoot } from 'react-dom/client'; import ReactNgwMap from '@nextgis/react-ngw-ol'; function App() { return ( ); } createRoot(document.getElementById('app')!).render(); ``` The component accepts the common `ReactNgwMap` props, including `whenCreated`, `placeholder`, and `children`. See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_react-ngw-ol.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/react-ngw-ol`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Functions - [default](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-ol/functions/default.md) ### @nextgis/react-ngw-maplibre-gl [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/react-ngw-maplibre-gl ### ReactNgwMaplibreGL ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/react-ngw-maplibre-gl) ![version](https://img.shields.io/npm/v/@nextgis/react-ngw-maplibre-gl) Ready-to-use React component for a [MapLibre GL JS](https://maplibre.org/maplibre-gl-js/docs/)-based NextGIS Web map. It configures the MapLibre adapter for the common component from `@nextgis/react-ngw-map`. #### Installation ```bash npm install maplibre-gl @nextgis/react-ngw-maplibre-gl ``` #### Usage ```tsx import { createRoot } from 'react-dom/client'; import ReactNgwMap from '@nextgis/react-ngw-maplibre-gl'; function App() { return ( ); } createRoot(document.getElementById('app')!).render(); ``` The component accepts the common `ReactNgwMap` props, including `whenCreated`, `placeholder`, and `children`. MapLibre GL JS worker setup also applies; see the [ngw-maplibre-gl instructions](https://code-api.nextgis.com/markdown/@nextgis/ngw-maplibre-gl/README.md). See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_react-ngw-maplibre-gl.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/react-ngw-maplibre-gl`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Functions - [default](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-maplibre-gl/functions/default.md) ### @nextgis/react-ngw-map [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/react-ngw-map ### React NGW Map ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/react-ngw-map) ![version](https://img.shields.io/npm/v/@nextgis/react-ngw-map) React integration for [`@nextgis/ngw-map`](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/README.md). It provides the common map component, context, hooks, layer components, and controls used by the engine-specific React packages. Most applications should use `react-ngw-leaflet`, `react-ngw-ol`, or `react-ngw-maplibre-gl`. Use this package directly when supplying a map adapter or building reusable React components around the common `NgwMap` API. #### Installation ```bash npm install @nextgis/react-ngw-map ``` Install one map engine and its adapter as well. This example uses OpenLayers: ```bash npm install ol @nextgis/ol-map-adapter ``` #### Usage ```tsx import { createRoot } from 'react-dom/client'; import { ReactNgwMap } from '@nextgis/react-ngw-map'; import MapAdapter from '@nextgis/ol-map-adapter'; import 'ol/ol.css'; function App() { return ( { // The map is initialized and exposes the common NgwMap/WebMap API. }} /> ); } createRoot(document.getElementById('app')!).render(); ``` Components rendered as children can access the map through `useNgwMapContext()`. The package also exports `ReactNgwLayer`, `MapControl`, `ButtonControl`, and `ToggleControl`. See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_react-ngw-map.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/react-ngw-map`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Interfaces - [ControlledLayer](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/interfaces/ControlledLayer.md) - [MapContainerProps](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/interfaces/MapContainerProps.md) - [MapControlProps](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/interfaces/MapControlProps.md) - [NgwMapContextInterface](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/interfaces/NgwMapContextInterface.md) - [ReactElementAttributes](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/interfaces/ReactElementAttributes.md) #### Type Aliases - [ReactNgwMapProps](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/type-aliases/ReactNgwMapProps.md) #### Variables - [MapControlContext](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/variables/MapControlContext.md) #### Functions - [ButtonControl](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/functions/ButtonControl.md) - [MapControl](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/functions/MapControl.md) - [ReactNgwLayer](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/functions/ReactNgwLayer.md) - [ReactNgwMap](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/functions/ReactNgwMap.md) - [ToggleControl](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/functions/ToggleControl.md) - [useMapControlContext](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/functions/useMapControlContext.md) - [useNgwMapContext](https://code-api.nextgis.com/markdown/@nextgis/react-ngw-map/functions/useNgwMapContext.md) ## QuickMapServices ### @nextgis/qms-leaflet [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/qms-leaflet ### QMS Leaflet ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/qms-leaflet) ![version](https://img.shields.io/npm/v/@nextgis/qms-leaflet) Add [NextGIS QMS](https://qms.nextgis.com/) TMS and WMS services directly to a Leaflet map. Use this package when the application owns the native Leaflet map instance. #### Installation ```bash npm install leaflet @nextgis/qms-leaflet ``` #### Usage Create a Leaflet map and add a QMS service by its ID: ```ts import { map as createMap } from 'leaflet'; import 'leaflet/dist/leaflet.css'; import '@nextgis/qms-leaflet/lib/qms-leaflet.css'; import { addQmsLayer } from '@nextgis/qms-leaflet'; const map = createMap('map').setView([20, 0], 2); const layer = await addQmsLayer(map, 448); ``` Set `fit` to move the map to the QMS service extent after adding the layer: ```ts const layer = await addQmsLayer(map, 4646, { fit: { padding: [24, 24], maxZoom: 14 }, }); ``` You can also fit the map by a QMS service ID: ```ts import { fitQmsService } from '@nextgis/qms-leaflet'; await fitQmsService(map, 4646, { maxZoom: 14 }); ``` Add the QMS search and catalog control to the map: ```ts import { createQmsControl } from '@nextgis/qms-leaflet'; createQmsControl({ initialLayer: 448, position: 'topleft' }).addTo(map); ``` | Option | Type | Default | Description | | --------------- | ------------------------- | ------------ | --------------------------------------------------------------- | | `initialLayer` | `number \| (() => Layer)` | | QMS service ID or a layer already added to the map. | | `position` | `ControlPosition` | `'topright'` | Leaflet control position. | | `search` | `boolean` | `true` | Show QMS search. | | `catalog` | `boolean` | `true` | Show the catalog. | | `closeOnSelect` | `boolean` | `false` | Close the panel after selecting a service. | | `lang` | `string` | `'en'` | Built-in language: `en`, `de`, `es`, `fr`, `it`, `pt`, or `ru`. | | `limit` | `number` | `10` | Maximum search results for each service type. | | `className` | `string` | | Additional class for custom control styles. | #### Examples - [QMS services](https://code.nextgis.com/qms-leaflet-examples-qms-services) - [Fit to service extent](https://code.nextgis.com/qms-leaflet-examples-fit-service) - [QMS control](https://code.nextgis.com/qms-leaflet-examples-search-control) See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_qms-leaflet.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### 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](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [QmsControl](https://code-api.nextgis.com/markdown/@nextgis/qms-leaflet/classes/QmsControl.md) #### Interfaces - [QmsControlOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-leaflet/interfaces/QmsControlOptions.md) - [QmsLeafletOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-leaflet/interfaces/QmsLeafletOptions.md) #### Type Aliases - [QmsLeafletFitOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-leaflet/type-aliases/QmsLeafletFitOptions.md) #### Functions - [addQmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-leaflet/functions/addQmsLayer.md) - [createQmsControl](https://code-api.nextgis.com/markdown/@nextgis/qms-leaflet/functions/createQmsControl.md) - [fitQmsService](https://code-api.nextgis.com/markdown/@nextgis/qms-leaflet/functions/fitQmsService.md) ### @nextgis/qms-ol [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/qms-ol ### QMS OpenLayers ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/qms-ol) ![version](https://img.shields.io/npm/v/@nextgis/qms-ol) Add [NextGIS QMS](https://qms.nextgis.com/) TMS and WMS services directly to an OpenLayers map. Use this package when the application owns the native OpenLayers map instance. #### Installation ```bash npm install ol @nextgis/qms-ol ``` #### Usage Create an OpenLayers map and add a QMS service by its numeric ID: ```ts import Map from 'ol/Map'; import View from 'ol/View'; import { fromLonLat } from 'ol/proj'; import 'ol/ol.css'; import '@nextgis/qms-ol/lib/qms-ol.css'; import { addQmsLayer } from '@nextgis/qms-ol'; const map = new Map({ target: 'map', view: new View({ center: fromLonLat([0, 20]), zoom: 2 }), }); const layer = await addQmsLayer(map, 448); ``` Set `fit` to move the map to the QMS service extent after adding the layer: ```ts const layer = await addQmsLayer(map, 4646, { fit: { padding: [24, 24, 24, 24], maxZoom: 14 }, }); ``` You can also fit the map by a QMS service ID: ```ts import { fitQmsService } from '@nextgis/qms-ol'; await fitQmsService(map, 4646, { maxZoom: 14 }); ``` Add the QMS search and catalog control to the map: ```ts import { createQmsControl } from '@nextgis/qms-ol'; map.addControl(createQmsControl({ initialLayer: 448 })); ``` | Option | Type | Default | Description | | --------------- | ----------------------------- | ------- | --------------------------------------------------------------- | | `initialLayer` | `number \| (() => BaseLayer)` | | QMS service ID or a layer already added to the map. | | `target` | `HTMLElement \| string` | | Optional OpenLayers control target. | | `search` | `boolean` | `true` | Show QMS search. | | `catalog` | `boolean` | `true` | Show the catalog. | | `closeOnSelect` | `boolean` | `false` | Close the panel after selecting a service. | | `lang` | `string` | `'en'` | Built-in language: `en`, `de`, `es`, `fr`, `it`, `pt`, or `ru`. | | `limit` | `number` | `10` | Maximum search results for each service type. | | `className` | `string` | | Additional class for custom control styles. | OpenLayers placement can also be changed with `--nextgis-qms-control-top` and `--nextgis-qms-control-left`. #### Examples - [QMS services](https://code.nextgis.com/qms-ol-examples-qms-services) - [Fit to service extent](https://code.nextgis.com/qms-ol-examples-fit-service) - [QMS control](https://code.nextgis.com/qms-ol-examples-search-control) See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_qms-ol.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### 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](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [QmsControl](https://code-api.nextgis.com/markdown/@nextgis/qms-ol/classes/QmsControl.md) #### Interfaces - [QmsControlOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-ol/interfaces/QmsControlOptions.md) - [QmsOlOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-ol/interfaces/QmsOlOptions.md) #### Type Aliases - [QmsOlFitOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-ol/type-aliases/QmsOlFitOptions.md) #### Functions - [addQmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-ol/functions/addQmsLayer.md) - [createQmsControl](https://code-api.nextgis.com/markdown/@nextgis/qms-ol/functions/createQmsControl.md) - [fitQmsService](https://code-api.nextgis.com/markdown/@nextgis/qms-ol/functions/fitQmsService.md) ### @nextgis/qms-maplibre-gl [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/qms-maplibre-gl ### QMS MapLibre GL ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/qms-maplibre-gl) ![version](https://img.shields.io/npm/v/@nextgis/qms-maplibre-gl) Add [NextGIS QMS](https://qms.nextgis.com/) TMS and WMS services directly to a MapLibre GL JS map. Use this package when the application owns the native MapLibre GL JS map instance. #### Installation ```bash npm install maplibre-gl @nextgis/qms-maplibre-gl ``` #### Usage Create a MapLibre GL JS map and add a QMS service after the map style is loaded: ```ts import { Map, NavigationControl } from 'maplibre-gl'; import 'maplibre-gl/dist/maplibre-gl.css'; import '@nextgis/qms-maplibre-gl/lib/qms-maplibre-gl.css'; import { addQmsLayer } from '@nextgis/qms-maplibre-gl'; const map = new Map({ container: 'map', style: { version: 8, sources: {}, layers: [] }, center: [0, 20], zoom: 2, }); map.addControl(new NavigationControl(), 'top-right'); map.once('load', () => { addQmsLayer(map, 448); }); ``` Set `fit` to move the map to the QMS service extent after adding the layer: ```ts const layer = await addQmsLayer(map, 4646, { fit: { padding: 24, maxZoom: 14 }, }); ``` You can also fit the map by a QMS service ID: ```ts import { fitQmsService } from '@nextgis/qms-maplibre-gl'; await fitQmsService(map, 4646, { maxZoom: 14 }); ``` Add the QMS search and catalog control to the map: ```ts import { createQmsControl } from '@nextgis/qms-maplibre-gl'; map.addControl(createQmsControl({ initialLayer: 448 }), 'top-left'); ``` | Option | Type | Default | Description | | --------------- | ------------------------------------ | ------- | --------------------------------------------------------------- | | `initialLayer` | `number \| (() => QmsMaplibreLayer)` | | QMS service ID or a layer already added to the map. | | `search` | `boolean` | `true` | Show QMS search. | | `catalog` | `boolean` | `true` | Show the catalog. | | `closeOnSelect` | `boolean` | `false` | Close the panel after selecting a service. | | `lang` | `string` | `'en'` | Built-in language: `en`, `de`, `es`, `fr`, `it`, `pt`, or `ru`. | | `limit` | `number` | `10` | Maximum search results for each service type. | | `className` | `string` | | Additional class for custom control styles. | #### Examples - [QMS services](https://code.nextgis.com/qms-maplibre-gl-examples-qms-services) - [Fit to service extent](https://code.nextgis.com/qms-maplibre-gl-examples-fit-service) - [QMS control](https://code.nextgis.com/qms-maplibre-gl-examples-search-control) See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_qms-maplibre-gl.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### 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](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [QmsControl](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/classes/QmsControl.md) - [QmsMaplibreLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/classes/QmsMaplibreLayer.md) #### Interfaces - [QmsMaplibreOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/interfaces/QmsMaplibreOptions.md) #### Type Aliases - [QmsControlOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/type-aliases/QmsControlOptions.md) - [QmsMaplibreFitOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/type-aliases/QmsMaplibreFitOptions.md) #### Functions - [addQmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/functions/addQmsLayer.md) - [createQmsControl](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/functions/createQmsControl.md) - [fitQmsService](https://code-api.nextgis.com/markdown/@nextgis/qms-maplibre-gl/functions/fitQmsService.md) ### @nextgis/qms-core [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/qms-core ### QMS Core ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/qms-core) ![version](https://img.shields.io/npm/v/@nextgis/qms-core) Map-independent client, catalog, and shared control UI for [NextGIS QMS](https://qms.nextgis.com/). Use an engine-specific package instead when adding QMS services directly to a Leaflet, OpenLayers, or MapLibre GL JS map. #### Installation ```bash npm install @nextgis/qms-core ``` ```ts 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: ```ts QmsClient.url = 'http://localhost:8000'; ``` Get a service extent as `[west, south, east, north]` in EPSG:4326: ```ts import { getQmsServiceExtent } from '@nextgis/qms-core'; const extent = await getQmsServiceExtent(4646); ``` Search for services by name or description: ```ts const services = await qms.searchServices('OpenStreetMap', { type: 'tms' }); ``` The bundled catalog is generated from [quickmapservices_contrib](https://github.com/nextgis/quickmapservices_contrib). The catalog is generated automatically before the package build. To update it manually, run: ```bash 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): ```ts import { QmsControlElement } from '@nextgis/qms-core'; const control = new QmsControlElement({ lang: 'ru', messages: { title: 'Подложки', }, }); ``` `messages` can override search panel labels. See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_qms-core.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### 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](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [QmsClient](https://code-api.nextgis.com/markdown/@nextgis/qms-core/classes/QmsClient.md) - [QmsControlController](https://code-api.nextgis.com/markdown/@nextgis/qms-core/classes/QmsControlController.md) - [QmsControlElement](https://code-api.nextgis.com/markdown/@nextgis/qms-core/classes/QmsControlElement.md) #### Interfaces - [QmsCatalog](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsCatalog.md) - [QmsCatalogGroup](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsCatalogGroup.md) - [QmsCatalogServiceBase](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsCatalogServiceBase.md) - [QmsCatalogTmsService](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsCatalogTmsService.md) - [QmsCatalogWmsService](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsCatalogWmsService.md) - [QmsControlElementOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsControlElementOptions.md) - [QmsControlLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsControlLayerAdapter.md) - [QmsControlMessages](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsControlMessages.md) - [QmsLayerBase](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsLayerBase.md) - [QmsRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsRequestOptions.md) - [QmsSearchOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsSearchOptions.md) - [QmsSearchService](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsSearchService.md) - [QmsServiceBase](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsServiceBase.md) - [QmsTmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsTmsLayer.md) - [QmsTmsService](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsTmsService.md) - [QmsWmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsWmsLayer.md) - [QmsWmsService](https://code-api.nextgis.com/markdown/@nextgis/qms-core/interfaces/QmsWmsService.md) #### Type Aliases - [QmsCatalogService](https://code-api.nextgis.com/markdown/@nextgis/qms-core/type-aliases/QmsCatalogService.md) - [QmsControlControllerOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-core/type-aliases/QmsControlControllerOptions.md) - [QmsControlItem](https://code-api.nextgis.com/markdown/@nextgis/qms-core/type-aliases/QmsControlItem.md) - [QmsControlLanguage](https://code-api.nextgis.com/markdown/@nextgis/qms-core/type-aliases/QmsControlLanguage.md) - [QmsExtent](https://code-api.nextgis.com/markdown/@nextgis/qms-core/type-aliases/QmsExtent.md) - [QmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-core/type-aliases/QmsLayer.md) - [QmsService](https://code-api.nextgis.com/markdown/@nextgis/qms-core/type-aliases/QmsService.md) - [QmsServiceType](https://code-api.nextgis.com/markdown/@nextgis/qms-core/type-aliases/QmsServiceType.md) #### Variables - [QMS\_CONTROL\_LANGUAGES](https://code-api.nextgis.com/markdown/@nextgis/qms-core/variables/QMS_CONTROL_LANGUAGES.md) - [QMS\_CONTROL\_MESSAGES](https://code-api.nextgis.com/markdown/@nextgis/qms-core/variables/QMS_CONTROL_MESSAGES.md) - [QMS\_URL](https://code-api.nextgis.com/markdown/@nextgis/qms-core/variables/QMS_URL.md) #### Functions - [getQmsServiceExtent](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/getQmsServiceExtent.md) - [getQmsTileQuadKey](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/getQmsTileQuadKey.md) - [getSubdomainsOriginUrl](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/getSubdomainsOriginUrl.md) - [normalizeQmsUrl](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/normalizeQmsUrl.md) - [parseQmsExtent](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/parseQmsExtent.md) - [parseQmsWmsParams](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/parseQmsWmsParams.md) - [prepareQmsTmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/prepareQmsTmsLayer.md) - [prepareQmsWmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/prepareQmsWmsLayer.md) - [resolveQmsLayer](https://code-api.nextgis.com/markdown/@nextgis/qms-core/functions/resolveQmsLayer.md) ### @nextgis/qms-kit [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/qms-kit ### Qms kit ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/qms-kit) ![version](https://img.shields.io/npm/v/@nextgis/qms-kit) Register [NextGIS QMS](https://qms.nextgis.com/) TMS and WMS services as baselayers in [`@nextgis/webmap`](https://code-api.nextgis.com/markdown/@nextgis/webmap/README.md). This is a developer package for libraries built on the common `WebMap` API. Use `qms-leaflet`, `qms-ol`, or `qms-maplibre-gl` when working with an existing native map. #### Installation ```bash npm install @nextgis/qms-kit @nextgis/webmap ``` #### Usage ##### Use as a WebMap starter kit ```ts import { createWebMap } from '@nextgis/webmap'; import { QmsKit } from '@nextgis/qms-kit'; import LeafletMapAdapter from '@nextgis/leaflet-map-adapter'; import 'leaflet/dist/leaflet.css'; const webMap = await createWebMap({ target: 'map', mapAdapter: new LeafletMapAdapter(), starterKits: [new QmsKit()], }); await webMap.addBaseLayer('QMS', { qmsId: 448 }); ``` ##### Register the adapter directly ```ts import { createWebMap } from '@nextgis/webmap'; import { createQmsAdapter } from '@nextgis/qms-kit'; import LeafletMapAdapter from '@nextgis/leaflet-map-adapter'; import 'leaflet/dist/leaflet.css'; const webMap = await createWebMap({ target: 'map', mapAdapter: new LeafletMapAdapter(), }); const QmsAdapter = createQmsAdapter({ webMap, qmsId: 448 }); await webMap.addBaseLayer(QmsAdapter); ``` See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_qms-kit.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [QmsKit](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/classes/QmsKit.md) #### Interfaces - [CreateQmsAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/interfaces/CreateQmsAdapterOptions.md) - [GeoserviceInList](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/interfaces/GeoserviceInList.md) - [QmsAdapter](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/interfaces/QmsAdapter.md) - [QmsAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/interfaces/QmsAdapterOptions.md) #### Type Aliases - [~~QmsBasemap~~](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/type-aliases/QmsBasemap.md) #### Variables - [alias](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/variables/alias.md) #### Functions - [createQmsAdapter](https://code-api.nextgis.com/markdown/@nextgis/qms-kit/functions/createQmsAdapter.md) ## Library foundations ### @nextgis/ngw-map [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/ngw-map ### NgwMap ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/ngw-map) ![version](https://img.shields.io/npm/v/@nextgis/ngw-map) Framework-independent NextGIS Web map class used by `ngw-leaflet`, `ngw-ol`, and `ngw-maplibre-gl`. Most applications should import one of those ready-to-use packages. Use `@nextgis/ngw-map` directly when creating another map distribution, injecting a custom map adapter, or extending the common NextGIS Web behavior. `NgwMap` extends [`WebMap`](https://code-api.nextgis.com/markdown/@nextgis/webmap/README.md), adds an `NgwConnector`, and provides NextGIS Web resources, feature requests, identification, selection, and extent operations. It also re-exports the public `@nextgis/webmap` API. #### Installation ```bash npm install @nextgis/ngw-map @nextgis/leaflet-map-adapter leaflet ``` #### Usage ```ts import { NgwMap } from '@nextgis/ngw-map'; import MapAdapter from '@nextgis/leaflet-map-adapter'; import 'leaflet/dist/leaflet.css'; const ngwMap = new NgwMap({ mapAdapter: new MapAdapter(), baseUrl: 'https://demo.nextgis.com', target: 'map', qmsId: 448, webmapId: 3985, }); await ngwMap.onLoad(); ``` The map adapter is required when this package is used directly. The ready-to-use map packages create it automatically. Important inherited API groups include: - NextGIS Web resources: `addNgwLayer()`, `fitResource()`, and `connector`; - features and identification: `fetchNgwLayerItems()`, `fetchIdentifyGeoJson()`, and `ngw:select` events; - common WebMap layers, controls, events, filtering, and view methods. See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_ngw-map.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/ngw-map`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [NgwMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/classes/NgwMap.md) - [WebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/classes/WebMap.md) - [WebMapControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/classes/WebMapControls.md) - [WebMapLayers](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/classes/WebMapLayers.md) - [WebMapMain](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/classes/WebMapMain.md) #### Interfaces - [AdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/AdapterOptions.md) - [AddControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/AddControlOptions.md) - [AttributionControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/AttributionControlOptions.md) - [ButtonControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ButtonControlOptions.md) - [ContribControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ContribControlsOptions.md) - [ControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ControlOptions.md) - [CreateControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/CreateControlOptions.md) - [CreatePopupContentProps](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/CreatePopupContentProps.md) - [DataLoadError](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/DataLoadError.md) - [FeaturePosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/FeaturePosition.md) - [FilterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/FilterOptions.md) - [FitOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/FitOptions.md) - [GeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/GeoJsonAdapterOptions.md) - [GeoJsonLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/GeoJsonLayerAdapter.md) - [GetAttributionsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/GetAttributionsOptions.md) - [GetLegendOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/GetLegendOptions.md) - [HtmlToggle](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/HtmlToggle.md) - [ImageAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ImageAdapterOptions.md) - [LayerAdapterCreators](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/LayerAdapterCreators.md) - [LayerAdapters](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/LayerAdapters.md) - [LayerAdaptersOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/LayerAdaptersOptions.md) - [LayerDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/LayerDefinition.md) - [LayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/LayerRequestOptions.md) - [Locate](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/Locate.md) - [LocateOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/LocateOptions.md) - [LocationEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/LocationEvent.md) - [LocationEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/LocationEvents.md) - [MainLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MainLayerAdapter.md) - [MainMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MainMapEvents.md) - [MapAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MapAdapter.md) - [MapAdapterEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MapAdapterEvents.md) - [MapClickEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MapClickEvent.md) - [MapControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MapControl.md) - [MapControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MapControls.md) - [MapOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MapOptions.md) - [Model3DOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/Model3DOptions.md) - [MvtAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/MvtAdapterOptions.md) - [NgwLayers](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/NgwLayers.md) - [NgwLayersMem](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/NgwLayersMem.md) - [NgwMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/NgwMapEvents.md) - [NgwMapOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/NgwMapOptions.md) - [OnLayerClickOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/OnLayerClickOptions.md) - [OnLayerMouseOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/OnLayerMouseOptions.md) - [OnLayerSelectOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/OnLayerSelectOptions.md) - [Pixel](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/Pixel.md) - [PopupOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/PopupOptions.md) - [RasterAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/RasterAdapterOptions.md) - [RuntimeParams](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/RuntimeParams.md) - [StarterKit](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/StarterKit.md) - [TileAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/TileAdapterOptions.md) - [Tileset3DAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/Tileset3DAdapterOptions.md) - [TitleToggle](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/TitleToggle.md) - [ToggleControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ToggleControl.md) - [ToggleControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ToggleControlOptions.md) - [ToggleLayerOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ToggleLayerOptions.md) - [UpdateLayerAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/UpdateLayerAdapterOptions.md) - [VectorAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/VectorAdapterOptions.md) - [VectorLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/VectorLayerAdapter.md) - [ViewOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ViewOptions.md) - [WebMapEvents](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/WebMapEvents.md) - [WmsAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/WmsAdapterOptions.md) - [ZoomControlOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/interfaces/ZoomControlOptions.md) #### Type Aliases - [AdapterConstructor](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/AdapterConstructor.md) - [CallbackFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/CallbackFilter.md) - [ControlPosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/ControlPosition.md) - [~~ControlPositions~~](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/ControlPositions.md) - [ControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/ControlsOptions.md) - [ControlTargetPosition](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/ControlTargetPosition.md) - [CreatePopupContent](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/CreatePopupContent.md) - [Cursor](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/Cursor.md) - [DataLayerFilter](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/DataLayerFilter.md) - [FeatureLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/FeatureLayerAdapter.md) - [GeoJsonAdapterFeature](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/GeoJsonAdapterFeature.md) - [HtmlDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/HtmlDef.md) - [LayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/LayerAdapter.md) - [LayerAdapterDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/LayerAdapterDefinition.md) - [LayerDef](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/LayerDef.md) - [NgwIdentifyEvent](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/NgwIdentifyEvent.md) - [NgwResourceDefinition](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/NgwResourceDefinition.md) - [OnBeforeLayerAdd](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/OnBeforeLayerAdd.md) - [OnLayerSelectType](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/OnLayerSelectType.md) - [PopupOnCloseFunction](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/PopupOnCloseFunction.md) - [ToggleStatusChangeListener](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/ToggleStatusChangeListener.md) - [VectorAdapterLayerType](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/type-aliases/VectorAdapterLayerType.md) #### Variables - [paintTypeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/variables/paintTypeAlias.md) - [typeAlias](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/variables/typeAlias.md) #### Functions - [applyLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/applyLayerRequestOptions.md) - [createNgwMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/createNgwMap.md) - [createToggleControl](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/createToggleControl.md) - [createWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/createWebMap.md) - [detectGeometryType](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/detectGeometryType.md) - [findMostFrequentGeomType](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/findMostFrequentGeomType.md) - [getDefaultControls](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/getDefaultControls.md) - [getLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/getLayerRequestOptions.md) - [getWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/getWebMap.md) - [normalizeLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/normalizeLayerRequestOptions.md) - [setWebMap](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/setWebMap.md) - [updateGeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/ngw-map/functions/updateGeoJsonAdapterOptions.md) ### @nextgis/webmap [**NextGIS Frontend**](https://code-api.nextgis.com/markdown/README.md) *** [NextGIS Frontend](https://code-api.nextgis.com/markdown/packages.md) / @nextgis/webmap ### WebMap ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/webmap) ![version](https://img.shields.io/npm/v/@nextgis/webmap) Framework-independent map engine and adapter contract. `WebMap` manages the map lifecycle, layers, controls, events, view state, selection, filtering, and ordering without depending on a particular rendering engine or backend. It is primarily intended for adapter and library authors. Applications connected to NextGIS Web normally use one of `ngw-leaflet`, `ngw-ol`, or `ngw-maplibre-gl`. Their map classes inherit the API documented by this package through `NgwMap`. #### Installation ```bash npm install @nextgis/webmap @nextgis/leaflet-map-adapter leaflet ``` #### Usage ```ts import { createWebMap } from '@nextgis/webmap'; import MapAdapter from '@nextgis/leaflet-map-adapter'; import 'leaflet/dist/leaflet.css'; const webMap = await createWebMap({ target: 'map', mapAdapter: new MapAdapter(), }); ``` Use this package to implement: - common layer operations through `WebMapLayers`; - controls through `WebMapControls`; - lifecycle, events, and view operations through `WebMapMain`; - new `MapAdapter` and `LayerAdapter` implementations; - starter kits that register controls and layer providers. Backend-specific behavior, including NextGIS Web requests and resources, does not belong in this package. See the [API Documentation](https://code-api.nextgis.com/modules/_nextgis_webmap.html) and the [package architecture guide](https://code-api.nextgis.com/markdown/documents/PACKAGES.md). #### Commercial support Need to fix a bug or add a feature to `@nextgis/webmap`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options! [![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com) #### Classes - [WebMap](https://code-api.nextgis.com/markdown/@nextgis/webmap/classes/WebMap.md) - [WebMapControls](https://code-api.nextgis.com/markdown/@nextgis/webmap/classes/WebMapControls.md) - [WebMapLayers](https://code-api.nextgis.com/markdown/@nextgis/webmap/classes/WebMapLayers.md) - [WebMapMain](https://code-api.nextgis.com/markdown/@nextgis/webmap/classes/WebMapMain.md) #### Interfaces - [AdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/AdapterOptions.md) - [AddControlOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/AddControlOptions.md) - [AttributionControlOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/AttributionControlOptions.md) - [ButtonControlOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ButtonControlOptions.md) - [ContribControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ContribControlsOptions.md) - [ControlOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ControlOptions.md) - [CreateControlOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/CreateControlOptions.md) - [CreatePopupContentProps](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/CreatePopupContentProps.md) - [DataLoadError](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/DataLoadError.md) - [FeaturePosition](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/FeaturePosition.md) - [FilterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/FilterOptions.md) - [FitOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/FitOptions.md) - [GeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/GeoJsonAdapterOptions.md) - [GeoJsonLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/GeoJsonLayerAdapter.md) - [GetAttributionsOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/GetAttributionsOptions.md) - [GetLegendOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/GetLegendOptions.md) - [HtmlToggle](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/HtmlToggle.md) - [ImageAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ImageAdapterOptions.md) - [LayerAdapterCreators](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/LayerAdapterCreators.md) - [LayerAdapters](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/LayerAdapters.md) - [LayerAdaptersOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/LayerAdaptersOptions.md) - [LayerDefinition](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/LayerDefinition.md) - [LayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/LayerRequestOptions.md) - [Locate](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/Locate.md) - [LocateOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/LocateOptions.md) - [LocationEvent](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/LocationEvent.md) - [LocationEvents](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/LocationEvents.md) - [MainLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MainLayerAdapter.md) - [MainMapEvents](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MainMapEvents.md) - [MapAdapter](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MapAdapter.md) - [MapAdapterEvents](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MapAdapterEvents.md) - [MapClickEvent](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MapClickEvent.md) - [MapControl](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MapControl.md) - [MapControls](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MapControls.md) - [MapOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MapOptions.md) - [Model3DOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/Model3DOptions.md) - [MvtAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/MvtAdapterOptions.md) - [OnLayerClickOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/OnLayerClickOptions.md) - [OnLayerMouseOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/OnLayerMouseOptions.md) - [OnLayerSelectOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/OnLayerSelectOptions.md) - [Pixel](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/Pixel.md) - [PopupOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/PopupOptions.md) - [RasterAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/RasterAdapterOptions.md) - [RuntimeParams](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/RuntimeParams.md) - [StarterKit](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/StarterKit.md) - [TileAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/TileAdapterOptions.md) - [Tileset3DAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/Tileset3DAdapterOptions.md) - [TitleToggle](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/TitleToggle.md) - [ToggleControl](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ToggleControl.md) - [ToggleControlOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ToggleControlOptions.md) - [ToggleLayerOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ToggleLayerOptions.md) - [UpdateLayerAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/UpdateLayerAdapterOptions.md) - [VectorAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/VectorAdapterOptions.md) - [VectorLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/VectorLayerAdapter.md) - [ViewOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ViewOptions.md) - [WebMapEvents](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/WebMapEvents.md) - [WmsAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/WmsAdapterOptions.md) - [ZoomControlOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/interfaces/ZoomControlOptions.md) #### Type Aliases - [AdapterConstructor](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/AdapterConstructor.md) - [CallbackFilter](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/CallbackFilter.md) - [ControlPosition](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/ControlPosition.md) - [~~ControlPositions~~](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/ControlPositions.md) - [ControlsOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/ControlsOptions.md) - [ControlTargetPosition](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/ControlTargetPosition.md) - [CreatePopupContent](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/CreatePopupContent.md) - [Cursor](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/Cursor.md) - [DataLayerFilter](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/DataLayerFilter.md) - [FeatureLayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/FeatureLayerAdapter.md) - [GeoJsonAdapterFeature](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/GeoJsonAdapterFeature.md) - [HtmlDef](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/HtmlDef.md) - [LayerAdapter](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/LayerAdapter.md) - [LayerAdapterDefinition](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/LayerAdapterDefinition.md) - [LayerDef](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/LayerDef.md) - [OnBeforeLayerAdd](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/OnBeforeLayerAdd.md) - [OnLayerSelectType](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/OnLayerSelectType.md) - [PopupOnCloseFunction](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/PopupOnCloseFunction.md) - [ToggleStatusChangeListener](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/ToggleStatusChangeListener.md) - [VectorAdapterLayerType](https://code-api.nextgis.com/markdown/@nextgis/webmap/type-aliases/VectorAdapterLayerType.md) #### Variables - [paintTypeAlias](https://code-api.nextgis.com/markdown/@nextgis/webmap/variables/paintTypeAlias.md) - [typeAlias](https://code-api.nextgis.com/markdown/@nextgis/webmap/variables/typeAlias.md) #### Functions - [applyLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/applyLayerRequestOptions.md) - [createToggleControl](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/createToggleControl.md) - [createWebMap](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/createWebMap.md) - [detectGeometryType](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/detectGeometryType.md) - [findMostFrequentGeomType](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/findMostFrequentGeomType.md) - [getDefaultControls](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/getDefaultControls.md) - [getLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/getLayerRequestOptions.md) - [getWebMap](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/getWebMap.md) - [normalizeLayerRequestOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/normalizeLayerRequestOptions.md) - [setWebMap](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/setWebMap.md) - [updateGeoJsonAdapterOptions](https://code-api.nextgis.com/markdown/@nextgis/webmap/functions/updateGeoJsonAdapterOptions.md)