@elastic/ems-client 8.6.2 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.backportrc.json +2 -4
- package/.buildkite/pipeline.yml +1 -1
- package/.github/workflows/backport.yml +1 -1
- package/.github/workflows/publish.yml +26 -0
- package/.nvmrc +1 -1
- package/CHANGELOG.md +16 -1
- package/CONTRIBUTING.md +4 -6
- package/eslint.config.mjs +2 -4
- package/package.json +35 -31
- package/renovate.json +10 -4
- package/src/ems_client.ts +3 -3
- package/target/node/ems_client.js +6 -4
- package/target/node/file_layer.js +1 -2
- package/target/web/ems_client.js +138 -168
- package/target/web/file_layer.js +23 -25
- package/target/web/tms_service.js +262 -275
- package/test/__snapshots__/ems_client.test.ts.snap +1 -1
- package/tsconfig.json +2 -2
- package/target/origin.d.ts +0 -4
|
@@ -8,7 +8,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
8
8
|
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; }
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
|
-
function
|
|
11
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
12
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
12
13
|
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); }
|
|
13
14
|
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); }); }; }
|
|
14
15
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -40,85 +41,83 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
40
41
|
_classCallCheck(this, TMSService);
|
|
41
42
|
_this = _callSuper(this, TMSService, [config, emsClient, proxyPath]);
|
|
42
43
|
_defineProperty(_this, "_config", void 0);
|
|
43
|
-
_defineProperty(_this, "_getRasterStyleJson", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
44
|
+
_defineProperty(_this, "_getRasterStyleJson", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
44
45
|
var rasterUrl, url;
|
|
45
|
-
return
|
|
46
|
-
while (1) switch (_context.
|
|
46
|
+
return _regenerator().w(function (_context) {
|
|
47
|
+
while (1) switch (_context.n) {
|
|
47
48
|
case 0:
|
|
48
49
|
rasterUrl = _this._getStyleUrlForLocale('raster');
|
|
49
50
|
if (!rasterUrl) {
|
|
50
|
-
_context.
|
|
51
|
+
_context.n = 1;
|
|
51
52
|
break;
|
|
52
53
|
}
|
|
53
54
|
url = _this._proxyPath + _this._getAbsoluteUrl(rasterUrl);
|
|
54
|
-
return _context.
|
|
55
|
-
case
|
|
56
|
-
return _context.
|
|
57
|
-
case
|
|
58
|
-
|
|
59
|
-
return _context.stop();
|
|
55
|
+
return _context.a(2, _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url)));
|
|
56
|
+
case 1:
|
|
57
|
+
return _context.a(2);
|
|
58
|
+
case 2:
|
|
59
|
+
return _context.a(2);
|
|
60
60
|
}
|
|
61
61
|
}, _callee);
|
|
62
62
|
}))));
|
|
63
|
-
_defineProperty(_this, "_getVectorStyleJsonRaw", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
63
|
+
_defineProperty(_this, "_getVectorStyleJsonRaw", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
64
64
|
var vectorUrl, url, vectorJson;
|
|
65
|
-
return
|
|
66
|
-
while (1) switch (_context2.
|
|
65
|
+
return _regenerator().w(function (_context2) {
|
|
66
|
+
while (1) switch (_context2.n) {
|
|
67
67
|
case 0:
|
|
68
68
|
vectorUrl = _this._getStyleUrlForLocale('vector');
|
|
69
69
|
if (!vectorUrl) {
|
|
70
|
-
_context2.
|
|
70
|
+
_context2.n = 2;
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
url = _this._proxyPath + _this._getAbsoluteUrl(vectorUrl);
|
|
74
|
-
_context2.
|
|
74
|
+
_context2.n = 1;
|
|
75
75
|
return _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url));
|
|
76
|
-
case
|
|
77
|
-
vectorJson = _context2.
|
|
78
|
-
return _context2.
|
|
79
|
-
case
|
|
80
|
-
return _context2.
|
|
81
|
-
case
|
|
82
|
-
|
|
83
|
-
return _context2.stop();
|
|
76
|
+
case 1:
|
|
77
|
+
vectorJson = _context2.v;
|
|
78
|
+
return _context2.a(2, _objectSpread({}, vectorJson));
|
|
79
|
+
case 2:
|
|
80
|
+
return _context2.a(2);
|
|
81
|
+
case 3:
|
|
82
|
+
return _context2.a(2);
|
|
84
83
|
}
|
|
85
84
|
}, _callee2);
|
|
86
85
|
}))));
|
|
87
|
-
_defineProperty(_this, "_getVectorStyleJsonInlined", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
88
|
-
var vectorJson, inlinedSources, sources, _iterator, _step, _sourceName, url, _sourceJson$tiles, sourceUrl, extendedUrl, sourceJson, tiles;
|
|
89
|
-
return
|
|
90
|
-
while (1) switch (_context3.
|
|
86
|
+
_defineProperty(_this, "_getVectorStyleJsonInlined", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
87
|
+
var vectorJson, inlinedSources, sources, _iterator, _step, _sourceName, url, _sourceJson$tiles, sourceUrl, extendedUrl, sourceJson, tiles, _t, _t2, _t3, _t4, _t5, _t6, _t7;
|
|
88
|
+
return _regenerator().w(function (_context3) {
|
|
89
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
91
90
|
case 0:
|
|
92
|
-
_context3.
|
|
91
|
+
_context3.n = 1;
|
|
93
92
|
return _this._getVectorStyleJsonRaw();
|
|
94
|
-
case
|
|
95
|
-
vectorJson = _context3.
|
|
93
|
+
case 1:
|
|
94
|
+
vectorJson = _context3.v;
|
|
96
95
|
if (!vectorJson) {
|
|
97
|
-
_context3.
|
|
96
|
+
_context3.n = 12;
|
|
98
97
|
break;
|
|
99
98
|
}
|
|
100
99
|
inlinedSources = {};
|
|
101
100
|
sources = vectorJson.sources;
|
|
102
101
|
_iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(sources));
|
|
103
|
-
_context3.
|
|
102
|
+
_context3.p = 2;
|
|
104
103
|
_iterator.s();
|
|
105
|
-
case
|
|
104
|
+
case 3:
|
|
106
105
|
if ((_step = _iterator.n()).done) {
|
|
107
|
-
_context3.
|
|
106
|
+
_context3.n = 6;
|
|
108
107
|
break;
|
|
109
108
|
}
|
|
110
109
|
_sourceName = _step.value;
|
|
111
110
|
url = sources[_sourceName].url;
|
|
112
111
|
if (!url) {
|
|
113
|
-
_context3.
|
|
112
|
+
_context3.n = 5;
|
|
114
113
|
break;
|
|
115
114
|
}
|
|
116
115
|
sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
|
|
117
116
|
extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
|
|
118
|
-
_context3.
|
|
117
|
+
_context3.n = 4;
|
|
119
118
|
return _this._emsClient.getManifest(extendedUrl);
|
|
120
|
-
case
|
|
121
|
-
sourceJson = _context3.
|
|
119
|
+
case 4:
|
|
120
|
+
sourceJson = _context3.v;
|
|
122
121
|
tiles = sourceJson === null || sourceJson === void 0 || (_sourceJson$tiles = sourceJson.tiles) === null || _sourceJson$tiles === void 0 ? void 0 : _sourceJson$tiles.map(function (tileUrl) {
|
|
123
122
|
var directUrl = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
|
|
124
123
|
return _this._emsClient.extendUrlWithParams(directUrl);
|
|
@@ -127,46 +126,44 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
127
126
|
type: 'vector',
|
|
128
127
|
tiles: tiles
|
|
129
128
|
});
|
|
130
|
-
case
|
|
131
|
-
_context3.
|
|
129
|
+
case 5:
|
|
130
|
+
_context3.n = 3;
|
|
132
131
|
break;
|
|
133
|
-
case
|
|
134
|
-
_context3.
|
|
132
|
+
case 6:
|
|
133
|
+
_context3.n = 8;
|
|
135
134
|
break;
|
|
136
|
-
case
|
|
137
|
-
_context3.
|
|
138
|
-
|
|
139
|
-
_iterator.e(
|
|
140
|
-
case
|
|
141
|
-
_context3.
|
|
135
|
+
case 7:
|
|
136
|
+
_context3.p = 7;
|
|
137
|
+
_t = _context3.v;
|
|
138
|
+
_iterator.e(_t);
|
|
139
|
+
case 8:
|
|
140
|
+
_context3.p = 8;
|
|
142
141
|
_iterator.f();
|
|
143
|
-
return _context3.
|
|
144
|
-
case
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
_context3.
|
|
142
|
+
return _context3.f(8);
|
|
143
|
+
case 9:
|
|
144
|
+
_t2 = _objectSpread;
|
|
145
|
+
_t3 = _objectSpread({}, vectorJson);
|
|
146
|
+
_t4 = {};
|
|
147
|
+
_t5 = inlinedSources;
|
|
148
|
+
_context3.n = 10;
|
|
150
149
|
return _this._getSpriteSheetRootPath();
|
|
151
|
-
case
|
|
152
|
-
|
|
153
|
-
_context3.
|
|
150
|
+
case 10:
|
|
151
|
+
_t6 = _context3.v;
|
|
152
|
+
_context3.n = 11;
|
|
154
153
|
return _this._getUrlTemplateForGlyphs();
|
|
155
|
-
case
|
|
156
|
-
|
|
157
|
-
_context3.
|
|
158
|
-
sources:
|
|
159
|
-
sprite:
|
|
160
|
-
glyphs:
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
case "end":
|
|
167
|
-
return _context3.stop();
|
|
154
|
+
case 11:
|
|
155
|
+
_t7 = _context3.v;
|
|
156
|
+
return _context3.a(2, _t2(_t3, _t4, {
|
|
157
|
+
sources: _t5,
|
|
158
|
+
sprite: _t6,
|
|
159
|
+
glyphs: _t7
|
|
160
|
+
}));
|
|
161
|
+
case 12:
|
|
162
|
+
return _context3.a(2);
|
|
163
|
+
case 13:
|
|
164
|
+
return _context3.a(2);
|
|
168
165
|
}
|
|
169
|
-
}, _callee3, null, [[
|
|
166
|
+
}, _callee3, null, [[2, 7, 8, 9]]);
|
|
170
167
|
}))));
|
|
171
168
|
_this._config = config;
|
|
172
169
|
return _this;
|
|
@@ -180,31 +177,30 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
180
177
|
return _createClass(TMSService, [{
|
|
181
178
|
key: "getDefaultRasterStyle",
|
|
182
179
|
value: function () {
|
|
183
|
-
var _getDefaultRasterStyle = _asyncToGenerator(/*#__PURE__*/
|
|
180
|
+
var _getDefaultRasterStyle = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
184
181
|
var _this2 = this;
|
|
185
182
|
var tileJson, tiles;
|
|
186
|
-
return
|
|
187
|
-
while (1) switch (_context4.
|
|
183
|
+
return _regenerator().w(function (_context4) {
|
|
184
|
+
while (1) switch (_context4.n) {
|
|
188
185
|
case 0:
|
|
189
|
-
_context4.
|
|
186
|
+
_context4.n = 1;
|
|
190
187
|
return this._getRasterStyleJson();
|
|
191
|
-
case
|
|
192
|
-
tileJson = _context4.
|
|
188
|
+
case 1:
|
|
189
|
+
tileJson = _context4.v;
|
|
193
190
|
if (!tileJson) {
|
|
194
|
-
_context4.
|
|
191
|
+
_context4.n = 2;
|
|
195
192
|
break;
|
|
196
193
|
}
|
|
197
194
|
tiles = tileJson.tiles.map(function (tile) {
|
|
198
195
|
return _this2._proxyPath + _this2._getAbsoluteUrl(tile);
|
|
199
196
|
});
|
|
200
|
-
return _context4.
|
|
197
|
+
return _context4.a(2, _objectSpread(_objectSpread({}, tileJson), {
|
|
201
198
|
tiles: tiles
|
|
202
199
|
}));
|
|
203
|
-
case
|
|
204
|
-
return _context4.
|
|
205
|
-
case
|
|
206
|
-
|
|
207
|
-
return _context4.stop();
|
|
200
|
+
case 2:
|
|
201
|
+
return _context4.a(2);
|
|
202
|
+
case 3:
|
|
203
|
+
return _context4.a(2);
|
|
208
204
|
}
|
|
209
205
|
}, _callee4, this);
|
|
210
206
|
}));
|
|
@@ -216,26 +212,25 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
216
212
|
}, {
|
|
217
213
|
key: "getUrlTemplate",
|
|
218
214
|
value: function () {
|
|
219
|
-
var _getUrlTemplate = _asyncToGenerator(/*#__PURE__*/
|
|
215
|
+
var _getUrlTemplate = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
220
216
|
var tileJson, directUrl;
|
|
221
|
-
return
|
|
222
|
-
while (1) switch (_context5.
|
|
217
|
+
return _regenerator().w(function (_context5) {
|
|
218
|
+
while (1) switch (_context5.n) {
|
|
223
219
|
case 0:
|
|
224
|
-
_context5.
|
|
220
|
+
_context5.n = 1;
|
|
225
221
|
return this._getRasterStyleJson();
|
|
226
|
-
case
|
|
227
|
-
tileJson = _context5.
|
|
222
|
+
case 1:
|
|
223
|
+
tileJson = _context5.v;
|
|
228
224
|
if (!tileJson) {
|
|
229
|
-
_context5.
|
|
225
|
+
_context5.n = 2;
|
|
230
226
|
break;
|
|
231
227
|
}
|
|
232
228
|
directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.tiles[0]);
|
|
233
|
-
return _context5.
|
|
234
|
-
case
|
|
235
|
-
return _context5.
|
|
236
|
-
case
|
|
237
|
-
|
|
238
|
-
return _context5.stop();
|
|
229
|
+
return _context5.a(2, this._emsClient.extendUrlWithParams(directUrl));
|
|
230
|
+
case 2:
|
|
231
|
+
return _context5.a(2, '');
|
|
232
|
+
case 3:
|
|
233
|
+
return _context5.a(2);
|
|
239
234
|
}
|
|
240
235
|
}, _callee5, this);
|
|
241
236
|
}));
|
|
@@ -247,28 +242,27 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
247
242
|
}, {
|
|
248
243
|
key: "getUrlTemplateForVector",
|
|
249
244
|
value: function () {
|
|
250
|
-
var _getUrlTemplateForVector = _asyncToGenerator(/*#__PURE__*/
|
|
245
|
+
var _getUrlTemplateForVector = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(sourceId) {
|
|
251
246
|
var _tileJson$sources$sou;
|
|
252
247
|
var tileJson, url, directUrl;
|
|
253
|
-
return
|
|
254
|
-
while (1) switch (_context6.
|
|
248
|
+
return _regenerator().w(function (_context6) {
|
|
249
|
+
while (1) switch (_context6.n) {
|
|
255
250
|
case 0:
|
|
256
|
-
_context6.
|
|
251
|
+
_context6.n = 1;
|
|
257
252
|
return this._getVectorStyleJsonInlined();
|
|
258
|
-
case
|
|
259
|
-
tileJson = _context6.
|
|
253
|
+
case 1:
|
|
254
|
+
tileJson = _context6.v;
|
|
260
255
|
url = tileJson === null || tileJson === void 0 || (_tileJson$sources$sou = tileJson.sources[sourceId]) === null || _tileJson$sources$sou === void 0 || (_tileJson$sources$sou = _tileJson$sources$sou.tiles) === null || _tileJson$sources$sou === void 0 ? void 0 : _tileJson$sources$sou.pop();
|
|
261
256
|
if (!url) {
|
|
262
|
-
_context6.
|
|
257
|
+
_context6.n = 2;
|
|
263
258
|
break;
|
|
264
259
|
}
|
|
265
260
|
directUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
266
|
-
return _context6.
|
|
267
|
-
case
|
|
268
|
-
return _context6.
|
|
269
|
-
case
|
|
270
|
-
|
|
271
|
-
return _context6.stop();
|
|
261
|
+
return _context6.a(2, this._emsClient.extendUrlWithParams(directUrl));
|
|
262
|
+
case 2:
|
|
263
|
+
return _context6.a(2, '');
|
|
264
|
+
case 3:
|
|
265
|
+
return _context6.a(2);
|
|
272
266
|
}
|
|
273
267
|
}, _callee6, this);
|
|
274
268
|
}));
|
|
@@ -280,17 +274,14 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
280
274
|
}, {
|
|
281
275
|
key: "getVectorStyleSheet",
|
|
282
276
|
value: function () {
|
|
283
|
-
var _getVectorStyleSheet = _asyncToGenerator(/*#__PURE__*/
|
|
284
|
-
return
|
|
285
|
-
while (1) switch (_context7.
|
|
277
|
+
var _getVectorStyleSheet = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
278
|
+
return _regenerator().w(function (_context7) {
|
|
279
|
+
while (1) switch (_context7.n) {
|
|
286
280
|
case 0:
|
|
287
|
-
_context7.
|
|
281
|
+
_context7.n = 1;
|
|
288
282
|
return this._getVectorStyleJsonInlined();
|
|
289
|
-
case
|
|
290
|
-
return _context7.
|
|
291
|
-
case 3:
|
|
292
|
-
case "end":
|
|
293
|
-
return _context7.stop();
|
|
283
|
+
case 1:
|
|
284
|
+
return _context7.a(2, _context7.v);
|
|
294
285
|
}
|
|
295
286
|
}, _callee7, this);
|
|
296
287
|
}));
|
|
@@ -302,17 +293,14 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
302
293
|
}, {
|
|
303
294
|
key: "getVectorStyleSheetRaw",
|
|
304
295
|
value: function () {
|
|
305
|
-
var _getVectorStyleSheetRaw = _asyncToGenerator(/*#__PURE__*/
|
|
306
|
-
return
|
|
307
|
-
while (1) switch (_context8.
|
|
296
|
+
var _getVectorStyleSheetRaw = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
297
|
+
return _regenerator().w(function (_context8) {
|
|
298
|
+
while (1) switch (_context8.n) {
|
|
308
299
|
case 0:
|
|
309
|
-
_context8.
|
|
300
|
+
_context8.n = 1;
|
|
310
301
|
return this._getVectorStyleJsonRaw();
|
|
311
|
-
case
|
|
312
|
-
return _context8.
|
|
313
|
-
case 3:
|
|
314
|
-
case "end":
|
|
315
|
-
return _context8.stop();
|
|
302
|
+
case 1:
|
|
303
|
+
return _context8.a(2, _context8.v);
|
|
316
304
|
}
|
|
317
305
|
}, _callee8, this);
|
|
318
306
|
}));
|
|
@@ -324,43 +312,42 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
324
312
|
}, {
|
|
325
313
|
key: "getSpriteSheetMeta",
|
|
326
314
|
value: function () {
|
|
327
|
-
var _getSpriteSheetMeta = _asyncToGenerator(/*#__PURE__*/
|
|
315
|
+
var _getSpriteSheetMeta = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
328
316
|
var isRetina,
|
|
329
317
|
metaUrl,
|
|
330
318
|
spritePngs,
|
|
331
319
|
metaUrlExtended,
|
|
332
320
|
jsonMeta,
|
|
333
321
|
_args9 = arguments;
|
|
334
|
-
return
|
|
335
|
-
while (1) switch (_context9.
|
|
322
|
+
return _regenerator().w(function (_context9) {
|
|
323
|
+
while (1) switch (_context9.n) {
|
|
336
324
|
case 0:
|
|
337
325
|
isRetina = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
|
|
338
|
-
_context9.
|
|
326
|
+
_context9.n = 1;
|
|
339
327
|
return this.getSpriteSheetJsonPath(isRetina);
|
|
340
|
-
case
|
|
341
|
-
metaUrl = _context9.
|
|
342
|
-
_context9.
|
|
328
|
+
case 1:
|
|
329
|
+
metaUrl = _context9.v;
|
|
330
|
+
_context9.n = 2;
|
|
343
331
|
return this.getSpriteSheetPngPath(isRetina);
|
|
344
|
-
case
|
|
345
|
-
spritePngs = _context9.
|
|
332
|
+
case 2:
|
|
333
|
+
spritePngs = _context9.v;
|
|
346
334
|
if (!(metaUrl && spritePngs)) {
|
|
347
|
-
_context9.
|
|
335
|
+
_context9.n = 4;
|
|
348
336
|
break;
|
|
349
337
|
}
|
|
350
338
|
metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl);
|
|
351
|
-
_context9.
|
|
339
|
+
_context9.n = 3;
|
|
352
340
|
return this._emsClient.getManifest(metaUrlExtended);
|
|
353
|
-
case
|
|
354
|
-
jsonMeta = _context9.
|
|
355
|
-
return _context9.
|
|
341
|
+
case 3:
|
|
342
|
+
jsonMeta = _context9.v;
|
|
343
|
+
return _context9.a(2, {
|
|
356
344
|
png: spritePngs,
|
|
357
345
|
json: jsonMeta
|
|
358
346
|
});
|
|
359
|
-
case
|
|
360
|
-
return _context9.
|
|
361
|
-
case
|
|
362
|
-
|
|
363
|
-
return _context9.stop();
|
|
347
|
+
case 4:
|
|
348
|
+
return _context9.a(2);
|
|
349
|
+
case 5:
|
|
350
|
+
return _context9.a(2);
|
|
364
351
|
}
|
|
365
352
|
}, _callee9, this);
|
|
366
353
|
}));
|
|
@@ -372,32 +359,31 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
372
359
|
}, {
|
|
373
360
|
key: "getSpriteSheetJsonPath",
|
|
374
361
|
value: function () {
|
|
375
|
-
var _getSpriteSheetJsonPath = _asyncToGenerator(/*#__PURE__*/
|
|
362
|
+
var _getSpriteSheetJsonPath = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
376
363
|
var isRetina,
|
|
377
364
|
spriteSheetRootPath,
|
|
378
365
|
suffix,
|
|
379
|
-
|
|
380
|
-
return
|
|
381
|
-
while (1) switch (
|
|
366
|
+
_args0 = arguments;
|
|
367
|
+
return _regenerator().w(function (_context0) {
|
|
368
|
+
while (1) switch (_context0.n) {
|
|
382
369
|
case 0:
|
|
383
|
-
isRetina =
|
|
384
|
-
|
|
370
|
+
isRetina = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : false;
|
|
371
|
+
_context0.n = 1;
|
|
385
372
|
return this._getSpriteSheetRootPath();
|
|
386
|
-
case
|
|
387
|
-
spriteSheetRootPath =
|
|
373
|
+
case 1:
|
|
374
|
+
spriteSheetRootPath = _context0.v;
|
|
388
375
|
if (!spriteSheetRootPath) {
|
|
389
|
-
|
|
376
|
+
_context0.n = 2;
|
|
390
377
|
break;
|
|
391
378
|
}
|
|
392
379
|
suffix = isRetina ? '@2x' : '';
|
|
393
|
-
return
|
|
394
|
-
case
|
|
395
|
-
return
|
|
396
|
-
case
|
|
397
|
-
|
|
398
|
-
return _context10.stop();
|
|
380
|
+
return _context0.a(2, spriteSheetRootPath + suffix + '.json');
|
|
381
|
+
case 2:
|
|
382
|
+
return _context0.a(2, '');
|
|
383
|
+
case 3:
|
|
384
|
+
return _context0.a(2);
|
|
399
385
|
}
|
|
400
|
-
},
|
|
386
|
+
}, _callee0, this);
|
|
401
387
|
}));
|
|
402
388
|
function getSpriteSheetJsonPath() {
|
|
403
389
|
return _getSpriteSheetJsonPath.apply(this, arguments);
|
|
@@ -407,32 +393,31 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
407
393
|
}, {
|
|
408
394
|
key: "getSpriteSheetPngPath",
|
|
409
395
|
value: function () {
|
|
410
|
-
var _getSpriteSheetPngPath = _asyncToGenerator(/*#__PURE__*/
|
|
396
|
+
var _getSpriteSheetPngPath = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
411
397
|
var isRetina,
|
|
412
398
|
spriteSheetRootPath,
|
|
413
399
|
suffix,
|
|
414
|
-
|
|
415
|
-
return
|
|
416
|
-
while (1) switch (
|
|
400
|
+
_args1 = arguments;
|
|
401
|
+
return _regenerator().w(function (_context1) {
|
|
402
|
+
while (1) switch (_context1.n) {
|
|
417
403
|
case 0:
|
|
418
|
-
isRetina =
|
|
419
|
-
|
|
404
|
+
isRetina = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : false;
|
|
405
|
+
_context1.n = 1;
|
|
420
406
|
return this._getSpriteSheetRootPath();
|
|
421
|
-
case
|
|
422
|
-
spriteSheetRootPath =
|
|
407
|
+
case 1:
|
|
408
|
+
spriteSheetRootPath = _context1.v;
|
|
423
409
|
if (!spriteSheetRootPath) {
|
|
424
|
-
|
|
410
|
+
_context1.n = 2;
|
|
425
411
|
break;
|
|
426
412
|
}
|
|
427
413
|
suffix = isRetina ? '@2x' : '';
|
|
428
|
-
return
|
|
429
|
-
case
|
|
430
|
-
return
|
|
431
|
-
case
|
|
432
|
-
|
|
433
|
-
return _context11.stop();
|
|
414
|
+
return _context1.a(2, spriteSheetRootPath + suffix + '.png');
|
|
415
|
+
case 2:
|
|
416
|
+
return _context1.a(2, '');
|
|
417
|
+
case 3:
|
|
418
|
+
return _context1.a(2);
|
|
434
419
|
}
|
|
435
|
-
},
|
|
420
|
+
}, _callee1, this);
|
|
436
421
|
}));
|
|
437
422
|
function getSpriteSheetPngPath() {
|
|
438
423
|
return _getSpriteSheetPngPath.apply(this, arguments);
|
|
@@ -447,61 +432,63 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
447
432
|
}, {
|
|
448
433
|
key: "getMinZoom",
|
|
449
434
|
value: function () {
|
|
450
|
-
var _getMinZoom = _asyncToGenerator(/*#__PURE__*/
|
|
435
|
+
var _getMinZoom = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
|
|
451
436
|
var format,
|
|
452
437
|
_ref4,
|
|
453
438
|
sources,
|
|
454
439
|
_ref5,
|
|
455
440
|
minzoom,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
441
|
+
_args10 = arguments,
|
|
442
|
+
_t8,
|
|
443
|
+
_t9,
|
|
444
|
+
_t0;
|
|
445
|
+
return _regenerator().w(function (_context10) {
|
|
446
|
+
while (1) switch (_context10.n) {
|
|
459
447
|
case 0:
|
|
460
|
-
format =
|
|
461
|
-
|
|
462
|
-
|
|
448
|
+
format = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : 'vector';
|
|
449
|
+
_t8 = format;
|
|
450
|
+
_context10.n = _t8 === 'vector' ? 1 : _t8 === 'raster' ? 4 : 7;
|
|
463
451
|
break;
|
|
464
|
-
case
|
|
465
|
-
|
|
452
|
+
case 1:
|
|
453
|
+
_context10.n = 2;
|
|
466
454
|
return this._getVectorStyleJsonInlined();
|
|
467
|
-
case
|
|
468
|
-
|
|
469
|
-
if (
|
|
470
|
-
|
|
455
|
+
case 2:
|
|
456
|
+
_t9 = _context10.v;
|
|
457
|
+
if (_t9) {
|
|
458
|
+
_context10.n = 3;
|
|
471
459
|
break;
|
|
472
460
|
}
|
|
473
|
-
|
|
461
|
+
_t9 = {
|
|
474
462
|
sources: {}
|
|
475
463
|
};
|
|
476
|
-
case
|
|
477
|
-
_ref4 =
|
|
464
|
+
case 3:
|
|
465
|
+
_ref4 = _t9;
|
|
478
466
|
sources = _ref4.sources;
|
|
479
|
-
return
|
|
467
|
+
return _context10.a(2, Math.min.apply(Math, _toConsumableArray(Object.values(sources).map(function (s) {
|
|
480
468
|
return s && s instanceof Object && 'minzoom' in s ? s['minzoom'] : null;
|
|
481
469
|
}).filter(function (minzoom) {
|
|
482
470
|
return Number.isFinite(minzoom);
|
|
483
471
|
}))));
|
|
484
|
-
case
|
|
485
|
-
|
|
472
|
+
case 4:
|
|
473
|
+
_context10.n = 5;
|
|
486
474
|
return this._getRasterStyleJson();
|
|
487
|
-
case
|
|
488
|
-
|
|
489
|
-
if (
|
|
490
|
-
|
|
475
|
+
case 5:
|
|
476
|
+
_t0 = _context10.v;
|
|
477
|
+
if (_t0) {
|
|
478
|
+
_context10.n = 6;
|
|
491
479
|
break;
|
|
492
480
|
}
|
|
493
|
-
|
|
494
|
-
case
|
|
495
|
-
_ref5 =
|
|
481
|
+
_t0 = {};
|
|
482
|
+
case 6:
|
|
483
|
+
_ref5 = _t0;
|
|
496
484
|
minzoom = _ref5.minzoom;
|
|
497
|
-
return
|
|
498
|
-
case
|
|
499
|
-
return
|
|
500
|
-
case
|
|
501
|
-
|
|
502
|
-
return _context12.stop();
|
|
485
|
+
return _context10.a(2, minzoom);
|
|
486
|
+
case 7:
|
|
487
|
+
return _context10.a(2);
|
|
488
|
+
case 8:
|
|
489
|
+
return _context10.a(2);
|
|
503
490
|
}
|
|
504
|
-
},
|
|
491
|
+
}, _callee10, this);
|
|
505
492
|
}));
|
|
506
493
|
function getMinZoom() {
|
|
507
494
|
return _getMinZoom.apply(this, arguments);
|
|
@@ -511,61 +498,63 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
511
498
|
}, {
|
|
512
499
|
key: "getMaxZoom",
|
|
513
500
|
value: function () {
|
|
514
|
-
var _getMaxZoom = _asyncToGenerator(/*#__PURE__*/
|
|
501
|
+
var _getMaxZoom = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
|
|
515
502
|
var format,
|
|
516
503
|
_ref6,
|
|
517
504
|
sources,
|
|
518
505
|
_ref7,
|
|
519
506
|
maxzoom,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
507
|
+
_args11 = arguments,
|
|
508
|
+
_t1,
|
|
509
|
+
_t10,
|
|
510
|
+
_t11;
|
|
511
|
+
return _regenerator().w(function (_context11) {
|
|
512
|
+
while (1) switch (_context11.n) {
|
|
523
513
|
case 0:
|
|
524
|
-
format =
|
|
525
|
-
|
|
526
|
-
|
|
514
|
+
format = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : 'vector';
|
|
515
|
+
_t1 = format;
|
|
516
|
+
_context11.n = _t1 === 'vector' ? 1 : _t1 === 'raster' ? 4 : 7;
|
|
527
517
|
break;
|
|
528
|
-
case
|
|
529
|
-
|
|
518
|
+
case 1:
|
|
519
|
+
_context11.n = 2;
|
|
530
520
|
return this._getVectorStyleJsonInlined();
|
|
531
|
-
case
|
|
532
|
-
|
|
533
|
-
if (
|
|
534
|
-
|
|
521
|
+
case 2:
|
|
522
|
+
_t10 = _context11.v;
|
|
523
|
+
if (_t10) {
|
|
524
|
+
_context11.n = 3;
|
|
535
525
|
break;
|
|
536
526
|
}
|
|
537
|
-
|
|
527
|
+
_t10 = {
|
|
538
528
|
sources: {}
|
|
539
529
|
};
|
|
540
|
-
case
|
|
541
|
-
_ref6 =
|
|
530
|
+
case 3:
|
|
531
|
+
_ref6 = _t10;
|
|
542
532
|
sources = _ref6.sources;
|
|
543
|
-
return
|
|
533
|
+
return _context11.a(2, Math.max.apply(Math, _toConsumableArray(Object.values(sources).map(function (s) {
|
|
544
534
|
return s && s instanceof Object && 'maxzoom' in s ? s['maxzoom'] : null;
|
|
545
535
|
}).filter(function (maxzoom) {
|
|
546
536
|
return Number.isFinite(maxzoom);
|
|
547
537
|
}))));
|
|
548
|
-
case
|
|
549
|
-
|
|
538
|
+
case 4:
|
|
539
|
+
_context11.n = 5;
|
|
550
540
|
return this._getRasterStyleJson();
|
|
551
|
-
case
|
|
552
|
-
|
|
553
|
-
if (
|
|
554
|
-
|
|
541
|
+
case 5:
|
|
542
|
+
_t11 = _context11.v;
|
|
543
|
+
if (_t11) {
|
|
544
|
+
_context11.n = 6;
|
|
555
545
|
break;
|
|
556
546
|
}
|
|
557
|
-
|
|
558
|
-
case
|
|
559
|
-
_ref7 =
|
|
547
|
+
_t11 = {};
|
|
548
|
+
case 6:
|
|
549
|
+
_ref7 = _t11;
|
|
560
550
|
maxzoom = _ref7.maxzoom;
|
|
561
|
-
return
|
|
562
|
-
case
|
|
563
|
-
return
|
|
564
|
-
case
|
|
565
|
-
|
|
566
|
-
return _context13.stop();
|
|
551
|
+
return _context11.a(2, maxzoom);
|
|
552
|
+
case 7:
|
|
553
|
+
return _context11.a(2);
|
|
554
|
+
case 8:
|
|
555
|
+
return _context11.a(2);
|
|
567
556
|
}
|
|
568
|
-
},
|
|
557
|
+
}, _callee11, this);
|
|
569
558
|
}));
|
|
570
559
|
function getMaxZoom() {
|
|
571
560
|
return _getMaxZoom.apply(this, arguments);
|
|
@@ -613,27 +602,26 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
613
602
|
}, {
|
|
614
603
|
key: "_getSpriteSheetRootPath",
|
|
615
604
|
value: function () {
|
|
616
|
-
var _getSpriteSheetRootPath2 = _asyncToGenerator(/*#__PURE__*/
|
|
605
|
+
var _getSpriteSheetRootPath2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
|
|
617
606
|
var vectorStyleJson;
|
|
618
|
-
return
|
|
619
|
-
while (1) switch (
|
|
607
|
+
return _regenerator().w(function (_context12) {
|
|
608
|
+
while (1) switch (_context12.n) {
|
|
620
609
|
case 0:
|
|
621
|
-
|
|
610
|
+
_context12.n = 1;
|
|
622
611
|
return this._getVectorStyleJsonRaw();
|
|
623
|
-
case
|
|
624
|
-
vectorStyleJson =
|
|
612
|
+
case 1:
|
|
613
|
+
vectorStyleJson = _context12.v;
|
|
625
614
|
if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.sprite)) {
|
|
626
|
-
|
|
615
|
+
_context12.n = 2;
|
|
627
616
|
break;
|
|
628
617
|
}
|
|
629
|
-
return
|
|
630
|
-
case
|
|
631
|
-
return
|
|
632
|
-
case
|
|
633
|
-
|
|
634
|
-
return _context14.stop();
|
|
618
|
+
return _context12.a(2, this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite.toString()));
|
|
619
|
+
case 2:
|
|
620
|
+
return _context12.a(2, '');
|
|
621
|
+
case 3:
|
|
622
|
+
return _context12.a(2);
|
|
635
623
|
}
|
|
636
|
-
},
|
|
624
|
+
}, _callee12, this);
|
|
637
625
|
}));
|
|
638
626
|
function _getSpriteSheetRootPath() {
|
|
639
627
|
return _getSpriteSheetRootPath2.apply(this, arguments);
|
|
@@ -643,27 +631,26 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
643
631
|
}, {
|
|
644
632
|
key: "_getUrlTemplateForGlyphs",
|
|
645
633
|
value: function () {
|
|
646
|
-
var _getUrlTemplateForGlyphs2 = _asyncToGenerator(/*#__PURE__*/
|
|
634
|
+
var _getUrlTemplateForGlyphs2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
|
|
647
635
|
var vectorStyleJson;
|
|
648
|
-
return
|
|
649
|
-
while (1) switch (
|
|
636
|
+
return _regenerator().w(function (_context13) {
|
|
637
|
+
while (1) switch (_context13.n) {
|
|
650
638
|
case 0:
|
|
651
|
-
|
|
639
|
+
_context13.n = 1;
|
|
652
640
|
return this._getVectorStyleJsonRaw();
|
|
653
|
-
case
|
|
654
|
-
vectorStyleJson =
|
|
641
|
+
case 1:
|
|
642
|
+
vectorStyleJson = _context13.v;
|
|
655
643
|
if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.glyphs)) {
|
|
656
|
-
|
|
644
|
+
_context13.n = 2;
|
|
657
645
|
break;
|
|
658
646
|
}
|
|
659
|
-
return
|
|
660
|
-
case
|
|
661
|
-
return
|
|
662
|
-
case
|
|
663
|
-
|
|
664
|
-
return _context15.stop();
|
|
647
|
+
return _context13.a(2, this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs));
|
|
648
|
+
case 2:
|
|
649
|
+
return _context13.a(2, '');
|
|
650
|
+
case 3:
|
|
651
|
+
return _context13.a(2);
|
|
665
652
|
}
|
|
666
|
-
},
|
|
653
|
+
}, _callee13, this);
|
|
667
654
|
}));
|
|
668
655
|
function _getUrlTemplateForGlyphs() {
|
|
669
656
|
return _getUrlTemplateForGlyphs2.apply(this, arguments);
|