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
package/dist/atlas-core-bare.js
CHANGED
|
@@ -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) {
|
|
@@ -16076,11 +16093,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16076
16093
|
// Translations for oceans: https://en.wikipedia.org/wiki/List_of_alternative_names_for_oceans
|
|
16077
16094
|
this._preloadedCache.add(lang);
|
|
16078
16095
|
var oceanConfig = {
|
|
16079
|
-
source: [
|
|
16096
|
+
source: [],
|
|
16080
16097
|
labelType: "water",
|
|
16081
16098
|
minZoom: 0,
|
|
16082
16099
|
radius: 3950000,
|
|
16083
|
-
polygonSources: [
|
|
16100
|
+
polygonSources: [] // doesn't affect the cache key
|
|
16084
16101
|
};
|
|
16085
16102
|
var shortLang = lang;
|
|
16086
16103
|
var index = shortLang.indexOf("-");
|
|
@@ -16176,6 +16193,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16176
16193
|
}
|
|
16177
16194
|
return ar;
|
|
16178
16195
|
};
|
|
16196
|
+
var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
|
|
16197
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
16198
|
+
to[j] = from[i];
|
|
16199
|
+
return to;
|
|
16200
|
+
};
|
|
16179
16201
|
/**
|
|
16180
16202
|
* This class analyizes the current view of a map and provides a description for use by accessibilty tools.
|
|
16181
16203
|
* TODO: Use services when in GeoPol regions. (Kasmir) or when user region sensitive.
|
|
@@ -16212,8 +16234,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16212
16234
|
this._minRoadDistance = 25;
|
|
16213
16235
|
// Minium distance in pixels a second road must be in order to be considered an intersection.
|
|
16214
16236
|
this._minIntersectionPixelDistance = 50;
|
|
16215
|
-
// The vector tile source id for Azure Maps.
|
|
16216
|
-
this._baseVectorTileSourceId = "microsoft.base";
|
|
16217
16237
|
/*
|
|
16218
16238
|
* Show details based on zoom level.
|
|
16219
16239
|
*
|
|
@@ -16236,7 +16256,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16236
16256
|
* Vector Tile source layers: https://developer.tomtom.com/maps-api/maps-api-documentation-vector/tile
|
|
16237
16257
|
*/
|
|
16238
16258
|
// Configuration for label extraction.
|
|
16239
|
-
this.
|
|
16259
|
+
this._labelConfig = [
|
|
16240
16260
|
// Water labels
|
|
16241
16261
|
{
|
|
16242
16262
|
source: ["Ocean label", "Ocean name"],
|
|
@@ -16370,10 +16390,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16370
16390
|
polygonSources: ["Reservation"]
|
|
16371
16391
|
}
|
|
16372
16392
|
];
|
|
16373
|
-
// Name of all polygon layers in which we want to do an intersection test with.
|
|
16374
|
-
this._polygonStyleLayer = ["National or state park", "National park", "Reservation", "Airport",
|
|
16375
|
-
"Runway", "Stadium", "University", "Zoo", "Shopping", "Hospital", "Amusement park", "Ocean", "Sea",
|
|
16376
|
-
"Ocean or sea"];
|
|
16377
16393
|
// Name of all label types to cache.
|
|
16378
16394
|
this._labelCache = new Set(["city", "state", "country", "water", "majorPoi"]);
|
|
16379
16395
|
// Name of all road source layers.
|
|
@@ -16635,6 +16651,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16635
16651
|
this._map.events.addOnce("idle", function () {
|
|
16636
16652
|
if (!_this._disposed) {
|
|
16637
16653
|
_this._updateCam(true);
|
|
16654
|
+
// Find the id of the vector tile source being used.
|
|
16655
|
+
_this._baseVectorTileSourceId = MapViewDescriptor._baseVectorTileSourceIds.find(function (id) { return _this._map.sources.getById(id); });
|
|
16656
|
+
// Set the label config based on the vector tile source.
|
|
16657
|
+
if (_this._baseVectorTileSourceId === "bing-mvt") {
|
|
16658
|
+
_this._labelConfig = MapViewDescriptor._labelConfigBing;
|
|
16659
|
+
_this._roadLayers = MapViewDescriptor._roadLayersBing;
|
|
16660
|
+
}
|
|
16661
|
+
// Derive polygon layers from the label config.
|
|
16662
|
+
_this._polygonStyleLayer = _this._labelConfig.reduce(function (acc, cur) {
|
|
16663
|
+
if (cur.polygonSources) {
|
|
16664
|
+
acc.push.apply(acc, __spreadArray$2([], __read$6(cur.polygonSources)));
|
|
16665
|
+
}
|
|
16666
|
+
return acc;
|
|
16667
|
+
}, []);
|
|
16638
16668
|
// Add event listeners directly to mapbox because we will be using custom event data.
|
|
16639
16669
|
// We don't automatically forward all properties of a mapbox event, so the custom data would be lost.
|
|
16640
16670
|
var baseMap = _this._map._getMap();
|
|
@@ -16732,8 +16762,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16732
16762
|
info_1 = {};
|
|
16733
16763
|
cPx_1 = this._map.positionsToPixels([cam.center])[0];
|
|
16734
16764
|
ErrorHandler.tryCatch(this._map, function () {
|
|
16735
|
-
|
|
16736
|
-
|
|
16765
|
+
var map = _this._map._getMap();
|
|
16766
|
+
intersects_1 = map.queryRenderedFeatures(cPx_1, {
|
|
16767
|
+
layers: _this._polygonStyleLayer.filter(function (layerId) { return map.getLayer(layerId); }),
|
|
16737
16768
|
filter: ["==", ["geometry-type"], "Polygon"]
|
|
16738
16769
|
});
|
|
16739
16770
|
}, function () { });
|
|
@@ -16743,8 +16774,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16743
16774
|
}
|
|
16744
16775
|
intersectingType_1 = null;
|
|
16745
16776
|
// Loop through each label config and try and retireve details about the map view.
|
|
16746
|
-
for (i = 0, cnt = this.
|
|
16747
|
-
layerInfo = this.
|
|
16777
|
+
for (i = 0, cnt = this._labelConfig.length; i < cnt; i++) {
|
|
16778
|
+
layerInfo = this._labelConfig[i];
|
|
16748
16779
|
if (cam.zoom >= layerInfo.minZoom) {
|
|
16749
16780
|
// If the layer info has polygons defined, do an intersection test for matching.
|
|
16750
16781
|
if (layerInfo.polygonSources) {
|
|
@@ -16844,7 +16875,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16844
16875
|
// Loop through the label sources.
|
|
16845
16876
|
for (var i = 0, len = layerInfo.source.length; i < len; i++) {
|
|
16846
16877
|
var params = {
|
|
16847
|
-
sourceLayer: layerInfo.source[i]
|
|
16878
|
+
sourceLayer: layerInfo.source[i],
|
|
16879
|
+
filter: ["has", "name"]
|
|
16848
16880
|
};
|
|
16849
16881
|
var labels = this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId, params);
|
|
16850
16882
|
var closest = null;
|
|
@@ -16921,21 +16953,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16921
16953
|
}
|
|
16922
16954
|
if (closestRoad) {
|
|
16923
16955
|
// Capture state and country codes from the closest road to ensure we have the most accurate values.
|
|
16924
|
-
|
|
16956
|
+
// Note: bing tiles do not have country_code and country_subdivision in road features.
|
|
16957
|
+
if (!info.country && closestRoad.properties.country_code) {
|
|
16925
16958
|
info.country = closestRoad.properties.country_code;
|
|
16926
16959
|
info.countryDis = 0;
|
|
16927
16960
|
MapViewDescriptor._labelCache.cache(info.country, {
|
|
16928
|
-
source: [
|
|
16961
|
+
source: [],
|
|
16929
16962
|
labelType: "country",
|
|
16930
16963
|
radius: 5000,
|
|
16931
16964
|
minZoom: 0
|
|
16932
16965
|
}, cPoint.geometry.coordinates, lang);
|
|
16933
16966
|
}
|
|
16934
|
-
if (!info.state) {
|
|
16967
|
+
if (!info.state && closestRoad.properties.country_subdivision) {
|
|
16935
16968
|
info.state = closestRoad.properties.country_subdivision;
|
|
16936
16969
|
info.stateDis = 0;
|
|
16937
16970
|
MapViewDescriptor._labelCache.cache(info.state, {
|
|
16938
|
-
source: [
|
|
16971
|
+
source: [],
|
|
16939
16972
|
labelType: "state",
|
|
16940
16973
|
radius: 5000,
|
|
16941
16974
|
minZoom: 4
|
|
@@ -17190,7 +17223,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
17190
17223
|
if (a.country) {
|
|
17191
17224
|
info.country = a.country;
|
|
17192
17225
|
MapViewDescriptor._labelCache.cache(info.country, {
|
|
17193
|
-
source: [
|
|
17226
|
+
source: [],
|
|
17194
17227
|
labelType: "country",
|
|
17195
17228
|
radius: 5000,
|
|
17196
17229
|
minZoom: 0
|
|
@@ -17199,7 +17232,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
17199
17232
|
if (a.countrySubdivision) {
|
|
17200
17233
|
info.state = a.countrySubdivision;
|
|
17201
17234
|
MapViewDescriptor._labelCache.cache(info.state, {
|
|
17202
|
-
source: [
|
|
17235
|
+
source: [],
|
|
17203
17236
|
labelType: "state",
|
|
17204
17237
|
radius: 5000,
|
|
17205
17238
|
minZoom: 4
|
|
@@ -17208,7 +17241,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
17208
17241
|
if (a.municipality) {
|
|
17209
17242
|
info.city = a.municipality;
|
|
17210
17243
|
MapViewDescriptor._labelCache.cache(info.state, {
|
|
17211
|
-
source: [
|
|
17244
|
+
source: [],
|
|
17212
17245
|
labelType: "city",
|
|
17213
17246
|
radius: 1000,
|
|
17214
17247
|
minZoom: 10
|
|
@@ -17241,6 +17274,118 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
17241
17274
|
if (increment === void 0) { increment = 1; }
|
|
17242
17275
|
return Math.round(val / increment) * increment;
|
|
17243
17276
|
};
|
|
17277
|
+
// Ids of vector tile sources for different style APIs.
|
|
17278
|
+
MapViewDescriptor._baseVectorTileSourceIds = ["microsoft.base", "vectorTiles", "bing-mvt"];
|
|
17279
|
+
// Configuration for label extraction of Bing tiles.
|
|
17280
|
+
MapViewDescriptor._labelConfigBing = [
|
|
17281
|
+
// Water labels
|
|
17282
|
+
{
|
|
17283
|
+
source: ["water_feature"],
|
|
17284
|
+
labelType: "water",
|
|
17285
|
+
minZoom: 0,
|
|
17286
|
+
radius: 3950000,
|
|
17287
|
+
polygonSources: ["generic_water_fill"]
|
|
17288
|
+
},
|
|
17289
|
+
{
|
|
17290
|
+
source: ["water_feature"],
|
|
17291
|
+
labelType: "water",
|
|
17292
|
+
minZoom: 3,
|
|
17293
|
+
radius: 1000000,
|
|
17294
|
+
polygonSources: ["generic_water_fill"]
|
|
17295
|
+
},
|
|
17296
|
+
// Country labels
|
|
17297
|
+
{
|
|
17298
|
+
source: ["country_region"],
|
|
17299
|
+
labelType: "country",
|
|
17300
|
+
minZoom: 0,
|
|
17301
|
+
maxZoom: 5,
|
|
17302
|
+
radius: 300000
|
|
17303
|
+
},
|
|
17304
|
+
// State labels
|
|
17305
|
+
{
|
|
17306
|
+
source: ["admin_division1"],
|
|
17307
|
+
labelType: "state",
|
|
17308
|
+
minZoom: 4,
|
|
17309
|
+
maxZoom: 7,
|
|
17310
|
+
radius: 300000
|
|
17311
|
+
},
|
|
17312
|
+
// City labels
|
|
17313
|
+
{
|
|
17314
|
+
source: ["populated_place"],
|
|
17315
|
+
labelType: "city",
|
|
17316
|
+
minZoom: 8,
|
|
17317
|
+
radius: 40000
|
|
17318
|
+
},
|
|
17319
|
+
// Neighbourhood labels
|
|
17320
|
+
{
|
|
17321
|
+
source: ["neighborhood"],
|
|
17322
|
+
labelType: "neighbourhood",
|
|
17323
|
+
minZoom: 12,
|
|
17324
|
+
radius: 6000
|
|
17325
|
+
},
|
|
17326
|
+
// POI labels
|
|
17327
|
+
{
|
|
17328
|
+
source: ["amusement_park"],
|
|
17329
|
+
labelType: "poi",
|
|
17330
|
+
minZoom: 14,
|
|
17331
|
+
radius: 2000,
|
|
17332
|
+
polygonSources: ["amusement_park_fill"]
|
|
17333
|
+
},
|
|
17334
|
+
{
|
|
17335
|
+
source: ["hospital"],
|
|
17336
|
+
labelType: "poi",
|
|
17337
|
+
minZoom: 14,
|
|
17338
|
+
radius: 1000,
|
|
17339
|
+
polygonSources: ["hospital_fill"]
|
|
17340
|
+
},
|
|
17341
|
+
{
|
|
17342
|
+
source: ["shopping_center"],
|
|
17343
|
+
labelType: "poi",
|
|
17344
|
+
minZoom: 14,
|
|
17345
|
+
radius: 1000,
|
|
17346
|
+
polygonSources: ["shopping_center_fill"]
|
|
17347
|
+
},
|
|
17348
|
+
{
|
|
17349
|
+
source: ["stadium"],
|
|
17350
|
+
labelType: "poi",
|
|
17351
|
+
minZoom: 14,
|
|
17352
|
+
radius: 1000,
|
|
17353
|
+
polygonSources: ["stadium_fill"]
|
|
17354
|
+
},
|
|
17355
|
+
{
|
|
17356
|
+
source: ["higher_education_facility", "school"],
|
|
17357
|
+
labelType: "poi",
|
|
17358
|
+
minZoom: 14,
|
|
17359
|
+
radius: 1000,
|
|
17360
|
+
polygonSources: ["higher_education_facility_fill", "school_fill"]
|
|
17361
|
+
},
|
|
17362
|
+
{
|
|
17363
|
+
source: ["zoo"],
|
|
17364
|
+
labelType: "poi",
|
|
17365
|
+
minZoom: 14,
|
|
17366
|
+
radius: 1000,
|
|
17367
|
+
polygonSources: ["zoo_fill"]
|
|
17368
|
+
},
|
|
17369
|
+
// Major Poi labels
|
|
17370
|
+
{
|
|
17371
|
+
source: ["airport", "airport_terminal"],
|
|
17372
|
+
labelType: "majorPoi",
|
|
17373
|
+
minZoom: 11,
|
|
17374
|
+
radius: 3000,
|
|
17375
|
+
polygonSources: ["airport_terminal_fill", "airport_fill-merged7", "airport_runway_fill"]
|
|
17376
|
+
},
|
|
17377
|
+
{
|
|
17378
|
+
source: ["reserve"],
|
|
17379
|
+
labelType: "majorPoi",
|
|
17380
|
+
minZoom: 7,
|
|
17381
|
+
radius: 15000,
|
|
17382
|
+
polygonSources: ["generic_reserve_fill", "land_cover_forest_fill"]
|
|
17383
|
+
}
|
|
17384
|
+
];
|
|
17385
|
+
// Name of all road source layers of Bing tiles.
|
|
17386
|
+
MapViewDescriptor._roadLayersBing = new Set([
|
|
17387
|
+
"road"
|
|
17388
|
+
]);
|
|
17244
17389
|
return MapViewDescriptor;
|
|
17245
17390
|
}());
|
|
17246
17391
|
|
|
@@ -20998,7 +21143,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20998
21143
|
}
|
|
20999
21144
|
return ar;
|
|
21000
21145
|
};
|
|
21001
|
-
var __spreadArray$
|
|
21146
|
+
var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
|
|
21002
21147
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
21003
21148
|
to[j] = from[i];
|
|
21004
21149
|
return to;
|
|
@@ -21016,7 +21161,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21016
21161
|
'data-azure-maps-attribution-order',
|
|
21017
21162
|
'data-azure-maps-attribution-dynamic'
|
|
21018
21163
|
];
|
|
21019
|
-
var allowedAttributionAttributes = __spreadArray$
|
|
21164
|
+
var allowedAttributionAttributes = __spreadArray$3([
|
|
21020
21165
|
'href'
|
|
21021
21166
|
], __read$7(attributionRuleAttributes));
|
|
21022
21167
|
var AttributionRuleProxy = /** @class */ (function () {
|
|
@@ -21241,7 +21386,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21241
21386
|
};
|
|
21242
21387
|
AttributionRuleProxy.prototype.applyAttributionResponse = function (attributions) {
|
|
21243
21388
|
var _this = this;
|
|
21244
|
-
var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$
|
|
21389
|
+
var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$3(__spreadArray$3([], __read$7(flat)), __read$7(copyrights)); }, []);
|
|
21245
21390
|
if (copyrights.length == 0) {
|
|
21246
21391
|
// no attribution for a provided tileset/bbox/z
|
|
21247
21392
|
return;
|
|
@@ -21306,7 +21451,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21306
21451
|
}
|
|
21307
21452
|
return ar;
|
|
21308
21453
|
};
|
|
21309
|
-
var __spreadArray$
|
|
21454
|
+
var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
|
|
21310
21455
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
21311
21456
|
to[j] = from[i];
|
|
21312
21457
|
return to;
|
|
@@ -21427,10 +21572,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21427
21572
|
}, function () { return document.createElement('span'); });
|
|
21428
21573
|
});
|
|
21429
21574
|
var registeredRuleSet = new Set(Object.values(registeredRules));
|
|
21430
|
-
var redundantRules = new Set(__spreadArray$
|
|
21431
|
-
var redundantElements = new Set(__spreadArray$
|
|
21575
|
+
var redundantRules = new Set(__spreadArray$4([], __read$8(allRules)).filter(function (rule) { return !registeredRuleSet.has(rule); }));
|
|
21576
|
+
var redundantElements = new Set(__spreadArray$4([], __read$8(redundantRules)).map(function (rule) { return rule.getElement(); }));
|
|
21432
21577
|
// eject redundant rules associated elements altogether
|
|
21433
|
-
__spreadArray$
|
|
21578
|
+
__spreadArray$4([], __read$8(redundantElements)).filter(function (elem) { return elem.parentElement !== null; })
|
|
21434
21579
|
.forEach(function (elem) { return elem.parentElement.removeChild(elem); });
|
|
21435
21580
|
_this.rules = Object.values(registeredRules);
|
|
21436
21581
|
var attributionsToApply = attributions
|
|
@@ -21466,7 +21611,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21466
21611
|
var visibleTextNodes = function (elem) {
|
|
21467
21612
|
return Array.from(elem.style.display != 'none' ? elem.children : [])
|
|
21468
21613
|
.map(function (elem) { return visibleTextNodes(elem); })
|
|
21469
|
-
.reduce(function (flattened, nodes) { return __spreadArray$
|
|
21614
|
+
.reduce(function (flattened, nodes) { return __spreadArray$4(__spreadArray$4([], __read$8(flattened)), __read$8(nodes)); }, Array.from(elem.style.display != 'none' ? elem.childNodes : []).filter(function (node) { return node.nodeType == node.TEXT_NODE; }));
|
|
21470
21615
|
};
|
|
21471
21616
|
var newRenderContext = _this.virtualContext.cloneNode(true);
|
|
21472
21617
|
var visibleNodes = visibleTextNodes(newRenderContext);
|
|
@@ -21481,7 +21626,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21481
21626
|
// }
|
|
21482
21627
|
// });
|
|
21483
21628
|
// strip all predefined keywords
|
|
21484
|
-
visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$
|
|
21629
|
+
visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$4([], __read$8(attributionFilters)).reduce(function (target, filter) { return target.replace(filter, '').trim(); }, node.textContent); });
|
|
21485
21630
|
// strip year from each node
|
|
21486
21631
|
// visibleNodes.forEach(node => node.textContent = node.textContent.replace(copyrightYearPattern, '').trim());
|
|
21487
21632
|
// deduplicate attribution text
|
|
@@ -23707,6 +23852,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23707
23852
|
}
|
|
23708
23853
|
return this.initPromise;
|
|
23709
23854
|
};
|
|
23855
|
+
/**
|
|
23856
|
+
* Cleans up any resources used by the authentication manager.
|
|
23857
|
+
*/
|
|
23858
|
+
AuthenticationManager.prototype.dispose = function () {
|
|
23859
|
+
if (this.tokenTimeOutHandle) {
|
|
23860
|
+
clearTimeout(this.tokenTimeOutHandle);
|
|
23861
|
+
this.tokenTimeOutHandle = null;
|
|
23862
|
+
}
|
|
23863
|
+
};
|
|
23710
23864
|
/**
|
|
23711
23865
|
* Gets the default auth context to be shared between maps without one specified to them.
|
|
23712
23866
|
*/
|
|
@@ -25191,7 +25345,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
25191
25345
|
}
|
|
25192
25346
|
return ar;
|
|
25193
25347
|
};
|
|
25194
|
-
var __spreadArray$
|
|
25348
|
+
var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
|
|
25195
25349
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
25196
25350
|
to[j] = from[i];
|
|
25197
25351
|
return to;
|
|
@@ -25627,7 +25781,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
25627
25781
|
// If a specified layer hasn't been added to the map throw an error.
|
|
25628
25782
|
var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
|
|
25629
25783
|
if (index > -1) {
|
|
25630
|
-
layerIds.push.apply(layerIds, __spreadArray$
|
|
25784
|
+
layerIds.push.apply(layerIds, __spreadArray$5([], __read$a(this_1.layerIndex[index]._getLayerIds()
|
|
25631
25785
|
.filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
|
|
25632
25786
|
}
|
|
25633
25787
|
else {
|
|
@@ -26386,7 +26540,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
26386
26540
|
}
|
|
26387
26541
|
return ar;
|
|
26388
26542
|
};
|
|
26389
|
-
var __spreadArray$
|
|
26543
|
+
var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
|
|
26390
26544
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
26391
26545
|
to[j] = from[i];
|
|
26392
26546
|
return to;
|
|
@@ -26461,7 +26615,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
26461
26615
|
}
|
|
26462
26616
|
finally { if (e_1) throw e_1.error; }
|
|
26463
26617
|
}
|
|
26464
|
-
return _super.prototype.merge.apply(this, __spreadArray$
|
|
26618
|
+
return _super.prototype.merge.apply(this, __spreadArray$6([], __read$b(valuesList)));
|
|
26465
26619
|
};
|
|
26466
26620
|
return CameraBoundsOptions;
|
|
26467
26621
|
}(Options));
|
|
@@ -26950,7 +27104,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
26950
27104
|
}
|
|
26951
27105
|
return ar;
|
|
26952
27106
|
};
|
|
26953
|
-
var __spreadArray$
|
|
27107
|
+
var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
|
|
26954
27108
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
26955
27109
|
to[j] = from[i];
|
|
26956
27110
|
return to;
|
|
@@ -27061,7 +27215,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27061
27215
|
/**
|
|
27062
27216
|
* 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.
|
|
27063
27217
|
* Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews}
|
|
27064
|
-
* 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.
|
|
27218
|
+
* 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.
|
|
27065
27219
|
* default: `undefined`
|
|
27066
27220
|
* @default undefined
|
|
27067
27221
|
*/
|
|
@@ -27109,7 +27263,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27109
27263
|
finally { if (e_1) throw e_1.error; }
|
|
27110
27264
|
}
|
|
27111
27265
|
// Then execute the standard merge behavior.
|
|
27112
|
-
return _super.prototype.merge.apply(this, __spreadArray$
|
|
27266
|
+
return _super.prototype.merge.apply(this, __spreadArray$7([], __read$c(valueList)));
|
|
27113
27267
|
};
|
|
27114
27268
|
return StyleOptions;
|
|
27115
27269
|
}(Options));
|
|
@@ -27167,7 +27321,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27167
27321
|
}
|
|
27168
27322
|
return ar;
|
|
27169
27323
|
};
|
|
27170
|
-
var __spreadArray$
|
|
27324
|
+
var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
|
|
27171
27325
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
27172
27326
|
to[j] = from[i];
|
|
27173
27327
|
return to;
|
|
@@ -27402,10 +27556,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27402
27556
|
// won't change default behavior in Options as usually that's what desired
|
|
27403
27557
|
// instead capture it here and reassign.
|
|
27404
27558
|
var currentTransforms = this._transformers;
|
|
27405
|
-
var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$
|
|
27559
|
+
var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$8(__spreadArray$8([], __read$d(flattened)), __read$d(value._transformers || [])); }, []) : [];
|
|
27406
27560
|
// Then execute the standard merge behavior.
|
|
27407
27561
|
// If subscription key auth method isn't being used then the subscription key property should be undefined.
|
|
27408
|
-
var merged = _super.prototype.merge.apply(this, __spreadArray$
|
|
27562
|
+
var merged = _super.prototype.merge.apply(this, __spreadArray$8([], __read$d(valueList)));
|
|
27409
27563
|
if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
|
|
27410
27564
|
merged["subscription-key"] = merged.subscriptionKey = undefined;
|
|
27411
27565
|
}
|
|
@@ -27417,7 +27571,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27417
27571
|
if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
|
|
27418
27572
|
merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
|
|
27419
27573
|
}
|
|
27420
|
-
this._transformers = __spreadArray$
|
|
27574
|
+
this._transformers = __spreadArray$8(__spreadArray$8([], __read$d(currentTransforms || [])), __read$d(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
|
|
27421
27575
|
if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
|
|
27422
27576
|
this._transformers.push(this.transformRequest);
|
|
27423
27577
|
}
|
|
@@ -27665,7 +27819,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27665
27819
|
}
|
|
27666
27820
|
return ar;
|
|
27667
27821
|
};
|
|
27668
|
-
var __spreadArray$
|
|
27822
|
+
var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
|
|
27669
27823
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
27670
27824
|
to[j] = from[i];
|
|
27671
27825
|
return to;
|
|
@@ -27692,6 +27846,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27692
27846
|
* Preserve the map configuration that was used before the indoor map configuration was set
|
|
27693
27847
|
*/
|
|
27694
27848
|
this.preservedPreindoorMapConfiguration = undefined;
|
|
27849
|
+
/**
|
|
27850
|
+
* The state of the progressive loading
|
|
27851
|
+
*/
|
|
27852
|
+
this._progressiveLoadingState = {
|
|
27853
|
+
mapStyle: undefined,
|
|
27854
|
+
pendingVisibilityChange: undefined,
|
|
27855
|
+
};
|
|
27695
27856
|
this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
|
|
27696
27857
|
var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
|
|
27697
27858
|
// If the initial layer groups are invalid, skip the progressive loading.
|
|
@@ -27699,11 +27860,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27699
27860
|
return;
|
|
27700
27861
|
var map = _this.map._getMap();
|
|
27701
27862
|
var currentZoomLevel = map.getZoom();
|
|
27702
|
-
|
|
27863
|
+
var currentMapStyle = _this.map.getStyle().style;
|
|
27864
|
+
// Cancel and release previous pending callback, if any.
|
|
27865
|
+
if (_this._progressiveLoadingState.pendingVisibilityChange) {
|
|
27866
|
+
_this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
27867
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
27868
|
+
}
|
|
27869
|
+
// Keep the current map style for future comparison.
|
|
27870
|
+
_this._progressiveLoadingState.mapStyle = currentMapStyle;
|
|
27871
|
+
// Select deferrable layers
|
|
27703
27872
|
var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
|
|
27704
27873
|
var _b = __read$e(_a, 2), groupName = _b[0], layers = _b[1];
|
|
27705
27874
|
var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
|
|
27706
|
-
return __spreadArray$
|
|
27875
|
+
return __spreadArray$9(__spreadArray$9([], __read$e(deferred)), __read$e(layers.filter(function (layer) {
|
|
27707
27876
|
var _a;
|
|
27708
27877
|
// Exclude custom layers
|
|
27709
27878
|
if (layer.type === 'custom')
|
|
@@ -27726,22 +27895,34 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27726
27895
|
return false;
|
|
27727
27896
|
}
|
|
27728
27897
|
}
|
|
27729
|
-
//
|
|
27898
|
+
// Select visible layers only.
|
|
27730
27899
|
return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
|
|
27731
27900
|
})));
|
|
27732
27901
|
}, []);
|
|
27733
|
-
// Hide the
|
|
27902
|
+
// Hide the deferrable layers at initial load, therefore we can save the render time.
|
|
27734
27903
|
deferredLayers.forEach(function (layer) {
|
|
27904
|
+
// Since this happens before sending style object into the map rendering,
|
|
27905
|
+
// we only need to update the style object, but not necessary to update maplibre's layout properties.
|
|
27735
27906
|
layer.layout = layer.layout || {};
|
|
27736
27907
|
layer.layout.visibility = 'none';
|
|
27737
27908
|
});
|
|
27738
|
-
// Make the deferred layers visible once the map instance is fully loaded
|
|
27739
|
-
_this.
|
|
27909
|
+
// Make the deferred layers visible once the map instance is fully loaded.
|
|
27910
|
+
_this._progressiveLoadingState.pendingVisibilityChange = function () {
|
|
27911
|
+
// Release the callback.
|
|
27912
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
27913
|
+
// Bail out the callback once map style has changed.
|
|
27914
|
+
var nextMapStyle = _this.map.getStyle().style;
|
|
27915
|
+
if (currentMapStyle !== nextMapStyle)
|
|
27916
|
+
return;
|
|
27917
|
+
// Make deferred layers visible
|
|
27740
27918
|
deferredLayers.forEach(function (layer) {
|
|
27919
|
+
// This happens after the map rendering; Therefore, we need to update
|
|
27920
|
+
// both the style object and the maplibre's layout properties.
|
|
27741
27921
|
layer.layout.visibility = 'visible';
|
|
27742
27922
|
map.setLayoutProperty(layer.id, 'visibility', 'visible');
|
|
27743
27923
|
});
|
|
27744
|
-
}
|
|
27924
|
+
};
|
|
27925
|
+
_this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
27745
27926
|
};
|
|
27746
27927
|
this._onStyleData = function () {
|
|
27747
27928
|
_this._lookUpAsync(_this.map.getStyle()).then(function (style) {
|
|
@@ -27883,7 +28064,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27883
28064
|
domain: _this.serviceOptions.staticAssetsDomain,
|
|
27884
28065
|
path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
|
|
27885
28066
|
queryParams: {
|
|
27886
|
-
|
|
28067
|
+
// Use the style version from the API response if it's available,
|
|
28068
|
+
// otherwise fallback to the version specified in the serviceOptions.
|
|
28069
|
+
// This is needed for flight testing the 2023-01-01 style version.
|
|
28070
|
+
styleVersion: definitions.version !== undefined && definitions.version !== null
|
|
28071
|
+
? definitions.version
|
|
28072
|
+
: _this.serviceOptions.styleDefinitionsVersion
|
|
27887
28073
|
// thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
|
|
27888
28074
|
//language: styleOptions.language
|
|
27889
28075
|
},
|
|
@@ -28023,18 +28209,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28023
28209
|
// should be modified before they are applied to the map.
|
|
28024
28210
|
var styleOptions = this.map.getStyle();
|
|
28025
28211
|
var trafficOptions = this.map.getTraffic();
|
|
28026
|
-
// force a replacement of language placeholder in the tileset url to avoid resolution to a same cache with placeholders on language change
|
|
28027
|
-
nextStyle.sources = Object.entries(nextStyle.sources).reduce(function (newSources, _a) {
|
|
28028
|
-
var _b = __read$e(_a, 2), sourceKey = _b[0], source = _b[1];
|
|
28029
|
-
var newSource = __assign$8({}, source);
|
|
28030
|
-
if ('url' in newSource && typeof newSource.url === 'string') {
|
|
28031
|
-
if (newSource.url.includes(constants.languagePlaceHolder)) {
|
|
28032
|
-
newSource.url = newSource.url.replace(constants.languagePlaceHolder, styleOptions.language);
|
|
28033
|
-
}
|
|
28034
|
-
}
|
|
28035
|
-
newSources[sourceKey] = newSource;
|
|
28036
|
-
return newSources;
|
|
28037
|
-
}, {});
|
|
28038
28212
|
var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
|
|
28039
28213
|
// The feature only effective at the initial load.
|
|
28040
28214
|
!this.map._isLoaded());
|
|
@@ -28186,27 +28360,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28186
28360
|
* Fetches a json resource at the specified domain and path.
|
|
28187
28361
|
*/
|
|
28188
28362
|
StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
|
|
28189
|
-
var _a;
|
|
28363
|
+
var _a, _b;
|
|
28190
28364
|
if (customQueryParams === void 0) { customQueryParams = {}; }
|
|
28191
28365
|
return __awaiter$3(this, void 0, void 0, function () {
|
|
28192
28366
|
var requestParams, fetchOptions;
|
|
28193
|
-
var
|
|
28194
|
-
return __generator$3(this, function (
|
|
28195
|
-
switch (
|
|
28367
|
+
var _c;
|
|
28368
|
+
return __generator$3(this, function (_d) {
|
|
28369
|
+
switch (_d.label) {
|
|
28196
28370
|
case 0:
|
|
28197
28371
|
requestParams = {
|
|
28198
28372
|
url: new Url({
|
|
28199
28373
|
protocol: "https",
|
|
28200
28374
|
domain: domain,
|
|
28201
28375
|
path: path,
|
|
28202
|
-
queryParams: __assign$8((
|
|
28376
|
+
queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
|
|
28377
|
+
// Generate a hash code to avoid cache conflict
|
|
28378
|
+
// TODO: Remove this once style version 2023-01-01 is publicly available
|
|
28379
|
+
_c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
|
|
28203
28380
|
}).toString()
|
|
28204
28381
|
};
|
|
28205
28382
|
if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
|
|
28206
28383
|
// If a transformRequest(...) was specified use it.
|
|
28207
28384
|
requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
|
|
28208
28385
|
}
|
|
28209
|
-
(
|
|
28386
|
+
(_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
|
|
28210
28387
|
fetchOptions = {
|
|
28211
28388
|
method: "GET",
|
|
28212
28389
|
mode: "cors",
|
|
@@ -28223,11 +28400,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28223
28400
|
throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
|
|
28224
28401
|
}
|
|
28225
28402
|
})];
|
|
28226
|
-
case 1: return [2 /*return*/,
|
|
28403
|
+
case 1: return [2 /*return*/, _d.sent()];
|
|
28227
28404
|
}
|
|
28228
28405
|
});
|
|
28229
28406
|
});
|
|
28230
28407
|
};
|
|
28408
|
+
/**
|
|
28409
|
+
* A basic helper function to generate a hash from an input string.
|
|
28410
|
+
*/
|
|
28411
|
+
StyleManager._hashCode = function (str) {
|
|
28412
|
+
if (str === void 0) { str = ""; }
|
|
28413
|
+
var chr, hash = 0;
|
|
28414
|
+
if (!str)
|
|
28415
|
+
return hash;
|
|
28416
|
+
for (var i = 0; i < str.length; i++) {
|
|
28417
|
+
chr = str.charCodeAt(i);
|
|
28418
|
+
hash = (hash << 5) - hash + chr;
|
|
28419
|
+
hash |= 0; // Convert to 32bit integer
|
|
28420
|
+
}
|
|
28421
|
+
return hash;
|
|
28422
|
+
};
|
|
28231
28423
|
return StyleManager;
|
|
28232
28424
|
}());
|
|
28233
28425
|
|
|
@@ -28314,7 +28506,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28314
28506
|
}
|
|
28315
28507
|
return ar;
|
|
28316
28508
|
};
|
|
28317
|
-
var __spreadArray$
|
|
28509
|
+
var __spreadArray$a = (window && window.__spreadArray) || function (to, from) {
|
|
28318
28510
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
28319
28511
|
to[j] = from[i];
|
|
28320
28512
|
return to;
|
|
@@ -28501,7 +28693,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28501
28693
|
_this.events.invoke("error", errorData);
|
|
28502
28694
|
});
|
|
28503
28695
|
// --> Set initial camera state of map
|
|
28504
|
-
_this.setCamera(__assign$9(__assign$9({
|
|
28696
|
+
_this.setCamera(__assign$9(__assign$9({
|
|
28697
|
+
// Default minZoom to ensure the map doesn't zoom out to unsupported zoom levels.
|
|
28698
|
+
minZoom: 1 }, options), { type: "jump", duration: 0 }));
|
|
28505
28699
|
// Add delegates to map
|
|
28506
28700
|
{
|
|
28507
28701
|
_this.incidentDelegate = new IncidentServiceDelegate(_this);
|
|
@@ -28598,6 +28792,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28598
28792
|
if (!mapboxCameraOptions) {
|
|
28599
28793
|
throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");
|
|
28600
28794
|
}
|
|
28795
|
+
if ('pitch' in options) {
|
|
28796
|
+
mapboxCameraOptions.pitch = options.pitch;
|
|
28797
|
+
}
|
|
28798
|
+
if ('bearing' in options) {
|
|
28799
|
+
mapboxCameraOptions.bearing = options.bearing;
|
|
28800
|
+
}
|
|
28601
28801
|
this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
|
|
28602
28802
|
this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
|
|
28603
28803
|
maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
|
|
@@ -28720,8 +28920,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28720
28920
|
// If this function is restructured such that a styledata event won't always trigger
|
|
28721
28921
|
// if the language is changed, then either those delegates need changed
|
|
28722
28922
|
// or the styledata event manually invoked.
|
|
28923
|
+
var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
|
|
28723
28924
|
this.styleOptions = newOptions;
|
|
28724
|
-
this._setStyleComponents(newOptions,
|
|
28925
|
+
this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
|
|
28725
28926
|
};
|
|
28726
28927
|
/**
|
|
28727
28928
|
* Returns the map control's current style settings.
|
|
@@ -29112,7 +29313,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
29112
29313
|
urls = layer.getOptions().subdomains || [];
|
|
29113
29314
|
}
|
|
29114
29315
|
// Add the tile urls to the layer, but don't update the map yet.
|
|
29115
|
-
urls.push.apply(urls, __spreadArray$
|
|
29316
|
+
urls.push.apply(urls, __spreadArray$a([], __read$f(tileSources)));
|
|
29116
29317
|
layer._setOptionsNoUpdate({
|
|
29117
29318
|
subdomains: urls
|
|
29118
29319
|
});
|
|
@@ -29281,9 +29482,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
29281
29482
|
* Clean up the map's resources. Map will not function correctly after calling this method.
|
|
29282
29483
|
*/
|
|
29283
29484
|
Map.prototype.dispose = function () {
|
|
29485
|
+
var _a;
|
|
29284
29486
|
this.clear();
|
|
29285
29487
|
this.map.remove();
|
|
29488
|
+
(_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
29286
29489
|
this.removed = true;
|
|
29490
|
+
// Remove event listeners
|
|
29491
|
+
window.removeEventListener("resize", this._windowResizeCallback);
|
|
29287
29492
|
while (this.getMapContainer().firstChild) {
|
|
29288
29493
|
var currChild = this.getMapContainer().firstChild;
|
|
29289
29494
|
this.getMapContainer().removeChild(currChild);
|
|
@@ -29628,7 +29833,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
29628
29833
|
}
|
|
29629
29834
|
return ar;
|
|
29630
29835
|
};
|
|
29631
|
-
var __spreadArray$
|
|
29836
|
+
var __spreadArray$b = (window && window.__spreadArray) || function (to, from) {
|
|
29632
29837
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
29633
29838
|
to[j] = from[i];
|
|
29634
29839
|
return to;
|
|
@@ -29774,7 +29979,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
29774
29979
|
lineLength = 50;
|
|
29775
29980
|
}
|
|
29776
29981
|
var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
|
|
29777
|
-
longestStringLength = Math.max.apply(Math, __spreadArray$
|
|
29982
|
+
longestStringLength = Math.max.apply(Math, __spreadArray$b([], __read$g((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
|
|
29778
29983
|
var w = Math.ceil(longestStringLength * 3.5);
|
|
29779
29984
|
if (w < width) {
|
|
29780
29985
|
width = w;
|