azure-maps-control 3.0.3 → 3.1.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/dist/atlas-core-bare-snr-min.js +1 -1
- package/dist/atlas-core-bare-snr.js +179 -189
- package/dist/atlas-core-bare.js +348 -302
- package/dist/atlas-core-bare.min.js +1 -1
- package/dist/atlas-core-snr.js +179 -189
- package/dist/atlas-core.js +348 -302
- package/dist/atlas-core.min.js +1 -1
- package/dist/atlas-esm.js +2455 -993
- package/dist/atlas-esm.min.js +4 -4
- package/dist/atlas.js +2455 -993
- package/dist/atlas.min.js +3 -3
- package/package.json +12 -12
- package/thirdpartynotices.txt +0 -0
- package/typings/index.d.ts +77 -2
package/dist/atlas-core-snr.js
CHANGED
|
@@ -50922,7 +50922,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
50922
50922
|
sessionIdHeaderName: "Session-Id"
|
|
50923
50923
|
};
|
|
50924
50924
|
|
|
50925
|
-
var __values$
|
|
50925
|
+
var __values$k = (window && window.__values) || function(o) {
|
|
50926
50926
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
50927
50927
|
if (m) return m.call(o);
|
|
50928
50928
|
if (o && typeof o.length === "number") return {
|
|
@@ -50950,7 +50950,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
50950
50950
|
}
|
|
50951
50951
|
var defaults;
|
|
50952
50952
|
try {
|
|
50953
|
-
for (var valuesList_1 = __values$
|
|
50953
|
+
for (var valuesList_1 = __values$k(valuesList), valuesList_1_1 = valuesList_1.next(); !valuesList_1_1.done; valuesList_1_1 = valuesList_1.next()) {
|
|
50954
50954
|
var values = valuesList_1_1.value;
|
|
50955
50955
|
if (!values) {
|
|
50956
50956
|
continue;
|
|
@@ -50990,7 +50990,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
50990
50990
|
return Options;
|
|
50991
50991
|
}());
|
|
50992
50992
|
|
|
50993
|
-
var __extends$
|
|
50993
|
+
var __extends$1g = (window && window.__extends) || (function () {
|
|
50994
50994
|
var extendStatics = function (d, b) {
|
|
50995
50995
|
extendStatics = Object.setPrototypeOf ||
|
|
50996
50996
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -51005,7 +51005,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51005
51005
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
51006
51006
|
};
|
|
51007
51007
|
})();
|
|
51008
|
-
var __read$
|
|
51008
|
+
var __read$d = (window && window.__read) || function (o, n) {
|
|
51009
51009
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51010
51010
|
if (!m) return o;
|
|
51011
51011
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -51025,7 +51025,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51025
51025
|
* @private
|
|
51026
51026
|
*/
|
|
51027
51027
|
var UrlOptions = /** @class */ (function (_super) {
|
|
51028
|
-
__extends$
|
|
51028
|
+
__extends$1g(UrlOptions, _super);
|
|
51029
51029
|
function UrlOptions() {
|
|
51030
51030
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
51031
51031
|
_this.domain = undefined;
|
|
@@ -51065,7 +51065,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51065
51065
|
var self = this;
|
|
51066
51066
|
var queryParamsString = Object.entries(self.options.queryParams)
|
|
51067
51067
|
.map(function (_a) {
|
|
51068
|
-
var _b = __read$
|
|
51068
|
+
var _b = __read$d(_a, 2), key = _b[0], value = _b[1];
|
|
51069
51069
|
return "".concat(key, "=").concat(value);
|
|
51070
51070
|
})
|
|
51071
51071
|
.join("&");
|
|
@@ -51096,7 +51096,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51096
51096
|
return Url;
|
|
51097
51097
|
}());
|
|
51098
51098
|
|
|
51099
|
-
var version = "3.
|
|
51099
|
+
var version = "3.1.1";
|
|
51100
51100
|
|
|
51101
51101
|
/**
|
|
51102
51102
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -51206,7 +51206,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51206
51206
|
eventTarget.addEventListener("keydown", dismissTooltip);
|
|
51207
51207
|
};
|
|
51208
51208
|
|
|
51209
|
-
var __extends$
|
|
51209
|
+
var __extends$1f = (window && window.__extends) || (function () {
|
|
51210
51210
|
var extendStatics = function (d, b) {
|
|
51211
51211
|
extendStatics = Object.setPrototypeOf ||
|
|
51212
51212
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -51256,7 +51256,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51256
51256
|
* The options for adding a control to the map.
|
|
51257
51257
|
*/
|
|
51258
51258
|
var ControlOptions = /** @class */ (function (_super) {
|
|
51259
|
-
__extends$
|
|
51259
|
+
__extends$1f(ControlOptions, _super);
|
|
51260
51260
|
function ControlOptions() {
|
|
51261
51261
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
51262
51262
|
/**
|
|
@@ -51400,7 +51400,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51400
51400
|
EventEmitter: EventEmitter
|
|
51401
51401
|
});
|
|
51402
51402
|
|
|
51403
|
-
var __extends$
|
|
51403
|
+
var __extends$1e = (window && window.__extends) || (function () {
|
|
51404
51404
|
var extendStatics = function (d, b) {
|
|
51405
51405
|
extendStatics = Object.setPrototypeOf ||
|
|
51406
51406
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -51420,7 +51420,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51420
51420
|
* Implements control interface and provides support for automatic styling based on the map style.
|
|
51421
51421
|
*/
|
|
51422
51422
|
var ControlBase = /** @class */ (function (_super) {
|
|
51423
|
-
__extends$
|
|
51423
|
+
__extends$1e(ControlBase, _super);
|
|
51424
51424
|
function ControlBase() {
|
|
51425
51425
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
51426
51426
|
/**
|
|
@@ -51522,7 +51522,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51522
51522
|
return ControlBase;
|
|
51523
51523
|
}(EventEmitter));
|
|
51524
51524
|
|
|
51525
|
-
var __extends$
|
|
51525
|
+
var __extends$1d = (window && window.__extends) || (function () {
|
|
51526
51526
|
var extendStatics = function (d, b) {
|
|
51527
51527
|
extendStatics = Object.setPrototypeOf ||
|
|
51528
51528
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -51541,7 +51541,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51541
51541
|
* The options for a CompassControl object.
|
|
51542
51542
|
*/
|
|
51543
51543
|
var CompassControlOptions = /** @class */ (function (_super) {
|
|
51544
|
-
__extends$
|
|
51544
|
+
__extends$1d(CompassControlOptions, _super);
|
|
51545
51545
|
function CompassControlOptions() {
|
|
51546
51546
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
51547
51547
|
/**
|
|
@@ -51566,7 +51566,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51566
51566
|
return CompassControlOptions;
|
|
51567
51567
|
}(Options));
|
|
51568
51568
|
|
|
51569
|
-
var __extends$
|
|
51569
|
+
var __extends$1c = (window && window.__extends) || (function () {
|
|
51570
51570
|
var extendStatics = function (d, b) {
|
|
51571
51571
|
extendStatics = Object.setPrototypeOf ||
|
|
51572
51572
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -51585,7 +51585,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51585
51585
|
* A control for changing the rotation of the map.
|
|
51586
51586
|
*/
|
|
51587
51587
|
var CompassControl = /** @class */ (function (_super) {
|
|
51588
|
-
__extends$
|
|
51588
|
+
__extends$1c(CompassControl, _super);
|
|
51589
51589
|
/**
|
|
51590
51590
|
* Constructs a CompassControl.
|
|
51591
51591
|
* @param options The options for the control.
|
|
@@ -51763,7 +51763,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51763
51763
|
return CompassControl;
|
|
51764
51764
|
}(ControlBase));
|
|
51765
51765
|
|
|
51766
|
-
var __extends$
|
|
51766
|
+
var __extends$1b = (window && window.__extends) || (function () {
|
|
51767
51767
|
var extendStatics = function (d, b) {
|
|
51768
51768
|
extendStatics = Object.setPrototypeOf ||
|
|
51769
51769
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -51782,7 +51782,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51782
51782
|
* The options for a PitchControl object.
|
|
51783
51783
|
*/
|
|
51784
51784
|
var PitchControlOptions = /** @class */ (function (_super) {
|
|
51785
|
-
__extends$
|
|
51785
|
+
__extends$1b(PitchControlOptions, _super);
|
|
51786
51786
|
function PitchControlOptions() {
|
|
51787
51787
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
51788
51788
|
/**
|
|
@@ -51807,7 +51807,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51807
51807
|
return PitchControlOptions;
|
|
51808
51808
|
}(Options));
|
|
51809
51809
|
|
|
51810
|
-
var __extends$
|
|
51810
|
+
var __extends$1a = (window && window.__extends) || (function () {
|
|
51811
51811
|
var extendStatics = function (d, b) {
|
|
51812
51812
|
extendStatics = Object.setPrototypeOf ||
|
|
51813
51813
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -51826,7 +51826,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
51826
51826
|
* A control for changing the pitch of the map.
|
|
51827
51827
|
*/
|
|
51828
51828
|
var PitchControl = /** @class */ (function (_super) {
|
|
51829
|
-
__extends$
|
|
51829
|
+
__extends$1a(PitchControl, _super);
|
|
51830
51830
|
/**
|
|
51831
51831
|
* Constructs a PitchControl.
|
|
51832
51832
|
* @param options The options for the control.
|
|
@@ -52047,6 +52047,74 @@ uniform ${precision} ${type} u_${name};
|
|
|
52047
52047
|
return PitchControl;
|
|
52048
52048
|
}(ControlBase));
|
|
52049
52049
|
|
|
52050
|
+
var __extends$19 = (window && window.__extends) || (function () {
|
|
52051
|
+
var extendStatics = function (d, b) {
|
|
52052
|
+
extendStatics = Object.setPrototypeOf ||
|
|
52053
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
52054
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
52055
|
+
return extendStatics(d, b);
|
|
52056
|
+
};
|
|
52057
|
+
return function (d, b) {
|
|
52058
|
+
if (typeof b !== "function" && b !== null)
|
|
52059
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
52060
|
+
extendStatics(d, b);
|
|
52061
|
+
function __() { this.constructor = d; }
|
|
52062
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
52063
|
+
};
|
|
52064
|
+
})();
|
|
52065
|
+
/**
|
|
52066
|
+
* A control to display a scale bar on the map.
|
|
52067
|
+
*/
|
|
52068
|
+
var ScaleControl = /** @class */ (function (_super) {
|
|
52069
|
+
__extends$19(ScaleControl, _super);
|
|
52070
|
+
/**
|
|
52071
|
+
* A control to displays a scale bar relative to the pixel resolution at the center of the map.
|
|
52072
|
+
* @param options Options for defining how the control is rendered and functions.
|
|
52073
|
+
*/
|
|
52074
|
+
function ScaleControl(options) {
|
|
52075
|
+
var _this = _super.call(this) || this;
|
|
52076
|
+
_this.map = null;
|
|
52077
|
+
_this.control = new maplibregl.ScaleControl({
|
|
52078
|
+
maxWidth: options === null || options === void 0 ? void 0 : options.maxWidth,
|
|
52079
|
+
unit: options === null || options === void 0 ? void 0 : options.unit
|
|
52080
|
+
});
|
|
52081
|
+
return _this;
|
|
52082
|
+
}
|
|
52083
|
+
/**
|
|
52084
|
+
* Initialization method for the control which is called when added to the map.
|
|
52085
|
+
* @param map The map that the control will be added to.
|
|
52086
|
+
* @param options The ControlOptions for this control.
|
|
52087
|
+
* @return An HTMLElement to be placed on the map for the control.
|
|
52088
|
+
*/
|
|
52089
|
+
ScaleControl.prototype.onAdd = function (map, options) {
|
|
52090
|
+
var _a, _b, _c;
|
|
52091
|
+
this.map = map;
|
|
52092
|
+
(_b = (_a = this.map) === null || _a === void 0 ? void 0 : _a._getMap()) === null || _b === void 0 ? void 0 : _b.addControl(this.control);
|
|
52093
|
+
var container = this.buildContainer(map, exports.ControlStyle.auto, "Scale Bar");
|
|
52094
|
+
container.appendChild((_c = this.control) === null || _c === void 0 ? void 0 : _c._container);
|
|
52095
|
+
return container;
|
|
52096
|
+
};
|
|
52097
|
+
/**
|
|
52098
|
+
* Method that is called when the control is removed from the map. Should perform any necessary cleanup for the
|
|
52099
|
+
* control.
|
|
52100
|
+
*/
|
|
52101
|
+
ScaleControl.prototype.onRemove = function () {
|
|
52102
|
+
var _a, _b;
|
|
52103
|
+
_super.prototype.onRemove.call(this);
|
|
52104
|
+
(_b = (_a = this.map) === null || _a === void 0 ? void 0 : _a._getMap()) === null || _b === void 0 ? void 0 : _b.removeControl(this.control);
|
|
52105
|
+
this.map = null;
|
|
52106
|
+
};
|
|
52107
|
+
/**
|
|
52108
|
+
* Set the scale's unit of the distance
|
|
52109
|
+
* @param unit - Unit of the distance (`"imperial"`, `"metric"` or `"nautical"`).
|
|
52110
|
+
*/
|
|
52111
|
+
ScaleControl.prototype.setUnit = function (unit) {
|
|
52112
|
+
var _a;
|
|
52113
|
+
(_a = this.control) === null || _a === void 0 ? void 0 : _a.setUnit(unit);
|
|
52114
|
+
};
|
|
52115
|
+
return ScaleControl;
|
|
52116
|
+
}(ControlBase));
|
|
52117
|
+
|
|
52050
52118
|
/**
|
|
52051
52119
|
* Removes all key-value entries from the list cache.
|
|
52052
52120
|
*
|
|
@@ -55631,7 +55699,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
55631
55699
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55632
55700
|
}
|
|
55633
55701
|
};
|
|
55634
|
-
var __read$
|
|
55702
|
+
var __read$c = (window && window.__read) || function (o, n) {
|
|
55635
55703
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
55636
55704
|
if (!m) return o;
|
|
55637
55705
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -55812,7 +55880,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
55812
55880
|
image_1.src = newSrc;
|
|
55813
55881
|
}
|
|
55814
55882
|
Object.entries(this.styleButtons).forEach(function (_a) {
|
|
55815
|
-
var _b = __read$
|
|
55883
|
+
var _b = __read$c(_a, 2), buttonStyleName = _b[0], button = _b[1];
|
|
55816
55884
|
return button.setAttribute('aria-current', buttonStyleName === styleName ? 'true' : 'false');
|
|
55817
55885
|
});
|
|
55818
55886
|
this.map.styles.definitions().then(function (mapConfiguration) {
|
|
@@ -55901,7 +55969,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
55901
55969
|
_this.map.setStyle({ style: name });
|
|
55902
55970
|
}
|
|
55903
55971
|
Object.entries(_this.styleButtons).forEach(function (_a) {
|
|
55904
|
-
var _b = __read$
|
|
55972
|
+
var _b = __read$c(_a, 2), styleName = _b[0], button = _b[1];
|
|
55905
55973
|
return button.setAttribute('aria-current', styleName === name ? 'true' : 'false');
|
|
55906
55974
|
});
|
|
55907
55975
|
}
|
|
@@ -55993,7 +56061,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
55993
56061
|
});
|
|
55994
56062
|
var targetStyleName = this.map.getStyle().style;
|
|
55995
56063
|
Object.entries(this.styleButtons).forEach(function (_a) {
|
|
55996
|
-
var _b = __read$
|
|
56064
|
+
var _b = __read$c(_a, 2), styleName = _b[0], button = _b[1];
|
|
55997
56065
|
return button.setAttribute('aria-current', styleName === targetStyleName ? 'true' : 'false');
|
|
55998
56066
|
});
|
|
55999
56067
|
};
|
|
@@ -56254,7 +56322,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
56254
56322
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
56255
56323
|
};
|
|
56256
56324
|
})();
|
|
56257
|
-
var __values$
|
|
56325
|
+
var __values$j = (window && window.__values) || function(o) {
|
|
56258
56326
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
56259
56327
|
if (m) return m.call(o);
|
|
56260
56328
|
if (o && typeof o.length === "number") return {
|
|
@@ -56325,7 +56393,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
56325
56393
|
// legend table contents
|
|
56326
56394
|
var tr2 = document.createElement("tr");
|
|
56327
56395
|
try {
|
|
56328
|
-
for (var _c = __values$
|
|
56396
|
+
for (var _c = __values$j(this.table), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
56329
56397
|
var col = _d.value;
|
|
56330
56398
|
var data = document.createElement("td");
|
|
56331
56399
|
if (col === "Fast" || col === "Slow") {
|
|
@@ -56338,7 +56406,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
56338
56406
|
data.setAttribute("aria-label", "Traffic Legend");
|
|
56339
56407
|
data.setAttribute("role", "img");
|
|
56340
56408
|
try {
|
|
56341
|
-
for (var col_1 = (e_2 = void 0, __values$
|
|
56409
|
+
for (var col_1 = (e_2 = void 0, __values$j(col)), col_1_1 = col_1.next(); !col_1_1.done; col_1_1 = col_1.next()) {
|
|
56342
56410
|
var color = col_1_1.value;
|
|
56343
56411
|
var div = document.createElement("div");
|
|
56344
56412
|
div.classList.add(color);
|
|
@@ -57274,7 +57342,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
57274
57342
|
return Point;
|
|
57275
57343
|
}());
|
|
57276
57344
|
|
|
57277
|
-
var __read$
|
|
57345
|
+
var __read$b = (window && window.__read) || function (o, n) {
|
|
57278
57346
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
57279
57347
|
if (!m) return o;
|
|
57280
57348
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -57290,7 +57358,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
57290
57358
|
}
|
|
57291
57359
|
return ar;
|
|
57292
57360
|
};
|
|
57293
|
-
var __values$
|
|
57361
|
+
var __values$i = (window && window.__values) || function(o) {
|
|
57294
57362
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
57295
57363
|
if (m) return m.call(o);
|
|
57296
57364
|
if (o && typeof o.length === "number") return {
|
|
@@ -58265,8 +58333,8 @@ uniform ${precision} ${type} u_${name};
|
|
|
58265
58333
|
if (k + 1 >= coords.length) {
|
|
58266
58334
|
continue;
|
|
58267
58335
|
}
|
|
58268
|
-
var _a = __read$
|
|
58269
|
-
var _b = __read$
|
|
58336
|
+
var _a = __read$b(coords[k], 2), lon1 = _a[0], lat1 = _a[1];
|
|
58337
|
+
var _b = __read$b(coords[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
|
|
58270
58338
|
// split the line by antimeridian
|
|
58271
58339
|
// and break geodesic into two line segments
|
|
58272
58340
|
if (Math.abs(lon2 - lon1) > 180.0) {
|
|
@@ -58337,8 +58405,8 @@ uniform ${precision} ${type} u_${name};
|
|
|
58337
58405
|
if (k + 1 >= geodesic.length) {
|
|
58338
58406
|
continue;
|
|
58339
58407
|
}
|
|
58340
|
-
var _a = __read$
|
|
58341
|
-
var _b = __read$
|
|
58408
|
+
var _a = __read$b(geodesic[k], 2), lon1 = _a[0], lat1 = _a[1];
|
|
58409
|
+
var _b = __read$b(geodesic[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
|
|
58342
58410
|
// split the line by antimeridian
|
|
58343
58411
|
// and break geodesic into two line segments
|
|
58344
58412
|
if (Math.abs(lon2 - lon1) > 180.0) {
|
|
@@ -58549,7 +58617,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
58549
58617
|
function getPixelHeading(origin, destination) {
|
|
58550
58618
|
origin = getPosition(origin);
|
|
58551
58619
|
destination = getPosition(destination);
|
|
58552
|
-
var _a = __read$
|
|
58620
|
+
var _a = __read$b(mercatorPositionsToPixels([origin, destination], 21), 2), p1 = _a[0], p2 = _a[1];
|
|
58553
58621
|
var dx = (p2[0] - p1[0]);
|
|
58554
58622
|
var dy = (p1[1] - p2[1]);
|
|
58555
58623
|
var alpha = ((5 / 2 * Math.PI) - Math.atan2(dy, dx)) * INV_PI_BY_180 % 360;
|
|
@@ -59096,7 +59164,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
59096
59164
|
});
|
|
59097
59165
|
var lower = [];
|
|
59098
59166
|
try {
|
|
59099
|
-
for (var positions_1 = __values$
|
|
59167
|
+
for (var positions_1 = __values$i(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
|
|
59100
59168
|
var position = positions_1_1.value;
|
|
59101
59169
|
while (lower.length >= 2 && _cross(lower[lower.length - 2], lower[lower.length - 1], position) <= 0) {
|
|
59102
59170
|
lower.pop();
|
|
@@ -59605,7 +59673,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
59605
59673
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
59606
59674
|
};
|
|
59607
59675
|
})();
|
|
59608
|
-
var __values$
|
|
59676
|
+
var __values$h = (window && window.__values) || function(o) {
|
|
59609
59677
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
59610
59678
|
if (m) return m.call(o);
|
|
59611
59679
|
if (o && typeof o.length === "number") return {
|
|
@@ -59692,7 +59760,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
59692
59760
|
else if (geoType === "MultiLineString") {
|
|
59693
59761
|
var pos = positions;
|
|
59694
59762
|
try {
|
|
59695
|
-
for (var pos_1 = __values$
|
|
59763
|
+
for (var pos_1 = __values$h(pos), pos_1_1 = pos_1.next(); !pos_1_1.done; pos_1_1 = pos_1.next()) {
|
|
59696
59764
|
var p = pos_1_1.value;
|
|
59697
59765
|
bbox = BoundingBox.merge(bbox, BoundingBox.fromPositions(p));
|
|
59698
59766
|
}
|
|
@@ -59708,7 +59776,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
59708
59776
|
else if (geoType === "MultiPolygon") {
|
|
59709
59777
|
var pos = positions;
|
|
59710
59778
|
try {
|
|
59711
|
-
for (var pos_2 = __values$
|
|
59779
|
+
for (var pos_2 = __values$h(pos), pos_2_1 = pos_2.next(); !pos_2_1.done; pos_2_1 = pos_2.next()) {
|
|
59712
59780
|
var p1 = pos_2_1.value;
|
|
59713
59781
|
// only need to check the exterior ring of Polygon
|
|
59714
59782
|
bbox = BoundingBox.merge(bbox, BoundingBox.fromPositions(p1[0]));
|
|
@@ -59931,7 +59999,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
59931
59999
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
59932
60000
|
};
|
|
59933
60001
|
})();
|
|
59934
|
-
var __values$
|
|
60002
|
+
var __values$g = (window && window.__values) || function(o) {
|
|
59935
60003
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
59936
60004
|
if (m) return m.call(o);
|
|
59937
60005
|
if (o && typeof o.length === "number") return {
|
|
@@ -60355,7 +60423,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
60355
60423
|
var bounds = null;
|
|
60356
60424
|
if (Array.isArray(data) && data.length > 0) {
|
|
60357
60425
|
try {
|
|
60358
|
-
for (var data_1 = __values$
|
|
60426
|
+
for (var data_1 = __values$g(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
|
|
60359
60427
|
var datum = data_1_1.value;
|
|
60360
60428
|
tempBounds = BoundingBox.fromData(datum);
|
|
60361
60429
|
if (tempBounds != null) {
|
|
@@ -60928,7 +60996,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
60928
60996
|
return SimplifyAP_1(points, tolerance, true);
|
|
60929
60997
|
}
|
|
60930
60998
|
|
|
60931
|
-
var __values$
|
|
60999
|
+
var __values$f = (window && window.__values) || function(o) {
|
|
60932
61000
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
60933
61001
|
if (m) return m.call(o);
|
|
60934
61002
|
if (o && typeof o.length === "number") return {
|
|
@@ -60988,7 +61056,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
60988
61056
|
if (points && Array.isArray(points) && Array.isArray(points[0])) {
|
|
60989
61057
|
var pos = [];
|
|
60990
61058
|
try {
|
|
60991
|
-
for (var points_1 = __values$
|
|
61059
|
+
for (var points_1 = __values$f(points), points_1_1 = points_1.next(); !points_1_1.done; points_1_1 = points_1.next()) {
|
|
60992
61060
|
var subPoints = points_1_1.value;
|
|
60993
61061
|
pos.push(this.transform(subPoints, transformMatrix, decimals));
|
|
60994
61062
|
}
|
|
@@ -61363,6 +61431,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
61363
61431
|
CompassControl: CompassControl,
|
|
61364
61432
|
ControlBase: ControlBase,
|
|
61365
61433
|
PitchControl: PitchControl,
|
|
61434
|
+
ScaleControl: ScaleControl,
|
|
61366
61435
|
StyleControl: StyleControl,
|
|
61367
61436
|
TrafficControl: TrafficControl,
|
|
61368
61437
|
TrafficLegendControl: TrafficLegendControl,
|
|
@@ -61646,7 +61715,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
61646
61715
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
61647
61716
|
};
|
|
61648
61717
|
})();
|
|
61649
|
-
var __values$
|
|
61718
|
+
var __values$e = (window && window.__values) || function(o) {
|
|
61650
61719
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
61651
61720
|
if (m) return m.call(o);
|
|
61652
61721
|
if (o && typeof o.length === "number") return {
|
|
@@ -61845,7 +61914,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
61845
61914
|
var e_1, _a;
|
|
61846
61915
|
var shapes = Array.isArray(shape) ? shape : [shape];
|
|
61847
61916
|
try {
|
|
61848
|
-
for (var shapes_1 = __values$
|
|
61917
|
+
for (var shapes_1 = __values$e(shapes), shapes_1_1 = shapes_1.next(); !shapes_1_1.done; shapes_1_1 = shapes_1.next()) {
|
|
61849
61918
|
var s = shapes_1_1.value;
|
|
61850
61919
|
if (typeof s === "number") {
|
|
61851
61920
|
this._removeByIndex(s);
|
|
@@ -61872,7 +61941,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
61872
61941
|
var e_2, _a;
|
|
61873
61942
|
var ids = Array.isArray(id) ? id : [id];
|
|
61874
61943
|
try {
|
|
61875
|
-
for (var ids_1 = __values$
|
|
61944
|
+
for (var ids_1 = __values$e(ids), ids_1_1 = ids_1.next(); !ids_1_1.done; ids_1_1 = ids_1.next()) {
|
|
61876
61945
|
var i = ids_1_1.value;
|
|
61877
61946
|
this._removeById(i);
|
|
61878
61947
|
}
|
|
@@ -62036,7 +62105,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
62036
62105
|
data = Array.isArray(data) ? data : [data];
|
|
62037
62106
|
if (typeof index !== "number") {
|
|
62038
62107
|
try {
|
|
62039
|
-
for (var data_1 = __values$
|
|
62108
|
+
for (var data_1 = __values$e(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
|
|
62040
62109
|
var d = data_1_1.value;
|
|
62041
62110
|
this.shapes.push(d);
|
|
62042
62111
|
this.shapesMap.set(d.getId(), this.shapes.length - 1);
|
|
@@ -62057,7 +62126,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
62057
62126
|
}
|
|
62058
62127
|
}
|
|
62059
62128
|
try {
|
|
62060
|
-
for (var data_2 = __values$
|
|
62129
|
+
for (var data_2 = __values$e(data), data_2_1 = data_2.next(); !data_2_1.done; data_2_1 = data_2.next()) {
|
|
62061
62130
|
var d = data_2_1.value;
|
|
62062
62131
|
d._setDataSource(this);
|
|
62063
62132
|
}
|
|
@@ -63000,7 +63069,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
63000
63069
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
63001
63070
|
}
|
|
63002
63071
|
};
|
|
63003
|
-
var __read$
|
|
63072
|
+
var __read$a = (window && window.__read) || function (o, n) {
|
|
63004
63073
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
63005
63074
|
if (!m) return o;
|
|
63006
63075
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -63016,7 +63085,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
63016
63085
|
}
|
|
63017
63086
|
return ar;
|
|
63018
63087
|
};
|
|
63019
|
-
var __spreadArray$
|
|
63088
|
+
var __spreadArray$8 = (window && window.__spreadArray) || function (to, from, pack) {
|
|
63020
63089
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
63021
63090
|
if (ar || !(i in from)) {
|
|
63022
63091
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
@@ -63053,7 +63122,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
63053
63122
|
var bubbleFeature = curRenderedShape instanceof Shape ? curRenderedShape.toJson() : curRenderedShape;
|
|
63054
63123
|
var indicator = new AccessibleIndicator({ positionInSet: idx + 1, setSize: renderedShapes.length });
|
|
63055
63124
|
var element = indicator.getElement();
|
|
63056
|
-
var _a = __read$
|
|
63125
|
+
var _a = __read$a(_this.map.positionsToPixels([_this.getFirstCoordinate(bubbleFeature.geometry.coordinates)]), 1), pixel = _a[0];
|
|
63057
63126
|
element.addEventListener('focusin', function (event) {
|
|
63058
63127
|
_this.accessibleIndicator.filter(function (i) { return i !== indicator; }).forEach(function (indicator) { return indicator.remove(); });
|
|
63059
63128
|
// insert previous and next popups
|
|
@@ -63225,7 +63294,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
63225
63294
|
return undefined;
|
|
63226
63295
|
}
|
|
63227
63296
|
var mapConfiguration = this.map.getServiceOptions().mapConfiguration;
|
|
63228
|
-
return __spreadArray$
|
|
63297
|
+
return __spreadArray$8(__spreadArray$8([], __read$a(this.map.getCamera().bounds), false), [
|
|
63229
63298
|
this.map.getCamera().zoom,
|
|
63230
63299
|
this.map.getCamera().pitch,
|
|
63231
63300
|
this.map.getStyle().style,
|
|
@@ -64365,42 +64434,6 @@ uniform ${precision} ${type} u_${name};
|
|
|
64365
64434
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
64366
64435
|
};
|
|
64367
64436
|
})();
|
|
64368
|
-
var __values$e = (window && window.__values) || function(o) {
|
|
64369
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
64370
|
-
if (m) return m.call(o);
|
|
64371
|
-
if (o && typeof o.length === "number") return {
|
|
64372
|
-
next: function () {
|
|
64373
|
-
if (o && i >= o.length) o = void 0;
|
|
64374
|
-
return { value: o && o[i++], done: !o };
|
|
64375
|
-
}
|
|
64376
|
-
};
|
|
64377
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
64378
|
-
};
|
|
64379
|
-
var __read$a = (window && window.__read) || function (o, n) {
|
|
64380
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
64381
|
-
if (!m) return o;
|
|
64382
|
-
var i = m.call(o), r, ar = [], e;
|
|
64383
|
-
try {
|
|
64384
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
64385
|
-
}
|
|
64386
|
-
catch (error) { e = { error: error }; }
|
|
64387
|
-
finally {
|
|
64388
|
-
try {
|
|
64389
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
64390
|
-
}
|
|
64391
|
-
finally { if (e) throw e.error; }
|
|
64392
|
-
}
|
|
64393
|
-
return ar;
|
|
64394
|
-
};
|
|
64395
|
-
var __spreadArray$8 = (window && window.__spreadArray) || function (to, from, pack) {
|
|
64396
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
64397
|
-
if (ar || !(i in from)) {
|
|
64398
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
64399
|
-
ar[i] = from[i];
|
|
64400
|
-
}
|
|
64401
|
-
}
|
|
64402
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
64403
|
-
};
|
|
64404
64437
|
/**
|
|
64405
64438
|
* Options used when rendering Polygon and MultiPolygon objects in a PolygonLayer.
|
|
64406
64439
|
*/
|
|
@@ -64436,50 +64469,6 @@ uniform ${precision} ${type} u_${name};
|
|
|
64436
64469
|
_this.fillPattern = undefined;
|
|
64437
64470
|
return _this;
|
|
64438
64471
|
}
|
|
64439
|
-
/**
|
|
64440
|
-
* Override the standard merge behavior to set fillPattern and fillColor to be mutually exclusive
|
|
64441
|
-
* @internal
|
|
64442
|
-
*/
|
|
64443
|
-
PolygonLayerOptions.prototype.merge = function () {
|
|
64444
|
-
var e_1, _a;
|
|
64445
|
-
var valueList = [];
|
|
64446
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
64447
|
-
valueList[_i] = arguments[_i];
|
|
64448
|
-
}
|
|
64449
|
-
var isNewColorSet = false;
|
|
64450
|
-
var isNewPatternSet = false;
|
|
64451
|
-
try {
|
|
64452
|
-
for (var valueList_1 = __values$e(valueList), valueList_1_1 = valueList_1.next(); !valueList_1_1.done; valueList_1_1 = valueList_1.next()) {
|
|
64453
|
-
var value = valueList_1_1.value;
|
|
64454
|
-
if (value) {
|
|
64455
|
-
if (value.hasOwnProperty("fillColor")) {
|
|
64456
|
-
isNewColorSet = true;
|
|
64457
|
-
isNewPatternSet = false;
|
|
64458
|
-
}
|
|
64459
|
-
else if (value.hasOwnProperty("fillPattern")) {
|
|
64460
|
-
isNewPatternSet = true;
|
|
64461
|
-
isNewColorSet = false;
|
|
64462
|
-
}
|
|
64463
|
-
}
|
|
64464
|
-
}
|
|
64465
|
-
}
|
|
64466
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
64467
|
-
finally {
|
|
64468
|
-
try {
|
|
64469
|
-
if (valueList_1_1 && !valueList_1_1.done && (_a = valueList_1.return)) _a.call(valueList_1);
|
|
64470
|
-
}
|
|
64471
|
-
finally { if (e_1) throw e_1.error; }
|
|
64472
|
-
}
|
|
64473
|
-
// Then execute the standard merge behavior.
|
|
64474
|
-
var merged = _super.prototype.merge.apply(this, __spreadArray$8([], __read$a(valueList), false));
|
|
64475
|
-
if (isNewColorSet) {
|
|
64476
|
-
merged.fillPattern = undefined;
|
|
64477
|
-
}
|
|
64478
|
-
else if (isNewPatternSet) {
|
|
64479
|
-
merged.fillColor = undefined;
|
|
64480
|
-
}
|
|
64481
|
-
return merged;
|
|
64482
|
-
};
|
|
64483
64472
|
return PolygonLayerOptions;
|
|
64484
64473
|
}(LayerOptions$1));
|
|
64485
64474
|
|
|
@@ -64531,6 +64520,8 @@ uniform ${precision} ${type} u_${name};
|
|
|
64531
64520
|
};
|
|
64532
64521
|
/**
|
|
64533
64522
|
* Sets the options of the polygon layer.
|
|
64523
|
+
* When `fillPattern` is set, `fillColor` will be ignored.
|
|
64524
|
+
* To set `fillColor`, make sure `fillPattern` is set to `undefined`.
|
|
64534
64525
|
* @param newOptions The new options of the polygon layer.
|
|
64535
64526
|
*/
|
|
64536
64527
|
PolygonLayer.prototype.setOptions = function (options) {
|
|
@@ -70803,59 +70794,59 @@ uniform ${precision} ${type} u_${name};
|
|
|
70803
70794
|
var features = this.map._getMap().querySourceFeatures(sourceID, { sourceLayer: sourceLayer, filter: filter });
|
|
70804
70795
|
return this.map.sources._mapFeaturesToShapes(features, true, this.sources.get(sourceID));
|
|
70805
70796
|
};
|
|
70806
|
-
|
|
70807
|
-
|
|
70808
|
-
|
|
70809
|
-
|
|
70810
|
-
|
|
70811
|
-
|
|
70812
|
-
|
|
70813
|
-
|
|
70814
|
-
|
|
70815
|
-
|
|
70816
|
-
|
|
70817
|
-
|
|
70818
|
-
|
|
70819
|
-
|
|
70820
|
-
|
|
70821
|
-
|
|
70822
|
-
|
|
70823
|
-
|
|
70824
|
-
|
|
70825
|
-
|
|
70826
|
-
|
|
70827
|
-
|
|
70828
|
-
|
|
70829
|
-
|
|
70830
|
-
|
|
70831
|
-
|
|
70832
|
-
|
|
70833
|
-
|
|
70834
|
-
|
|
70835
|
-
|
|
70836
|
-
|
|
70837
|
-
|
|
70838
|
-
|
|
70839
|
-
|
|
70840
|
-
|
|
70841
|
-
|
|
70842
|
-
|
|
70843
|
-
|
|
70844
|
-
|
|
70845
|
-
|
|
70846
|
-
|
|
70847
|
-
|
|
70848
|
-
|
|
70849
|
-
|
|
70850
|
-
|
|
70851
|
-
|
|
70852
|
-
|
|
70853
|
-
|
|
70854
|
-
|
|
70855
|
-
|
|
70856
|
-
|
|
70857
|
-
|
|
70858
|
-
|
|
70797
|
+
/**
|
|
70798
|
+
* Gets the state of a feature
|
|
70799
|
+
* @param feature the ID of the feature
|
|
70800
|
+
* @param source the ID of the source
|
|
70801
|
+
* @param sourceLayer the ID of the layer
|
|
70802
|
+
*/
|
|
70803
|
+
SourceManager.prototype.getFeatureState = function (feature, source, sourceLayer) {
|
|
70804
|
+
var featureId;
|
|
70805
|
+
if (typeof feature === "string") {
|
|
70806
|
+
featureId = feature;
|
|
70807
|
+
}
|
|
70808
|
+
else {
|
|
70809
|
+
featureId = feature instanceof Shape ? feature.getId() : feature.id;
|
|
70810
|
+
}
|
|
70811
|
+
var featureSource = typeof source === "string" ? source : source.getId();
|
|
70812
|
+
return this.map._getMap().getFeatureState({ id: featureId, source: featureSource, sourceLayer: sourceLayer });
|
|
70813
|
+
};
|
|
70814
|
+
/**
|
|
70815
|
+
* Removes the state or a single key value of the state of a feature.
|
|
70816
|
+
* @param feature the ID of the feature
|
|
70817
|
+
* @param source the ID of the source
|
|
70818
|
+
* @param sourceLayer the ID of the layer
|
|
70819
|
+
* @param key the key in the feature state to update
|
|
70820
|
+
*/
|
|
70821
|
+
SourceManager.prototype.removeFeatureState = function (feature, source, sourceLayer, key) {
|
|
70822
|
+
var featureId;
|
|
70823
|
+
if (typeof feature === "string") {
|
|
70824
|
+
featureId = feature;
|
|
70825
|
+
}
|
|
70826
|
+
else {
|
|
70827
|
+
featureId = feature instanceof Shape ? feature.getId() : feature.id;
|
|
70828
|
+
}
|
|
70829
|
+
var featureSource = typeof source === "string" ? source : source.getId();
|
|
70830
|
+
this.map._getMap().removeFeatureState({ id: featureId, source: featureSource, sourceLayer: sourceLayer }, key);
|
|
70831
|
+
};
|
|
70832
|
+
/**
|
|
70833
|
+
* Sets the state of the feature by passing in a key value pair object.
|
|
70834
|
+
* @param feature the ID of the feature
|
|
70835
|
+
* @param source the ID of the source
|
|
70836
|
+
* @param sourceLayer the ID of the layer
|
|
70837
|
+
* @param key the key in the feature state to update
|
|
70838
|
+
*/
|
|
70839
|
+
SourceManager.prototype.setFeatureState = function (feature, source, state, sourceLayer) {
|
|
70840
|
+
var featureId;
|
|
70841
|
+
if (typeof feature === "string") {
|
|
70842
|
+
featureId = feature;
|
|
70843
|
+
}
|
|
70844
|
+
else {
|
|
70845
|
+
featureId = feature instanceof Shape ? feature.getId() : feature.id;
|
|
70846
|
+
}
|
|
70847
|
+
var featureSource = typeof source === "string" ? source : source.getId();
|
|
70848
|
+
this.map._getMap().setFeatureState({ id: featureId, source: featureSource, sourceLayer: sourceLayer }, state);
|
|
70849
|
+
};
|
|
70859
70850
|
/**
|
|
70860
70851
|
* @internal
|
|
70861
70852
|
*/
|
|
@@ -72131,10 +72122,10 @@ uniform ${precision} ${type} u_${name};
|
|
|
72131
72122
|
*/
|
|
72132
72123
|
_this["enable-accessibility"] = _this.enableAccessibility;
|
|
72133
72124
|
/**
|
|
72134
|
-
* Enable fallback to geocoder for
|
|
72125
|
+
* Enable the fallback to the REST API geocoder for detecting location accessibility if extracting location from vector data fails.
|
|
72126
|
+
* Disabling this option will prevent the generation of geocode API requests but may lead to a lack of location information for screen readers.
|
|
72135
72127
|
* default: true
|
|
72136
72128
|
* @default true
|
|
72137
|
-
* @internal
|
|
72138
72129
|
*/
|
|
72139
72130
|
_this.enableAccessibilityLocationFallback = true;
|
|
72140
72131
|
/**
|
|
@@ -72959,14 +72950,13 @@ uniform ${precision} ${type} u_${name};
|
|
|
72959
72950
|
return !previousStyle
|
|
72960
72951
|
? nextStyle
|
|
72961
72952
|
: this.map.layers._getUserLayers().reduce(function (style, userLayer) {
|
|
72953
|
+
var _a, _b;
|
|
72962
72954
|
if (userLayer.layer instanceof WebGLLayer) {
|
|
72963
72955
|
// mapbox custom layers cannot be serialized and preserved,
|
|
72964
72956
|
// return to continue to the next user layer.
|
|
72965
72957
|
return style;
|
|
72966
72958
|
}
|
|
72967
|
-
var
|
|
72968
|
-
? layerGroupLayers[userLayer.before][0]
|
|
72969
|
-
: undefined;
|
|
72959
|
+
var beforeLayerId = ((_b = (_a = layerGroupLayers === null || layerGroupLayers === void 0 ? void 0 : layerGroupLayers[userLayer.before]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id) || userLayer.before;
|
|
72970
72960
|
var layer = previousStyle.layers.find(function (layer) { return layer.id === userLayer.layer.getId(); });
|
|
72971
72961
|
// when setStyle diff attempt is unsuccesful, _load will be called on the style that may have already injected user layers -> clean it up
|
|
72972
72962
|
var existingLayerIdx = nextStyle.layers.findIndex(function (layer) { return layer.id === userLayer.layer.getId(); });
|
|
@@ -72977,7 +72967,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
72977
72967
|
var sourcesToCopy = new Set(Array.from(userLayer.layer._getSourceIds())
|
|
72978
72968
|
.map(function (sourceId) { return previousStyle.sources[sourceId] ? { source: previousStyle.sources[sourceId], id: sourceId } : undefined; })
|
|
72979
72969
|
.filter(function (source) { return source !== undefined; }));
|
|
72980
|
-
var insertIdx =
|
|
72970
|
+
var insertIdx = beforeLayerId ? style.layers.findIndex(function (layer) { return layer.id === beforeLayerId; }) : -1;
|
|
72981
72971
|
if (insertIdx > -1) {
|
|
72982
72972
|
style.layers.splice(insertIdx, 0, layer);
|
|
72983
72973
|
}
|