azure-maps-control 2.2.2 → 2.2.4
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.js +143 -70
- package/dist/atlas-core-bare.js +305 -100
- package/dist/atlas-core-bare.min.js +1 -1
- package/dist/atlas-core-snr.js +445 -163
- package/dist/atlas-core.js +607 -193
- package/dist/atlas-core.min.js +1 -1
- package/dist/atlas.css +4 -28
- package/dist/atlas.js +607 -193
- package/dist/atlas.min.css +1 -1
- package/dist/atlas.min.js +1 -1
- package/package.json +2 -2
- package/thirdpartynotices.txt +0 -0
- package/typings/index.d.ts +9 -5
|
@@ -265,7 +265,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
265
265
|
return Url;
|
|
266
266
|
}());
|
|
267
267
|
|
|
268
|
-
var version = "2.2.
|
|
268
|
+
var version = "2.2.4";
|
|
269
269
|
|
|
270
270
|
/**
|
|
271
271
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -306,27 +306,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
306
306
|
var tooltipContent = document.createElement("span");
|
|
307
307
|
tooltipContent.innerText = name;
|
|
308
308
|
tooltipContent.classList.add('tooltiptext');
|
|
309
|
-
// mimics default edge tooltip theming
|
|
310
|
-
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
311
|
-
tooltipContent.classList.add('dark');
|
|
312
|
-
}
|
|
313
|
-
var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
314
|
-
var onThemeChange = function (e) {
|
|
315
|
-
var isDark = e.matches;
|
|
316
|
-
if (isDark && !tooltipContent.classList.contains('dark')) {
|
|
317
|
-
tooltipContent.classList.add('dark');
|
|
318
|
-
}
|
|
319
|
-
else if (!isDark && tooltipContent.classList.contains('dark')) {
|
|
320
|
-
tooltipContent.classList.remove('dark');
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
// compensate for browsers where MediaQueryList is not derived from EventTarget (pre iOS13 Safari)
|
|
324
|
-
if (typeof themeQuery.addEventListener === 'function') {
|
|
325
|
-
themeQuery.addEventListener('change', function (e) { return onThemeChange(e); });
|
|
326
|
-
}
|
|
327
|
-
else if (typeof themeQuery.addListener === 'function') {
|
|
328
|
-
themeQuery.addListener(function (e) { return onThemeChange(e); });
|
|
329
|
-
}
|
|
330
309
|
if (navigator.userAgent.indexOf('Edg') != -1) {
|
|
331
310
|
tooltipContent.classList.add('edge');
|
|
332
311
|
}
|
|
@@ -4514,6 +4493,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
4514
4493
|
}
|
|
4515
4494
|
});
|
|
4516
4495
|
container.addEventListener("focusout", function (event) {
|
|
4496
|
+
if (event.target === currStyleButton) {
|
|
4497
|
+
// on focusout from reveal button -> reset the tabIndex on the styleOpsGrid elements that could have been set to -1 on esc key press
|
|
4498
|
+
Array.from(styleOpsGrid.children).forEach(function (e) { return e.removeAttribute('tabIndex'); });
|
|
4499
|
+
}
|
|
4517
4500
|
if (!(event.relatedTarget instanceof Node && container.contains(event.relatedTarget))) {
|
|
4518
4501
|
_this.hasFocus = false;
|
|
4519
4502
|
if (!_this.hasMouse) {
|
|
@@ -4528,6 +4511,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
4528
4511
|
if (event.keyCode === 27) {
|
|
4529
4512
|
event.stopPropagation();
|
|
4530
4513
|
currStyleButton.focus();
|
|
4514
|
+
Array.from(styleOpsGrid.children).forEach(function (e) { return e.setAttribute('tabIndex', "-1"); });
|
|
4531
4515
|
if (container.classList.contains(StyleControl.Css.inUse)) {
|
|
4532
4516
|
container.classList.remove(StyleControl.Css.inUse);
|
|
4533
4517
|
styleOpsGrid.classList.add("hidden-accessible-element");
|
|
@@ -14672,6 +14656,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14672
14656
|
defaultRegion: {
|
|
14673
14657
|
code: "NGT",
|
|
14674
14658
|
strings: "en/resource.json"
|
|
14659
|
+
},
|
|
14660
|
+
latn: {
|
|
14661
|
+
code: "NGT-Latn",
|
|
14662
|
+
strings: "en/resource.json"
|
|
14675
14663
|
}
|
|
14676
14664
|
},
|
|
14677
14665
|
ar: {
|
|
@@ -14718,6 +14706,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14718
14706
|
us: {
|
|
14719
14707
|
code: "en-US",
|
|
14720
14708
|
strings: "en/resource.json"
|
|
14709
|
+
},
|
|
14710
|
+
au: {
|
|
14711
|
+
code: "en-AU",
|
|
14712
|
+
strings: "en/resource.json"
|
|
14713
|
+
},
|
|
14714
|
+
gb: {
|
|
14715
|
+
code: "en-GB",
|
|
14716
|
+
strings: "en/resource.json"
|
|
14717
|
+
},
|
|
14718
|
+
nz: {
|
|
14719
|
+
code: "en-NZ",
|
|
14720
|
+
strings: "en/resource.json"
|
|
14721
14721
|
}
|
|
14722
14722
|
},
|
|
14723
14723
|
es: {
|
|
@@ -14843,14 +14843,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14843
14843
|
}
|
|
14844
14844
|
},
|
|
14845
14845
|
zh: {
|
|
14846
|
+
// per https://microsoft.sharepoint.com/sites/globalreadiness/SitePages/Language-fallback.aspx
|
|
14847
|
+
// Chinese - Neutral (zh) fallbacks to en-US
|
|
14846
14848
|
defaultRegion: {
|
|
14847
|
-
code: "zh
|
|
14848
|
-
strings: "
|
|
14849
|
+
code: "zh",
|
|
14850
|
+
strings: "en/resource.json"
|
|
14851
|
+
}
|
|
14852
|
+
},
|
|
14853
|
+
"zh-hans": {
|
|
14854
|
+
defaultRegion: {
|
|
14855
|
+
code: "zh-Hans",
|
|
14856
|
+
strings: "zh-cn/resource.json"
|
|
14857
|
+
},
|
|
14858
|
+
cn: {
|
|
14859
|
+
code: "zh-Hans-CN",
|
|
14860
|
+
strings: "zh-cn/resource.json"
|
|
14849
14861
|
}
|
|
14850
14862
|
},
|
|
14851
14863
|
"zh-hant": {
|
|
14864
|
+
// per discussion with global readiness team, we were explicitly asked to not fallback zh-hant to zh-tw
|
|
14852
14865
|
defaultRegion: {
|
|
14853
14866
|
code: "zh-Hant",
|
|
14867
|
+
strings: "en/resource.json"
|
|
14868
|
+
},
|
|
14869
|
+
tw: {
|
|
14870
|
+
code: "zh-Hant-TW",
|
|
14854
14871
|
strings: "zh-tw/resource.json"
|
|
14855
14872
|
}
|
|
14856
14873
|
}
|
|
@@ -15479,7 +15496,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
15479
15496
|
/**
|
|
15480
15497
|
* Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View.
|
|
15481
15498
|
* Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews }.
|
|
15482
|
-
* It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
|
|
15499
|
+
* It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
|
|
15483
15500
|
* @param view The new default view
|
|
15484
15501
|
*/
|
|
15485
15502
|
function setView(view) {
|
|
@@ -15971,6 +15988,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
15971
15988
|
}
|
|
15972
15989
|
return ar;
|
|
15973
15990
|
};
|
|
15991
|
+
var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
|
|
15992
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
15993
|
+
to[j] = from[i];
|
|
15994
|
+
return to;
|
|
15995
|
+
};
|
|
15974
15996
|
|
|
15975
15997
|
/**
|
|
15976
15998
|
* @private
|
|
@@ -17602,7 +17624,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
17602
17624
|
}
|
|
17603
17625
|
return ar;
|
|
17604
17626
|
};
|
|
17605
|
-
var __spreadArray$
|
|
17627
|
+
var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
|
|
17606
17628
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
17607
17629
|
to[j] = from[i];
|
|
17608
17630
|
return to;
|
|
@@ -18038,7 +18060,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
18038
18060
|
// If a specified layer hasn't been added to the map throw an error.
|
|
18039
18061
|
var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
|
|
18040
18062
|
if (index > -1) {
|
|
18041
|
-
layerIds.push.apply(layerIds, __spreadArray$
|
|
18063
|
+
layerIds.push.apply(layerIds, __spreadArray$3([], __read$8(this_1.layerIndex[index]._getLayerIds()
|
|
18042
18064
|
.filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
|
|
18043
18065
|
}
|
|
18044
18066
|
else {
|
|
@@ -18797,7 +18819,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
18797
18819
|
}
|
|
18798
18820
|
return ar;
|
|
18799
18821
|
};
|
|
18800
|
-
var __spreadArray$
|
|
18822
|
+
var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
|
|
18801
18823
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
18802
18824
|
to[j] = from[i];
|
|
18803
18825
|
return to;
|
|
@@ -18872,7 +18894,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
18872
18894
|
}
|
|
18873
18895
|
finally { if (e_1) throw e_1.error; }
|
|
18874
18896
|
}
|
|
18875
|
-
return _super.prototype.merge.apply(this, __spreadArray$
|
|
18897
|
+
return _super.prototype.merge.apply(this, __spreadArray$4([], __read$9(valuesList)));
|
|
18876
18898
|
};
|
|
18877
18899
|
return CameraBoundsOptions;
|
|
18878
18900
|
}(Options));
|
|
@@ -19361,7 +19383,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
19361
19383
|
}
|
|
19362
19384
|
return ar;
|
|
19363
19385
|
};
|
|
19364
|
-
var __spreadArray$
|
|
19386
|
+
var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
|
|
19365
19387
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
19366
19388
|
to[j] = from[i];
|
|
19367
19389
|
return to;
|
|
@@ -19472,7 +19494,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
19472
19494
|
/**
|
|
19473
19495
|
* Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View.
|
|
19474
19496
|
* Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews}
|
|
19475
|
-
* It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
|
|
19497
|
+
* It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
|
|
19476
19498
|
* default: `undefined`
|
|
19477
19499
|
* @default undefined
|
|
19478
19500
|
*/
|
|
@@ -19520,7 +19542,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
19520
19542
|
finally { if (e_1) throw e_1.error; }
|
|
19521
19543
|
}
|
|
19522
19544
|
// Then execute the standard merge behavior.
|
|
19523
|
-
return _super.prototype.merge.apply(this, __spreadArray$
|
|
19545
|
+
return _super.prototype.merge.apply(this, __spreadArray$5([], __read$a(valueList)));
|
|
19524
19546
|
};
|
|
19525
19547
|
return StyleOptions;
|
|
19526
19548
|
}(Options));
|
|
@@ -19578,7 +19600,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
19578
19600
|
}
|
|
19579
19601
|
return ar;
|
|
19580
19602
|
};
|
|
19581
|
-
var __spreadArray$
|
|
19603
|
+
var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
|
|
19582
19604
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
19583
19605
|
to[j] = from[i];
|
|
19584
19606
|
return to;
|
|
@@ -19813,10 +19835,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
19813
19835
|
// won't change default behavior in Options as usually that's what desired
|
|
19814
19836
|
// instead capture it here and reassign.
|
|
19815
19837
|
var currentTransforms = this._transformers;
|
|
19816
|
-
var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$
|
|
19838
|
+
var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$6(__spreadArray$6([], __read$b(flattened)), __read$b(value._transformers || [])); }, []) : [];
|
|
19817
19839
|
// Then execute the standard merge behavior.
|
|
19818
19840
|
// If subscription key auth method isn't being used then the subscription key property should be undefined.
|
|
19819
|
-
var merged = _super.prototype.merge.apply(this, __spreadArray$
|
|
19841
|
+
var merged = _super.prototype.merge.apply(this, __spreadArray$6([], __read$b(valueList)));
|
|
19820
19842
|
if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
|
|
19821
19843
|
merged["subscription-key"] = merged.subscriptionKey = undefined;
|
|
19822
19844
|
}
|
|
@@ -19828,7 +19850,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
19828
19850
|
if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
|
|
19829
19851
|
merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
|
|
19830
19852
|
}
|
|
19831
|
-
this._transformers = __spreadArray$
|
|
19853
|
+
this._transformers = __spreadArray$6(__spreadArray$6([], __read$b(currentTransforms || [])), __read$b(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
|
|
19832
19854
|
if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
|
|
19833
19855
|
this._transformers.push(this.transformRequest);
|
|
19834
19856
|
}
|
|
@@ -20076,7 +20098,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20076
20098
|
}
|
|
20077
20099
|
return ar;
|
|
20078
20100
|
};
|
|
20079
|
-
var __spreadArray$
|
|
20101
|
+
var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
|
|
20080
20102
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
20081
20103
|
to[j] = from[i];
|
|
20082
20104
|
return to;
|
|
@@ -20103,6 +20125,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20103
20125
|
* Preserve the map configuration that was used before the indoor map configuration was set
|
|
20104
20126
|
*/
|
|
20105
20127
|
this.preservedPreindoorMapConfiguration = undefined;
|
|
20128
|
+
/**
|
|
20129
|
+
* The state of the progressive loading
|
|
20130
|
+
*/
|
|
20131
|
+
this._progressiveLoadingState = {
|
|
20132
|
+
mapStyle: undefined,
|
|
20133
|
+
pendingVisibilityChange: undefined,
|
|
20134
|
+
};
|
|
20106
20135
|
this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
|
|
20107
20136
|
var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
|
|
20108
20137
|
// If the initial layer groups are invalid, skip the progressive loading.
|
|
@@ -20110,11 +20139,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20110
20139
|
return;
|
|
20111
20140
|
var map = _this.map._getMap();
|
|
20112
20141
|
var currentZoomLevel = map.getZoom();
|
|
20113
|
-
|
|
20142
|
+
var currentMapStyle = _this.map.getStyle().style;
|
|
20143
|
+
// Cancel and release previous pending callback, if any.
|
|
20144
|
+
if (_this._progressiveLoadingState.pendingVisibilityChange) {
|
|
20145
|
+
_this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
20146
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
20147
|
+
}
|
|
20148
|
+
// Keep the current map style for future comparison.
|
|
20149
|
+
_this._progressiveLoadingState.mapStyle = currentMapStyle;
|
|
20150
|
+
// Select deferrable layers
|
|
20114
20151
|
var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
|
|
20115
20152
|
var _b = __read$c(_a, 2), groupName = _b[0], layers = _b[1];
|
|
20116
20153
|
var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
|
|
20117
|
-
return __spreadArray$
|
|
20154
|
+
return __spreadArray$7(__spreadArray$7([], __read$c(deferred)), __read$c(layers.filter(function (layer) {
|
|
20118
20155
|
var _a;
|
|
20119
20156
|
// Exclude custom layers
|
|
20120
20157
|
if (layer.type === 'custom')
|
|
@@ -20137,22 +20174,34 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20137
20174
|
return false;
|
|
20138
20175
|
}
|
|
20139
20176
|
}
|
|
20140
|
-
//
|
|
20177
|
+
// Select visible layers only.
|
|
20141
20178
|
return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
|
|
20142
20179
|
})));
|
|
20143
20180
|
}, []);
|
|
20144
|
-
// Hide the
|
|
20181
|
+
// Hide the deferrable layers at initial load, therefore we can save the render time.
|
|
20145
20182
|
deferredLayers.forEach(function (layer) {
|
|
20183
|
+
// Since this happens before sending style object into the map rendering,
|
|
20184
|
+
// we only need to update the style object, but not necessary to update maplibre's layout properties.
|
|
20146
20185
|
layer.layout = layer.layout || {};
|
|
20147
20186
|
layer.layout.visibility = 'none';
|
|
20148
20187
|
});
|
|
20149
|
-
// Make the deferred layers visible once the map instance is fully loaded
|
|
20150
|
-
_this.
|
|
20188
|
+
// Make the deferred layers visible once the map instance is fully loaded.
|
|
20189
|
+
_this._progressiveLoadingState.pendingVisibilityChange = function () {
|
|
20190
|
+
// Release the callback.
|
|
20191
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
20192
|
+
// Bail out the callback once map style has changed.
|
|
20193
|
+
var nextMapStyle = _this.map.getStyle().style;
|
|
20194
|
+
if (currentMapStyle !== nextMapStyle)
|
|
20195
|
+
return;
|
|
20196
|
+
// Make deferred layers visible
|
|
20151
20197
|
deferredLayers.forEach(function (layer) {
|
|
20198
|
+
// This happens after the map rendering; Therefore, we need to update
|
|
20199
|
+
// both the style object and the maplibre's layout properties.
|
|
20152
20200
|
layer.layout.visibility = 'visible';
|
|
20153
20201
|
map.setLayoutProperty(layer.id, 'visibility', 'visible');
|
|
20154
20202
|
});
|
|
20155
|
-
}
|
|
20203
|
+
};
|
|
20204
|
+
_this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
20156
20205
|
};
|
|
20157
20206
|
this._onStyleData = function () {
|
|
20158
20207
|
_this._lookUpAsync(_this.map.getStyle()).then(function (style) {
|
|
@@ -20294,7 +20343,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20294
20343
|
domain: _this.serviceOptions.staticAssetsDomain,
|
|
20295
20344
|
path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
|
|
20296
20345
|
queryParams: {
|
|
20297
|
-
|
|
20346
|
+
// Use the style version from the API response if it's available,
|
|
20347
|
+
// otherwise fallback to the version specified in the serviceOptions.
|
|
20348
|
+
// This is needed for flight testing the 2023-01-01 style version.
|
|
20349
|
+
styleVersion: definitions.version !== undefined && definitions.version !== null
|
|
20350
|
+
? definitions.version
|
|
20351
|
+
: _this.serviceOptions.styleDefinitionsVersion
|
|
20298
20352
|
// thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
|
|
20299
20353
|
//language: styleOptions.language
|
|
20300
20354
|
},
|
|
@@ -20434,18 +20488,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20434
20488
|
// should be modified before they are applied to the map.
|
|
20435
20489
|
var styleOptions = this.map.getStyle();
|
|
20436
20490
|
var trafficOptions = this.map.getTraffic();
|
|
20437
|
-
// force a replacement of language placeholder in the tileset url to avoid resolution to a same cache with placeholders on language change
|
|
20438
|
-
nextStyle.sources = Object.entries(nextStyle.sources).reduce(function (newSources, _a) {
|
|
20439
|
-
var _b = __read$c(_a, 2), sourceKey = _b[0], source = _b[1];
|
|
20440
|
-
var newSource = __assign$8({}, source);
|
|
20441
|
-
if ('url' in newSource && typeof newSource.url === 'string') {
|
|
20442
|
-
if (newSource.url.includes(constants.languagePlaceHolder)) {
|
|
20443
|
-
newSource.url = newSource.url.replace(constants.languagePlaceHolder, styleOptions.language);
|
|
20444
|
-
}
|
|
20445
|
-
}
|
|
20446
|
-
newSources[sourceKey] = newSource;
|
|
20447
|
-
return newSources;
|
|
20448
|
-
}, {});
|
|
20449
20491
|
var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
|
|
20450
20492
|
// The feature only effective at the initial load.
|
|
20451
20493
|
!this.map._isLoaded());
|
|
@@ -20597,27 +20639,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20597
20639
|
* Fetches a json resource at the specified domain and path.
|
|
20598
20640
|
*/
|
|
20599
20641
|
StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
|
|
20600
|
-
var _a;
|
|
20642
|
+
var _a, _b;
|
|
20601
20643
|
if (customQueryParams === void 0) { customQueryParams = {}; }
|
|
20602
20644
|
return __awaiter$2(this, void 0, void 0, function () {
|
|
20603
20645
|
var requestParams, fetchOptions;
|
|
20604
|
-
var
|
|
20605
|
-
return __generator$2(this, function (
|
|
20606
|
-
switch (
|
|
20646
|
+
var _c;
|
|
20647
|
+
return __generator$2(this, function (_d) {
|
|
20648
|
+
switch (_d.label) {
|
|
20607
20649
|
case 0:
|
|
20608
20650
|
requestParams = {
|
|
20609
20651
|
url: new Url({
|
|
20610
20652
|
protocol: "https",
|
|
20611
20653
|
domain: domain,
|
|
20612
20654
|
path: path,
|
|
20613
|
-
queryParams: __assign$8((
|
|
20655
|
+
queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
|
|
20656
|
+
// Generate a hash code to avoid cache conflict
|
|
20657
|
+
// TODO: Remove this once style version 2023-01-01 is publicly available
|
|
20658
|
+
_c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
|
|
20614
20659
|
}).toString()
|
|
20615
20660
|
};
|
|
20616
20661
|
if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
|
|
20617
20662
|
// If a transformRequest(...) was specified use it.
|
|
20618
20663
|
requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
|
|
20619
20664
|
}
|
|
20620
|
-
(
|
|
20665
|
+
(_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
|
|
20621
20666
|
fetchOptions = {
|
|
20622
20667
|
method: "GET",
|
|
20623
20668
|
mode: "cors",
|
|
@@ -20634,11 +20679,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20634
20679
|
throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
|
|
20635
20680
|
}
|
|
20636
20681
|
})];
|
|
20637
|
-
case 1: return [2 /*return*/,
|
|
20682
|
+
case 1: return [2 /*return*/, _d.sent()];
|
|
20638
20683
|
}
|
|
20639
20684
|
});
|
|
20640
20685
|
});
|
|
20641
20686
|
};
|
|
20687
|
+
/**
|
|
20688
|
+
* A basic helper function to generate a hash from an input string.
|
|
20689
|
+
*/
|
|
20690
|
+
StyleManager._hashCode = function (str) {
|
|
20691
|
+
if (str === void 0) { str = ""; }
|
|
20692
|
+
var chr, hash = 0;
|
|
20693
|
+
if (!str)
|
|
20694
|
+
return hash;
|
|
20695
|
+
for (var i = 0; i < str.length; i++) {
|
|
20696
|
+
chr = str.charCodeAt(i);
|
|
20697
|
+
hash = (hash << 5) - hash + chr;
|
|
20698
|
+
hash |= 0; // Convert to 32bit integer
|
|
20699
|
+
}
|
|
20700
|
+
return hash;
|
|
20701
|
+
};
|
|
20642
20702
|
return StyleManager;
|
|
20643
20703
|
}());
|
|
20644
20704
|
|
|
@@ -20725,7 +20785,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20725
20785
|
}
|
|
20726
20786
|
return ar;
|
|
20727
20787
|
};
|
|
20728
|
-
var __spreadArray$
|
|
20788
|
+
var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
|
|
20729
20789
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
20730
20790
|
to[j] = from[i];
|
|
20731
20791
|
return to;
|
|
@@ -20908,7 +20968,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20908
20968
|
_this.events.invoke("error", errorData);
|
|
20909
20969
|
});
|
|
20910
20970
|
// --> Set initial camera state of map
|
|
20911
|
-
_this.setCamera(__assign$9(__assign$9({
|
|
20971
|
+
_this.setCamera(__assign$9(__assign$9({
|
|
20972
|
+
// Default minZoom to ensure the map doesn't zoom out to unsupported zoom levels.
|
|
20973
|
+
minZoom: 1 }, options), { type: "jump", duration: 0 }));
|
|
20912
20974
|
_this.flowDelegate = new FlowServiceDelegate(_this);
|
|
20913
20975
|
_this.accessibleMapDelegate = new AccessibleMapDelegate(_this);
|
|
20914
20976
|
_this.userInteractionDelegate = new UserInteractionDelegate(_this, options);
|
|
@@ -21003,6 +21065,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21003
21065
|
if (!mapboxCameraOptions) {
|
|
21004
21066
|
throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");
|
|
21005
21067
|
}
|
|
21068
|
+
if ('pitch' in options) {
|
|
21069
|
+
mapboxCameraOptions.pitch = options.pitch;
|
|
21070
|
+
}
|
|
21071
|
+
if ('bearing' in options) {
|
|
21072
|
+
mapboxCameraOptions.bearing = options.bearing;
|
|
21073
|
+
}
|
|
21006
21074
|
this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
|
|
21007
21075
|
this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
|
|
21008
21076
|
maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
|
|
@@ -21125,8 +21193,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21125
21193
|
// If this function is restructured such that a styledata event won't always trigger
|
|
21126
21194
|
// if the language is changed, then either those delegates need changed
|
|
21127
21195
|
// or the styledata event manually invoked.
|
|
21196
|
+
var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
|
|
21128
21197
|
this.styleOptions = newOptions;
|
|
21129
|
-
this._setStyleComponents(newOptions,
|
|
21198
|
+
this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
|
|
21130
21199
|
};
|
|
21131
21200
|
/**
|
|
21132
21201
|
* Returns the map control's current style settings.
|
|
@@ -21517,7 +21586,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21517
21586
|
urls = layer.getOptions().subdomains || [];
|
|
21518
21587
|
}
|
|
21519
21588
|
// Add the tile urls to the layer, but don't update the map yet.
|
|
21520
|
-
urls.push.apply(urls, __spreadArray$
|
|
21589
|
+
urls.push.apply(urls, __spreadArray$8([], __read$d(tileSources)));
|
|
21521
21590
|
layer._setOptionsNoUpdate({
|
|
21522
21591
|
subdomains: urls
|
|
21523
21592
|
});
|
|
@@ -21686,9 +21755,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21686
21755
|
* Clean up the map's resources. Map will not function correctly after calling this method.
|
|
21687
21756
|
*/
|
|
21688
21757
|
Map.prototype.dispose = function () {
|
|
21758
|
+
var _a;
|
|
21689
21759
|
this.clear();
|
|
21690
21760
|
this.map.remove();
|
|
21761
|
+
(_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
21691
21762
|
this.removed = true;
|
|
21763
|
+
// Remove event listeners
|
|
21764
|
+
window.removeEventListener("resize", this._windowResizeCallback);
|
|
21692
21765
|
while (this.getMapContainer().firstChild) {
|
|
21693
21766
|
var currChild = this.getMapContainer().firstChild;
|
|
21694
21767
|
this.getMapContainer().removeChild(currChild);
|
|
@@ -22033,7 +22106,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
22033
22106
|
}
|
|
22034
22107
|
return ar;
|
|
22035
22108
|
};
|
|
22036
|
-
var __spreadArray$
|
|
22109
|
+
var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
|
|
22037
22110
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
22038
22111
|
to[j] = from[i];
|
|
22039
22112
|
return to;
|
|
@@ -22179,7 +22252,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
22179
22252
|
lineLength = 50;
|
|
22180
22253
|
}
|
|
22181
22254
|
var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
|
|
22182
|
-
longestStringLength = Math.max.apply(Math, __spreadArray$
|
|
22255
|
+
longestStringLength = Math.max.apply(Math, __spreadArray$9([], __read$e((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
|
|
22183
22256
|
var w = Math.ceil(longestStringLength * 3.5);
|
|
22184
22257
|
if (w < width) {
|
|
22185
22258
|
width = w;
|