@nextgis/ngw-map 1.15.0 → 1.15.1

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/ngw-map; version: 1.15.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 1.15.1; author: NextGIS */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-map; version: 1.15.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 1.15.1; author: NextGIS */
2
2
  /******************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -4644,6 +4644,9 @@ var NgwConnector$1 = /** @class */ (function () {
4644
4644
  if (this.options.route) {
4645
4645
  this.routeStr = this.options.route;
4646
4646
  }
4647
+ if (this.options.requestTransform) {
4648
+ this.requestTransform = this.options.requestTransform;
4649
+ }
4647
4650
  this.resources = new ResourcesControl(this);
4648
4651
  addConnector(this);
4649
4652
  }
@@ -4651,6 +4654,9 @@ var NgwConnector$1 = /** @class */ (function () {
4651
4654
  NgwConnector.create = function (options) {
4652
4655
  return new this(options);
4653
4656
  };
4657
+ NgwConnector.prototype.setRequestTransform = function (requestTransform) {
4658
+ this.requestTransform = requestTransform;
4659
+ };
4654
4660
  /**
4655
4661
  * Fast way to specify the connection address to NextGIS Web.
4656
4662
  * The current connection will be severed.
@@ -4910,9 +4916,8 @@ var NgwConnector$1 = /** @class */ (function () {
4910
4916
  if (params) {
4911
4917
  url = template(url, params);
4912
4918
  }
4913
- // remove double slash
4914
- url = fixUrlStr(url);
4915
- return this._loadData(encodeURI(url), options);
4919
+ url = encodeURI(fixUrlStr(url));
4920
+ return this._loadData(url, options);
4916
4921
  }
4917
4922
  else {
4918
4923
  throw new Error('Empty `url` not allowed');
@@ -5005,6 +5010,11 @@ var NgwConnector$1 = /** @class */ (function () {
5005
5010
  // options.withCredentials = true;
5006
5011
  options.headers = __assign(__assign({}, _this.getAuthorizationHeaders()), options.headers);
5007
5012
  }
5013
+ if (_this.requestTransform) {
5014
+ var _a = _this.requestTransform(url, options), transUrl = _a[0], transOptions = _a[1];
5015
+ url = transUrl;
5016
+ options = transOptions;
5017
+ }
5008
5018
  loadData(url, resolve, options, reject, onCancel);
5009
5019
  })
5010
5020
  .then(function (resp) {
@@ -5029,6 +5039,7 @@ var NgwConnector$1 = /** @class */ (function () {
5029
5039
  typeof options.signal.addEventListener === 'function') {
5030
5040
  options.signal.addEventListener('abort', function () {
5031
5041
  request.cancel();
5042
+ _this._cleanActiveRequests(request);
5032
5043
  });
5033
5044
  }
5034
5045
  this.activeRequests.push(request);