How to use the @nextgis/webmap.WebMap function in @nextgis/webmap

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

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

github nextgis / nextgisweb_frontend / packages / ol-map-adapter / examples / main.js View on Github external
import { WebMap } from '@nextgis/webmap';
import { OlMapAdapter } from '@nextgis/ol-map-adapter';
import { NgwKit } from '@nextgis/ngw-kit';
import { QmsKit } from '@nextgis/qms-kit';

const ngwKit = new NgwKit({
  'baseUrl': "http://geonote.nextgis.com",
  'resourceId': 1,
  // 'pixelRadius': 10,
  // auth: {
  //   login: 'administrator',
  //   password: '',
  // }
})

const webMap = new WebMap({
  mapAdapter: new OlMapAdapter(),
  starterKits: [new QmsKit(), ngwKit],
});

webMap.create({
  target: 'map'
}).then(() => {
  webMap.addControl('ZOOM', 'top-left');
  webMap.addBaseLayer('sputnik', 'QMS', {
    qmsid: 487
  }).then((layer) => {
    webMap.showLayer(layer.name);
  });
});

// webMap.addBaseLayer('osm', 'OSM').then((layer) => {

@nextgis/webmap

Universal map constructor

MIT
Latest version published 20 days ago

Package Health Score

69 / 100
Full package analysis