@elastic/ems-client 8.7.0 → 8.8.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/.buildkite/compare_dependencies.js +15 -0
- package/.buildkite/pipeline.yml +1 -1
- package/.github/workflows/backport.yml +2 -2
- package/.github/workflows/publish.yml +6 -2
- package/.nvmrc +1 -1
- package/CHANGELOG.md +9 -1
- package/babel.config.js +2 -3
- package/package.json +28 -29
- package/renovate.json +9 -8
- package/src/ems_client.ts +1 -1
- package/src/file_layer.ts +1 -1
- package/src/tms_service.ts +1 -1
- package/src/utils.ts +1 -1
- package/target/ems_client.d.ts +1 -1
- package/target/file_layer.d.ts +1 -1
- package/target/node/ems_client.js +25 -24
- package/target/node/ems_service.js +17 -16
- package/target/node/file_layer.js +5 -5
- package/target/node/tms_service.js +274 -273
- package/target/node/utils.js +3 -2
- package/target/tms_service.d.ts +1 -1
- package/target/utils.d.ts +1 -1
- package/target/web/ems_client.js +216 -502
- package/target/web/ems_service.js +35 -49
- package/target/web/file_layer.js +118 -210
- package/target/web/tms_service.js +477 -901
- package/target/web/utils.js +13 -16
- package/tsconfig.json +6 -3
|
@@ -1,30 +1,3 @@
|
|
|
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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
-
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; } } }; }
|
|
7
|
-
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; } }
|
|
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
|
-
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
|
-
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 _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); }
|
|
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); }
|
|
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); }); }; }
|
|
15
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
-
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); } }
|
|
17
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
19
|
-
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); }
|
|
20
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
|
-
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); }
|
|
24
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
25
|
-
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; }
|
|
26
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
27
|
-
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); }
|
|
28
1
|
/*
|
|
29
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
30
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -33,899 +6,502 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
33
6
|
*/
|
|
34
7
|
|
|
35
8
|
import _ from 'lodash';
|
|
9
|
+
import { EMSClient, EmsTmsFormat, TMSServiceConfig } from './ems_client';
|
|
36
10
|
import { AbstractEmsService } from './ems_service';
|
|
37
|
-
import { colorizeColor } from './utils';
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
11
|
+
import { layerPaintProperty, colorizeColor, blendMode, mbColorDefinition } from './utils';
|
|
12
|
+
export class TMSService extends AbstractEmsService {
|
|
13
|
+
/*
|
|
14
|
+
List of supported languages with labels and OMT codes extracted
|
|
15
|
+
from https://openmaptiles.org/languages
|
|
16
|
+
Keys are values for i18.locale from Kibana settings
|
|
17
|
+
and OMT codes for the rest.
|
|
18
|
+
*/
|
|
19
|
+
static SupportedLanguages = [{
|
|
20
|
+
key: 'ar',
|
|
21
|
+
omt: 'ar'
|
|
22
|
+
}, {
|
|
23
|
+
key: 'az',
|
|
24
|
+
omt: 'az'
|
|
25
|
+
}, {
|
|
26
|
+
key: 'be',
|
|
27
|
+
omt: 'be'
|
|
28
|
+
}, {
|
|
29
|
+
key: 'bg',
|
|
30
|
+
omt: 'bg'
|
|
31
|
+
}, {
|
|
32
|
+
key: 'br',
|
|
33
|
+
omt: 'br'
|
|
34
|
+
}, {
|
|
35
|
+
key: 'bs',
|
|
36
|
+
omt: 'bs'
|
|
37
|
+
}, {
|
|
38
|
+
key: 'ca',
|
|
39
|
+
omt: 'ca'
|
|
40
|
+
}, {
|
|
41
|
+
key: 'cs',
|
|
42
|
+
omt: 'cs'
|
|
43
|
+
}, {
|
|
44
|
+
key: 'cy',
|
|
45
|
+
omt: 'cy'
|
|
46
|
+
}, {
|
|
47
|
+
key: 'da',
|
|
48
|
+
omt: 'da'
|
|
49
|
+
}, {
|
|
50
|
+
key: 'de',
|
|
51
|
+
omt: 'de'
|
|
52
|
+
}, {
|
|
53
|
+
key: 'el',
|
|
54
|
+
omt: 'el'
|
|
55
|
+
}, {
|
|
56
|
+
key: 'en',
|
|
57
|
+
omt: 'en'
|
|
58
|
+
}, {
|
|
59
|
+
key: 'eo',
|
|
60
|
+
omt: 'eo'
|
|
61
|
+
}, {
|
|
62
|
+
key: 'es',
|
|
63
|
+
omt: 'es'
|
|
64
|
+
}, {
|
|
65
|
+
key: 'et',
|
|
66
|
+
omt: 'et'
|
|
67
|
+
}, {
|
|
68
|
+
key: 'fi',
|
|
69
|
+
omt: 'fi'
|
|
70
|
+
}, {
|
|
71
|
+
key: 'fr-fr',
|
|
72
|
+
omt: 'fr'
|
|
73
|
+
}, {
|
|
74
|
+
key: 'fy',
|
|
75
|
+
omt: 'fy'
|
|
76
|
+
}, {
|
|
77
|
+
key: 'ga',
|
|
78
|
+
omt: 'ga'
|
|
79
|
+
}, {
|
|
80
|
+
key: 'gd',
|
|
81
|
+
omt: 'gd'
|
|
82
|
+
}, {
|
|
83
|
+
key: 'he',
|
|
84
|
+
omt: 'he'
|
|
85
|
+
}, {
|
|
86
|
+
key: 'hi-in',
|
|
87
|
+
omt: 'hi'
|
|
88
|
+
}, {
|
|
89
|
+
key: 'hr',
|
|
90
|
+
omt: 'hr'
|
|
91
|
+
}, {
|
|
92
|
+
key: 'hu',
|
|
93
|
+
omt: 'hu'
|
|
94
|
+
}, {
|
|
95
|
+
key: 'hy',
|
|
96
|
+
omt: 'hy'
|
|
97
|
+
}, {
|
|
98
|
+
key: 'is',
|
|
99
|
+
omt: 'is'
|
|
100
|
+
}, {
|
|
101
|
+
key: 'it',
|
|
102
|
+
omt: 'it'
|
|
103
|
+
}, {
|
|
104
|
+
key: 'ja_kana',
|
|
105
|
+
omt: 'ja_kana'
|
|
106
|
+
}, {
|
|
107
|
+
key: 'ja_rm',
|
|
108
|
+
omt: 'ja_rm'
|
|
109
|
+
}, {
|
|
110
|
+
key: 'ja-jp',
|
|
111
|
+
omt: 'ja'
|
|
112
|
+
}, {
|
|
113
|
+
key: 'ka',
|
|
114
|
+
omt: 'ka'
|
|
115
|
+
}, {
|
|
116
|
+
key: 'kk',
|
|
117
|
+
omt: 'kk'
|
|
118
|
+
}, {
|
|
119
|
+
key: 'kn',
|
|
120
|
+
omt: 'kn'
|
|
121
|
+
}, {
|
|
122
|
+
key: 'ko_rm',
|
|
123
|
+
omt: 'ko_rm'
|
|
124
|
+
}, {
|
|
125
|
+
key: 'ko',
|
|
126
|
+
omt: 'ko'
|
|
127
|
+
}, {
|
|
128
|
+
key: 'la',
|
|
129
|
+
omt: 'la'
|
|
130
|
+
}, {
|
|
131
|
+
key: 'lb',
|
|
132
|
+
omt: 'lb'
|
|
133
|
+
}, {
|
|
134
|
+
key: 'lt',
|
|
135
|
+
omt: 'lt'
|
|
136
|
+
}, {
|
|
137
|
+
key: 'lv',
|
|
138
|
+
omt: 'lv'
|
|
139
|
+
}, {
|
|
140
|
+
key: 'mk',
|
|
141
|
+
omt: 'mk'
|
|
142
|
+
}, {
|
|
143
|
+
key: 'mt',
|
|
144
|
+
omt: 'mt'
|
|
145
|
+
}, {
|
|
146
|
+
key: 'nl',
|
|
147
|
+
omt: 'nl'
|
|
148
|
+
}, {
|
|
149
|
+
key: 'no',
|
|
150
|
+
omt: 'no'
|
|
151
|
+
}, {
|
|
152
|
+
key: 'pl',
|
|
153
|
+
omt: 'pl'
|
|
154
|
+
}, {
|
|
155
|
+
key: 'pt-pt',
|
|
156
|
+
omt: 'pt'
|
|
157
|
+
}, {
|
|
158
|
+
key: 'rm',
|
|
159
|
+
omt: 'rm'
|
|
160
|
+
}, {
|
|
161
|
+
key: 'ro',
|
|
162
|
+
omt: 'ro'
|
|
163
|
+
}, {
|
|
164
|
+
key: 'ru-ru',
|
|
165
|
+
omt: 'ru'
|
|
166
|
+
}, {
|
|
167
|
+
key: 'sk',
|
|
168
|
+
omt: 'sk'
|
|
169
|
+
}, {
|
|
170
|
+
key: 'sl',
|
|
171
|
+
omt: 'sl'
|
|
172
|
+
}, {
|
|
173
|
+
key: 'sq',
|
|
174
|
+
omt: 'sq'
|
|
175
|
+
}, {
|
|
176
|
+
key: 'sr-Ltn',
|
|
177
|
+
omt: 'sr-Ltn'
|
|
178
|
+
}, {
|
|
179
|
+
key: 'sr',
|
|
180
|
+
omt: 'sr'
|
|
181
|
+
}, {
|
|
182
|
+
key: 'sv',
|
|
183
|
+
omt: 'sv'
|
|
184
|
+
}, {
|
|
185
|
+
key: 'th',
|
|
186
|
+
omt: 'th'
|
|
187
|
+
}, {
|
|
188
|
+
key: 'tr',
|
|
189
|
+
omt: 'tr'
|
|
190
|
+
}, {
|
|
191
|
+
key: 'uk',
|
|
192
|
+
omt: 'uk'
|
|
193
|
+
}, {
|
|
194
|
+
key: 'zh-cn',
|
|
195
|
+
omt: 'zh'
|
|
196
|
+
}];
|
|
171
197
|
|
|
172
198
|
/*
|
|
173
|
-
|
|
174
|
-
layout['text-field'] to apply using map.setLayoutProperty
|
|
199
|
+
Suggested default operations for the different EMS styles
|
|
175
200
|
*/
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
var _getDefaultRasterStyle = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
181
|
-
var _this2 = this;
|
|
182
|
-
var tileJson, tiles;
|
|
183
|
-
return _regenerator().w(function (_context4) {
|
|
184
|
-
while (1) switch (_context4.n) {
|
|
185
|
-
case 0:
|
|
186
|
-
_context4.n = 1;
|
|
187
|
-
return this._getRasterStyleJson();
|
|
188
|
-
case 1:
|
|
189
|
-
tileJson = _context4.v;
|
|
190
|
-
if (!tileJson) {
|
|
191
|
-
_context4.n = 2;
|
|
192
|
-
break;
|
|
193
|
-
}
|
|
194
|
-
tiles = tileJson.tiles.map(function (tile) {
|
|
195
|
-
return _this2._proxyPath + _this2._getAbsoluteUrl(tile);
|
|
196
|
-
});
|
|
197
|
-
return _context4.a(2, _objectSpread(_objectSpread({}, tileJson), {
|
|
198
|
-
tiles: tiles
|
|
199
|
-
}));
|
|
200
|
-
case 2:
|
|
201
|
-
return _context4.a(2);
|
|
202
|
-
case 3:
|
|
203
|
-
return _context4.a(2);
|
|
204
|
-
}
|
|
205
|
-
}, _callee4, this);
|
|
206
|
-
}));
|
|
207
|
-
function getDefaultRasterStyle() {
|
|
208
|
-
return _getDefaultRasterStyle.apply(this, arguments);
|
|
209
|
-
}
|
|
210
|
-
return getDefaultRasterStyle;
|
|
211
|
-
}()
|
|
212
|
-
}, {
|
|
213
|
-
key: "getUrlTemplate",
|
|
214
|
-
value: function () {
|
|
215
|
-
var _getUrlTemplate = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
216
|
-
var tileJson, directUrl;
|
|
217
|
-
return _regenerator().w(function (_context5) {
|
|
218
|
-
while (1) switch (_context5.n) {
|
|
219
|
-
case 0:
|
|
220
|
-
_context5.n = 1;
|
|
221
|
-
return this._getRasterStyleJson();
|
|
222
|
-
case 1:
|
|
223
|
-
tileJson = _context5.v;
|
|
224
|
-
if (!tileJson) {
|
|
225
|
-
_context5.n = 2;
|
|
226
|
-
break;
|
|
227
|
-
}
|
|
228
|
-
directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.tiles[0]);
|
|
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);
|
|
234
|
-
}
|
|
235
|
-
}, _callee5, this);
|
|
236
|
-
}));
|
|
237
|
-
function getUrlTemplate() {
|
|
238
|
-
return _getUrlTemplate.apply(this, arguments);
|
|
239
|
-
}
|
|
240
|
-
return getUrlTemplate;
|
|
241
|
-
}()
|
|
242
|
-
}, {
|
|
243
|
-
key: "getUrlTemplateForVector",
|
|
244
|
-
value: function () {
|
|
245
|
-
var _getUrlTemplateForVector = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(sourceId) {
|
|
246
|
-
var _tileJson$sources$sou;
|
|
247
|
-
var tileJson, url, directUrl;
|
|
248
|
-
return _regenerator().w(function (_context6) {
|
|
249
|
-
while (1) switch (_context6.n) {
|
|
250
|
-
case 0:
|
|
251
|
-
_context6.n = 1;
|
|
252
|
-
return this._getVectorStyleJsonInlined();
|
|
253
|
-
case 1:
|
|
254
|
-
tileJson = _context6.v;
|
|
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();
|
|
256
|
-
if (!url) {
|
|
257
|
-
_context6.n = 2;
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
directUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
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);
|
|
266
|
-
}
|
|
267
|
-
}, _callee6, this);
|
|
268
|
-
}));
|
|
269
|
-
function getUrlTemplateForVector(_x) {
|
|
270
|
-
return _getUrlTemplateForVector.apply(this, arguments);
|
|
271
|
-
}
|
|
272
|
-
return getUrlTemplateForVector;
|
|
273
|
-
}()
|
|
274
|
-
}, {
|
|
275
|
-
key: "getVectorStyleSheet",
|
|
276
|
-
value: function () {
|
|
277
|
-
var _getVectorStyleSheet = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
278
|
-
return _regenerator().w(function (_context7) {
|
|
279
|
-
while (1) switch (_context7.n) {
|
|
280
|
-
case 0:
|
|
281
|
-
_context7.n = 1;
|
|
282
|
-
return this._getVectorStyleJsonInlined();
|
|
283
|
-
case 1:
|
|
284
|
-
return _context7.a(2, _context7.v);
|
|
285
|
-
}
|
|
286
|
-
}, _callee7, this);
|
|
287
|
-
}));
|
|
288
|
-
function getVectorStyleSheet() {
|
|
289
|
-
return _getVectorStyleSheet.apply(this, arguments);
|
|
290
|
-
}
|
|
291
|
-
return getVectorStyleSheet;
|
|
292
|
-
}()
|
|
293
|
-
}, {
|
|
294
|
-
key: "getVectorStyleSheetRaw",
|
|
295
|
-
value: function () {
|
|
296
|
-
var _getVectorStyleSheetRaw = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
297
|
-
return _regenerator().w(function (_context8) {
|
|
298
|
-
while (1) switch (_context8.n) {
|
|
299
|
-
case 0:
|
|
300
|
-
_context8.n = 1;
|
|
301
|
-
return this._getVectorStyleJsonRaw();
|
|
302
|
-
case 1:
|
|
303
|
-
return _context8.a(2, _context8.v);
|
|
304
|
-
}
|
|
305
|
-
}, _callee8, this);
|
|
306
|
-
}));
|
|
307
|
-
function getVectorStyleSheetRaw() {
|
|
308
|
-
return _getVectorStyleSheetRaw.apply(this, arguments);
|
|
309
|
-
}
|
|
310
|
-
return getVectorStyleSheetRaw;
|
|
311
|
-
}()
|
|
312
|
-
}, {
|
|
313
|
-
key: "getSpriteSheetMeta",
|
|
314
|
-
value: function () {
|
|
315
|
-
var _getSpriteSheetMeta = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
316
|
-
var isRetina,
|
|
317
|
-
metaUrl,
|
|
318
|
-
spritePngs,
|
|
319
|
-
metaUrlExtended,
|
|
320
|
-
jsonMeta,
|
|
321
|
-
_args9 = arguments;
|
|
322
|
-
return _regenerator().w(function (_context9) {
|
|
323
|
-
while (1) switch (_context9.n) {
|
|
324
|
-
case 0:
|
|
325
|
-
isRetina = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
|
|
326
|
-
_context9.n = 1;
|
|
327
|
-
return this.getSpriteSheetJsonPath(isRetina);
|
|
328
|
-
case 1:
|
|
329
|
-
metaUrl = _context9.v;
|
|
330
|
-
_context9.n = 2;
|
|
331
|
-
return this.getSpriteSheetPngPath(isRetina);
|
|
332
|
-
case 2:
|
|
333
|
-
spritePngs = _context9.v;
|
|
334
|
-
if (!(metaUrl && spritePngs)) {
|
|
335
|
-
_context9.n = 4;
|
|
336
|
-
break;
|
|
337
|
-
}
|
|
338
|
-
metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl);
|
|
339
|
-
_context9.n = 3;
|
|
340
|
-
return this._emsClient.getManifest(metaUrlExtended);
|
|
341
|
-
case 3:
|
|
342
|
-
jsonMeta = _context9.v;
|
|
343
|
-
return _context9.a(2, {
|
|
344
|
-
png: spritePngs,
|
|
345
|
-
json: jsonMeta
|
|
346
|
-
});
|
|
347
|
-
case 4:
|
|
348
|
-
return _context9.a(2);
|
|
349
|
-
case 5:
|
|
350
|
-
return _context9.a(2);
|
|
351
|
-
}
|
|
352
|
-
}, _callee9, this);
|
|
353
|
-
}));
|
|
354
|
-
function getSpriteSheetMeta() {
|
|
355
|
-
return _getSpriteSheetMeta.apply(this, arguments);
|
|
356
|
-
}
|
|
357
|
-
return getSpriteSheetMeta;
|
|
358
|
-
}()
|
|
359
|
-
}, {
|
|
360
|
-
key: "getSpriteSheetJsonPath",
|
|
361
|
-
value: function () {
|
|
362
|
-
var _getSpriteSheetJsonPath = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
363
|
-
var isRetina,
|
|
364
|
-
spriteSheetRootPath,
|
|
365
|
-
suffix,
|
|
366
|
-
_args0 = arguments;
|
|
367
|
-
return _regenerator().w(function (_context0) {
|
|
368
|
-
while (1) switch (_context0.n) {
|
|
369
|
-
case 0:
|
|
370
|
-
isRetina = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : false;
|
|
371
|
-
_context0.n = 1;
|
|
372
|
-
return this._getSpriteSheetRootPath();
|
|
373
|
-
case 1:
|
|
374
|
-
spriteSheetRootPath = _context0.v;
|
|
375
|
-
if (!spriteSheetRootPath) {
|
|
376
|
-
_context0.n = 2;
|
|
377
|
-
break;
|
|
378
|
-
}
|
|
379
|
-
suffix = isRetina ? '@2x' : '';
|
|
380
|
-
return _context0.a(2, spriteSheetRootPath + suffix + '.json');
|
|
381
|
-
case 2:
|
|
382
|
-
return _context0.a(2, '');
|
|
383
|
-
case 3:
|
|
384
|
-
return _context0.a(2);
|
|
385
|
-
}
|
|
386
|
-
}, _callee0, this);
|
|
387
|
-
}));
|
|
388
|
-
function getSpriteSheetJsonPath() {
|
|
389
|
-
return _getSpriteSheetJsonPath.apply(this, arguments);
|
|
390
|
-
}
|
|
391
|
-
return getSpriteSheetJsonPath;
|
|
392
|
-
}()
|
|
393
|
-
}, {
|
|
394
|
-
key: "getSpriteSheetPngPath",
|
|
395
|
-
value: function () {
|
|
396
|
-
var _getSpriteSheetPngPath = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
397
|
-
var isRetina,
|
|
398
|
-
spriteSheetRootPath,
|
|
399
|
-
suffix,
|
|
400
|
-
_args1 = arguments;
|
|
401
|
-
return _regenerator().w(function (_context1) {
|
|
402
|
-
while (1) switch (_context1.n) {
|
|
403
|
-
case 0:
|
|
404
|
-
isRetina = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : false;
|
|
405
|
-
_context1.n = 1;
|
|
406
|
-
return this._getSpriteSheetRootPath();
|
|
407
|
-
case 1:
|
|
408
|
-
spriteSheetRootPath = _context1.v;
|
|
409
|
-
if (!spriteSheetRootPath) {
|
|
410
|
-
_context1.n = 2;
|
|
411
|
-
break;
|
|
412
|
-
}
|
|
413
|
-
suffix = isRetina ? '@2x' : '';
|
|
414
|
-
return _context1.a(2, spriteSheetRootPath + suffix + '.png');
|
|
415
|
-
case 2:
|
|
416
|
-
return _context1.a(2, '');
|
|
417
|
-
case 3:
|
|
418
|
-
return _context1.a(2);
|
|
419
|
-
}
|
|
420
|
-
}, _callee1, this);
|
|
421
|
-
}));
|
|
422
|
-
function getSpriteSheetPngPath() {
|
|
423
|
-
return _getSpriteSheetPngPath.apply(this, arguments);
|
|
424
|
-
}
|
|
425
|
-
return getSpriteSheetPngPath;
|
|
426
|
-
}()
|
|
201
|
+
static colorOperationDefaults = [{
|
|
202
|
+
style: 'road_map',
|
|
203
|
+
operation: 'mix',
|
|
204
|
+
percentage: 0.25
|
|
427
205
|
}, {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}
|
|
206
|
+
style: 'road_map_desaturated',
|
|
207
|
+
operation: 'screen',
|
|
208
|
+
percentage: 0.25
|
|
432
209
|
}, {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
var format,
|
|
437
|
-
_ref4,
|
|
438
|
-
sources,
|
|
439
|
-
_ref5,
|
|
440
|
-
minzoom,
|
|
441
|
-
_args10 = arguments,
|
|
442
|
-
_t8,
|
|
443
|
-
_t9,
|
|
444
|
-
_t0;
|
|
445
|
-
return _regenerator().w(function (_context10) {
|
|
446
|
-
while (1) switch (_context10.n) {
|
|
447
|
-
case 0:
|
|
448
|
-
format = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : 'vector';
|
|
449
|
-
_t8 = format;
|
|
450
|
-
_context10.n = _t8 === 'vector' ? 1 : _t8 === 'raster' ? 4 : 7;
|
|
451
|
-
break;
|
|
452
|
-
case 1:
|
|
453
|
-
_context10.n = 2;
|
|
454
|
-
return this._getVectorStyleJsonInlined();
|
|
455
|
-
case 2:
|
|
456
|
-
_t9 = _context10.v;
|
|
457
|
-
if (_t9) {
|
|
458
|
-
_context10.n = 3;
|
|
459
|
-
break;
|
|
460
|
-
}
|
|
461
|
-
_t9 = {
|
|
462
|
-
sources: {}
|
|
463
|
-
};
|
|
464
|
-
case 3:
|
|
465
|
-
_ref4 = _t9;
|
|
466
|
-
sources = _ref4.sources;
|
|
467
|
-
return _context10.a(2, Math.min.apply(Math, _toConsumableArray(Object.values(sources).map(function (s) {
|
|
468
|
-
return s && s instanceof Object && 'minzoom' in s ? s['minzoom'] : null;
|
|
469
|
-
}).filter(function (minzoom) {
|
|
470
|
-
return Number.isFinite(minzoom);
|
|
471
|
-
}))));
|
|
472
|
-
case 4:
|
|
473
|
-
_context10.n = 5;
|
|
474
|
-
return this._getRasterStyleJson();
|
|
475
|
-
case 5:
|
|
476
|
-
_t0 = _context10.v;
|
|
477
|
-
if (_t0) {
|
|
478
|
-
_context10.n = 6;
|
|
479
|
-
break;
|
|
480
|
-
}
|
|
481
|
-
_t0 = {};
|
|
482
|
-
case 6:
|
|
483
|
-
_ref5 = _t0;
|
|
484
|
-
minzoom = _ref5.minzoom;
|
|
485
|
-
return _context10.a(2, minzoom);
|
|
486
|
-
case 7:
|
|
487
|
-
return _context10.a(2);
|
|
488
|
-
case 8:
|
|
489
|
-
return _context10.a(2);
|
|
490
|
-
}
|
|
491
|
-
}, _callee10, this);
|
|
492
|
-
}));
|
|
493
|
-
function getMinZoom() {
|
|
494
|
-
return _getMinZoom.apply(this, arguments);
|
|
495
|
-
}
|
|
496
|
-
return getMinZoom;
|
|
497
|
-
}()
|
|
498
|
-
}, {
|
|
499
|
-
key: "getMaxZoom",
|
|
500
|
-
value: function () {
|
|
501
|
-
var _getMaxZoom = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
|
|
502
|
-
var format,
|
|
503
|
-
_ref6,
|
|
504
|
-
sources,
|
|
505
|
-
_ref7,
|
|
506
|
-
maxzoom,
|
|
507
|
-
_args11 = arguments,
|
|
508
|
-
_t1,
|
|
509
|
-
_t10,
|
|
510
|
-
_t11;
|
|
511
|
-
return _regenerator().w(function (_context11) {
|
|
512
|
-
while (1) switch (_context11.n) {
|
|
513
|
-
case 0:
|
|
514
|
-
format = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : 'vector';
|
|
515
|
-
_t1 = format;
|
|
516
|
-
_context11.n = _t1 === 'vector' ? 1 : _t1 === 'raster' ? 4 : 7;
|
|
517
|
-
break;
|
|
518
|
-
case 1:
|
|
519
|
-
_context11.n = 2;
|
|
520
|
-
return this._getVectorStyleJsonInlined();
|
|
521
|
-
case 2:
|
|
522
|
-
_t10 = _context11.v;
|
|
523
|
-
if (_t10) {
|
|
524
|
-
_context11.n = 3;
|
|
525
|
-
break;
|
|
526
|
-
}
|
|
527
|
-
_t10 = {
|
|
528
|
-
sources: {}
|
|
529
|
-
};
|
|
530
|
-
case 3:
|
|
531
|
-
_ref6 = _t10;
|
|
532
|
-
sources = _ref6.sources;
|
|
533
|
-
return _context11.a(2, Math.max.apply(Math, _toConsumableArray(Object.values(sources).map(function (s) {
|
|
534
|
-
return s && s instanceof Object && 'maxzoom' in s ? s['maxzoom'] : null;
|
|
535
|
-
}).filter(function (maxzoom) {
|
|
536
|
-
return Number.isFinite(maxzoom);
|
|
537
|
-
}))));
|
|
538
|
-
case 4:
|
|
539
|
-
_context11.n = 5;
|
|
540
|
-
return this._getRasterStyleJson();
|
|
541
|
-
case 5:
|
|
542
|
-
_t11 = _context11.v;
|
|
543
|
-
if (_t11) {
|
|
544
|
-
_context11.n = 6;
|
|
545
|
-
break;
|
|
546
|
-
}
|
|
547
|
-
_t11 = {};
|
|
548
|
-
case 6:
|
|
549
|
-
_ref7 = _t11;
|
|
550
|
-
maxzoom = _ref7.maxzoom;
|
|
551
|
-
return _context11.a(2, maxzoom);
|
|
552
|
-
case 7:
|
|
553
|
-
return _context11.a(2);
|
|
554
|
-
case 8:
|
|
555
|
-
return _context11.a(2);
|
|
556
|
-
}
|
|
557
|
-
}, _callee11, this);
|
|
558
|
-
}));
|
|
559
|
-
function getMaxZoom() {
|
|
560
|
-
return _getMaxZoom.apply(this, arguments);
|
|
561
|
-
}
|
|
562
|
-
return getMaxZoom;
|
|
563
|
-
}()
|
|
210
|
+
style: 'dark_map',
|
|
211
|
+
operation: 'dodge',
|
|
212
|
+
percentage: 0.25
|
|
564
213
|
}, {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
214
|
+
style: 'high_contrast',
|
|
215
|
+
operation: 'screen',
|
|
216
|
+
percentage: 0.25
|
|
569
217
|
}, {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
218
|
+
style: 'road_map_desaturated_v9',
|
|
219
|
+
operation: 'screen',
|
|
220
|
+
percentage: 0.25
|
|
574
221
|
}, {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
222
|
+
style: 'dark_map_v9',
|
|
223
|
+
operation: 'dodge',
|
|
224
|
+
percentage: 0.25
|
|
225
|
+
}];
|
|
226
|
+
_config;
|
|
227
|
+
_getRasterStyleJson = _.once(async () => {
|
|
228
|
+
const rasterUrl = this._getStyleUrlForLocale('raster');
|
|
229
|
+
if (rasterUrl) {
|
|
230
|
+
const url = this._proxyPath + this._getAbsoluteUrl(rasterUrl);
|
|
231
|
+
return this._emsClient.getManifest(this._emsClient.extendUrlWithParams(url));
|
|
232
|
+
} else {
|
|
233
|
+
return;
|
|
578
234
|
}
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var defaultStyle = vectorFormats[0];
|
|
591
|
-
if (defaultStyle && Object.prototype.hasOwnProperty.call(defaultStyle, 'url')) {
|
|
592
|
-
return defaultStyle.url;
|
|
593
|
-
}
|
|
235
|
+
});
|
|
236
|
+
_getVectorStyleJsonRaw = _.once(async () => {
|
|
237
|
+
const vectorUrl = this._getStyleUrlForLocale('vector');
|
|
238
|
+
if (vectorUrl) {
|
|
239
|
+
const url = this._proxyPath + this._getAbsoluteUrl(vectorUrl);
|
|
240
|
+
const vectorJson = await this._emsClient.getManifest(this._emsClient.extendUrlWithParams(url));
|
|
241
|
+
return {
|
|
242
|
+
...vectorJson
|
|
243
|
+
};
|
|
244
|
+
} else {
|
|
245
|
+
return;
|
|
594
246
|
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
247
|
+
});
|
|
248
|
+
_getVectorStyleJsonInlined = _.once(async () => {
|
|
249
|
+
const vectorJson = await this._getVectorStyleJsonRaw();
|
|
250
|
+
if (vectorJson) {
|
|
251
|
+
const inlinedSources = {};
|
|
252
|
+
const {
|
|
253
|
+
sources
|
|
254
|
+
} = vectorJson;
|
|
255
|
+
for (const sourceName of Object.getOwnPropertyNames(sources)) {
|
|
256
|
+
const {
|
|
257
|
+
url
|
|
258
|
+
} = sources[sourceName];
|
|
259
|
+
if (url) {
|
|
260
|
+
const sourceUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
261
|
+
const extendedUrl = this._emsClient.extendUrlWithParams(sourceUrl);
|
|
262
|
+
const sourceJson = await this._emsClient.getManifest(extendedUrl);
|
|
263
|
+
const tiles = sourceJson?.tiles?.map(tileUrl => {
|
|
264
|
+
const directUrl = this._proxyPath + this._getAbsoluteUrl(tileUrl);
|
|
265
|
+
return this._emsClient.extendUrlWithParams(directUrl);
|
|
266
|
+
});
|
|
267
|
+
inlinedSources[sourceName] = {
|
|
268
|
+
...sourceJson,
|
|
269
|
+
type: 'vector',
|
|
270
|
+
tiles
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
...vectorJson,
|
|
276
|
+
sources: inlinedSources,
|
|
277
|
+
sprite: await this._getSpriteSheetRootPath(),
|
|
278
|
+
glyphs: await this._getUrlTemplateForGlyphs()
|
|
279
|
+
};
|
|
280
|
+
} else {
|
|
281
|
+
return;
|
|
601
282
|
}
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
case 2:
|
|
620
|
-
return _context12.a(2, '');
|
|
621
|
-
case 3:
|
|
622
|
-
return _context12.a(2);
|
|
623
|
-
}
|
|
624
|
-
}, _callee12, this);
|
|
625
|
-
}));
|
|
626
|
-
function _getSpriteSheetRootPath() {
|
|
627
|
-
return _getSpriteSheetRootPath2.apply(this, arguments);
|
|
283
|
+
});
|
|
284
|
+
constructor(config, emsClient, proxyPath) {
|
|
285
|
+
super(config, emsClient, proxyPath);
|
|
286
|
+
this._config = config;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/*
|
|
290
|
+
This method returns an array of objects with the layers and the new
|
|
291
|
+
layout['text-field'] to apply using map.setLayoutProperty
|
|
292
|
+
*/
|
|
293
|
+
static transformLanguageProperty(layer, lang) {
|
|
294
|
+
const supportedLang = this.SupportedLanguages.find(l => l.key === lang);
|
|
295
|
+
if (layer.type === 'symbol' && layer.layout !== undefined && supportedLang !== undefined) {
|
|
296
|
+
const omtLang = supportedLang.omt;
|
|
297
|
+
const textField = layer.layout['text-field'];
|
|
298
|
+
if (textField && typeof textField === 'string') {
|
|
299
|
+
return TMSService._getTextField(textField, omtLang);
|
|
628
300
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
vectorStyleJson = _context13.v;
|
|
643
|
-
if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.glyphs)) {
|
|
644
|
-
_context13.n = 2;
|
|
645
|
-
break;
|
|
646
|
-
}
|
|
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);
|
|
652
|
-
}
|
|
653
|
-
}, _callee13, this);
|
|
654
|
-
}));
|
|
655
|
-
function _getUrlTemplateForGlyphs() {
|
|
656
|
-
return _getUrlTemplateForGlyphs2.apply(this, arguments);
|
|
301
|
+
}
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/*
|
|
306
|
+
This method returns an array of objects per layer, containing a list of
|
|
307
|
+
properties with new colors to apply using map.setPaintProperty
|
|
308
|
+
*/
|
|
309
|
+
static transformColorProperties(layer, color, operation, percentage) {
|
|
310
|
+
if (['background', 'fill', 'line', 'symbol'].indexOf(layer.type) !== -1 && layer.paint) {
|
|
311
|
+
const paint = layer.paint;
|
|
312
|
+
if (layer.type === 'symbol' && Object.keys(paint).length === 0) {
|
|
313
|
+
paint['text-color'] = 'rgb(0,0,0)';
|
|
657
314
|
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
315
|
+
const types = Object.keys(paint).filter(key => {
|
|
316
|
+
return ['background-color', 'circle-color', 'circle-stroke-color', 'fill-color', 'fill-extrusion-color', 'fill-outline-color', 'icon-color', 'icon-halo-color', 'line-color', 'text-color', 'text-halo-color'].indexOf(key) !== -1;
|
|
317
|
+
});
|
|
318
|
+
return types.map(type => {
|
|
319
|
+
const paintColor = paint[type];
|
|
320
|
+
return {
|
|
321
|
+
property: type,
|
|
322
|
+
color: paintColor && color ? colorizeColor(paintColor, color, operation, percentage) : paintColor
|
|
323
|
+
};
|
|
665
324
|
});
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
325
|
+
} else {
|
|
326
|
+
return [];
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
static _getTextField(label, lang) {
|
|
330
|
+
// Capture {name:xx} labels
|
|
331
|
+
const labelMatch = label.match(/\{name([:_])(.{2})\}/);
|
|
332
|
+
if (labelMatch && labelMatch[1] != lang) {
|
|
333
|
+
// Only apply if the languages are different
|
|
334
|
+
return ['coalesce', ['get', `name:${lang}`], ['get', `name${labelMatch[1]}${labelMatch[2]}`]];
|
|
335
|
+
} else if (label.includes('latin') && label.includes('nonlatin')) {
|
|
336
|
+
// Capture the common pattern {name:latin}\n{name:nonlatin}
|
|
337
|
+
return ['coalesce', ['get', `name:${lang}`], ['concat', ['get', 'name:latin'], '\n', ['get', 'name:nonlatin']]];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// If no case is found, return the input label
|
|
341
|
+
return label;
|
|
342
|
+
}
|
|
343
|
+
async getDefaultRasterStyle() {
|
|
344
|
+
const tileJson = await this._getRasterStyleJson();
|
|
345
|
+
if (tileJson) {
|
|
346
|
+
const tiles = tileJson.tiles.map(tile => this._proxyPath + this._getAbsoluteUrl(tile));
|
|
347
|
+
return {
|
|
348
|
+
...tileJson,
|
|
349
|
+
...{
|
|
350
|
+
tiles
|
|
671
351
|
}
|
|
672
|
-
}
|
|
352
|
+
};
|
|
353
|
+
} else {
|
|
673
354
|
return;
|
|
674
355
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
356
|
+
}
|
|
357
|
+
async getUrlTemplate() {
|
|
358
|
+
const tileJson = await this._getRasterStyleJson();
|
|
359
|
+
if (tileJson) {
|
|
360
|
+
const directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.tiles[0]);
|
|
361
|
+
return this._emsClient.extendUrlWithParams(directUrl);
|
|
362
|
+
} else {
|
|
363
|
+
return '';
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
async getUrlTemplateForVector(sourceId) {
|
|
367
|
+
const tileJson = await this._getVectorStyleJsonInlined();
|
|
368
|
+
const url = tileJson?.sources[sourceId]?.tiles?.pop();
|
|
369
|
+
if (url) {
|
|
370
|
+
const directUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
371
|
+
return this._emsClient.extendUrlWithParams(directUrl);
|
|
372
|
+
} else {
|
|
373
|
+
return '';
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
async getVectorStyleSheet() {
|
|
377
|
+
return await this._getVectorStyleJsonInlined();
|
|
378
|
+
}
|
|
379
|
+
async getVectorStyleSheetRaw() {
|
|
380
|
+
return await this._getVectorStyleJsonRaw();
|
|
381
|
+
}
|
|
382
|
+
async getSpriteSheetMeta(isRetina = false) {
|
|
383
|
+
const metaUrl = await this.getSpriteSheetJsonPath(isRetina);
|
|
384
|
+
const spritePngs = await this.getSpriteSheetPngPath(isRetina);
|
|
385
|
+
if (metaUrl && spritePngs) {
|
|
386
|
+
const metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl);
|
|
387
|
+
const jsonMeta = await this._emsClient.getManifest(metaUrlExtended);
|
|
388
|
+
return {
|
|
389
|
+
png: spritePngs,
|
|
390
|
+
json: jsonMeta
|
|
391
|
+
};
|
|
392
|
+
} else {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
async getSpriteSheetJsonPath(isRetina = false) {
|
|
397
|
+
const spriteSheetRootPath = await this._getSpriteSheetRootPath();
|
|
398
|
+
if (spriteSheetRootPath) {
|
|
399
|
+
const suffix = isRetina ? '@2x' : '';
|
|
400
|
+
return spriteSheetRootPath + suffix + '.json';
|
|
401
|
+
} else {
|
|
402
|
+
return '';
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
async getSpriteSheetPngPath(isRetina = false) {
|
|
406
|
+
const spriteSheetRootPath = await this._getSpriteSheetRootPath();
|
|
407
|
+
if (spriteSheetRootPath) {
|
|
408
|
+
const suffix = isRetina ? '@2x' : '';
|
|
409
|
+
return spriteSheetRootPath + suffix + '.png';
|
|
410
|
+
} else {
|
|
411
|
+
return '';
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
getDisplayName() {
|
|
415
|
+
return this._emsClient.getValueInLanguage(this._config.name);
|
|
416
|
+
}
|
|
417
|
+
async getMinZoom(format = 'vector') {
|
|
418
|
+
switch (format) {
|
|
419
|
+
case 'vector':
|
|
420
|
+
{
|
|
421
|
+
const {
|
|
422
|
+
sources
|
|
423
|
+
} = (await this._getVectorStyleJsonInlined()) || {
|
|
424
|
+
sources: {}
|
|
425
|
+
};
|
|
426
|
+
return Math.min(...Object.values(sources).map(s => {
|
|
427
|
+
return s && s instanceof Object && 'minzoom' in s ? s['minzoom'] : null;
|
|
428
|
+
}).filter(minzoom => Number.isFinite(minzoom)));
|
|
429
|
+
}
|
|
430
|
+
case 'raster':
|
|
431
|
+
{
|
|
432
|
+
const {
|
|
433
|
+
minzoom
|
|
434
|
+
} = (await this._getRasterStyleJson()) || {};
|
|
435
|
+
return minzoom;
|
|
687
436
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
437
|
+
default:
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
async getMaxZoom(format = 'vector') {
|
|
442
|
+
switch (format) {
|
|
443
|
+
case 'vector':
|
|
444
|
+
{
|
|
445
|
+
const {
|
|
446
|
+
sources
|
|
447
|
+
} = (await this._getVectorStyleJsonInlined()) || {
|
|
448
|
+
sources: {}
|
|
696
449
|
};
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
450
|
+
return Math.max(...Object.values(sources).map(s => {
|
|
451
|
+
return s && s instanceof Object && 'maxzoom' in s ? s['maxzoom'] : null;
|
|
452
|
+
}).filter(maxzoom => Number.isFinite(maxzoom)));
|
|
453
|
+
}
|
|
454
|
+
case 'raster':
|
|
455
|
+
{
|
|
456
|
+
const {
|
|
457
|
+
maxzoom
|
|
458
|
+
} = (await this._getRasterStyleJson()) || {};
|
|
459
|
+
return maxzoom;
|
|
460
|
+
}
|
|
461
|
+
default:
|
|
462
|
+
return;
|
|
701
463
|
}
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
//
|
|
716
|
-
|
|
464
|
+
}
|
|
465
|
+
getId() {
|
|
466
|
+
return this._config.id;
|
|
467
|
+
}
|
|
468
|
+
hasId(id) {
|
|
469
|
+
return this._config.id === id;
|
|
470
|
+
}
|
|
471
|
+
getApiUrl() {
|
|
472
|
+
return this._emsClient.getTileApiUrl();
|
|
473
|
+
}
|
|
474
|
+
_getStyleUrlForLocale(formatType) {
|
|
475
|
+
let vectorFormats = this._getFormats(formatType, this._emsClient.getLocale());
|
|
476
|
+
if (!vectorFormats.length) {
|
|
477
|
+
//fallback to default locale
|
|
478
|
+
vectorFormats = this._getFormats(formatType, this._emsClient.getDefaultLocale());
|
|
717
479
|
}
|
|
718
|
-
|
|
719
|
-
}(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
omt: 'ca'
|
|
747
|
-
}, {
|
|
748
|
-
key: 'cs',
|
|
749
|
-
omt: 'cs'
|
|
750
|
-
}, {
|
|
751
|
-
key: 'cy',
|
|
752
|
-
omt: 'cy'
|
|
753
|
-
}, {
|
|
754
|
-
key: 'da',
|
|
755
|
-
omt: 'da'
|
|
756
|
-
}, {
|
|
757
|
-
key: 'de',
|
|
758
|
-
omt: 'de'
|
|
759
|
-
}, {
|
|
760
|
-
key: 'el',
|
|
761
|
-
omt: 'el'
|
|
762
|
-
}, {
|
|
763
|
-
key: 'en',
|
|
764
|
-
omt: 'en'
|
|
765
|
-
}, {
|
|
766
|
-
key: 'eo',
|
|
767
|
-
omt: 'eo'
|
|
768
|
-
}, {
|
|
769
|
-
key: 'es',
|
|
770
|
-
omt: 'es'
|
|
771
|
-
}, {
|
|
772
|
-
key: 'et',
|
|
773
|
-
omt: 'et'
|
|
774
|
-
}, {
|
|
775
|
-
key: 'fi',
|
|
776
|
-
omt: 'fi'
|
|
777
|
-
}, {
|
|
778
|
-
key: 'fr-fr',
|
|
779
|
-
omt: 'fr'
|
|
780
|
-
}, {
|
|
781
|
-
key: 'fy',
|
|
782
|
-
omt: 'fy'
|
|
783
|
-
}, {
|
|
784
|
-
key: 'ga',
|
|
785
|
-
omt: 'ga'
|
|
786
|
-
}, {
|
|
787
|
-
key: 'gd',
|
|
788
|
-
omt: 'gd'
|
|
789
|
-
}, {
|
|
790
|
-
key: 'he',
|
|
791
|
-
omt: 'he'
|
|
792
|
-
}, {
|
|
793
|
-
key: 'hi-in',
|
|
794
|
-
omt: 'hi'
|
|
795
|
-
}, {
|
|
796
|
-
key: 'hr',
|
|
797
|
-
omt: 'hr'
|
|
798
|
-
}, {
|
|
799
|
-
key: 'hu',
|
|
800
|
-
omt: 'hu'
|
|
801
|
-
}, {
|
|
802
|
-
key: 'hy',
|
|
803
|
-
omt: 'hy'
|
|
804
|
-
}, {
|
|
805
|
-
key: 'is',
|
|
806
|
-
omt: 'is'
|
|
807
|
-
}, {
|
|
808
|
-
key: 'it',
|
|
809
|
-
omt: 'it'
|
|
810
|
-
}, {
|
|
811
|
-
key: 'ja_kana',
|
|
812
|
-
omt: 'ja_kana'
|
|
813
|
-
}, {
|
|
814
|
-
key: 'ja_rm',
|
|
815
|
-
omt: 'ja_rm'
|
|
816
|
-
}, {
|
|
817
|
-
key: 'ja-jp',
|
|
818
|
-
omt: 'ja'
|
|
819
|
-
}, {
|
|
820
|
-
key: 'ka',
|
|
821
|
-
omt: 'ka'
|
|
822
|
-
}, {
|
|
823
|
-
key: 'kk',
|
|
824
|
-
omt: 'kk'
|
|
825
|
-
}, {
|
|
826
|
-
key: 'kn',
|
|
827
|
-
omt: 'kn'
|
|
828
|
-
}, {
|
|
829
|
-
key: 'ko_rm',
|
|
830
|
-
omt: 'ko_rm'
|
|
831
|
-
}, {
|
|
832
|
-
key: 'ko',
|
|
833
|
-
omt: 'ko'
|
|
834
|
-
}, {
|
|
835
|
-
key: 'la',
|
|
836
|
-
omt: 'la'
|
|
837
|
-
}, {
|
|
838
|
-
key: 'lb',
|
|
839
|
-
omt: 'lb'
|
|
840
|
-
}, {
|
|
841
|
-
key: 'lt',
|
|
842
|
-
omt: 'lt'
|
|
843
|
-
}, {
|
|
844
|
-
key: 'lv',
|
|
845
|
-
omt: 'lv'
|
|
846
|
-
}, {
|
|
847
|
-
key: 'mk',
|
|
848
|
-
omt: 'mk'
|
|
849
|
-
}, {
|
|
850
|
-
key: 'mt',
|
|
851
|
-
omt: 'mt'
|
|
852
|
-
}, {
|
|
853
|
-
key: 'nl',
|
|
854
|
-
omt: 'nl'
|
|
855
|
-
}, {
|
|
856
|
-
key: 'no',
|
|
857
|
-
omt: 'no'
|
|
858
|
-
}, {
|
|
859
|
-
key: 'pl',
|
|
860
|
-
omt: 'pl'
|
|
861
|
-
}, {
|
|
862
|
-
key: 'pt-pt',
|
|
863
|
-
omt: 'pt'
|
|
864
|
-
}, {
|
|
865
|
-
key: 'rm',
|
|
866
|
-
omt: 'rm'
|
|
867
|
-
}, {
|
|
868
|
-
key: 'ro',
|
|
869
|
-
omt: 'ro'
|
|
870
|
-
}, {
|
|
871
|
-
key: 'ru-ru',
|
|
872
|
-
omt: 'ru'
|
|
873
|
-
}, {
|
|
874
|
-
key: 'sk',
|
|
875
|
-
omt: 'sk'
|
|
876
|
-
}, {
|
|
877
|
-
key: 'sl',
|
|
878
|
-
omt: 'sl'
|
|
879
|
-
}, {
|
|
880
|
-
key: 'sq',
|
|
881
|
-
omt: 'sq'
|
|
882
|
-
}, {
|
|
883
|
-
key: 'sr-Ltn',
|
|
884
|
-
omt: 'sr-Ltn'
|
|
885
|
-
}, {
|
|
886
|
-
key: 'sr',
|
|
887
|
-
omt: 'sr'
|
|
888
|
-
}, {
|
|
889
|
-
key: 'sv',
|
|
890
|
-
omt: 'sv'
|
|
891
|
-
}, {
|
|
892
|
-
key: 'th',
|
|
893
|
-
omt: 'th'
|
|
894
|
-
}, {
|
|
895
|
-
key: 'tr',
|
|
896
|
-
omt: 'tr'
|
|
897
|
-
}, {
|
|
898
|
-
key: 'uk',
|
|
899
|
-
omt: 'uk'
|
|
900
|
-
}, {
|
|
901
|
-
key: 'zh-cn',
|
|
902
|
-
omt: 'zh'
|
|
903
|
-
}]);
|
|
904
|
-
/*
|
|
905
|
-
Suggested default operations for the different EMS styles
|
|
906
|
-
*/
|
|
907
|
-
_defineProperty(TMSService, "colorOperationDefaults", [{
|
|
908
|
-
style: 'road_map',
|
|
909
|
-
operation: 'mix',
|
|
910
|
-
percentage: 0.25
|
|
911
|
-
}, {
|
|
912
|
-
style: 'road_map_desaturated',
|
|
913
|
-
operation: 'screen',
|
|
914
|
-
percentage: 0.25
|
|
915
|
-
}, {
|
|
916
|
-
style: 'dark_map',
|
|
917
|
-
operation: 'dodge',
|
|
918
|
-
percentage: 0.25
|
|
919
|
-
}, {
|
|
920
|
-
style: 'high_contrast',
|
|
921
|
-
operation: 'screen',
|
|
922
|
-
percentage: 0.25
|
|
923
|
-
}, {
|
|
924
|
-
style: 'road_map_desaturated_v9',
|
|
925
|
-
operation: 'screen',
|
|
926
|
-
percentage: 0.25
|
|
927
|
-
}, {
|
|
928
|
-
style: 'dark_map_v9',
|
|
929
|
-
operation: 'dodge',
|
|
930
|
-
percentage: 0.25
|
|
931
|
-
}]);
|
|
480
|
+
if (!vectorFormats.length) {
|
|
481
|
+
throw new Error(`Cannot find ${formatType} tile layer for locale ${this._emsClient.getLocale()} or ${this._emsClient.getDefaultLocale()}`);
|
|
482
|
+
}
|
|
483
|
+
const defaultStyle = vectorFormats[0];
|
|
484
|
+
if (defaultStyle && Object.prototype.hasOwnProperty.call(defaultStyle, 'url')) {
|
|
485
|
+
return defaultStyle.url;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
_getFormats(formatType, locale) {
|
|
489
|
+
return this._config.formats.filter(format => format.locale === locale && format.format === formatType);
|
|
490
|
+
}
|
|
491
|
+
async _getSpriteSheetRootPath() {
|
|
492
|
+
const vectorStyleJson = await this._getVectorStyleJsonRaw();
|
|
493
|
+
if (vectorStyleJson?.sprite) {
|
|
494
|
+
return this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite.toString());
|
|
495
|
+
} else {
|
|
496
|
+
return '';
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
async _getUrlTemplateForGlyphs() {
|
|
500
|
+
const vectorStyleJson = await this._getVectorStyleJsonRaw();
|
|
501
|
+
if (vectorStyleJson?.glyphs) {
|
|
502
|
+
return this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs);
|
|
503
|
+
} else {
|
|
504
|
+
return '';
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|