@elastic/ems-client 7.15.1 → 7.17.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.
- package/.backportrc.json +13 -2
- package/.buildkite/build.sh +16 -0
- package/.buildkite/pipeline.yml +8 -0
- package/.buildkite/pull-requests.json +30 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +16 -0
- package/catalog-info.yaml +68 -0
- package/package.json +8 -5
- package/src/ems_client.ts +14 -12
- package/src/file_layer.ts +0 -1
- package/target/node/ems_client.js +33 -100
- package/target/node/ems_service.js +11 -23
- package/target/node/file_layer.js +18 -64
- package/target/node/index.js +6 -10
- package/target/node/origin.js +3 -4
- package/target/node/tms_service.js +16 -64
- package/target/node/utils.js +0 -3
- package/target/web/ems_client.js +300 -432
- package/target/web/ems_service.js +10 -26
- package/target/web/file_layer.js +62 -118
- package/target/web/index.js +1 -0
- package/target/web/origin.js +1 -0
- package/target/web/tms_service.js +367 -540
- package/target/web/utils.js +0 -2
- package/.ci/jobs/defaults.yml +0 -67
- package/.ci/jobs/elastic+ems-client+master.yml +0 -18
- package/.ci/jobs/elastic+ems-client+pull-request.yml +0 -18
- package/target/ems_client.js +0 -443
- package/target/ems_service.js +0 -76
- package/target/file_layer.js +0 -123
- package/target/index.js +0 -28
- package/target/origin.js +0 -24
- package/target/tms_service.js +0 -429
- package/target/tsdoc-metadata.json +0 -11
- package/target/utils.js +0 -42
|
@@ -1,565 +1,433 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
|
|
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); }
|
|
3
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
12
|
-
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
13
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
14
|
-
|
|
15
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
16
|
-
|
|
17
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
24
|
-
|
|
25
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
26
|
-
|
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
28
|
-
|
|
29
16
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
30
|
-
|
|
31
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
-
|
|
33
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
34
|
-
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
|
|
19
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
39
23
|
/*
|
|
40
24
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
41
25
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
42
26
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
43
27
|
* 2.0.
|
|
44
28
|
*/
|
|
29
|
+
|
|
45
30
|
import _ from 'lodash';
|
|
46
31
|
import { AbstractEmsService } from './ems_service';
|
|
47
32
|
export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
48
33
|
_inherits(TMSService, _AbstractEmsService);
|
|
49
|
-
|
|
50
34
|
var _super = _createSuper(TMSService);
|
|
51
|
-
|
|
52
35
|
function TMSService(config, emsClient, proxyPath) {
|
|
53
36
|
var _this;
|
|
54
|
-
|
|
55
37
|
_classCallCheck(this, TMSService);
|
|
56
|
-
|
|
57
38
|
_this = _super.call(this, config, emsClient, proxyPath);
|
|
58
|
-
|
|
59
39
|
_defineProperty(_assertThisInitialized(_this), "_config", void 0);
|
|
60
|
-
|
|
61
|
-
_defineProperty(_assertThisInitialized(_this), "_getRasterStyleJson", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "_getRasterStyleJson", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
62
41
|
var rasterUrl, url;
|
|
63
|
-
return
|
|
64
|
-
while (1) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return _context.abrupt("return");
|
|
79
|
-
|
|
80
|
-
case 7:
|
|
81
|
-
case "end":
|
|
82
|
-
return _context.stop();
|
|
83
|
-
}
|
|
42
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
rasterUrl = _this._getStyleUrlForLocale('raster');
|
|
46
|
+
if (!rasterUrl) {
|
|
47
|
+
_context.next = 6;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
url = _this._proxyPath + _this._getAbsoluteUrl(rasterUrl);
|
|
51
|
+
return _context.abrupt("return", _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url)));
|
|
52
|
+
case 6:
|
|
53
|
+
return _context.abrupt("return");
|
|
54
|
+
case 7:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
84
57
|
}
|
|
85
58
|
}, _callee);
|
|
86
59
|
}))));
|
|
87
|
-
|
|
88
|
-
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonRaw", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonRaw", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
89
61
|
var vectorUrl, url, vectorJson;
|
|
90
|
-
return
|
|
91
|
-
while (1) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
case 9:
|
|
110
|
-
return _context2.abrupt("return");
|
|
111
|
-
|
|
112
|
-
case 10:
|
|
113
|
-
case "end":
|
|
114
|
-
return _context2.stop();
|
|
115
|
-
}
|
|
62
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
63
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
64
|
+
case 0:
|
|
65
|
+
vectorUrl = _this._getStyleUrlForLocale('vector');
|
|
66
|
+
if (!vectorUrl) {
|
|
67
|
+
_context2.next = 9;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
url = _this._proxyPath + _this._getAbsoluteUrl(vectorUrl);
|
|
71
|
+
_context2.next = 5;
|
|
72
|
+
return _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url));
|
|
73
|
+
case 5:
|
|
74
|
+
vectorJson = _context2.sent;
|
|
75
|
+
return _context2.abrupt("return", _objectSpread({}, vectorJson));
|
|
76
|
+
case 9:
|
|
77
|
+
return _context2.abrupt("return");
|
|
78
|
+
case 10:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context2.stop();
|
|
116
81
|
}
|
|
117
82
|
}, _callee2);
|
|
118
83
|
}))));
|
|
119
|
-
|
|
120
|
-
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonInlined", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
84
|
+
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonInlined", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
121
85
|
var vectorJson, inlinedSources, sources, _iterator, _step, _sourceName, url, sourceUrl, extendedUrl, sourceJson, extendedTileUrls;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
vectorJson = _context3.sent;
|
|
132
|
-
|
|
133
|
-
if (!vectorJson) {
|
|
134
|
-
_context3.next = 43;
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
inlinedSources = {};
|
|
139
|
-
sources = vectorJson.sources;
|
|
140
|
-
_iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(sources));
|
|
141
|
-
_context3.prev = 7;
|
|
142
|
-
|
|
143
|
-
_iterator.s();
|
|
144
|
-
|
|
145
|
-
case 9:
|
|
146
|
-
if ((_step = _iterator.n()).done) {
|
|
147
|
-
_context3.next = 21;
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
_sourceName = _step.value;
|
|
152
|
-
url = sources[_sourceName].url;
|
|
153
|
-
sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
|
|
154
|
-
extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
|
|
155
|
-
_context3.next = 16;
|
|
156
|
-
return _this._emsClient.getManifest(extendedUrl);
|
|
157
|
-
|
|
158
|
-
case 16:
|
|
159
|
-
sourceJson = _context3.sent;
|
|
160
|
-
extendedTileUrls = sourceJson.tiles.map(function (tileUrl) {
|
|
161
|
-
var url = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
|
|
162
|
-
|
|
163
|
-
return _this._emsClient.extendUrlWithParams(url);
|
|
164
|
-
});
|
|
165
|
-
inlinedSources[_sourceName] = _objectSpread(_objectSpread({}, sourceJson), {}, {
|
|
166
|
-
type: 'vector',
|
|
167
|
-
tiles: extendedTileUrls
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
case 19:
|
|
171
|
-
_context3.next = 9;
|
|
86
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
87
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
88
|
+
case 0:
|
|
89
|
+
_context3.next = 2;
|
|
90
|
+
return _this._getVectorStyleJsonRaw();
|
|
91
|
+
case 2:
|
|
92
|
+
vectorJson = _context3.sent;
|
|
93
|
+
if (!vectorJson) {
|
|
94
|
+
_context3.next = 43;
|
|
172
95
|
break;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
96
|
+
}
|
|
97
|
+
inlinedSources = {};
|
|
98
|
+
sources = vectorJson.sources;
|
|
99
|
+
_iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(sources));
|
|
100
|
+
_context3.prev = 7;
|
|
101
|
+
_iterator.s();
|
|
102
|
+
case 9:
|
|
103
|
+
if ((_step = _iterator.n()).done) {
|
|
104
|
+
_context3.next = 21;
|
|
176
105
|
break;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
106
|
+
}
|
|
107
|
+
_sourceName = _step.value;
|
|
108
|
+
url = sources[_sourceName].url;
|
|
109
|
+
sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
|
|
110
|
+
extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
|
|
111
|
+
_context3.next = 16;
|
|
112
|
+
return _this._emsClient.getManifest(extendedUrl);
|
|
113
|
+
case 16:
|
|
114
|
+
sourceJson = _context3.sent;
|
|
115
|
+
extendedTileUrls = sourceJson.tiles.map(function (tileUrl) {
|
|
116
|
+
var url = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
|
|
117
|
+
return _this._emsClient.extendUrlWithParams(url);
|
|
118
|
+
});
|
|
119
|
+
inlinedSources[_sourceName] = _objectSpread(_objectSpread({}, sourceJson), {}, {
|
|
120
|
+
type: 'vector',
|
|
121
|
+
tiles: extendedTileUrls
|
|
122
|
+
});
|
|
123
|
+
case 19:
|
|
124
|
+
_context3.next = 9;
|
|
125
|
+
break;
|
|
126
|
+
case 21:
|
|
127
|
+
_context3.next = 26;
|
|
128
|
+
break;
|
|
129
|
+
case 23:
|
|
130
|
+
_context3.prev = 23;
|
|
131
|
+
_context3.t0 = _context3["catch"](7);
|
|
132
|
+
_iterator.e(_context3.t0);
|
|
133
|
+
case 26:
|
|
134
|
+
_context3.prev = 26;
|
|
135
|
+
_iterator.f();
|
|
136
|
+
return _context3.finish(26);
|
|
137
|
+
case 29:
|
|
138
|
+
_context3.t1 = _objectSpread;
|
|
139
|
+
_context3.t2 = _objectSpread({}, vectorJson);
|
|
140
|
+
_context3.t3 = {};
|
|
141
|
+
_context3.t4 = inlinedSources;
|
|
142
|
+
_context3.next = 35;
|
|
143
|
+
return _this._getSpriteSheetRootPath();
|
|
144
|
+
case 35:
|
|
145
|
+
_context3.t5 = _context3.sent;
|
|
146
|
+
_context3.next = 38;
|
|
147
|
+
return _this._getUrlTemplateForGlyphs();
|
|
148
|
+
case 38:
|
|
149
|
+
_context3.t6 = _context3.sent;
|
|
150
|
+
_context3.t7 = {
|
|
151
|
+
sources: _context3.t4,
|
|
152
|
+
sprite: _context3.t5,
|
|
153
|
+
glyphs: _context3.t6
|
|
154
|
+
};
|
|
155
|
+
return _context3.abrupt("return", (0, _context3.t1)(_context3.t2, _context3.t3, _context3.t7));
|
|
156
|
+
case 43:
|
|
157
|
+
return _context3.abrupt("return");
|
|
158
|
+
case 44:
|
|
159
|
+
case "end":
|
|
160
|
+
return _context3.stop();
|
|
220
161
|
}
|
|
221
162
|
}, _callee3, null, [[7, 23, 26, 29]]);
|
|
222
163
|
}))));
|
|
223
|
-
|
|
224
164
|
_this._config = config;
|
|
225
165
|
return _this;
|
|
226
166
|
}
|
|
227
|
-
|
|
228
167
|
_createClass(TMSService, [{
|
|
229
168
|
key: "getDefaultRasterStyle",
|
|
230
169
|
value: function () {
|
|
231
|
-
var _getDefaultRasterStyle = _asyncToGenerator( /*#__PURE__*/
|
|
170
|
+
var _getDefaultRasterStyle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
232
171
|
var _this2 = this;
|
|
233
|
-
|
|
234
172
|
var tileJson, tiles;
|
|
235
|
-
return
|
|
236
|
-
while (1) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
tiles
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
case 8:
|
|
258
|
-
return _context4.abrupt("return");
|
|
259
|
-
|
|
260
|
-
case 9:
|
|
261
|
-
case "end":
|
|
262
|
-
return _context4.stop();
|
|
263
|
-
}
|
|
173
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
174
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
175
|
+
case 0:
|
|
176
|
+
_context4.next = 2;
|
|
177
|
+
return this._getRasterStyleJson();
|
|
178
|
+
case 2:
|
|
179
|
+
tileJson = _context4.sent;
|
|
180
|
+
if (!tileJson) {
|
|
181
|
+
_context4.next = 8;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
tiles = tileJson.tiles.map(function (tile) {
|
|
185
|
+
return _this2._proxyPath + _this2._getAbsoluteUrl(tile);
|
|
186
|
+
});
|
|
187
|
+
return _context4.abrupt("return", _objectSpread(_objectSpread({}, tileJson), {
|
|
188
|
+
tiles: tiles
|
|
189
|
+
}));
|
|
190
|
+
case 8:
|
|
191
|
+
return _context4.abrupt("return");
|
|
192
|
+
case 9:
|
|
193
|
+
case "end":
|
|
194
|
+
return _context4.stop();
|
|
264
195
|
}
|
|
265
196
|
}, _callee4, this);
|
|
266
197
|
}));
|
|
267
|
-
|
|
268
198
|
function getDefaultRasterStyle() {
|
|
269
199
|
return _getDefaultRasterStyle.apply(this, arguments);
|
|
270
200
|
}
|
|
271
|
-
|
|
272
201
|
return getDefaultRasterStyle;
|
|
273
202
|
}()
|
|
274
203
|
}, {
|
|
275
204
|
key: "getUrlTemplate",
|
|
276
205
|
value: function () {
|
|
277
|
-
var _getUrlTemplate = _asyncToGenerator( /*#__PURE__*/
|
|
206
|
+
var _getUrlTemplate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
278
207
|
var tileJson, directUrl;
|
|
279
|
-
return
|
|
280
|
-
while (1) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
case 8:
|
|
298
|
-
return _context5.abrupt("return", '');
|
|
299
|
-
|
|
300
|
-
case 9:
|
|
301
|
-
case "end":
|
|
302
|
-
return _context5.stop();
|
|
303
|
-
}
|
|
208
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
209
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
210
|
+
case 0:
|
|
211
|
+
_context5.next = 2;
|
|
212
|
+
return this._getRasterStyleJson();
|
|
213
|
+
case 2:
|
|
214
|
+
tileJson = _context5.sent;
|
|
215
|
+
if (!tileJson) {
|
|
216
|
+
_context5.next = 8;
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.tiles[0]);
|
|
220
|
+
return _context5.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
|
|
221
|
+
case 8:
|
|
222
|
+
return _context5.abrupt("return", '');
|
|
223
|
+
case 9:
|
|
224
|
+
case "end":
|
|
225
|
+
return _context5.stop();
|
|
304
226
|
}
|
|
305
227
|
}, _callee5, this);
|
|
306
228
|
}));
|
|
307
|
-
|
|
308
229
|
function getUrlTemplate() {
|
|
309
230
|
return _getUrlTemplate.apply(this, arguments);
|
|
310
231
|
}
|
|
311
|
-
|
|
312
232
|
return getUrlTemplate;
|
|
313
233
|
}()
|
|
314
234
|
}, {
|
|
315
235
|
key: "getUrlTemplateForVector",
|
|
316
236
|
value: function () {
|
|
317
|
-
var _getUrlTemplateForVector = _asyncToGenerator( /*#__PURE__*/
|
|
237
|
+
var _getUrlTemplateForVector = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sourceId) {
|
|
318
238
|
var tileJson, directUrl;
|
|
319
|
-
return
|
|
320
|
-
while (1) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
return _context6.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
|
|
344
|
-
|
|
345
|
-
case 10:
|
|
346
|
-
return _context6.abrupt("return", '');
|
|
347
|
-
|
|
348
|
-
case 11:
|
|
349
|
-
case "end":
|
|
350
|
-
return _context6.stop();
|
|
351
|
-
}
|
|
239
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
240
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
241
|
+
case 0:
|
|
242
|
+
_context6.next = 2;
|
|
243
|
+
return this._getVectorStyleJsonInlined();
|
|
244
|
+
case 2:
|
|
245
|
+
tileJson = _context6.sent;
|
|
246
|
+
if (tileJson) {
|
|
247
|
+
_context6.next = 5;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
return _context6.abrupt("return", '');
|
|
251
|
+
case 5:
|
|
252
|
+
if (!(tileJson.sources[sourceId] && tileJson.sources[sourceId].tiles)) {
|
|
253
|
+
_context6.next = 10;
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.sources[sourceId].tiles[0]);
|
|
257
|
+
return _context6.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
|
|
258
|
+
case 10:
|
|
259
|
+
return _context6.abrupt("return", '');
|
|
260
|
+
case 11:
|
|
261
|
+
case "end":
|
|
262
|
+
return _context6.stop();
|
|
352
263
|
}
|
|
353
264
|
}, _callee6, this);
|
|
354
265
|
}));
|
|
355
|
-
|
|
356
266
|
function getUrlTemplateForVector(_x) {
|
|
357
267
|
return _getUrlTemplateForVector.apply(this, arguments);
|
|
358
268
|
}
|
|
359
|
-
|
|
360
269
|
return getUrlTemplateForVector;
|
|
361
270
|
}()
|
|
362
271
|
}, {
|
|
363
272
|
key: "getVectorStyleSheet",
|
|
364
273
|
value: function () {
|
|
365
|
-
var _getVectorStyleSheet = _asyncToGenerator( /*#__PURE__*/
|
|
366
|
-
return
|
|
367
|
-
while (1) {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
case 3:
|
|
377
|
-
case "end":
|
|
378
|
-
return _context7.stop();
|
|
379
|
-
}
|
|
274
|
+
var _getVectorStyleSheet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
275
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
276
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
277
|
+
case 0:
|
|
278
|
+
_context7.next = 2;
|
|
279
|
+
return this._getVectorStyleJsonInlined();
|
|
280
|
+
case 2:
|
|
281
|
+
return _context7.abrupt("return", _context7.sent);
|
|
282
|
+
case 3:
|
|
283
|
+
case "end":
|
|
284
|
+
return _context7.stop();
|
|
380
285
|
}
|
|
381
286
|
}, _callee7, this);
|
|
382
287
|
}));
|
|
383
|
-
|
|
384
288
|
function getVectorStyleSheet() {
|
|
385
289
|
return _getVectorStyleSheet.apply(this, arguments);
|
|
386
290
|
}
|
|
387
|
-
|
|
388
291
|
return getVectorStyleSheet;
|
|
389
292
|
}()
|
|
390
293
|
}, {
|
|
391
294
|
key: "getVectorStyleSheetRaw",
|
|
392
295
|
value: function () {
|
|
393
|
-
var _getVectorStyleSheetRaw = _asyncToGenerator( /*#__PURE__*/
|
|
394
|
-
return
|
|
395
|
-
while (1) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
case 3:
|
|
405
|
-
case "end":
|
|
406
|
-
return _context8.stop();
|
|
407
|
-
}
|
|
296
|
+
var _getVectorStyleSheetRaw = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
297
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
298
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
299
|
+
case 0:
|
|
300
|
+
_context8.next = 2;
|
|
301
|
+
return this._getVectorStyleJsonRaw();
|
|
302
|
+
case 2:
|
|
303
|
+
return _context8.abrupt("return", _context8.sent);
|
|
304
|
+
case 3:
|
|
305
|
+
case "end":
|
|
306
|
+
return _context8.stop();
|
|
408
307
|
}
|
|
409
308
|
}, _callee8, this);
|
|
410
309
|
}));
|
|
411
|
-
|
|
412
310
|
function getVectorStyleSheetRaw() {
|
|
413
311
|
return _getVectorStyleSheetRaw.apply(this, arguments);
|
|
414
312
|
}
|
|
415
|
-
|
|
416
313
|
return getVectorStyleSheetRaw;
|
|
417
314
|
}()
|
|
418
315
|
}, {
|
|
419
316
|
key: "getSpriteSheetMeta",
|
|
420
317
|
value: function () {
|
|
421
|
-
var _getSpriteSheetMeta = _asyncToGenerator( /*#__PURE__*/
|
|
318
|
+
var _getSpriteSheetMeta = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
422
319
|
var isRetina,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
return
|
|
429
|
-
while (1) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
case 15:
|
|
461
|
-
return _context9.abrupt("return");
|
|
462
|
-
|
|
463
|
-
case 16:
|
|
464
|
-
case "end":
|
|
465
|
-
return _context9.stop();
|
|
466
|
-
}
|
|
320
|
+
metaUrl,
|
|
321
|
+
spritePngs,
|
|
322
|
+
metaUrlExtended,
|
|
323
|
+
jsonMeta,
|
|
324
|
+
_args9 = arguments;
|
|
325
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
326
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
327
|
+
case 0:
|
|
328
|
+
isRetina = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
|
|
329
|
+
_context9.next = 3;
|
|
330
|
+
return this.getSpriteSheetJsonPath(isRetina);
|
|
331
|
+
case 3:
|
|
332
|
+
metaUrl = _context9.sent;
|
|
333
|
+
_context9.next = 6;
|
|
334
|
+
return this.getSpriteSheetPngPath(isRetina);
|
|
335
|
+
case 6:
|
|
336
|
+
spritePngs = _context9.sent;
|
|
337
|
+
if (!(metaUrl && spritePngs)) {
|
|
338
|
+
_context9.next = 15;
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl);
|
|
342
|
+
_context9.next = 11;
|
|
343
|
+
return this._emsClient.getManifest(metaUrlExtended);
|
|
344
|
+
case 11:
|
|
345
|
+
jsonMeta = _context9.sent;
|
|
346
|
+
return _context9.abrupt("return", {
|
|
347
|
+
png: spritePngs,
|
|
348
|
+
json: jsonMeta
|
|
349
|
+
});
|
|
350
|
+
case 15:
|
|
351
|
+
return _context9.abrupt("return");
|
|
352
|
+
case 16:
|
|
353
|
+
case "end":
|
|
354
|
+
return _context9.stop();
|
|
467
355
|
}
|
|
468
356
|
}, _callee9, this);
|
|
469
357
|
}));
|
|
470
|
-
|
|
471
358
|
function getSpriteSheetMeta() {
|
|
472
359
|
return _getSpriteSheetMeta.apply(this, arguments);
|
|
473
360
|
}
|
|
474
|
-
|
|
475
361
|
return getSpriteSheetMeta;
|
|
476
362
|
}()
|
|
477
363
|
}, {
|
|
478
364
|
key: "getSpriteSheetJsonPath",
|
|
479
365
|
value: function () {
|
|
480
|
-
var _getSpriteSheetJsonPath = _asyncToGenerator( /*#__PURE__*/
|
|
366
|
+
var _getSpriteSheetJsonPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
481
367
|
var isRetina,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
return
|
|
486
|
-
while (1) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
case 9:
|
|
505
|
-
return _context10.abrupt("return", '');
|
|
506
|
-
|
|
507
|
-
case 10:
|
|
508
|
-
case "end":
|
|
509
|
-
return _context10.stop();
|
|
510
|
-
}
|
|
368
|
+
spriteSheetRootPath,
|
|
369
|
+
suffix,
|
|
370
|
+
_args10 = arguments;
|
|
371
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
372
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
373
|
+
case 0:
|
|
374
|
+
isRetina = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : false;
|
|
375
|
+
_context10.next = 3;
|
|
376
|
+
return this._getSpriteSheetRootPath();
|
|
377
|
+
case 3:
|
|
378
|
+
spriteSheetRootPath = _context10.sent;
|
|
379
|
+
if (!spriteSheetRootPath) {
|
|
380
|
+
_context10.next = 9;
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
suffix = isRetina ? '@2x' : '';
|
|
384
|
+
return _context10.abrupt("return", spriteSheetRootPath + suffix + '.json');
|
|
385
|
+
case 9:
|
|
386
|
+
return _context10.abrupt("return", '');
|
|
387
|
+
case 10:
|
|
388
|
+
case "end":
|
|
389
|
+
return _context10.stop();
|
|
511
390
|
}
|
|
512
391
|
}, _callee10, this);
|
|
513
392
|
}));
|
|
514
|
-
|
|
515
393
|
function getSpriteSheetJsonPath() {
|
|
516
394
|
return _getSpriteSheetJsonPath.apply(this, arguments);
|
|
517
395
|
}
|
|
518
|
-
|
|
519
396
|
return getSpriteSheetJsonPath;
|
|
520
397
|
}()
|
|
521
398
|
}, {
|
|
522
399
|
key: "getSpriteSheetPngPath",
|
|
523
400
|
value: function () {
|
|
524
|
-
var _getSpriteSheetPngPath = _asyncToGenerator( /*#__PURE__*/
|
|
401
|
+
var _getSpriteSheetPngPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
525
402
|
var isRetina,
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
return
|
|
530
|
-
while (1) {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
case 9:
|
|
549
|
-
return _context11.abrupt("return", '');
|
|
550
|
-
|
|
551
|
-
case 10:
|
|
552
|
-
case "end":
|
|
553
|
-
return _context11.stop();
|
|
554
|
-
}
|
|
403
|
+
spriteSheetRootPath,
|
|
404
|
+
suffix,
|
|
405
|
+
_args11 = arguments;
|
|
406
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
407
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
408
|
+
case 0:
|
|
409
|
+
isRetina = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : false;
|
|
410
|
+
_context11.next = 3;
|
|
411
|
+
return this._getSpriteSheetRootPath();
|
|
412
|
+
case 3:
|
|
413
|
+
spriteSheetRootPath = _context11.sent;
|
|
414
|
+
if (!spriteSheetRootPath) {
|
|
415
|
+
_context11.next = 9;
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
suffix = isRetina ? '@2x' : '';
|
|
419
|
+
return _context11.abrupt("return", spriteSheetRootPath + suffix + '.png');
|
|
420
|
+
case 9:
|
|
421
|
+
return _context11.abrupt("return", '');
|
|
422
|
+
case 10:
|
|
423
|
+
case "end":
|
|
424
|
+
return _context11.stop();
|
|
555
425
|
}
|
|
556
426
|
}, _callee11, this);
|
|
557
427
|
}));
|
|
558
|
-
|
|
559
428
|
function getSpriteSheetPngPath() {
|
|
560
429
|
return _getSpriteSheetPngPath.apply(this, arguments);
|
|
561
430
|
}
|
|
562
|
-
|
|
563
431
|
return getSpriteSheetPngPath;
|
|
564
432
|
}()
|
|
565
433
|
}, {
|
|
@@ -570,79 +438,61 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
570
438
|
}, {
|
|
571
439
|
key: "getMinZoom",
|
|
572
440
|
value: function () {
|
|
573
|
-
var _getMinZoom = _asyncToGenerator( /*#__PURE__*/
|
|
441
|
+
var _getMinZoom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
574
442
|
var tileJson;
|
|
575
|
-
return
|
|
576
|
-
while (1) {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
case 7:
|
|
593
|
-
return _context12.abrupt("return");
|
|
594
|
-
|
|
595
|
-
case 8:
|
|
596
|
-
case "end":
|
|
597
|
-
return _context12.stop();
|
|
598
|
-
}
|
|
443
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
444
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
445
|
+
case 0:
|
|
446
|
+
_context12.next = 2;
|
|
447
|
+
return this._getRasterStyleJson();
|
|
448
|
+
case 2:
|
|
449
|
+
tileJson = _context12.sent;
|
|
450
|
+
if (!tileJson) {
|
|
451
|
+
_context12.next = 7;
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
return _context12.abrupt("return", tileJson.minzoom);
|
|
455
|
+
case 7:
|
|
456
|
+
return _context12.abrupt("return");
|
|
457
|
+
case 8:
|
|
458
|
+
case "end":
|
|
459
|
+
return _context12.stop();
|
|
599
460
|
}
|
|
600
461
|
}, _callee12, this);
|
|
601
462
|
}));
|
|
602
|
-
|
|
603
463
|
function getMinZoom() {
|
|
604
464
|
return _getMinZoom.apply(this, arguments);
|
|
605
465
|
}
|
|
606
|
-
|
|
607
466
|
return getMinZoom;
|
|
608
467
|
}()
|
|
609
468
|
}, {
|
|
610
469
|
key: "getMaxZoom",
|
|
611
470
|
value: function () {
|
|
612
|
-
var _getMaxZoom = _asyncToGenerator( /*#__PURE__*/
|
|
471
|
+
var _getMaxZoom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
613
472
|
var tileJson;
|
|
614
|
-
return
|
|
615
|
-
while (1) {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
case 7:
|
|
632
|
-
return _context13.abrupt("return");
|
|
633
|
-
|
|
634
|
-
case 8:
|
|
635
|
-
case "end":
|
|
636
|
-
return _context13.stop();
|
|
637
|
-
}
|
|
473
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
474
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
475
|
+
case 0:
|
|
476
|
+
_context13.next = 2;
|
|
477
|
+
return this._getRasterStyleJson();
|
|
478
|
+
case 2:
|
|
479
|
+
tileJson = _context13.sent;
|
|
480
|
+
if (!tileJson) {
|
|
481
|
+
_context13.next = 7;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
return _context13.abrupt("return", tileJson.maxzoom);
|
|
485
|
+
case 7:
|
|
486
|
+
return _context13.abrupt("return");
|
|
487
|
+
case 8:
|
|
488
|
+
case "end":
|
|
489
|
+
return _context13.stop();
|
|
638
490
|
}
|
|
639
491
|
}, _callee13, this);
|
|
640
492
|
}));
|
|
641
|
-
|
|
642
493
|
function getMaxZoom() {
|
|
643
494
|
return _getMaxZoom.apply(this, arguments);
|
|
644
495
|
}
|
|
645
|
-
|
|
646
496
|
return getMaxZoom;
|
|
647
497
|
}()
|
|
648
498
|
}, {
|
|
@@ -664,19 +514,15 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
664
514
|
key: "_getStyleUrlForLocale",
|
|
665
515
|
value: function _getStyleUrlForLocale(formatType) {
|
|
666
516
|
var vectorFormats = this._getFormats(formatType, this._emsClient.getLocale());
|
|
667
|
-
|
|
668
517
|
if (!vectorFormats.length) {
|
|
669
518
|
//fallback to default locale
|
|
670
519
|
vectorFormats = this._getFormats(formatType, this._emsClient.getDefaultLocale());
|
|
671
520
|
}
|
|
672
|
-
|
|
673
521
|
if (!vectorFormats.length) {
|
|
674
522
|
// eslint-disable-next-line max-len
|
|
675
523
|
throw new Error("Cannot find ".concat(formatType, " tile layer for locale ").concat(this._emsClient.getLocale(), " or ").concat(this._emsClient.getDefaultLocale()));
|
|
676
524
|
}
|
|
677
|
-
|
|
678
525
|
var defaultStyle = vectorFormats[0];
|
|
679
|
-
|
|
680
526
|
if (defaultStyle && defaultStyle.hasOwnProperty('url')) {
|
|
681
527
|
return defaultStyle.url;
|
|
682
528
|
}
|
|
@@ -691,82 +537,63 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
691
537
|
}, {
|
|
692
538
|
key: "_getSpriteSheetRootPath",
|
|
693
539
|
value: function () {
|
|
694
|
-
var _getSpriteSheetRootPath2 = _asyncToGenerator( /*#__PURE__*/
|
|
540
|
+
var _getSpriteSheetRootPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
695
541
|
var vectorStyleJson;
|
|
696
|
-
return
|
|
697
|
-
while (1) {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
case 7:
|
|
714
|
-
return _context14.abrupt("return", '');
|
|
715
|
-
|
|
716
|
-
case 8:
|
|
717
|
-
case "end":
|
|
718
|
-
return _context14.stop();
|
|
719
|
-
}
|
|
542
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
543
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
544
|
+
case 0:
|
|
545
|
+
_context14.next = 2;
|
|
546
|
+
return this._getVectorStyleJsonRaw();
|
|
547
|
+
case 2:
|
|
548
|
+
vectorStyleJson = _context14.sent;
|
|
549
|
+
if (!vectorStyleJson) {
|
|
550
|
+
_context14.next = 7;
|
|
551
|
+
break;
|
|
552
|
+
}
|
|
553
|
+
return _context14.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite));
|
|
554
|
+
case 7:
|
|
555
|
+
return _context14.abrupt("return", '');
|
|
556
|
+
case 8:
|
|
557
|
+
case "end":
|
|
558
|
+
return _context14.stop();
|
|
720
559
|
}
|
|
721
560
|
}, _callee14, this);
|
|
722
561
|
}));
|
|
723
|
-
|
|
724
562
|
function _getSpriteSheetRootPath() {
|
|
725
563
|
return _getSpriteSheetRootPath2.apply(this, arguments);
|
|
726
564
|
}
|
|
727
|
-
|
|
728
565
|
return _getSpriteSheetRootPath;
|
|
729
566
|
}()
|
|
730
567
|
}, {
|
|
731
568
|
key: "_getUrlTemplateForGlyphs",
|
|
732
569
|
value: function () {
|
|
733
|
-
var _getUrlTemplateForGlyphs2 = _asyncToGenerator( /*#__PURE__*/
|
|
570
|
+
var _getUrlTemplateForGlyphs2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
734
571
|
var vectorStyleJson;
|
|
735
|
-
return
|
|
736
|
-
while (1) {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
case 7:
|
|
753
|
-
return _context15.abrupt("return", '');
|
|
754
|
-
|
|
755
|
-
case 8:
|
|
756
|
-
case "end":
|
|
757
|
-
return _context15.stop();
|
|
758
|
-
}
|
|
572
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
573
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
574
|
+
case 0:
|
|
575
|
+
_context15.next = 2;
|
|
576
|
+
return this._getVectorStyleJsonRaw();
|
|
577
|
+
case 2:
|
|
578
|
+
vectorStyleJson = _context15.sent;
|
|
579
|
+
if (!vectorStyleJson) {
|
|
580
|
+
_context15.next = 7;
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
return _context15.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs));
|
|
584
|
+
case 7:
|
|
585
|
+
return _context15.abrupt("return", '');
|
|
586
|
+
case 8:
|
|
587
|
+
case "end":
|
|
588
|
+
return _context15.stop();
|
|
759
589
|
}
|
|
760
590
|
}, _callee15, this);
|
|
761
591
|
}));
|
|
762
|
-
|
|
763
592
|
function _getUrlTemplateForGlyphs() {
|
|
764
593
|
return _getUrlTemplateForGlyphs2.apply(this, arguments);
|
|
765
594
|
}
|
|
766
|
-
|
|
767
595
|
return _getUrlTemplateForGlyphs;
|
|
768
596
|
}()
|
|
769
597
|
}]);
|
|
770
|
-
|
|
771
598
|
return TMSService;
|
|
772
599
|
}(AbstractEmsService);
|