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