@elastic/ems-client 8.6.2 → 8.7.0
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/.backportrc.json +2 -4
- package/.buildkite/pipeline.yml +1 -1
- package/.github/workflows/backport.yml +1 -1
- package/.github/workflows/publish.yml +26 -0
- package/.nvmrc +1 -1
- package/CHANGELOG.md +16 -1
- package/CONTRIBUTING.md +4 -6
- package/eslint.config.mjs +2 -4
- package/package.json +35 -31
- package/renovate.json +10 -4
- package/src/ems_client.ts +3 -3
- package/target/node/ems_client.js +6 -4
- package/target/node/file_layer.js +1 -2
- package/target/web/ems_client.js +138 -168
- package/target/web/file_layer.js +23 -25
- package/target/web/tms_service.js +262 -275
- package/test/__snapshots__/ems_client.test.ts.snap +1 -1
- package/tsconfig.json +2 -2
- package/target/origin.d.ts +0 -4
package/target/web/ems_client.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function
|
|
2
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
3
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
3
4
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
4
5
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
5
6
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -23,7 +24,7 @@ import semverMajor from 'semver/functions/major';
|
|
|
23
24
|
import semverMinor from 'semver/functions/minor';
|
|
24
25
|
import { format as formatUrl, parse as parseUrl } from 'url';
|
|
25
26
|
import { toAbsoluteUrl } from './utils';
|
|
26
|
-
import LRUCache from 'lru-cache';
|
|
27
|
+
import { LRUCache } from 'lru-cache';
|
|
27
28
|
var REST_API_REGEX = /\d{4}-\d{2}-\d{2}/;
|
|
28
29
|
export var LATEST_API_URL_PATH = 'latest';
|
|
29
30
|
/**
|
|
@@ -164,53 +165,54 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
164
165
|
}, {
|
|
165
166
|
key: "getManifest",
|
|
166
167
|
value: (function () {
|
|
167
|
-
var _getManifest = _asyncToGenerator(/*#__PURE__*/
|
|
168
|
-
var url, response;
|
|
169
|
-
return
|
|
170
|
-
while (1) switch (_context.
|
|
168
|
+
var _getManifest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(endpointUrl) {
|
|
169
|
+
var url, response, _t;
|
|
170
|
+
return _regenerator().w(function (_context) {
|
|
171
|
+
while (1) switch (_context.p = _context.n) {
|
|
171
172
|
case 0:
|
|
172
|
-
_context.
|
|
173
|
+
_context.p = 0;
|
|
173
174
|
url = extendUrl(endpointUrl, {
|
|
174
175
|
query: this._queryParams
|
|
175
176
|
});
|
|
176
|
-
_context.
|
|
177
|
+
_context.n = 1;
|
|
177
178
|
return this._fetchWithTimeout(url);
|
|
178
|
-
case
|
|
179
|
-
response = _context.
|
|
179
|
+
case 1:
|
|
180
|
+
response = _context.v;
|
|
180
181
|
if (response.ok) {
|
|
181
|
-
_context.
|
|
182
|
+
_context.n = 2;
|
|
182
183
|
break;
|
|
183
184
|
}
|
|
184
185
|
throw new Error(response.statusText);
|
|
185
|
-
case
|
|
186
|
+
case 2:
|
|
186
187
|
if (!response) {
|
|
187
|
-
_context.
|
|
188
|
+
_context.n = 4;
|
|
188
189
|
break;
|
|
189
190
|
}
|
|
190
|
-
_context.
|
|
191
|
+
_context.n = 3;
|
|
191
192
|
return response.json();
|
|
192
|
-
case
|
|
193
|
-
return _context.
|
|
194
|
-
case
|
|
193
|
+
case 3:
|
|
194
|
+
return _context.a(2, _context.v);
|
|
195
|
+
case 4:
|
|
195
196
|
throw new Error('Response not found');
|
|
196
|
-
case
|
|
197
|
-
_context.
|
|
197
|
+
case 5:
|
|
198
|
+
_context.n = 8;
|
|
198
199
|
break;
|
|
199
|
-
case
|
|
200
|
-
_context.
|
|
201
|
-
|
|
202
|
-
if (!(
|
|
203
|
-
_context.
|
|
200
|
+
case 6:
|
|
201
|
+
_context.p = 6;
|
|
202
|
+
_t = _context.v;
|
|
203
|
+
if (!(_t instanceof Error)) {
|
|
204
|
+
_context.n = 7;
|
|
204
205
|
break;
|
|
205
206
|
}
|
|
206
|
-
throw
|
|
207
|
-
case
|
|
208
|
-
throw new Error('Unknown error'
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
throw _t;
|
|
208
|
+
case 7:
|
|
209
|
+
throw new Error('Unknown error', {
|
|
210
|
+
cause: _t
|
|
211
|
+
});
|
|
212
|
+
case 8:
|
|
213
|
+
return _context.a(2);
|
|
212
214
|
}
|
|
213
|
-
}, _callee, this, [[0,
|
|
215
|
+
}, _callee, this, [[0, 6]]);
|
|
214
216
|
}));
|
|
215
217
|
function getManifest(_x) {
|
|
216
218
|
return _getManifest.apply(this, arguments);
|
|
@@ -240,17 +242,14 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
240
242
|
}, {
|
|
241
243
|
key: "getMainManifest",
|
|
242
244
|
value: function () {
|
|
243
|
-
var _getMainManifest = _asyncToGenerator(/*#__PURE__*/
|
|
244
|
-
return
|
|
245
|
-
while (1) switch (_context2.
|
|
245
|
+
var _getMainManifest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
246
|
+
return _regenerator().w(function (_context2) {
|
|
247
|
+
while (1) switch (_context2.n) {
|
|
246
248
|
case 0:
|
|
247
|
-
_context2.
|
|
249
|
+
_context2.n = 1;
|
|
248
250
|
return this._getMainCatalog();
|
|
249
|
-
case
|
|
250
|
-
return _context2.
|
|
251
|
-
case 3:
|
|
252
|
-
case "end":
|
|
253
|
-
return _context2.stop();
|
|
251
|
+
case 1:
|
|
252
|
+
return _context2.a(2, _context2.v);
|
|
254
253
|
}
|
|
255
254
|
}, _callee2, this);
|
|
256
255
|
}));
|
|
@@ -262,17 +261,14 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
262
261
|
}, {
|
|
263
262
|
key: "getDefaultFileManifest",
|
|
264
263
|
value: function () {
|
|
265
|
-
var _getDefaultFileManifest = _asyncToGenerator(/*#__PURE__*/
|
|
266
|
-
return
|
|
267
|
-
while (1) switch (_context3.
|
|
264
|
+
var _getDefaultFileManifest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
265
|
+
return _regenerator().w(function (_context3) {
|
|
266
|
+
while (1) switch (_context3.n) {
|
|
268
267
|
case 0:
|
|
269
|
-
_context3.
|
|
268
|
+
_context3.n = 1;
|
|
270
269
|
return this._getDefaultFileCatalog();
|
|
271
|
-
case
|
|
272
|
-
return _context3.
|
|
273
|
-
case 3:
|
|
274
|
-
case "end":
|
|
275
|
-
return _context3.stop();
|
|
270
|
+
case 1:
|
|
271
|
+
return _context3.a(2, _context3.v);
|
|
276
272
|
}
|
|
277
273
|
}, _callee3, this);
|
|
278
274
|
}));
|
|
@@ -284,17 +280,14 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
284
280
|
}, {
|
|
285
281
|
key: "getDefaultTMSManifest",
|
|
286
282
|
value: function () {
|
|
287
|
-
var _getDefaultTMSManifest = _asyncToGenerator(/*#__PURE__*/
|
|
288
|
-
return
|
|
289
|
-
while (1) switch (_context4.
|
|
283
|
+
var _getDefaultTMSManifest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
284
|
+
return _regenerator().w(function (_context4) {
|
|
285
|
+
while (1) switch (_context4.n) {
|
|
290
286
|
case 0:
|
|
291
|
-
_context4.
|
|
287
|
+
_context4.n = 1;
|
|
292
288
|
return this._getDefaultTMSCatalog();
|
|
293
|
-
case
|
|
294
|
-
return _context4.
|
|
295
|
-
case 3:
|
|
296
|
-
case "end":
|
|
297
|
-
return _context4.stop();
|
|
289
|
+
case 1:
|
|
290
|
+
return _context4.a(2, _context4.v);
|
|
298
291
|
}
|
|
299
292
|
}, _callee4, this);
|
|
300
293
|
}));
|
|
@@ -306,17 +299,14 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
306
299
|
}, {
|
|
307
300
|
key: "getFileLayers",
|
|
308
301
|
value: function () {
|
|
309
|
-
var _getFileLayers = _asyncToGenerator(/*#__PURE__*/
|
|
310
|
-
return
|
|
311
|
-
while (1) switch (_context5.
|
|
302
|
+
var _getFileLayers = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
303
|
+
return _regenerator().w(function (_context5) {
|
|
304
|
+
while (1) switch (_context5.n) {
|
|
312
305
|
case 0:
|
|
313
|
-
_context5.
|
|
306
|
+
_context5.n = 1;
|
|
314
307
|
return this._loadFileLayers();
|
|
315
|
-
case
|
|
316
|
-
return _context5.
|
|
317
|
-
case 3:
|
|
318
|
-
case "end":
|
|
319
|
-
return _context5.stop();
|
|
308
|
+
case 1:
|
|
309
|
+
return _context5.a(2, _context5.v);
|
|
320
310
|
}
|
|
321
311
|
}, _callee5, this);
|
|
322
312
|
}));
|
|
@@ -328,17 +318,14 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
328
318
|
}, {
|
|
329
319
|
key: "getTMSServices",
|
|
330
320
|
value: function () {
|
|
331
|
-
var _getTMSServices = _asyncToGenerator(/*#__PURE__*/
|
|
332
|
-
return
|
|
333
|
-
while (1) switch (_context6.
|
|
321
|
+
var _getTMSServices = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
322
|
+
return _regenerator().w(function (_context6) {
|
|
323
|
+
while (1) switch (_context6.n) {
|
|
334
324
|
case 0:
|
|
335
|
-
_context6.
|
|
325
|
+
_context6.n = 1;
|
|
336
326
|
return this._loadTMSServices();
|
|
337
|
-
case
|
|
338
|
-
return _context6.
|
|
339
|
-
case 3:
|
|
340
|
-
case "end":
|
|
341
|
-
return _context6.stop();
|
|
327
|
+
case 1:
|
|
328
|
+
return _context6.a(2, _context6.v);
|
|
342
329
|
}
|
|
343
330
|
}, _callee6, this);
|
|
344
331
|
}));
|
|
@@ -393,33 +380,32 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
393
380
|
}, {
|
|
394
381
|
key: "findFileLayerById",
|
|
395
382
|
value: function () {
|
|
396
|
-
var _findFileLayerById = _asyncToGenerator(/*#__PURE__*/
|
|
383
|
+
var _findFileLayerById = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(id) {
|
|
397
384
|
var fileLayers, i;
|
|
398
|
-
return
|
|
399
|
-
while (1) switch (_context7.
|
|
385
|
+
return _regenerator().w(function (_context7) {
|
|
386
|
+
while (1) switch (_context7.n) {
|
|
400
387
|
case 0:
|
|
401
|
-
_context7.
|
|
388
|
+
_context7.n = 1;
|
|
402
389
|
return this.getFileLayers();
|
|
403
|
-
case
|
|
404
|
-
fileLayers = _context7.
|
|
390
|
+
case 1:
|
|
391
|
+
fileLayers = _context7.v;
|
|
405
392
|
i = 0;
|
|
406
|
-
case
|
|
393
|
+
case 2:
|
|
407
394
|
if (!(i < fileLayers.length)) {
|
|
408
|
-
_context7.
|
|
395
|
+
_context7.n = 4;
|
|
409
396
|
break;
|
|
410
397
|
}
|
|
411
398
|
if (!fileLayers[i].hasId(id)) {
|
|
412
|
-
_context7.
|
|
399
|
+
_context7.n = 3;
|
|
413
400
|
break;
|
|
414
401
|
}
|
|
415
|
-
return _context7.
|
|
416
|
-
case
|
|
402
|
+
return _context7.a(2, fileLayers[i]);
|
|
403
|
+
case 3:
|
|
417
404
|
i++;
|
|
418
|
-
_context7.
|
|
405
|
+
_context7.n = 2;
|
|
419
406
|
break;
|
|
420
|
-
case
|
|
421
|
-
|
|
422
|
-
return _context7.stop();
|
|
407
|
+
case 4:
|
|
408
|
+
return _context7.a(2);
|
|
423
409
|
}
|
|
424
410
|
}, _callee7, this);
|
|
425
411
|
}));
|
|
@@ -431,33 +417,32 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
431
417
|
}, {
|
|
432
418
|
key: "findTMSServiceById",
|
|
433
419
|
value: function () {
|
|
434
|
-
var _findTMSServiceById = _asyncToGenerator(/*#__PURE__*/
|
|
420
|
+
var _findTMSServiceById = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(id) {
|
|
435
421
|
var tmsServices, i;
|
|
436
|
-
return
|
|
437
|
-
while (1) switch (_context8.
|
|
422
|
+
return _regenerator().w(function (_context8) {
|
|
423
|
+
while (1) switch (_context8.n) {
|
|
438
424
|
case 0:
|
|
439
|
-
_context8.
|
|
425
|
+
_context8.n = 1;
|
|
440
426
|
return this.getTMSServices();
|
|
441
|
-
case
|
|
442
|
-
tmsServices = _context8.
|
|
427
|
+
case 1:
|
|
428
|
+
tmsServices = _context8.v;
|
|
443
429
|
i = 0;
|
|
444
|
-
case
|
|
430
|
+
case 2:
|
|
445
431
|
if (!(i < tmsServices.length)) {
|
|
446
|
-
_context8.
|
|
432
|
+
_context8.n = 4;
|
|
447
433
|
break;
|
|
448
434
|
}
|
|
449
435
|
if (!tmsServices[i].hasId(id)) {
|
|
450
|
-
_context8.
|
|
436
|
+
_context8.n = 3;
|
|
451
437
|
break;
|
|
452
438
|
}
|
|
453
|
-
return _context8.
|
|
454
|
-
case
|
|
439
|
+
return _context8.a(2, tmsServices[i]);
|
|
440
|
+
case 3:
|
|
455
441
|
i++;
|
|
456
|
-
_context8.
|
|
442
|
+
_context8.n = 2;
|
|
457
443
|
break;
|
|
458
|
-
case
|
|
459
|
-
|
|
460
|
-
return _context8.stop();
|
|
444
|
+
case 4:
|
|
445
|
+
return _context8.a(2);
|
|
461
446
|
}
|
|
462
447
|
}, _callee8, this);
|
|
463
448
|
}));
|
|
@@ -500,11 +485,11 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
500
485
|
key: "_invalidateSettings",
|
|
501
486
|
value: function _invalidateSettings() {
|
|
502
487
|
var _this2 = this;
|
|
503
|
-
this._cache.
|
|
504
|
-
this._getMainCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
488
|
+
this._cache.clear();
|
|
489
|
+
this._getMainCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
505
490
|
var services, version, _version;
|
|
506
|
-
return
|
|
507
|
-
while (1) switch (_context9.
|
|
491
|
+
return _regenerator().w(function (_context9) {
|
|
492
|
+
while (1) switch (_context9.n) {
|
|
508
493
|
case 0:
|
|
509
494
|
services = [];
|
|
510
495
|
if (_this2._tileApiUrl) {
|
|
@@ -521,114 +506,99 @@ export var EMSClient = /*#__PURE__*/function () {
|
|
|
521
506
|
manifest: toAbsoluteUrl(_this2._fileApiUrl, "".concat(_version, "/manifest"))
|
|
522
507
|
});
|
|
523
508
|
}
|
|
524
|
-
return _context9.
|
|
509
|
+
return _context9.a(2, {
|
|
525
510
|
services: services
|
|
526
511
|
});
|
|
527
|
-
case 4:
|
|
528
|
-
case "end":
|
|
529
|
-
return _context9.stop();
|
|
530
512
|
}
|
|
531
513
|
}, _callee9);
|
|
532
514
|
})));
|
|
533
|
-
this._getDefaultTMSCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
515
|
+
this._getDefaultTMSCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
534
516
|
var catalogue, firstService, url;
|
|
535
|
-
return
|
|
536
|
-
while (1) switch (
|
|
517
|
+
return _regenerator().w(function (_context0) {
|
|
518
|
+
while (1) switch (_context0.n) {
|
|
537
519
|
case 0:
|
|
538
|
-
|
|
520
|
+
_context0.n = 1;
|
|
539
521
|
return _this2._getMainCatalog();
|
|
540
|
-
case
|
|
541
|
-
catalogue =
|
|
522
|
+
case 1:
|
|
523
|
+
catalogue = _context0.v;
|
|
542
524
|
firstService = catalogue.services.find(function (service) {
|
|
543
525
|
return service.type === 'tms';
|
|
544
526
|
});
|
|
545
527
|
if (firstService) {
|
|
546
|
-
|
|
528
|
+
_context0.n = 2;
|
|
547
529
|
break;
|
|
548
530
|
}
|
|
549
|
-
return
|
|
531
|
+
return _context0.a(2, {
|
|
550
532
|
services: []
|
|
551
533
|
});
|
|
552
|
-
case
|
|
534
|
+
case 2:
|
|
553
535
|
url = _this2._proxyPath + firstService.manifest;
|
|
554
|
-
|
|
536
|
+
_context0.n = 3;
|
|
555
537
|
return _this2.getManifest(url);
|
|
556
|
-
case
|
|
557
|
-
return
|
|
558
|
-
case 10:
|
|
559
|
-
case "end":
|
|
560
|
-
return _context10.stop();
|
|
538
|
+
case 3:
|
|
539
|
+
return _context0.a(2, _context0.v);
|
|
561
540
|
}
|
|
562
|
-
},
|
|
541
|
+
}, _callee0);
|
|
563
542
|
})));
|
|
564
|
-
this._getDefaultFileCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
543
|
+
this._getDefaultFileCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
565
544
|
var catalogue, firstService, url;
|
|
566
|
-
return
|
|
567
|
-
while (1) switch (
|
|
545
|
+
return _regenerator().w(function (_context1) {
|
|
546
|
+
while (1) switch (_context1.n) {
|
|
568
547
|
case 0:
|
|
569
|
-
|
|
548
|
+
_context1.n = 1;
|
|
570
549
|
return _this2._getMainCatalog();
|
|
571
|
-
case
|
|
572
|
-
catalogue =
|
|
550
|
+
case 1:
|
|
551
|
+
catalogue = _context1.v;
|
|
573
552
|
firstService = catalogue.services.find(function (service) {
|
|
574
553
|
return service.type === 'file';
|
|
575
554
|
});
|
|
576
555
|
if (firstService) {
|
|
577
|
-
|
|
556
|
+
_context1.n = 2;
|
|
578
557
|
break;
|
|
579
558
|
}
|
|
580
|
-
return
|
|
559
|
+
return _context1.a(2, {
|
|
581
560
|
layers: []
|
|
582
561
|
});
|
|
583
|
-
case
|
|
562
|
+
case 2:
|
|
584
563
|
url = _this2._proxyPath + firstService.manifest;
|
|
585
|
-
|
|
564
|
+
_context1.n = 3;
|
|
586
565
|
return _this2.getManifest(url);
|
|
587
|
-
case
|
|
588
|
-
return
|
|
589
|
-
case 10:
|
|
590
|
-
case "end":
|
|
591
|
-
return _context11.stop();
|
|
566
|
+
case 3:
|
|
567
|
+
return _context1.a(2, _context1.v);
|
|
592
568
|
}
|
|
593
|
-
},
|
|
569
|
+
}, _callee1);
|
|
594
570
|
})));
|
|
595
571
|
|
|
596
572
|
//Cache the actual instances of TMSService as these in turn cache sub-manifests for the style-files
|
|
597
|
-
this._loadTMSServices = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
573
|
+
this._loadTMSServices = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
|
|
598
574
|
var tmsManifest;
|
|
599
|
-
return
|
|
600
|
-
while (1) switch (
|
|
575
|
+
return _regenerator().w(function (_context10) {
|
|
576
|
+
while (1) switch (_context10.n) {
|
|
601
577
|
case 0:
|
|
602
|
-
|
|
578
|
+
_context10.n = 1;
|
|
603
579
|
return _this2._getDefaultTMSCatalog();
|
|
604
|
-
case
|
|
605
|
-
tmsManifest =
|
|
606
|
-
return
|
|
580
|
+
case 1:
|
|
581
|
+
tmsManifest = _context10.v;
|
|
582
|
+
return _context10.a(2, tmsManifest.services.map(function (serviceConfig) {
|
|
607
583
|
return new TMSService(serviceConfig, _this2, _this2._proxyPath);
|
|
608
584
|
}));
|
|
609
|
-
case 4:
|
|
610
|
-
case "end":
|
|
611
|
-
return _context12.stop();
|
|
612
585
|
}
|
|
613
|
-
},
|
|
586
|
+
}, _callee10);
|
|
614
587
|
})));
|
|
615
|
-
this._loadFileLayers = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
588
|
+
this._loadFileLayers = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
|
|
616
589
|
var fileManifest;
|
|
617
|
-
return
|
|
618
|
-
while (1) switch (
|
|
590
|
+
return _regenerator().w(function (_context11) {
|
|
591
|
+
while (1) switch (_context11.n) {
|
|
619
592
|
case 0:
|
|
620
|
-
|
|
593
|
+
_context11.n = 1;
|
|
621
594
|
return _this2._getDefaultFileCatalog();
|
|
622
|
-
case
|
|
623
|
-
fileManifest =
|
|
624
|
-
return
|
|
595
|
+
case 1:
|
|
596
|
+
fileManifest = _context11.v;
|
|
597
|
+
return _context11.a(2, fileManifest.layers.map(function (layerConfig) {
|
|
625
598
|
return new FileLayer(layerConfig, _this2, _this2._proxyPath);
|
|
626
599
|
}));
|
|
627
|
-
case 4:
|
|
628
|
-
case "end":
|
|
629
|
-
return _context13.stop();
|
|
630
600
|
}
|
|
631
|
-
},
|
|
601
|
+
}, _callee11);
|
|
632
602
|
})));
|
|
633
603
|
}
|
|
634
604
|
}]);
|