2.2.3 • Published 15 days ago

@nextgis/ngw-connector v2.2.3

Weekly downloads
23
License
MIT
Repository
github
Last release
15 days ago

NgwConnector

size version

A lightweight HTTP client optimized for use with NextGIS Web API.

Make sure CORS is registered in the NextGIS Web settings 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.

<script src="../lib/ngw-connector.global.js"></script>

<script>
  var ngwConnector = new NgwConnector({
    baseUrl: 'https://demo.nextgis.com',
  });
</script>

CDN

unpkg

<script src="https://unpkg.com/@nextgis/ngw-connector"></script>

jsdelivr

<script src="https://cdn.jsdelivr.net/npm/@nextgis/ngw-connector"></script>

We recommend linking to a specific version number /ngw-connector@[version]

In Node.js

npm install @nextgis/ngw-connector

Usage

import NgwConnector from '@nextgis/ngw-connector';

const ngwConnector = new NgwConnector({
  baseUrl: 'https://demo.nextgis.com',
  // auth: {login, password}
});

ngwConnector.get('resource.item', null, { id: 485 }).then((data) => {
  console.log(data);
});

ngwConnector.post('resource.collection', { data: [RESOURCE JSON] });
ngwConnector.patch(
  'feature_layer.feature.collection',
  { data: [ITEMS JSON] },
  {
    id,
    srs: 4326,
    geom_format: 'geojson',
  }
);
ngwConnector.put('feature_layer.feature.item', { data: [ITEM JSON] }, { id, fid })
ngwConnector.delete('feature_layer.feature.item', null, { id, fid })

// 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

Check out the API Documentation

NGW API

NextGIS Web API Doc

ngwConnector.get(request_name, request_options, arguments);

request_options

