azure-maps-control 2.2.2 → 2.2.3
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 +79 -24
- package/dist/atlas-core-bare.js +86 -28
- package/dist/atlas-core-bare.min.js +1 -1
- package/dist/atlas-core-snr.js +381 -117
- package/dist/atlas-core.js +388 -121
- package/dist/atlas-core.min.js +1 -1
- package/dist/atlas.js +388 -121
- package/dist/atlas.min.js +1 -1
- package/package.json +2 -2
- package/thirdpartynotices.txt +0 -0
- package/typings/index.d.ts +5 -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.3";
|
|
269
269
|
|
|
270
270
|
/**
|
|
271
271
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -14672,6 +14672,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14672
14672
|
defaultRegion: {
|
|
14673
14673
|
code: "NGT",
|
|
14674
14674
|
strings: "en/resource.json"
|
|
14675
|
+
},
|
|
14676
|
+
latn: {
|
|
14677
|
+
code: "NGT-Latn",
|
|
14678
|
+
strings: "en/resource.json"
|
|
14675
14679
|
}
|
|
14676
14680
|
},
|
|
14677
14681
|
ar: {
|
|
@@ -14718,6 +14722,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14718
14722
|
us: {
|
|
14719
14723
|
code: "en-US",
|
|
14720
14724
|
strings: "en/resource.json"
|
|
14725
|
+
},
|
|
14726
|
+
au: {
|
|
14727
|
+
code: "en-AU",
|
|
14728
|
+
strings: "en/resource.json"
|
|
14729
|
+
},
|
|
14730
|
+
gb: {
|
|
14731
|
+
code: "en-GB",
|
|
14732
|
+
strings: "en/resource.json"
|
|
14733
|
+
},
|
|
14734
|
+
nz: {
|
|
14735
|
+
code: "en-NZ",
|
|
14736
|
+
strings: "en/resource.json"
|
|
14721
14737
|
}
|
|
14722
14738
|
},
|
|
14723
14739
|
es: {
|
|
@@ -14843,14 +14859,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14843
14859
|
}
|
|
14844
14860
|
},
|
|
14845
14861
|
zh: {
|
|
14862
|
+
// per https://microsoft.sharepoint.com/sites/globalreadiness/SitePages/Language-fallback.aspx
|
|
14863
|
+
// Chinese - Neutral (zh) fallbacks to en-US
|
|
14846
14864
|
defaultRegion: {
|
|
14847
|
-
code: "zh
|
|
14848
|
-
strings: "
|
|
14865
|
+
code: "zh",
|
|
14866
|
+
strings: "en/resource.json"
|
|
14867
|
+
}
|
|
14868
|
+
},
|
|
14869
|
+
"zh-hans": {
|
|
14870
|
+
defaultRegion: {
|
|
14871
|
+
code: "zh-Hans",
|
|
14872
|
+
strings: "zh-cn/resource.json"
|
|
14873
|
+
},
|
|
14874
|
+
cn: {
|
|
14875
|
+
code: "zh-Hans-CN",
|
|
14876
|
+
strings: "zh-cn/resource.json"
|
|
14849
14877
|
}
|
|
14850
14878
|
},
|
|
14851
14879
|
"zh-hant": {
|
|
14880
|
+
// per discussion with global readiness team, we were explicitly asked to not fallback zh-hant to zh-tw
|
|
14852
14881
|
defaultRegion: {
|
|
14853
14882
|
code: "zh-Hant",
|
|
14883
|
+
strings: "en/resource.json"
|
|
14884
|
+
},
|
|
14885
|
+
tw: {
|
|
14886
|
+
code: "zh-Hant-TW",
|
|
14854
14887
|
strings: "zh-tw/resource.json"
|
|
14855
14888
|
}
|
|
14856
14889
|
}
|
|
@@ -15479,7 +15512,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
15479
15512
|
/**
|
|
15480
15513
|
* 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
15514
|
* 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.
|
|
15515
|
+
* 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
15516
|
* @param view The new default view
|
|
15484
15517
|
*/
|
|
15485
15518
|
function setView(view) {
|
|
@@ -19472,7 +19505,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
19472
19505
|
/**
|
|
19473
19506
|
* 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
19507
|
* 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.
|
|
19508
|
+
* 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
19509
|
* default: `undefined`
|
|
19477
19510
|
* @default undefined
|
|
19478
19511
|
*/
|
|
@@ -20103,6 +20136,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20103
20136
|
* Preserve the map configuration that was used before the indoor map configuration was set
|
|
20104
20137
|
*/
|
|
20105
20138
|
this.preservedPreindoorMapConfiguration = undefined;
|
|
20139
|
+
/**
|
|
20140
|
+
* The state of the progressive loading
|
|
20141
|
+
*/
|
|
20142
|
+
this._progressiveLoadingState = {
|
|
20143
|
+
mapStyle: undefined,
|
|
20144
|
+
pendingVisibilityChange: undefined,
|
|
20145
|
+
};
|
|
20106
20146
|
this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
|
|
20107
20147
|
var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
|
|
20108
20148
|
// If the initial layer groups are invalid, skip the progressive loading.
|
|
@@ -20110,7 +20150,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20110
20150
|
return;
|
|
20111
20151
|
var map = _this.map._getMap();
|
|
20112
20152
|
var currentZoomLevel = map.getZoom();
|
|
20113
|
-
|
|
20153
|
+
var currentMapStyle = _this.map.getStyle().style;
|
|
20154
|
+
// Cancel and release previous pending callback, if any.
|
|
20155
|
+
if (_this._progressiveLoadingState.pendingVisibilityChange) {
|
|
20156
|
+
_this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
20157
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
20158
|
+
}
|
|
20159
|
+
// Keep the current map style for future comparison.
|
|
20160
|
+
_this._progressiveLoadingState.mapStyle = currentMapStyle;
|
|
20161
|
+
// Select deferrable layers
|
|
20114
20162
|
var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
|
|
20115
20163
|
var _b = __read$c(_a, 2), groupName = _b[0], layers = _b[1];
|
|
20116
20164
|
var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
|
|
@@ -20137,22 +20185,34 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20137
20185
|
return false;
|
|
20138
20186
|
}
|
|
20139
20187
|
}
|
|
20140
|
-
//
|
|
20188
|
+
// Select visible layers only.
|
|
20141
20189
|
return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
|
|
20142
20190
|
})));
|
|
20143
20191
|
}, []);
|
|
20144
|
-
// Hide the
|
|
20192
|
+
// Hide the deferrable layers at initial load, therefore we can save the render time.
|
|
20145
20193
|
deferredLayers.forEach(function (layer) {
|
|
20194
|
+
// Since this happens before sending style object into the map rendering,
|
|
20195
|
+
// we only need to update the style object, but not necessary to update maplibre's layout properties.
|
|
20146
20196
|
layer.layout = layer.layout || {};
|
|
20147
20197
|
layer.layout.visibility = 'none';
|
|
20148
20198
|
});
|
|
20149
|
-
// Make the deferred layers visible once the map instance is fully loaded
|
|
20150
|
-
_this.
|
|
20199
|
+
// Make the deferred layers visible once the map instance is fully loaded.
|
|
20200
|
+
_this._progressiveLoadingState.pendingVisibilityChange = function () {
|
|
20201
|
+
// Release the callback.
|
|
20202
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
20203
|
+
// Bail out the callback once map style has changed.
|
|
20204
|
+
var nextMapStyle = _this.map.getStyle().style;
|
|
20205
|
+
if (currentMapStyle !== nextMapStyle)
|
|
20206
|
+
return;
|
|
20207
|
+
// Make deferred layers visible
|
|
20151
20208
|
deferredLayers.forEach(function (layer) {
|
|
20209
|
+
// This happens after the map rendering; Therefore, we need to update
|
|
20210
|
+
// both the style object and the maplibre's layout properties.
|
|
20152
20211
|
layer.layout.visibility = 'visible';
|
|
20153
20212
|
map.setLayoutProperty(layer.id, 'visibility', 'visible');
|
|
20154
20213
|
});
|
|
20155
|
-
}
|
|
20214
|
+
};
|
|
20215
|
+
_this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
20156
20216
|
};
|
|
20157
20217
|
this._onStyleData = function () {
|
|
20158
20218
|
_this._lookUpAsync(_this.map.getStyle()).then(function (style) {
|
|
@@ -20434,18 +20494,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20434
20494
|
// should be modified before they are applied to the map.
|
|
20435
20495
|
var styleOptions = this.map.getStyle();
|
|
20436
20496
|
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
20497
|
var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
|
|
20450
20498
|
// The feature only effective at the initial load.
|
|
20451
20499
|
!this.map._isLoaded());
|
|
@@ -21003,6 +21051,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21003
21051
|
if (!mapboxCameraOptions) {
|
|
21004
21052
|
throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");
|
|
21005
21053
|
}
|
|
21054
|
+
if ('pitch' in options) {
|
|
21055
|
+
mapboxCameraOptions.pitch = options.pitch;
|
|
21056
|
+
}
|
|
21057
|
+
if ('bearing' in options) {
|
|
21058
|
+
mapboxCameraOptions.bearing = options.bearing;
|
|
21059
|
+
}
|
|
21006
21060
|
this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
|
|
21007
21061
|
this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
|
|
21008
21062
|
maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
|
|
@@ -21125,8 +21179,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21125
21179
|
// If this function is restructured such that a styledata event won't always trigger
|
|
21126
21180
|
// if the language is changed, then either those delegates need changed
|
|
21127
21181
|
// or the styledata event manually invoked.
|
|
21182
|
+
var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
|
|
21128
21183
|
this.styleOptions = newOptions;
|
|
21129
|
-
this._setStyleComponents(newOptions,
|
|
21184
|
+
this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
|
|
21130
21185
|
};
|
|
21131
21186
|
/**
|
|
21132
21187
|
* Returns the map control's current style settings.
|
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.3";
|
|
269
269
|
|
|
270
270
|
/**
|
|
271
271
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -14672,6 +14672,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14672
14672
|
defaultRegion: {
|
|
14673
14673
|
code: "NGT",
|
|
14674
14674
|
strings: "en/resource.json"
|
|
14675
|
+
},
|
|
14676
|
+
latn: {
|
|
14677
|
+
code: "NGT-Latn",
|
|
14678
|
+
strings: "en/resource.json"
|
|
14675
14679
|
}
|
|
14676
14680
|
},
|
|
14677
14681
|
ar: {
|
|
@@ -14718,6 +14722,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14718
14722
|
us: {
|
|
14719
14723
|
code: "en-US",
|
|
14720
14724
|
strings: "en/resource.json"
|
|
14725
|
+
},
|
|
14726
|
+
au: {
|
|
14727
|
+
code: "en-AU",
|
|
14728
|
+
strings: "en/resource.json"
|
|
14729
|
+
},
|
|
14730
|
+
gb: {
|
|
14731
|
+
code: "en-GB",
|
|
14732
|
+
strings: "en/resource.json"
|
|
14733
|
+
},
|
|
14734
|
+
nz: {
|
|
14735
|
+
code: "en-NZ",
|
|
14736
|
+
strings: "en/resource.json"
|
|
14721
14737
|
}
|
|
14722
14738
|
},
|
|
14723
14739
|
es: {
|
|
@@ -14843,14 +14859,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
14843
14859
|
}
|
|
14844
14860
|
},
|
|
14845
14861
|
zh: {
|
|
14862
|
+
// per https://microsoft.sharepoint.com/sites/globalreadiness/SitePages/Language-fallback.aspx
|
|
14863
|
+
// Chinese - Neutral (zh) fallbacks to en-US
|
|
14846
14864
|
defaultRegion: {
|
|
14847
|
-
code: "zh
|
|
14848
|
-
strings: "
|
|
14865
|
+
code: "zh",
|
|
14866
|
+
strings: "en/resource.json"
|
|
14867
|
+
}
|
|
14868
|
+
},
|
|
14869
|
+
"zh-hans": {
|
|
14870
|
+
defaultRegion: {
|
|
14871
|
+
code: "zh-Hans",
|
|
14872
|
+
strings: "zh-cn/resource.json"
|
|
14873
|
+
},
|
|
14874
|
+
cn: {
|
|
14875
|
+
code: "zh-Hans-CN",
|
|
14876
|
+
strings: "zh-cn/resource.json"
|
|
14849
14877
|
}
|
|
14850
14878
|
},
|
|
14851
14879
|
"zh-hant": {
|
|
14880
|
+
// per discussion with global readiness team, we were explicitly asked to not fallback zh-hant to zh-tw
|
|
14852
14881
|
defaultRegion: {
|
|
14853
14882
|
code: "zh-Hant",
|
|
14883
|
+
strings: "en/resource.json"
|
|
14884
|
+
},
|
|
14885
|
+
tw: {
|
|
14886
|
+
code: "zh-Hant-TW",
|
|
14854
14887
|
strings: "zh-tw/resource.json"
|
|
14855
14888
|
}
|
|
14856
14889
|
}
|
|
@@ -15479,7 +15512,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
15479
15512
|
/**
|
|
15480
15513
|
* 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
15514
|
* 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.
|
|
15515
|
+
* 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
15516
|
* @param view The new default view
|
|
15484
15517
|
*/
|
|
15485
15518
|
function setView(view) {
|
|
@@ -16212,8 +16245,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16212
16245
|
this._minRoadDistance = 25;
|
|
16213
16246
|
// Minium distance in pixels a second road must be in order to be considered an intersection.
|
|
16214
16247
|
this._minIntersectionPixelDistance = 50;
|
|
16215
|
-
// The vector tile source id for Azure Maps.
|
|
16216
|
-
this._baseVectorTileSourceId = "microsoft.base";
|
|
16217
16248
|
/*
|
|
16218
16249
|
* Show details based on zoom level.
|
|
16219
16250
|
*
|
|
@@ -16635,6 +16666,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16635
16666
|
this._map.events.addOnce("idle", function () {
|
|
16636
16667
|
if (!_this._disposed) {
|
|
16637
16668
|
_this._updateCam(true);
|
|
16669
|
+
// Find the id of the vector tile source being used.
|
|
16670
|
+
_this._baseVectorTileSourceId = MapViewDescriptor._baseVectorTileSourceIds.find(function (id) { return _this._map.sources.getById(id); });
|
|
16638
16671
|
// Add event listeners directly to mapbox because we will be using custom event data.
|
|
16639
16672
|
// We don't automatically forward all properties of a mapbox event, so the custom data would be lost.
|
|
16640
16673
|
var baseMap = _this._map._getMap();
|
|
@@ -16732,8 +16765,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
16732
16765
|
info_1 = {};
|
|
16733
16766
|
cPx_1 = this._map.positionsToPixels([cam.center])[0];
|
|
16734
16767
|
ErrorHandler.tryCatch(this._map, function () {
|
|
16735
|
-
|
|
16736
|
-
|
|
16768
|
+
var map = _this._map._getMap();
|
|
16769
|
+
intersects_1 = map.queryRenderedFeatures(cPx_1, {
|
|
16770
|
+
layers: _this._polygonStyleLayer.filter(function (layerId) { return map.getLayer(layerId); }),
|
|
16737
16771
|
filter: ["==", ["geometry-type"], "Polygon"]
|
|
16738
16772
|
});
|
|
16739
16773
|
}, function () { });
|
|
@@ -17241,6 +17275,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
17241
17275
|
if (increment === void 0) { increment = 1; }
|
|
17242
17276
|
return Math.round(val / increment) * increment;
|
|
17243
17277
|
};
|
|
17278
|
+
// Ids of vector tile sources for different style APIs.
|
|
17279
|
+
MapViewDescriptor._baseVectorTileSourceIds = ["microsoft.base", "vectorTiles", "bing-mvt"];
|
|
17244
17280
|
return MapViewDescriptor;
|
|
17245
17281
|
}());
|
|
17246
17282
|
|
|
@@ -27061,7 +27097,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27061
27097
|
/**
|
|
27062
27098
|
* 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
27099
|
* 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.
|
|
27100
|
+
* 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
27101
|
* default: `undefined`
|
|
27066
27102
|
* @default undefined
|
|
27067
27103
|
*/
|
|
@@ -27692,6 +27728,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27692
27728
|
* Preserve the map configuration that was used before the indoor map configuration was set
|
|
27693
27729
|
*/
|
|
27694
27730
|
this.preservedPreindoorMapConfiguration = undefined;
|
|
27731
|
+
/**
|
|
27732
|
+
* The state of the progressive loading
|
|
27733
|
+
*/
|
|
27734
|
+
this._progressiveLoadingState = {
|
|
27735
|
+
mapStyle: undefined,
|
|
27736
|
+
pendingVisibilityChange: undefined,
|
|
27737
|
+
};
|
|
27695
27738
|
this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
|
|
27696
27739
|
var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
|
|
27697
27740
|
// If the initial layer groups are invalid, skip the progressive loading.
|
|
@@ -27699,7 +27742,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27699
27742
|
return;
|
|
27700
27743
|
var map = _this.map._getMap();
|
|
27701
27744
|
var currentZoomLevel = map.getZoom();
|
|
27702
|
-
|
|
27745
|
+
var currentMapStyle = _this.map.getStyle().style;
|
|
27746
|
+
// Cancel and release previous pending callback, if any.
|
|
27747
|
+
if (_this._progressiveLoadingState.pendingVisibilityChange) {
|
|
27748
|
+
_this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
27749
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
27750
|
+
}
|
|
27751
|
+
// Keep the current map style for future comparison.
|
|
27752
|
+
_this._progressiveLoadingState.mapStyle = currentMapStyle;
|
|
27753
|
+
// Select deferrable layers
|
|
27703
27754
|
var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
|
|
27704
27755
|
var _b = __read$e(_a, 2), groupName = _b[0], layers = _b[1];
|
|
27705
27756
|
var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
|
|
@@ -27726,22 +27777,34 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27726
27777
|
return false;
|
|
27727
27778
|
}
|
|
27728
27779
|
}
|
|
27729
|
-
//
|
|
27780
|
+
// Select visible layers only.
|
|
27730
27781
|
return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
|
|
27731
27782
|
})));
|
|
27732
27783
|
}, []);
|
|
27733
|
-
// Hide the
|
|
27784
|
+
// Hide the deferrable layers at initial load, therefore we can save the render time.
|
|
27734
27785
|
deferredLayers.forEach(function (layer) {
|
|
27786
|
+
// Since this happens before sending style object into the map rendering,
|
|
27787
|
+
// we only need to update the style object, but not necessary to update maplibre's layout properties.
|
|
27735
27788
|
layer.layout = layer.layout || {};
|
|
27736
27789
|
layer.layout.visibility = 'none';
|
|
27737
27790
|
});
|
|
27738
|
-
// Make the deferred layers visible once the map instance is fully loaded
|
|
27739
|
-
_this.
|
|
27791
|
+
// Make the deferred layers visible once the map instance is fully loaded.
|
|
27792
|
+
_this._progressiveLoadingState.pendingVisibilityChange = function () {
|
|
27793
|
+
// Release the callback.
|
|
27794
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
27795
|
+
// Bail out the callback once map style has changed.
|
|
27796
|
+
var nextMapStyle = _this.map.getStyle().style;
|
|
27797
|
+
if (currentMapStyle !== nextMapStyle)
|
|
27798
|
+
return;
|
|
27799
|
+
// Make deferred layers visible
|
|
27740
27800
|
deferredLayers.forEach(function (layer) {
|
|
27801
|
+
// This happens after the map rendering; Therefore, we need to update
|
|
27802
|
+
// both the style object and the maplibre's layout properties.
|
|
27741
27803
|
layer.layout.visibility = 'visible';
|
|
27742
27804
|
map.setLayoutProperty(layer.id, 'visibility', 'visible');
|
|
27743
27805
|
});
|
|
27744
|
-
}
|
|
27806
|
+
};
|
|
27807
|
+
_this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
27745
27808
|
};
|
|
27746
27809
|
this._onStyleData = function () {
|
|
27747
27810
|
_this._lookUpAsync(_this.map.getStyle()).then(function (style) {
|
|
@@ -28023,18 +28086,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28023
28086
|
// should be modified before they are applied to the map.
|
|
28024
28087
|
var styleOptions = this.map.getStyle();
|
|
28025
28088
|
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
28089
|
var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
|
|
28039
28090
|
// The feature only effective at the initial load.
|
|
28040
28091
|
!this.map._isLoaded());
|
|
@@ -28598,6 +28649,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28598
28649
|
if (!mapboxCameraOptions) {
|
|
28599
28650
|
throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");
|
|
28600
28651
|
}
|
|
28652
|
+
if ('pitch' in options) {
|
|
28653
|
+
mapboxCameraOptions.pitch = options.pitch;
|
|
28654
|
+
}
|
|
28655
|
+
if ('bearing' in options) {
|
|
28656
|
+
mapboxCameraOptions.bearing = options.bearing;
|
|
28657
|
+
}
|
|
28601
28658
|
this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
|
|
28602
28659
|
this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
|
|
28603
28660
|
maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
|
|
@@ -28720,8 +28777,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
28720
28777
|
// If this function is restructured such that a styledata event won't always trigger
|
|
28721
28778
|
// if the language is changed, then either those delegates need changed
|
|
28722
28779
|
// or the styledata event manually invoked.
|
|
28780
|
+
var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
|
|
28723
28781
|
this.styleOptions = newOptions;
|
|
28724
|
-
this._setStyleComponents(newOptions,
|
|
28782
|
+
this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
|
|
28725
28783
|
};
|
|
28726
28784
|
/**
|
|
28727
28785
|
* Returns the map control's current style settings.
|