Options
All
  • Public
  • Public/Protected
  • All
Menu

WebMap plugin and utilities that allow you to interact with NextGIS Web.

remarks

Make sure CORS is registered in the NextGIS Web settings to be able to send requests.

example

As WebMap starter kit example

import { NgwKit } from '@nextgis/ngw-kit';
import { createWebMap } from '@nextgis/webmap';
import LeafletMapAdapter from '@nextgis/leaflet-map-adapter';

import 'leaflet/dist/leaflet.css';

createWebMap({
mapAdapter: new LeafletMapAdapter(),
starterKits: [
new NgwKit({
baseUrl: 'YOU NEXTGIS WEB URL',
resource: 'WEBMAP RESOURCE ID',
}),
],
});
example

Get NGW vector layer items

import { getNgwLayerItem, getNgwLayerItems } from '@nextgis/ngw-kit';
import NgwConnector from '@nextgis/ngw-connector';

const connector = new NgwConnector({ baseUrl: 'YOU NEXTGIS WEB URL'});

getNgwLayerItem({
resourceId: 2011,
featureId: 1,
connector: connector
}).then((item) => { ... });

getNgwLayerItems({
resourceId: 2011,
offset: 10,
limit: 300,
fields: ['name', 'year', 'Ni', 'Cu', 'Pt', 'Pd', 'Au']
orderBy: ['year']
}).then((items) => { ... });

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

ClassAdapter: Promise<Type<LayerAdapter> | undefined>
FetchNgwItemOptions<P>: GetNgwItemOptions & NgwFeatureRequestOptions<P>

Type parameters

FetchNgwItemsOptions<P>: GetNgwItemsOptions<P> & NgwFeatureRequestOptions<P> & { clientFilterValidate?: boolean }

Type parameters

GeomFormat: "wkt" | "geojson"
GetClassAdapterByType: {}

Type declaration

GetClassAdapterCallback: (options: GetClassAdapterOptions) => Promise<Type<LayerAdapter> | undefined> | undefined

Type declaration

NgwIdentify: FeatureLayersIdentify & (NgwVectorIdentify | NgwRasterIdentify)
NgwLayerAdapterType: "IMAGE" | "TILE" | "GEOJSON" | "MVT" | "WMS" | "TERRAIN" | "MODEL_3D" | "NGW:WEBMAP"
NgwRequestOptions: Pick<RequestOptions, "cache" | "signal">
PropertiesForNgwFilter<P>: P & { id: number }

Type parameters

ResourceIdDef: number | [resourceId: number, layerId: string]
ResourceNgwLayerOptions<T, P>: NgwLayerOptions<T, P>
deprecated

use NgwLayerOptions instead

Type parameters

TileNoData: 200 | 404 | 204
VectorResourceAdapter<M, L, O, F>: ResourceAdapter<M, L, O, F> & VectorLayerAdapter<M, L, O, F>

Type parameters

Variables

FEATURE_REQUEST_PARAMS: FeatureRequestParams = ...
WEBMAP_BASELAYER_ID_PREFIX: "webmap-baselayer" = 'webmap-baselayer'
vectorLayerGeomToPaintTypeAlias: Record<GeometryType, VectorAdapterLayerType> = ...

Functions

  • createOnFirstShowAdapter(__namedParameters: CreateOnFirstShowAdapterOptions): Promise<Type<FirstShowAdapter>>
  • createOnFirstShowNgwAdapter(__namedParameters: CreateOnFirstShowAdapterOptions): Promise<Type<MainLayerAdapter>>
  • createPopupContent(feature: Feature<Geometry, GeoJsonProperties>, item?: ResourceItem): HTMLElement | string
  • deleteFeatureAttachment(options: GetNgwItemOptions & { attachmentId: number }): Promise<void>
  • getMapWidthForLanInMeters(lat: number): number
  • getZoomFromScale(scale: number): number
  • pixelsInMeterWidth(): number
  • prepareFieldsToNgw<T>(item: T, resourceFields: Pick<FeatureProperties, "keyname" | "datatype">[]): Record<keyof T, any>
  • prepareNgwFieldsToPropertiesFilter(fields: Record<string, any>): Record<string, any>
  • setScaleRatio(scale: number, lat?: number): number
  • updateImageParams(params: Record<string, any>, resourceId: number | number[]): Record<string, any>

Generated using TypeDoc