request nameurlarguments
auth.current_user/api/component/auth/current_user
auth.group.collection/api/component/auth/group/
auth.group.create/auth/group/create
auth.group.delete/auth/group/{0}/deleteid
auth.group.edit/auth/group/{0}/editid
auth.group.item/api/component/auth/group/{0}id
auth.login_cookies/api/component/auth/login
auth.logout_cookies/api/component/auth/logout
auth.profile/api/component/auth/profile
auth.register/api/component/auth/register
auth.user.collection/api/component/auth/user/
auth.user.create/auth/user/create
auth.user.delete/auth/user/{0}/deleteid
auth.user.edit/auth/user/{0}/editid
auth.user.item/api/component/auth/user/{0}id
collector.resource.read/collector/resource/{0}/readid
collector.resource.users/collector/resource/{0}/usersid
collector.settings/api/component/collector/settings
collector.settings.users/collector/user
collector.user/collector/user/{0}user_id
feature_attachment.collection/api/resource/{0}/feature/{1}/attachment/id,fid
feature_attachment.download/api/resource/{0}/feature/{1}/attachment/{2}/downloadid,fid,aid
feature_attachment.image/api/resource/{0}/feature/{1}/attachment/{2}/imageid,fid,aid
feature_attachment.item/api/resource/{0}/feature/{1}/attachment/{2}id,fid,aid
feature_layer.feature.browse/resource/{0}/feature/id
feature_layer.feature.collection/api/resource/{0}/feature/id
feature_layer.feature.count/api/resource/{0}/feature_countid
feature_layer.feature.item/api/resource/{0}/feature/{1}id,fid
feature_layer.feature.item_extent/api/resource/{0}/feature/{1}/extentid,fid
feature_layer.feature.show/resource/{0}/feature/{1}id,feature_id
feature_layer.feature.update/resource/{0}/feature/{1}/updateid,feature_id
feature_layer.field/resource/{0}/field/id
feature_layer.geojson/api/resource/{0}/geojsonid
feature_layer.identify/api/feature_layer/identify
feature_layer.mvt/api/component/feature_layer/mvt
feature_layer.store/api/resource/{0}/store/id
feature_layer.store.item/resource/{0}/store/{1}id,feature_id
file_upload.collection/api/component/file_upload/
file_upload.item/api/component/file_upload/{0}id
file_upload.upload/api/component/file_upload/upload
formbuilder.formbuilder_form_ngfp/api/resource/{0}/ngfpid
layer.extent/api/resource/{0}/extentid
postgis.connection.inspect/api/resource/{0}/inspect/id
postgis.connection.inspect.table/api/resource/{0}/inspect/{1}/id,table_name
pyramid.company_logo/api/component/pyramid/company_logo
pyramid.control_panel/control-panel
pyramid.control_panel.sysinfo/control-panel/sysinfo
pyramid.cors/api/component/pyramid/cors
pyramid.custom_css/api/component/pyramid/custom_css
pyramid.estimate_storage/api/component/pyramid/estimate_storage
pyramid.healthcheck/api/component/pyramid/healthcheck
pyramid.home_path/api/component/pyramid/home_path
pyramid.kind_of_data/api/component/pyramid/kind_of_data
pyramid.locdata/api/component/pyramid/locdata/{0}/{1}component,locale
pyramid.logo/api/component/pyramid/logo
pyramid.pkg_version/api/component/pyramid/pkg_version
pyramid.route/api/component/pyramid/route
pyramid.settings/api/component/pyramid/settings
pyramid.statistics/api/component/pyramid/statistics
pyramid.storage/api/component/pyramid/storage
pyramid.system_name/api/component/pyramid/system_name
qgis.style_qml/api/resource/{0}/qmlid
render.image/api/component/render/image
render.legend/api/resource/{0}/legendid
render.tile/api/component/render/tile
render.tile_cache.seed_status/api/resource/{0}/tile_cache/seed_statusid
resource.collection/api/resource/
resource.create/resource/{0}/createid
resource.delete/resource/{0}/deleteid
resource.export/api/resource/{0}/exportid
resource.file_download/api/resource/{0}/file/{1}id,name
resource.item/api/resource/{0}id
resource.json/resource/{0}/jsonid
resource.permission/api/resource/{0}/permissionid
resource.permission.explain/api/resource/{0}/permission/explainid
resource.preview/api/resource/{0}/preview.pngid
resource.quota/api/resource/quota
resource.resource_export/api/component/resource/resource_export
resource.schema/resource/schema
resource.search/api/resource/search/
resource.show/resource/{0}id
resource.tree/resource/{0}/treeid
resource.update/resource/{0}/updateid
resource.volume/api/resource/{0}/volumeid
resource.widget/resource/widget
spatial_ref_sys.collection/api/component/spatial_ref_sys/
spatial_ref_sys.convert/api/component/spatial_ref_sys/convert
spatial_ref_sys.geom_area/api/component/spatial_ref_sys/{0}/geom_areaid
spatial_ref_sys.geom_length/api/component/spatial_ref_sys/{0}/geom_lengthid
spatial_ref_sys.geom_transform/api/component/spatial_ref_sys/{0}/geom_transformid
spatial_ref_sys.get/api/component/spatial_ref_sys/{0}id
srs.create/srs/create
srs.delete/srs/{0}/deleteid
srs.edit/srs/{0}/editid
tmsclient.connection.layers/api/component/tmsclient/{0}/layers/id
tracker.export_to_gpx/tracker/gpx
tracker.get.stops/tracker/stops
tracker.get_amd_static_url/tracker/amd/static/url/
tracker.get_device_types/tracker/device_types
tracker.get_full_tracks/tracker/tracks/full
tracker.get_last_activity_tracker/tracker/activity/last
tracker.get_short_tracks/tracker/tracks/short
tracker.get_tracker_last_points/tracker/last/points
tracker.get_tracker_lines/tracker/lines
tracker.get_tracker_points/tracker/points
tracker.get_trackers/tracker/trackers/tree
tracker.receive_packet/tracker/{0}/receiveunique_id
tracker.reports/tracker/reports/
tracker.reports.build/tracker/report/build/
tracker.settings/api/component/tracker/settings
vector_layer.dataset/api/component/vector_layer/dataset
webmap.annotation.collection/api/resource/{0}/annotation/id
webmap.annotation.item/api/resource/{0}/annotation/{1}id,annotation_id
webmap.display/resource/{0}/displayid
webmap.display.tiny/resource/{0}/display/tinyid
webmap.settings/api/component/webmap/settings
wfsserver.wfs/api/resource/{0}/wfsid
wmsserver.wms/api/resource/{0}/wmsid

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 to discuss options!

http://nextgis.com

2.2.3

15 days ago

2.1.0

2 months ago

2.0.2

2 months ago

2.0.0

2 months ago

2.0.0-alpha.2

2 months ago

2.0.0-alpha.1

2 months ago

