@nextgis/ngw-leaflet 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-leaflet; version: 1.15.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 1.15.1; author: NextGIS */
2
2
  import 'leaflet/dist/leaflet.css';
3
3
  import { Icon } from 'leaflet';
4
4
  import { NgwMap } from '@nextgis/ngw-map';
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 1.15.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 1.15.1; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -18720,6 +18720,9 @@ var NgwLeaflet = (function () {
18720
18720
  if (this.options.route) {
18721
18721
  this.routeStr = this.options.route;
18722
18722
  }
18723
+ if (this.options.requestTransform) {
18724
+ this.requestTransform = this.options.requestTransform;
18725
+ }
18723
18726
  this.resources = new ResourcesControl(this);
18724
18727
  addConnector(this);
18725
18728
  }
@@ -18727,6 +18730,9 @@ var NgwLeaflet = (function () {
18727
18730
  NgwConnector.create = function (options) {
18728
18731
  return new this(options);
18729
18732
  };
18733
+ NgwConnector.prototype.setRequestTransform = function (requestTransform) {
18734
+ this.requestTransform = requestTransform;
18735
+ };
18730
18736
  /**
18731
18737
  * Fast way to specify the connection address to NextGIS Web.
18732
18738
  * The current connection will be severed.
@@ -18986,9 +18992,8 @@ var NgwLeaflet = (function () {
18986
18992
  if (params) {
18987
18993
  url = template(url, params);
18988
18994
  }
18989
- // remove double slash
18990
- url = fixUrlStr(url);
18991
- return this._loadData(encodeURI(url), options);
18995
+ url = encodeURI(fixUrlStr(url));
18996
+ return this._loadData(url, options);
18992
18997
  }
18993
18998
  else {
18994
18999
  throw new Error('Empty `url` not allowed');
@@ -19081,6 +19086,11 @@ var NgwLeaflet = (function () {
19081
19086
  // options.withCredentials = true;
19082
19087
  options.headers = __assign(__assign({}, _this.getAuthorizationHeaders()), options.headers);
19083
19088
  }
19089
+ if (_this.requestTransform) {
19090
+ var _a = _this.requestTransform(url, options), transUrl = _a[0], transOptions = _a[1];
19091
+ url = transUrl;
19092
+ options = transOptions;
19093
+ }
19084
19094
  loadData(url, resolve, options, reject, onCancel);
19085
19095
  })
19086
19096
  .then(function (resp) {
@@ -19105,6 +19115,7 @@ var NgwLeaflet = (function () {
19105
19115
  typeof options.signal.addEventListener === 'function') {
19106
19116
  options.signal.addEventListener('abort', function () {
19107
19117
  request.cancel();
19118
+ _this._cleanActiveRequests(request);
19108
19119
  });
19109
19120
  }
19110
19121
  this.activeRequests.push(request);