@elastic/ems-client 7.16.0 → 7.17.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/.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 +15 -0
- package/catalog-info.yaml +68 -0
- package/package.json +10 -7
- package/src/ems_client.ts +1 -1
- package/target/ems_client.d.ts +16 -16
- package/target/ems_client.js +318 -0
- package/target/ems_service.js +47 -0
- package/target/file_layer.d.ts +1 -1
- package/target/file_layer.js +176 -0
- package/target/index.js +16 -0
- package/target/node/ems_client.js +25 -93
- package/target/node/ems_service.js +11 -23
- package/target/node/file_layer.js +18 -63
- package/target/node/index.js +0 -4
- package/target/node/origin.js +3 -4
- package/target/node/tms_service.js +17 -65
- package/target/node/utils.js +0 -3
- package/target/tms_service.d.ts +6 -6
- package/target/tms_service.js +409 -0
- package/target/utils.js +86 -0
- package/target/web/ems_client.js +304 -444
- package/target/web/ems_service.js +12 -29
- package/target/web/file_layer.js +73 -130
- package/target/web/index.js +1 -0
- package/target/web/origin.js +1 -0
- package/target/web/tms_service.js +380 -555
- 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
|
@@ -1,565 +1,432 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
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
|
-
|
|
27
|
-
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
|
-
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
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
-
|
|
33
|
-
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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
36
|
-
|
|
37
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
38
|
-
|
|
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 _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
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 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 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 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; }
|
|
8
|
+
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); }
|
|
9
|
+
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); }); }; }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
15
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
18
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
19
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
20
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
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
|
-
_inherits(TMSService, _AbstractEmsService);
|
|
49
|
-
|
|
50
|
-
var _super = _createSuper(TMSService);
|
|
51
|
-
|
|
52
33
|
function TMSService(config, emsClient, proxyPath) {
|
|
53
34
|
var _this;
|
|
54
|
-
|
|
55
35
|
_classCallCheck(this, TMSService);
|
|
56
|
-
|
|
57
|
-
_this
|
|
58
|
-
|
|
59
|
-
_defineProperty(_assertThisInitialized(_this), "_config", void 0);
|
|
60
|
-
|
|
61
|
-
_defineProperty(_assertThisInitialized(_this), "_getRasterStyleJson", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
36
|
+
_this = _callSuper(this, TMSService, [config, emsClient, proxyPath]);
|
|
37
|
+
_defineProperty(_this, "_config", void 0);
|
|
38
|
+
_defineProperty(_this, "_getRasterStyleJson", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
62
39
|
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
|
-
}
|
|
40
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
rasterUrl = _this._getStyleUrlForLocale('raster');
|
|
44
|
+
if (!rasterUrl) {
|
|
45
|
+
_context.next = 6;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
url = _this._proxyPath + _this._getAbsoluteUrl(rasterUrl);
|
|
49
|
+
return _context.abrupt("return", _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url)));
|
|
50
|
+
case 6:
|
|
51
|
+
return _context.abrupt("return");
|
|
52
|
+
case 7:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context.stop();
|
|
84
55
|
}
|
|
85
56
|
}, _callee);
|
|
86
57
|
}))));
|
|
87
|
-
|
|
88
|
-
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonRaw", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
58
|
+
_defineProperty(_this, "_getVectorStyleJsonRaw", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
89
59
|
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
|
-
}
|
|
60
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
61
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
62
|
+
case 0:
|
|
63
|
+
vectorUrl = _this._getStyleUrlForLocale('vector');
|
|
64
|
+
if (!vectorUrl) {
|
|
65
|
+
_context2.next = 9;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
url = _this._proxyPath + _this._getAbsoluteUrl(vectorUrl);
|
|
69
|
+
_context2.next = 5;
|
|
70
|
+
return _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url));
|
|
71
|
+
case 5:
|
|
72
|
+
vectorJson = _context2.sent;
|
|
73
|
+
return _context2.abrupt("return", _objectSpread({}, vectorJson));
|
|
74
|
+
case 9:
|
|
75
|
+
return _context2.abrupt("return");
|
|
76
|
+
case 10:
|
|
77
|
+
case "end":
|
|
78
|
+
return _context2.stop();
|
|
116
79
|
}
|
|
117
80
|
}, _callee2);
|
|
118
81
|
}))));
|
|
119
|
-
|
|
120
|
-
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonInlined", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
82
|
+
_defineProperty(_this, "_getVectorStyleJsonInlined", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
121
83
|
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;
|
|
84
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
85
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
86
|
+
case 0:
|
|
87
|
+
_context3.next = 2;
|
|
88
|
+
return _this._getVectorStyleJsonRaw();
|
|
89
|
+
case 2:
|
|
90
|
+
vectorJson = _context3.sent;
|
|
91
|
+
if (!vectorJson) {
|
|
92
|
+
_context3.next = 43;
|
|
172
93
|
break;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
94
|
+
}
|
|
95
|
+
inlinedSources = {};
|
|
96
|
+
sources = vectorJson.sources;
|
|
97
|
+
_iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(sources));
|
|
98
|
+
_context3.prev = 7;
|
|
99
|
+
_iterator.s();
|
|
100
|
+
case 9:
|
|
101
|
+
if ((_step = _iterator.n()).done) {
|
|
102
|
+
_context3.next = 21;
|
|
176
103
|
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
|
-
|
|
104
|
+
}
|
|
105
|
+
_sourceName = _step.value;
|
|
106
|
+
url = sources[_sourceName].url;
|
|
107
|
+
sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
|
|
108
|
+
extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
|
|
109
|
+
_context3.next = 16;
|
|
110
|
+
return _this._emsClient.getManifest(extendedUrl);
|
|
111
|
+
case 16:
|
|
112
|
+
sourceJson = _context3.sent;
|
|
113
|
+
extendedTileUrls = sourceJson.tiles.map(function (tileUrl) {
|
|
114
|
+
var url = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
|
|
115
|
+
return _this._emsClient.extendUrlWithParams(url);
|
|
116
|
+
});
|
|
117
|
+
inlinedSources[_sourceName] = _objectSpread(_objectSpread({}, sourceJson), {}, {
|
|
118
|
+
type: 'vector',
|
|
119
|
+
tiles: extendedTileUrls
|
|
120
|
+
});
|
|
121
|
+
case 19:
|
|
122
|
+
_context3.next = 9;
|
|
123
|
+
break;
|
|
124
|
+
case 21:
|
|
125
|
+
_context3.next = 26;
|
|
126
|
+
break;
|
|
127
|
+
case 23:
|
|
128
|
+
_context3.prev = 23;
|
|
129
|
+
_context3.t0 = _context3["catch"](7);
|
|
130
|
+
_iterator.e(_context3.t0);
|
|
131
|
+
case 26:
|
|
132
|
+
_context3.prev = 26;
|
|
133
|
+
_iterator.f();
|
|
134
|
+
return _context3.finish(26);
|
|
135
|
+
case 29:
|
|
136
|
+
_context3.t1 = _objectSpread;
|
|
137
|
+
_context3.t2 = _objectSpread({}, vectorJson);
|
|
138
|
+
_context3.t3 = {};
|
|
139
|
+
_context3.t4 = inlinedSources;
|
|
140
|
+
_context3.next = 35;
|
|
141
|
+
return _this._getSpriteSheetRootPath();
|
|
142
|
+
case 35:
|
|
143
|
+
_context3.t5 = _context3.sent;
|
|
144
|
+
_context3.next = 38;
|
|
145
|
+
return _this._getUrlTemplateForGlyphs();
|
|
146
|
+
case 38:
|
|
147
|
+
_context3.t6 = _context3.sent;
|
|
148
|
+
_context3.t7 = {
|
|
149
|
+
sources: _context3.t4,
|
|
150
|
+
sprite: _context3.t5,
|
|
151
|
+
glyphs: _context3.t6
|
|
152
|
+
};
|
|
153
|
+
return _context3.abrupt("return", (0, _context3.t1)(_context3.t2, _context3.t3, _context3.t7));
|
|
154
|
+
case 43:
|
|
155
|
+
return _context3.abrupt("return");
|
|
156
|
+
case 44:
|
|
157
|
+
case "end":
|
|
158
|
+
return _context3.stop();
|
|
220
159
|
}
|
|
221
160
|
}, _callee3, null, [[7, 23, 26, 29]]);
|
|
222
161
|
}))));
|
|
223
|
-
|
|
224
162
|
_this._config = config;
|
|
225
163
|
return _this;
|
|
226
164
|
}
|
|
227
|
-
|
|
228
|
-
_createClass(TMSService, [{
|
|
165
|
+
_inherits(TMSService, _AbstractEmsService);
|
|
166
|
+
return _createClass(TMSService, [{
|
|
229
167
|
key: "getDefaultRasterStyle",
|
|
230
168
|
value: function () {
|
|
231
|
-
var _getDefaultRasterStyle = _asyncToGenerator( /*#__PURE__*/
|
|
169
|
+
var _getDefaultRasterStyle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
232
170
|
var _this2 = this;
|
|
233
|
-
|
|
234
171
|
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
|
-
}
|
|
172
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
173
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
174
|
+
case 0:
|
|
175
|
+
_context4.next = 2;
|
|
176
|
+
return this._getRasterStyleJson();
|
|
177
|
+
case 2:
|
|
178
|
+
tileJson = _context4.sent;
|
|
179
|
+
if (!tileJson) {
|
|
180
|
+
_context4.next = 8;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
tiles = tileJson.tiles.map(function (tile) {
|
|
184
|
+
return _this2._proxyPath + _this2._getAbsoluteUrl(tile);
|
|
185
|
+
});
|
|
186
|
+
return _context4.abrupt("return", _objectSpread(_objectSpread({}, tileJson), {
|
|
187
|
+
tiles: tiles
|
|
188
|
+
}));
|
|
189
|
+
case 8:
|
|
190
|
+
return _context4.abrupt("return");
|
|
191
|
+
case 9:
|
|
192
|
+
case "end":
|
|
193
|
+
return _context4.stop();
|
|
264
194
|
}
|
|
265
195
|
}, _callee4, this);
|
|
266
196
|
}));
|
|
267
|
-
|
|
268
197
|
function getDefaultRasterStyle() {
|
|
269
198
|
return _getDefaultRasterStyle.apply(this, arguments);
|
|
270
199
|
}
|
|
271
|
-
|
|
272
200
|
return getDefaultRasterStyle;
|
|
273
201
|
}()
|
|
274
202
|
}, {
|
|
275
203
|
key: "getUrlTemplate",
|
|
276
204
|
value: function () {
|
|
277
|
-
var _getUrlTemplate = _asyncToGenerator( /*#__PURE__*/
|
|
205
|
+
var _getUrlTemplate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
278
206
|
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
|
-
}
|
|
207
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
208
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
209
|
+
case 0:
|
|
210
|
+
_context5.next = 2;
|
|
211
|
+
return this._getRasterStyleJson();
|
|
212
|
+
case 2:
|
|
213
|
+
tileJson = _context5.sent;
|
|
214
|
+
if (!tileJson) {
|
|
215
|
+
_context5.next = 8;
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.tiles[0]);
|
|
219
|
+
return _context5.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
|
|
220
|
+
case 8:
|
|
221
|
+
return _context5.abrupt("return", '');
|
|
222
|
+
case 9:
|
|
223
|
+
case "end":
|
|
224
|
+
return _context5.stop();
|
|
304
225
|
}
|
|
305
226
|
}, _callee5, this);
|
|
306
227
|
}));
|
|
307
|
-
|
|
308
228
|
function getUrlTemplate() {
|
|
309
229
|
return _getUrlTemplate.apply(this, arguments);
|
|
310
230
|
}
|
|
311
|
-
|
|
312
231
|
return getUrlTemplate;
|
|
313
232
|
}()
|
|
314
233
|
}, {
|
|
315
234
|
key: "getUrlTemplateForVector",
|
|
316
235
|
value: function () {
|
|
317
|
-
var _getUrlTemplateForVector = _asyncToGenerator( /*#__PURE__*/
|
|
236
|
+
var _getUrlTemplateForVector = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sourceId) {
|
|
318
237
|
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
|
-
}
|
|
238
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
239
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
240
|
+
case 0:
|
|
241
|
+
_context6.next = 2;
|
|
242
|
+
return this._getVectorStyleJsonInlined();
|
|
243
|
+
case 2:
|
|
244
|
+
tileJson = _context6.sent;
|
|
245
|
+
if (tileJson) {
|
|
246
|
+
_context6.next = 5;
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
return _context6.abrupt("return", '');
|
|
250
|
+
case 5:
|
|
251
|
+
if (!(tileJson.sources[sourceId] && tileJson.sources[sourceId].tiles)) {
|
|
252
|
+
_context6.next = 10;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.sources[sourceId].tiles[0]);
|
|
256
|
+
return _context6.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
|
|
257
|
+
case 10:
|
|
258
|
+
return _context6.abrupt("return", '');
|
|
259
|
+
case 11:
|
|
260
|
+
case "end":
|
|
261
|
+
return _context6.stop();
|
|
352
262
|
}
|
|
353
263
|
}, _callee6, this);
|
|
354
264
|
}));
|
|
355
|
-
|
|
356
265
|
function getUrlTemplateForVector(_x) {
|
|
357
266
|
return _getUrlTemplateForVector.apply(this, arguments);
|
|
358
267
|
}
|
|
359
|
-
|
|
360
268
|
return getUrlTemplateForVector;
|
|
361
269
|
}()
|
|
362
270
|
}, {
|
|
363
271
|
key: "getVectorStyleSheet",
|
|
364
272
|
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
|
-
}
|
|
273
|
+
var _getVectorStyleSheet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
274
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
275
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
276
|
+
case 0:
|
|
277
|
+
_context7.next = 2;
|
|
278
|
+
return this._getVectorStyleJsonInlined();
|
|
279
|
+
case 2:
|
|
280
|
+
return _context7.abrupt("return", _context7.sent);
|
|
281
|
+
case 3:
|
|
282
|
+
case "end":
|
|
283
|
+
return _context7.stop();
|
|
380
284
|
}
|
|
381
285
|
}, _callee7, this);
|
|
382
286
|
}));
|
|
383
|
-
|
|
384
287
|
function getVectorStyleSheet() {
|
|
385
288
|
return _getVectorStyleSheet.apply(this, arguments);
|
|
386
289
|
}
|
|
387
|
-
|
|
388
290
|
return getVectorStyleSheet;
|
|
389
291
|
}()
|
|
390
292
|
}, {
|
|
391
293
|
key: "getVectorStyleSheetRaw",
|
|
392
294
|
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
|
-
}
|
|
295
|
+
var _getVectorStyleSheetRaw = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
296
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
297
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
298
|
+
case 0:
|
|
299
|
+
_context8.next = 2;
|
|
300
|
+
return this._getVectorStyleJsonRaw();
|
|
301
|
+
case 2:
|
|
302
|
+
return _context8.abrupt("return", _context8.sent);
|
|
303
|
+
case 3:
|
|
304
|
+
case "end":
|
|
305
|
+
return _context8.stop();
|
|
408
306
|
}
|
|
409
307
|
}, _callee8, this);
|
|
410
308
|
}));
|
|
411
|
-
|
|
412
309
|
function getVectorStyleSheetRaw() {
|
|
413
310
|
return _getVectorStyleSheetRaw.apply(this, arguments);
|
|
414
311
|
}
|
|
415
|
-
|
|
416
312
|
return getVectorStyleSheetRaw;
|
|
417
313
|
}()
|
|
418
314
|
}, {
|
|
419
315
|
key: "getSpriteSheetMeta",
|
|
420
316
|
value: function () {
|
|
421
|
-
var _getSpriteSheetMeta = _asyncToGenerator( /*#__PURE__*/
|
|
317
|
+
var _getSpriteSheetMeta = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
422
318
|
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
|
-
}
|
|
319
|
+
metaUrl,
|
|
320
|
+
spritePngs,
|
|
321
|
+
metaUrlExtended,
|
|
322
|
+
jsonMeta,
|
|
323
|
+
_args9 = arguments;
|
|
324
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
325
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
326
|
+
case 0:
|
|
327
|
+
isRetina = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
|
|
328
|
+
_context9.next = 3;
|
|
329
|
+
return this.getSpriteSheetJsonPath(isRetina);
|
|
330
|
+
case 3:
|
|
331
|
+
metaUrl = _context9.sent;
|
|
332
|
+
_context9.next = 6;
|
|
333
|
+
return this.getSpriteSheetPngPath(isRetina);
|
|
334
|
+
case 6:
|
|
335
|
+
spritePngs = _context9.sent;
|
|
336
|
+
if (!(metaUrl && spritePngs)) {
|
|
337
|
+
_context9.next = 15;
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl);
|
|
341
|
+
_context9.next = 11;
|
|
342
|
+
return this._emsClient.getManifest(metaUrlExtended);
|
|
343
|
+
case 11:
|
|
344
|
+
jsonMeta = _context9.sent;
|
|
345
|
+
return _context9.abrupt("return", {
|
|
346
|
+
png: spritePngs,
|
|
347
|
+
json: jsonMeta
|
|
348
|
+
});
|
|
349
|
+
case 15:
|
|
350
|
+
return _context9.abrupt("return");
|
|
351
|
+
case 16:
|
|
352
|
+
case "end":
|
|
353
|
+
return _context9.stop();
|
|
467
354
|
}
|
|
468
355
|
}, _callee9, this);
|
|
469
356
|
}));
|
|
470
|
-
|
|
471
357
|
function getSpriteSheetMeta() {
|
|
472
358
|
return _getSpriteSheetMeta.apply(this, arguments);
|
|
473
359
|
}
|
|
474
|
-
|
|
475
360
|
return getSpriteSheetMeta;
|
|
476
361
|
}()
|
|
477
362
|
}, {
|
|
478
363
|
key: "getSpriteSheetJsonPath",
|
|
479
364
|
value: function () {
|
|
480
|
-
var _getSpriteSheetJsonPath = _asyncToGenerator( /*#__PURE__*/
|
|
365
|
+
var _getSpriteSheetJsonPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
481
366
|
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
|
-
}
|
|
367
|
+
spriteSheetRootPath,
|
|
368
|
+
suffix,
|
|
369
|
+
_args10 = arguments;
|
|
370
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
371
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
372
|
+
case 0:
|
|
373
|
+
isRetina = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : false;
|
|
374
|
+
_context10.next = 3;
|
|
375
|
+
return this._getSpriteSheetRootPath();
|
|
376
|
+
case 3:
|
|
377
|
+
spriteSheetRootPath = _context10.sent;
|
|
378
|
+
if (!spriteSheetRootPath) {
|
|
379
|
+
_context10.next = 9;
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
suffix = isRetina ? '@2x' : '';
|
|
383
|
+
return _context10.abrupt("return", spriteSheetRootPath + suffix + '.json');
|
|
384
|
+
case 9:
|
|
385
|
+
return _context10.abrupt("return", '');
|
|
386
|
+
case 10:
|
|
387
|
+
case "end":
|
|
388
|
+
return _context10.stop();
|
|
511
389
|
}
|
|
512
390
|
}, _callee10, this);
|
|
513
391
|
}));
|
|
514
|
-
|
|
515
392
|
function getSpriteSheetJsonPath() {
|
|
516
393
|
return _getSpriteSheetJsonPath.apply(this, arguments);
|
|
517
394
|
}
|
|
518
|
-
|
|
519
395
|
return getSpriteSheetJsonPath;
|
|
520
396
|
}()
|
|
521
397
|
}, {
|
|
522
398
|
key: "getSpriteSheetPngPath",
|
|
523
399
|
value: function () {
|
|
524
|
-
var _getSpriteSheetPngPath = _asyncToGenerator( /*#__PURE__*/
|
|
400
|
+
var _getSpriteSheetPngPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
525
401
|
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
|
-
}
|
|
402
|
+
spriteSheetRootPath,
|
|
403
|
+
suffix,
|
|
404
|
+
_args11 = arguments;
|
|
405
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
406
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
407
|
+
case 0:
|
|
408
|
+
isRetina = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : false;
|
|
409
|
+
_context11.next = 3;
|
|
410
|
+
return this._getSpriteSheetRootPath();
|
|
411
|
+
case 3:
|
|
412
|
+
spriteSheetRootPath = _context11.sent;
|
|
413
|
+
if (!spriteSheetRootPath) {
|
|
414
|
+
_context11.next = 9;
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
suffix = isRetina ? '@2x' : '';
|
|
418
|
+
return _context11.abrupt("return", spriteSheetRootPath + suffix + '.png');
|
|
419
|
+
case 9:
|
|
420
|
+
return _context11.abrupt("return", '');
|
|
421
|
+
case 10:
|
|
422
|
+
case "end":
|
|
423
|
+
return _context11.stop();
|
|
555
424
|
}
|
|
556
425
|
}, _callee11, this);
|
|
557
426
|
}));
|
|
558
|
-
|
|
559
427
|
function getSpriteSheetPngPath() {
|
|
560
428
|
return _getSpriteSheetPngPath.apply(this, arguments);
|
|
561
429
|
}
|
|
562
|
-
|
|
563
430
|
return getSpriteSheetPngPath;
|
|
564
431
|
}()
|
|
565
432
|
}, {
|
|
@@ -570,79 +437,61 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
570
437
|
}, {
|
|
571
438
|
key: "getMinZoom",
|
|
572
439
|
value: function () {
|
|
573
|
-
var _getMinZoom = _asyncToGenerator( /*#__PURE__*/
|
|
440
|
+
var _getMinZoom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
574
441
|
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
|
-
}
|
|
442
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
443
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
444
|
+
case 0:
|
|
445
|
+
_context12.next = 2;
|
|
446
|
+
return this._getRasterStyleJson();
|
|
447
|
+
case 2:
|
|
448
|
+
tileJson = _context12.sent;
|
|
449
|
+
if (!tileJson) {
|
|
450
|
+
_context12.next = 7;
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
return _context12.abrupt("return", tileJson.minzoom);
|
|
454
|
+
case 7:
|
|
455
|
+
return _context12.abrupt("return");
|
|
456
|
+
case 8:
|
|
457
|
+
case "end":
|
|
458
|
+
return _context12.stop();
|
|
599
459
|
}
|
|
600
460
|
}, _callee12, this);
|
|
601
461
|
}));
|
|
602
|
-
|
|
603
462
|
function getMinZoom() {
|
|
604
463
|
return _getMinZoom.apply(this, arguments);
|
|
605
464
|
}
|
|
606
|
-
|
|
607
465
|
return getMinZoom;
|
|
608
466
|
}()
|
|
609
467
|
}, {
|
|
610
468
|
key: "getMaxZoom",
|
|
611
469
|
value: function () {
|
|
612
|
-
var _getMaxZoom = _asyncToGenerator( /*#__PURE__*/
|
|
470
|
+
var _getMaxZoom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
613
471
|
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
|
-
}
|
|
472
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
473
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
474
|
+
case 0:
|
|
475
|
+
_context13.next = 2;
|
|
476
|
+
return this._getRasterStyleJson();
|
|
477
|
+
case 2:
|
|
478
|
+
tileJson = _context13.sent;
|
|
479
|
+
if (!tileJson) {
|
|
480
|
+
_context13.next = 7;
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
return _context13.abrupt("return", tileJson.maxzoom);
|
|
484
|
+
case 7:
|
|
485
|
+
return _context13.abrupt("return");
|
|
486
|
+
case 8:
|
|
487
|
+
case "end":
|
|
488
|
+
return _context13.stop();
|
|
638
489
|
}
|
|
639
490
|
}, _callee13, this);
|
|
640
491
|
}));
|
|
641
|
-
|
|
642
492
|
function getMaxZoom() {
|
|
643
493
|
return _getMaxZoom.apply(this, arguments);
|
|
644
494
|
}
|
|
645
|
-
|
|
646
495
|
return getMaxZoom;
|
|
647
496
|
}()
|
|
648
497
|
}, {
|
|
@@ -664,19 +513,15 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
664
513
|
key: "_getStyleUrlForLocale",
|
|
665
514
|
value: function _getStyleUrlForLocale(formatType) {
|
|
666
515
|
var vectorFormats = this._getFormats(formatType, this._emsClient.getLocale());
|
|
667
|
-
|
|
668
516
|
if (!vectorFormats.length) {
|
|
669
517
|
//fallback to default locale
|
|
670
518
|
vectorFormats = this._getFormats(formatType, this._emsClient.getDefaultLocale());
|
|
671
519
|
}
|
|
672
|
-
|
|
673
520
|
if (!vectorFormats.length) {
|
|
674
521
|
// eslint-disable-next-line max-len
|
|
675
522
|
throw new Error("Cannot find ".concat(formatType, " tile layer for locale ").concat(this._emsClient.getLocale(), " or ").concat(this._emsClient.getDefaultLocale()));
|
|
676
523
|
}
|
|
677
|
-
|
|
678
524
|
var defaultStyle = vectorFormats[0];
|
|
679
|
-
|
|
680
525
|
if (defaultStyle && defaultStyle.hasOwnProperty('url')) {
|
|
681
526
|
return defaultStyle.url;
|
|
682
527
|
}
|
|
@@ -691,82 +536,62 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
691
536
|
}, {
|
|
692
537
|
key: "_getSpriteSheetRootPath",
|
|
693
538
|
value: function () {
|
|
694
|
-
var _getSpriteSheetRootPath2 = _asyncToGenerator( /*#__PURE__*/
|
|
539
|
+
var _getSpriteSheetRootPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
695
540
|
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
|
-
}
|
|
541
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
542
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
543
|
+
case 0:
|
|
544
|
+
_context14.next = 2;
|
|
545
|
+
return this._getVectorStyleJsonRaw();
|
|
546
|
+
case 2:
|
|
547
|
+
vectorStyleJson = _context14.sent;
|
|
548
|
+
if (!vectorStyleJson) {
|
|
549
|
+
_context14.next = 7;
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
return _context14.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite));
|
|
553
|
+
case 7:
|
|
554
|
+
return _context14.abrupt("return", '');
|
|
555
|
+
case 8:
|
|
556
|
+
case "end":
|
|
557
|
+
return _context14.stop();
|
|
720
558
|
}
|
|
721
559
|
}, _callee14, this);
|
|
722
560
|
}));
|
|
723
|
-
|
|
724
561
|
function _getSpriteSheetRootPath() {
|
|
725
562
|
return _getSpriteSheetRootPath2.apply(this, arguments);
|
|
726
563
|
}
|
|
727
|
-
|
|
728
564
|
return _getSpriteSheetRootPath;
|
|
729
565
|
}()
|
|
730
566
|
}, {
|
|
731
567
|
key: "_getUrlTemplateForGlyphs",
|
|
732
568
|
value: function () {
|
|
733
|
-
var _getUrlTemplateForGlyphs2 = _asyncToGenerator( /*#__PURE__*/
|
|
569
|
+
var _getUrlTemplateForGlyphs2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
734
570
|
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
|
-
}
|
|
571
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
572
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
573
|
+
case 0:
|
|
574
|
+
_context15.next = 2;
|
|
575
|
+
return this._getVectorStyleJsonRaw();
|
|
576
|
+
case 2:
|
|
577
|
+
vectorStyleJson = _context15.sent;
|
|
578
|
+
if (!vectorStyleJson) {
|
|
579
|
+
_context15.next = 7;
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
return _context15.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs));
|
|
583
|
+
case 7:
|
|
584
|
+
return _context15.abrupt("return", '');
|
|
585
|
+
case 8:
|
|
586
|
+
case "end":
|
|
587
|
+
return _context15.stop();
|
|
759
588
|
}
|
|
760
589
|
}, _callee15, this);
|
|
761
590
|
}));
|
|
762
|
-
|
|
763
591
|
function _getUrlTemplateForGlyphs() {
|
|
764
592
|
return _getUrlTemplateForGlyphs2.apply(this, arguments);
|
|
765
593
|
}
|
|
766
|
-
|
|
767
594
|
return _getUrlTemplateForGlyphs;
|
|
768
595
|
}()
|
|
769
596
|
}]);
|
|
770
|
-
|
|
771
|
-
return TMSService;
|
|
772
597
|
}(AbstractEmsService);
|