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
npm install @nextgis/webmap @nextgis/leaflet-map-adapter leaflet
Usage
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
MapAdapterandLayerAdapterimplementations; - 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 and the package architecture guide.
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 to discuss options!
