@nextgis/geocoder 1.19.2 → 1.19.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/geocoder; version: 1.19.2; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 1.19.6; author: NextGIS */
2
2
  import CancelablePromise from '@nextgis/cancelable-promise';
3
3
  import { objectAssign, fixUrlStr } from '@nextgis/utils';
4
4
  import NgwConnector from '@nextgis/ngw-connector';
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/geocoder; version: 1.19.2; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 1.19.6; author: NextGIS */
2
2
  var Geocoder = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1590,6 +1590,62 @@ var Geocoder = (function (exports) {
1590
1590
  */
1591
1591
  var Cache = Cache$1;
1592
1592
 
1593
+ var pkg = {
1594
+ name: "@nextgis/ngw-connector",
1595
+ version: "1.19.6",
1596
+ _priority: 12,
1597
+ description: "A lightweight HTTP client optimized for use with NextGIS Web API",
1598
+ main: "index.js",
1599
+ module: "lib/ngw-connector.esm-bundler.js",
1600
+ unpkg: "lib/ngw-connector.global.prod.js",
1601
+ jsdelivr: "lib/ngw-connector.global.prod.js",
1602
+ types: "lib/index.d.ts",
1603
+ dependencies: {
1604
+ "@nextgis/cache": "^1.19.0",
1605
+ "@nextgis/cancelable-promise": "^1.19.0",
1606
+ "@nextgis/utils": "^1.19.0",
1607
+ "@types/events": "^3.0.0",
1608
+ events: "^3.3.0",
1609
+ "form-data": "^4.0.0"
1610
+ },
1611
+ devDependencies: {
1612
+ "@nextgis/build-tools": "^1.19.0"
1613
+ },
1614
+ scripts: {
1615
+ clean: "rimraf ./lib",
1616
+ dev: "node ../build-tools/lib/build.js",
1617
+ prod: "npm run dev -- --release",
1618
+ lint: "eslint ./src/**/*.ts --fix --c ../../.eslintrc",
1619
+ watch: "npm run dev -- --watch",
1620
+ "gen:types": "node ./scripts/generator"
1621
+ },
1622
+ buildOptions: {
1623
+ name: "NgwConnector",
1624
+ formats: [
1625
+ "esm-bundler",
1626
+ "esm-browser",
1627
+ "cjs",
1628
+ "global"
1629
+ ]
1630
+ },
1631
+ keywords: [
1632
+ "NextGIS",
1633
+ "MAP"
1634
+ ],
1635
+ author: "NextGIS",
1636
+ files: [
1637
+ "index.js",
1638
+ "lib"
1639
+ ],
1640
+ license: "MIT",
1641
+ homepage: "https://github.com/nextgis/nextgis_frontend/tree/master/packages/ngw-connector#readme",
1642
+ repository: {
1643
+ type: "git",
1644
+ url: "git://github.com/nextgis/nextgis_frontend.git"
1645
+ },
1646
+ gitHead: "edc68033f914f6c95c4125b9738bba6d36e990b4"
1647
+ };
1648
+
1593
1649
  /**
1594
1650
  * Thrown when...
1595
1651
  */
@@ -2180,6 +2236,7 @@ var Geocoder = (function (exports) {
2180
2236
  this.options = options;
2181
2237
  this.id = ID++;
2182
2238
  this.emitter = new events.exports.EventEmitter();
2239
+ this.client = "NextGIS-NGW-Connector/".concat(pkg.version);
2183
2240
  this.routeStr = '/api/component/pyramid/route';
2184
2241
  this.activeRequests = [];
2185
2242
  var exist = findConnector(options);
@@ -2233,7 +2290,8 @@ var Geocoder = (function (exports) {
2233
2290
  var makeConnect = function () {
2234
2291
  return new CancelablePromise(function (resolve, reject) {
2235
2292
  var makeQuery = function () {
2236
- return _this.makeQuery(_this.routeStr, {}, {})
2293
+ var routeUrl = "".concat(_this.routeStr, "?client=").concat(_this.client);
2294
+ return _this.makeQuery(routeUrl.toString(), {}, {})
2237
2295
  .then(function (route) {
2238
2296
  resolve(route);
2239
2297
  })
@@ -2719,7 +2777,7 @@ var Geocoder = (function (exports) {
2719
2777
  if (extensionsStr !== '*') {
2720
2778
  params.extensions = extensionsStr;
2721
2779
  }
2722
- if (fields !== undefined) {
2780
+ if (fields !== undefined && fields !== null) {
2723
2781
  params.fields = Array.isArray(fields) ? fields.join(',') : '';
2724
2782
  }
2725
2783
  if (geom !== undefined) {