@nextgis/geocoder 1.12.1 → 1.13.2
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.
- package/index.js +3 -3
- package/lib/geocoder.cjs.js +1 -1
- package/lib/geocoder.esm-browser.js +23 -21
- package/lib/geocoder.esm-browser.js.map +1 -1
- package/lib/geocoder.esm-browser.prod.js +1 -1
- package/lib/geocoder.esm-browser.prod.js.map +1 -1
- package/lib/geocoder.esm-bundler.js +1 -1
- package/lib/geocoder.global.js +23 -21
- package/lib/geocoder.global.js.map +1 -1
- package/lib/geocoder.global.prod.js +1 -1
- package/lib/geocoder.global.prod.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/geocoder; version: 1.
|
|
1
|
+
/** Bundle of @nextgis/geocoder; version: 1.13.2; 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';
|
package/lib/geocoder.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/geocoder; version: 1.
|
|
1
|
+
/** Bundle of @nextgis/geocoder; version: 1.13.2; author: NextGIS */
|
|
2
2
|
var Geocoder = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -1373,31 +1373,31 @@ var Geocoder = (function (exports) {
|
|
|
1373
1373
|
/**
|
|
1374
1374
|
* Thrown when...
|
|
1375
1375
|
*/
|
|
1376
|
-
var
|
|
1377
|
-
__extends(
|
|
1378
|
-
function
|
|
1376
|
+
var NetworkError = /** @class */ (function (_super) {
|
|
1377
|
+
__extends(NetworkError, _super);
|
|
1378
|
+
function NetworkError(url) {
|
|
1379
1379
|
var _this = _super.call(this) || this;
|
|
1380
|
-
_this.name = '
|
|
1381
|
-
Object.
|
|
1382
|
-
|
|
1380
|
+
_this.name = 'NetworkError';
|
|
1381
|
+
Object.setPrototypeOf(_this, NetworkError.prototype);
|
|
1382
|
+
_this.message = "Unable to request ".concat(url, ".\n Possibly invalid NGW URL entered or CORS not configured to get request from ").concat(location.origin); // /control-panel/cors
|
|
1383
1383
|
return _this;
|
|
1384
1384
|
}
|
|
1385
|
-
return
|
|
1385
|
+
return NetworkError;
|
|
1386
1386
|
}(Error));
|
|
1387
1387
|
|
|
1388
1388
|
/**
|
|
1389
1389
|
* Thrown when...
|
|
1390
1390
|
*/
|
|
1391
|
-
var
|
|
1392
|
-
__extends(
|
|
1393
|
-
function
|
|
1391
|
+
var NgwError = /** @class */ (function (_super) {
|
|
1392
|
+
__extends(NgwError, _super);
|
|
1393
|
+
function NgwError(er) {
|
|
1394
1394
|
var _this = _super.call(this) || this;
|
|
1395
|
-
_this.name = '
|
|
1396
|
-
Object.
|
|
1397
|
-
|
|
1395
|
+
_this.name = 'NgwError';
|
|
1396
|
+
Object.assign(_this, er);
|
|
1397
|
+
Object.setPrototypeOf(_this, NgwError.prototype);
|
|
1398
1398
|
return _this;
|
|
1399
1399
|
}
|
|
1400
|
-
return
|
|
1400
|
+
return NgwError;
|
|
1401
1401
|
}(Error));
|
|
1402
1402
|
|
|
1403
1403
|
function isObject(val) {
|
|
@@ -1511,11 +1511,6 @@ var Geocoder = (function (exports) {
|
|
|
1511
1511
|
xhr.abort();
|
|
1512
1512
|
});
|
|
1513
1513
|
}
|
|
1514
|
-
if (options.signal) {
|
|
1515
|
-
options.signal.addEventListener('abort', function () {
|
|
1516
|
-
xhr.abort();
|
|
1517
|
-
});
|
|
1518
|
-
}
|
|
1519
1514
|
xhr.send(data);
|
|
1520
1515
|
};
|
|
1521
1516
|
}
|
|
@@ -2317,7 +2312,7 @@ var Geocoder = (function (exports) {
|
|
|
2317
2312
|
NgwConnector.prototype._loadData = function (url, options) {
|
|
2318
2313
|
var _this = this;
|
|
2319
2314
|
options.responseType = options.responseType || 'json';
|
|
2320
|
-
|
|
2315
|
+
var request = new CancelablePromise(function (resolve, reject, onCancel) {
|
|
2321
2316
|
if (_this.user) {
|
|
2322
2317
|
options = options || {};
|
|
2323
2318
|
// options.withCredentials = true;
|
|
@@ -2337,6 +2332,13 @@ var Geocoder = (function (exports) {
|
|
|
2337
2332
|
}
|
|
2338
2333
|
}
|
|
2339
2334
|
});
|
|
2335
|
+
if (options.signal &&
|
|
2336
|
+
typeof options.signal.addEventListener === 'function') {
|
|
2337
|
+
options.signal.addEventListener('abort', function () {
|
|
2338
|
+
request.cancel();
|
|
2339
|
+
});
|
|
2340
|
+
}
|
|
2341
|
+
return request;
|
|
2340
2342
|
};
|
|
2341
2343
|
NgwConnector.prototype._handleHttpError = function (er) {
|
|
2342
2344
|
if (er) {
|