2.0.0-alpha.0

3 months ago

1.18.4

8 months ago

1.18.3

8 months ago

1.19.0

6 months ago

1.17.0

8 months ago

1.18.21

6 months ago

1.18.12

7 months ago

1.16.8

1 year ago

1.16.7

1 year ago

1.16.6

1 year ago

1.16.5

1 year ago

1.16.2

2 years ago

1.16.1

2 years ago

1.16.0

2 years ago

1.14.0

2 years ago

1.15.0

2 years ago

1.15.1

2 years ago

1.13.2

2 years ago

1.13.5

2 years ago

1.12.1

2 years ago

1.12.0

2 years ago

1.11.10

2 years ago

1.11.3

2 years ago

1.11.8

2 years ago

1.11.2

2 years ago

1.9.4

3 years ago

1.11.0

2 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-beta.10

3 years ago

1.0.0-beta.7

3 years ago

1.0.0-beta.8

3 years ago

1.0.0-beta.9

3 years ago

1.0.0-beta.6

3 years ago

1.0.0-beta.5

3 years ago

1.0.0-beta.4

3 years ago

1.0.0-beta.3

3 years ago

1.0.0-beta.2

3 years ago

1.0.0-beta.1

4 years ago

1.0.0-beta.0

4 years ago

1.0.0-alpha.11

4 years ago

1.0.0-alpha.10

4 years ago

1.0.0-alpha.9

4 years ago

1.0.0-alpha.8

4 years ago

1.0.0-alpha.7

4 years ago

1.0.0-alpha.6

4 years ago

1.0.0-alpha.5

4 years ago

1.0.0-alpha.4

4 years ago

1.0.0-alpha.3

4 years ago

1.0.0-alpha.2

4 years ago

1.0.0-alpha.1

4 years ago

1.0.0-alpha.0

4 years ago

0.32.0

4 years ago

0.31.0

4 years ago

0.30.1

4 years ago

0.30.0

4 years ago

0.29.11

4 years ago

0.29.6

4 years ago

0.29.5

4 years ago

0.29.4

4 years ago

0.29.3

4 years ago

0.29.2

4 years ago

0.29.1

4 years ago

0.29.0

4 years ago

0.28.0

4 years ago

0.27.1

4 years ago

0.27.0

4 years ago

0.25.8

4 years ago

0.26.0

4 years ago

0.25.7

4 years ago

0.25.6

4 years ago

0.25.5

4 years ago

0.25.4

4 years ago

0.25.3

4 years ago

0.25.1

4 years ago

0.25.0

4 years ago

0.24.1

4 years ago

0.24.0

4 years ago

0.22.0

4 years ago

0.21.0

4 years ago

0.20.2

5 years ago

0.20.1

5 years ago

0.20.0

5 years ago

0.19.1

5 years ago

0.19.0

5 years ago

0.18.0

5 years ago

0.17.0

5 years ago

0.16.1

5 years ago

0.16.0

5 years ago

0.15.9

5 years ago

0.15.6

5 years ago

0.15.4

5 years ago

0.15.1

5 years ago

0.15.0

5 years ago

0.14.14

5 years ago

0.14.13

5 years ago

0.14.12

5 years ago

0.14.11

5 years ago

0.14.9

5 years ago

0.14.8

5 years ago

0.14.7

5 years ago

0.14.0

5 years ago

0.13.2

5 years ago

0.13.1

5 years ago

0.13.0

5 years ago

0.12.0

5 years ago

0.11.7

5 years ago

0.11.5

5 years ago

0.11.4

5 years ago

0.11.3

5 years ago

0.11.2

5 years ago

0.11.1

5 years ago

0.11.0

5 years ago

0.10.0

5 years ago

0.9.9

5 years ago

0.9.7

5 years ago

0.9.6

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

0.9.3

5 years ago

0.9.2

5 years ago

0.9.0

5 years ago

0.8.14

5 years ago

0.8.7

5 years ago

0.8.4

5 years ago

0.8.2

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.5

6 years ago

0.6.3

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.2

6 years ago

0.5.0

6 years ago

0.4.14

6 years ago

0.4.12

6 years ago

0.4.11

6 years ago

0.4.10

6 years ago

0.4.9

6 years ago

0.4.8

6 years ago

0.4.5

6 years ago

0.4.3

6 years ago

0.4.0

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago