azure-maps-control 2.1.14 → 2.1.17
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.js +297 -58
- package/dist/atlas-core-bare.min.js +1 -1
- package/dist/atlas-core.js +297 -58
- package/dist/atlas-core.min.js +1 -1
- package/dist/atlas.css +1 -1
- package/dist/atlas.js +297 -58
- package/dist/atlas.min.css +1 -1
- package/dist/atlas.min.js +1 -1
- package/package.json +6 -4
- package/thirdpartynotices.txt +0 -0
- package/typings/index.d.ts +27 -3
package/dist/atlas-core.js
CHANGED
|
@@ -43217,6 +43217,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43217
43217
|
apiVersionQueryParameter: "api-version",
|
|
43218
43218
|
authorizationHeaderName: "Authorization",
|
|
43219
43219
|
authorizationTokenPrefix: "Bearer ",
|
|
43220
|
+
jwtSasPrefix: "jwt-sas ",
|
|
43220
43221
|
domainPlaceHolder: "{{azMapsDomain}}",
|
|
43221
43222
|
legacyDomainPlaceHolder: "{azMapsDomain}",
|
|
43222
43223
|
viewPlaceHolder: "{{azMapsView}}",
|
|
@@ -43487,7 +43488,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43487
43488
|
return Url;
|
|
43488
43489
|
}());
|
|
43489
43490
|
|
|
43490
|
-
var version = "2.1.
|
|
43491
|
+
var version = "2.1.17";
|
|
43491
43492
|
|
|
43492
43493
|
/**
|
|
43493
43494
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -43845,7 +43846,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43845
43846
|
delete this._container;
|
|
43846
43847
|
}
|
|
43847
43848
|
if (this._map) {
|
|
43848
|
-
this._map.events.remove("
|
|
43849
|
+
this._map.events.remove("stylechanged", this._onStyleChange);
|
|
43849
43850
|
delete this._map;
|
|
43850
43851
|
}
|
|
43851
43852
|
if (this._observer) {
|
|
@@ -43869,7 +43870,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43869
43870
|
if (style.toLowerCase() === exports.ControlStyle.auto) {
|
|
43870
43871
|
this._map.styles.definitions().then(function (definitions) {
|
|
43871
43872
|
if (_this._map) {
|
|
43872
|
-
_this._map.events.add("
|
|
43873
|
+
_this._map.events.add("stylechanged", _this._onStyleChange);
|
|
43873
43874
|
}
|
|
43874
43875
|
});
|
|
43875
43876
|
}
|
|
@@ -43982,6 +43983,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43982
43983
|
}
|
|
43983
43984
|
}
|
|
43984
43985
|
});
|
|
43986
|
+
// Keep the focus on this control when esc key is pressed on the grid
|
|
43987
|
+
grid.addEventListener("keydown", function (event) {
|
|
43988
|
+
if (event.key === "Escape" || event.key === "Esc") {
|
|
43989
|
+
event.stopPropagation();
|
|
43990
|
+
rotationButton.focus();
|
|
43991
|
+
container.classList.remove("in-use");
|
|
43992
|
+
grid.classList.add("hidden-accessible-element");
|
|
43993
|
+
}
|
|
43994
|
+
});
|
|
43985
43995
|
// If the control's position will require inverting the element order
|
|
43986
43996
|
// add them in the opposite order to preserve tabindex.
|
|
43987
43997
|
if (options && CompassControl.InvertOrderPositions.includes(options.position)) {
|
|
@@ -44129,6 +44139,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44129
44139
|
var _this = _super.call(this) || this;
|
|
44130
44140
|
_this.container = null;
|
|
44131
44141
|
_this.map = null;
|
|
44142
|
+
_this.pitchButton = null;
|
|
44132
44143
|
_this.pitchIncrementButton = null;
|
|
44133
44144
|
_this.pitchDecrementButton = null;
|
|
44134
44145
|
_this.hasMouse = false;
|
|
@@ -44137,6 +44148,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44137
44148
|
_this.updatePitchButtonsState = function () {
|
|
44138
44149
|
var minPitchReached = _this.map.getCamera().pitch <= 0;
|
|
44139
44150
|
var maxPitchReached = _this.map.getCamera().pitch >= 60;
|
|
44151
|
+
// Keep the focus on this control when max/min pitch is reached
|
|
44152
|
+
if (_this.hasFocus && _this.pitchButton && (minPitchReached || maxPitchReached)) {
|
|
44153
|
+
_this.pitchButton.focus();
|
|
44154
|
+
}
|
|
44140
44155
|
if (_this.options.inverted) {
|
|
44141
44156
|
if (_this.pitchIncrementButton && _this.pitchIncrementButton.disabled != minPitchReached) {
|
|
44142
44157
|
_this.pitchIncrementButton.disabled = minPitchReached;
|
|
@@ -44199,6 +44214,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44199
44214
|
}
|
|
44200
44215
|
}
|
|
44201
44216
|
});
|
|
44217
|
+
// Keep the focus on this control when esc key is pressed on the grid
|
|
44218
|
+
grid.addEventListener("keydown", function (event) {
|
|
44219
|
+
if (event.key === "Escape" || event.key === "Esc") {
|
|
44220
|
+
event.stopPropagation();
|
|
44221
|
+
pitchButton.focus();
|
|
44222
|
+
container.classList.remove("in-use");
|
|
44223
|
+
grid.classList.add("hidden-accessible-element");
|
|
44224
|
+
}
|
|
44225
|
+
});
|
|
44202
44226
|
// If the control's position will require inverting the element order
|
|
44203
44227
|
// add them in the opposite order to preserve tabindex.
|
|
44204
44228
|
if (options && PitchControl.INVERT_ORDER_POSITIONS.includes(options.position)) {
|
|
@@ -44215,6 +44239,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44215
44239
|
}
|
|
44216
44240
|
this.map = map;
|
|
44217
44241
|
this.container = container;
|
|
44242
|
+
this.pitchButton = pitchButton;
|
|
44218
44243
|
map.events.add('pitch', this.pitchChanged);
|
|
44219
44244
|
this.updatePitchButtonsState();
|
|
44220
44245
|
return container;
|
|
@@ -44223,6 +44248,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44223
44248
|
if (this.container) {
|
|
44224
44249
|
this.container.remove();
|
|
44225
44250
|
this.container = null;
|
|
44251
|
+
this.pitchButton = null;
|
|
44226
44252
|
this.pitchIncrementButton = null;
|
|
44227
44253
|
this.pitchDecrementButton = null;
|
|
44228
44254
|
}
|
|
@@ -47577,7 +47603,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47577
47603
|
_super.prototype.onRemove.call(this);
|
|
47578
47604
|
this.styleOpsGrid = null;
|
|
47579
47605
|
this.styleButtons.clear();
|
|
47580
|
-
this.map.events.remove("
|
|
47606
|
+
this.map.events.remove("stylechanged", this.onStyleChange);
|
|
47581
47607
|
this.map.events.remove("stylesetchanged", this.onStylesetChange);
|
|
47582
47608
|
};
|
|
47583
47609
|
/**
|
|
@@ -47632,7 +47658,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47632
47658
|
var _this = this;
|
|
47633
47659
|
var styleOptionButton = document.createElement("button");
|
|
47634
47660
|
var friendlyName = this.mapToFriendlyStyleName(name, styleset);
|
|
47635
|
-
styleOptionButton.setAttribute("
|
|
47661
|
+
styleOptionButton.setAttribute("aria-label", friendlyName);
|
|
47636
47662
|
styleOptionButton.setAttribute("type", "button");
|
|
47637
47663
|
var styleIconImage = new Image();
|
|
47638
47664
|
fetchIconPromise
|
|
@@ -47652,9 +47678,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47652
47678
|
}
|
|
47653
47679
|
_this.styleIcons.set(name, iconUrl);
|
|
47654
47680
|
});
|
|
47655
|
-
|
|
47656
|
-
styleIconImage.alt = friendlyName;
|
|
47657
|
-
}
|
|
47681
|
+
styleIconImage.setAttribute("aria-hidden", "true");
|
|
47658
47682
|
styleOptionButton.appendChild(styleIconImage);
|
|
47659
47683
|
if (this.options.layout === "icons") {
|
|
47660
47684
|
styleOptionButton.classList.add(StyleControl.Css.button);
|
|
@@ -47694,7 +47718,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47694
47718
|
}
|
|
47695
47719
|
selectCurrButton.classList.add(StyleControl.Css.currentStyle);
|
|
47696
47720
|
selectCurrButton.setAttribute("aria-label", "Select Style");
|
|
47697
|
-
selectCurrButton.setAttribute("alt", "Select Style");
|
|
47698
47721
|
selectCurrButton.setAttribute("tabindex", "-1");
|
|
47699
47722
|
this.currStyleImage = new Image();
|
|
47700
47723
|
selectCurrButton.appendChild(this.currStyleImage);
|
|
@@ -47720,7 +47743,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47720
47743
|
this.map.styles.definitions().then(function (definitions) { return __awaiter(_this, void 0, void 0, function () {
|
|
47721
47744
|
return __generator(this, function (_a) {
|
|
47722
47745
|
this.onStylesetChange(definitions);
|
|
47723
|
-
this.map.events.add("
|
|
47746
|
+
this.map.events.add("stylechanged", this.onStyleChange);
|
|
47724
47747
|
return [2 /*return*/];
|
|
47725
47748
|
});
|
|
47726
47749
|
}); });
|
|
@@ -47909,6 +47932,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47909
47932
|
return this.container;
|
|
47910
47933
|
};
|
|
47911
47934
|
TrafficControl.prototype.onRemove = function () {
|
|
47935
|
+
_super.prototype.onRemove.call(this);
|
|
47912
47936
|
this.map = null;
|
|
47913
47937
|
};
|
|
47914
47938
|
/**
|
|
@@ -47969,6 +47993,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47969
47993
|
_this.table = ["Fast",
|
|
47970
47994
|
["green", "yellow", "red", "dark-red"],
|
|
47971
47995
|
"Slow"];
|
|
47996
|
+
_this.map = null;
|
|
47997
|
+
_this.syncHiddenState = null;
|
|
47972
47998
|
return _this;
|
|
47973
47999
|
}
|
|
47974
48000
|
/**
|
|
@@ -47978,11 +48004,21 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47978
48004
|
* @return An HTMLElement to be placed on the map for the control.
|
|
47979
48005
|
*/
|
|
47980
48006
|
TrafficLegendControl.prototype.onAdd = function (map) {
|
|
48007
|
+
this.map = map;
|
|
47981
48008
|
var container = this.buildContainer(map, exports.ControlStyle.auto, "Traffic Legend");
|
|
47982
48009
|
var TrafficLegendDiv = this.buildTrafficLegendDiv(map);
|
|
48010
|
+
container.setAttribute("role", "definition");
|
|
47983
48011
|
container.appendChild(TrafficLegendDiv);
|
|
47984
48012
|
return container;
|
|
47985
48013
|
};
|
|
48014
|
+
TrafficLegendControl.prototype.onRemove = function () {
|
|
48015
|
+
_super.prototype.onRemove.call(this);
|
|
48016
|
+
if (this.syncHiddenState) {
|
|
48017
|
+
this.map.events.remove('styledata', this.syncHiddenState);
|
|
48018
|
+
this.syncHiddenState = null;
|
|
48019
|
+
}
|
|
48020
|
+
this.map = null;
|
|
48021
|
+
};
|
|
47986
48022
|
TrafficLegendControl.prototype.buildTrafficLegendDiv = function (map) {
|
|
47987
48023
|
var e_1, _a, e_2, _b;
|
|
47988
48024
|
var trafficLegend = document.createElement("div");
|
|
@@ -48047,8 +48083,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
48047
48083
|
}
|
|
48048
48084
|
trafficLegendTable.appendChild(tr2);
|
|
48049
48085
|
trafficLegend.appendChild(trafficLegendTable);
|
|
48050
|
-
|
|
48051
|
-
map.events.add("styledata", function (eventData) {
|
|
48086
|
+
this.syncHiddenState = function (eventData) {
|
|
48052
48087
|
if (eventData.dataType === "style") {
|
|
48053
48088
|
var trafficOptions = map.getTraffic();
|
|
48054
48089
|
if (trafficOptions.flow && trafficOptions.flow !== "none") {
|
|
@@ -48058,7 +48093,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
48058
48093
|
trafficLegend.classList.add("hidden");
|
|
48059
48094
|
}
|
|
48060
48095
|
}
|
|
48061
|
-
}
|
|
48096
|
+
};
|
|
48097
|
+
// display legend when the traffic flow is shown, hide it otherwise
|
|
48098
|
+
this.syncHiddenState({ dataType: 'style' });
|
|
48099
|
+
map.events.add("styledata", this.syncHiddenState);
|
|
48062
48100
|
return trafficLegend;
|
|
48063
48101
|
};
|
|
48064
48102
|
return TrafficLegendControl;
|
|
@@ -55889,6 +55927,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
55889
55927
|
// They must use setOptions(...).
|
|
55890
55928
|
return cloneDeepWith_1(this.options, PopupOptions._cloneCustomizer);
|
|
55891
55929
|
};
|
|
55930
|
+
/**
|
|
55931
|
+
* Returns popup container element.
|
|
55932
|
+
*/
|
|
55933
|
+
Popup.prototype.getPopupContainer = function () {
|
|
55934
|
+
return this.containerDiv;
|
|
55935
|
+
};
|
|
55892
55936
|
/**
|
|
55893
55937
|
* Drags the popup to the specified pixel.
|
|
55894
55938
|
* Accounts for the pixel offset when dragging started.
|
|
@@ -56918,6 +56962,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
56918
56962
|
* Literal value `"anonymous"`
|
|
56919
56963
|
*/
|
|
56920
56964
|
AuthenticationType["anonymous"] = "anonymous";
|
|
56965
|
+
/**
|
|
56966
|
+
* The shared access signature authentication mechanism. Allows a callback responsible for acquiring a token to be provided on requests.
|
|
56967
|
+
* Literal value `"sas"`.
|
|
56968
|
+
*/
|
|
56969
|
+
AuthenticationType["sas"] = "sas";
|
|
56921
56970
|
})(exports.AuthenticationType || (exports.AuthenticationType = {}));
|
|
56922
56971
|
/**
|
|
56923
56972
|
* Options for specifying how the map control should authenticate with the Azure Maps services.
|
|
@@ -56957,11 +57006,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
56957
57006
|
*/
|
|
56958
57007
|
_this.aadInstance = undefined;
|
|
56959
57008
|
/**
|
|
56960
|
-
* A callback to use with the anonymous authentication mechanism.
|
|
57009
|
+
* A callback to use with the anonymous/sas authentication mechanism.
|
|
56961
57010
|
* This callback will be responsible for resolving to a authentication token.
|
|
56962
57011
|
* E.g. fetching a CORS protected token from an endpoint.
|
|
56963
57012
|
*/
|
|
56964
57013
|
_this.getToken = undefined;
|
|
57014
|
+
/**
|
|
57015
|
+
* Optionally provide an initial token for sas authentication.
|
|
57016
|
+
*/
|
|
57017
|
+
_this.sasToken = undefined;
|
|
56965
57018
|
/**
|
|
56966
57019
|
* Optionally provide an existing `AuthenticationContext` from the ADAL.js library.
|
|
56967
57020
|
* This authentication context will be used to acquire the AAD token.
|
|
@@ -57004,6 +57057,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57004
57057
|
this.authType = exports.AuthenticationType.anonymous;
|
|
57005
57058
|
this.getToken = getTokenCallback;
|
|
57006
57059
|
};
|
|
57060
|
+
/**
|
|
57061
|
+
* Sets the required options to configure the sas authentication method.
|
|
57062
|
+
* @param getTokenCallback Callback function responsible for resolving to an authentication token.
|
|
57063
|
+
*/
|
|
57064
|
+
AuthenticationOptions.prototype.setSasCallbackFunction = function (getTokenCallback) {
|
|
57065
|
+
this.authType = exports.AuthenticationType.sas;
|
|
57066
|
+
this.getToken = getTokenCallback;
|
|
57067
|
+
};
|
|
57007
57068
|
/**
|
|
57008
57069
|
* Override the standard merge behavior to handle mutually exclusive options.
|
|
57009
57070
|
* @internal
|
|
@@ -57023,6 +57084,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57023
57084
|
else if (merged.authType === exports.AuthenticationType.anonymous) {
|
|
57024
57085
|
merged.subscriptionKey = merged.authContext = merged.aadAppId = undefined;
|
|
57025
57086
|
}
|
|
57087
|
+
else if (merged.authType === exports.AuthenticationType.sas) {
|
|
57088
|
+
merged.authContext = merged.subscriptionKey = merged.aadAppId = undefined;
|
|
57089
|
+
}
|
|
57026
57090
|
return merged;
|
|
57027
57091
|
};
|
|
57028
57092
|
return AuthenticationOptions;
|
|
@@ -57749,7 +57813,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57749
57813
|
path: "search/address/reverse/json",
|
|
57750
57814
|
queryParams: __assign({ "api-version": "1.0", "language": options.style.language, "limit": 1, "query": normalizeLatitude(options.position[1]) + "," + normalizeLongitude(options.position[0]) }, (options.style.view && { view: options.style.view }))
|
|
57751
57815
|
};
|
|
57752
|
-
return new Url((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(urlOptions)).get();
|
|
57816
|
+
return new Url(((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(urlOptions)) || urlOptions).get();
|
|
57753
57817
|
};
|
|
57754
57818
|
return NearbyGeographySearchService;
|
|
57755
57819
|
}());
|
|
@@ -58953,8 +59017,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
58953
59017
|
_this.createMapKeyBindingInfo();
|
|
58954
59018
|
_this.map.getMapContainer().setAttribute("role", "application");
|
|
58955
59019
|
_this.map.getMapContainer().setAttribute("aria-label", "Map Application");
|
|
59020
|
+
_this.map.getCanvasContainer().setAttribute("aria-live", "polite");
|
|
59021
|
+
_this.map.getCanvasContainer().setAttribute("aria-describedby", "atlas-map-state atlas-map-style");
|
|
58956
59022
|
_this.map.getCanvas().setAttribute("aria-label", "Interactive Map");
|
|
58957
|
-
_this.map.getCanvas().setAttribute("aria-describedby", "atlas-map-
|
|
59023
|
+
_this.map.getCanvas().setAttribute("aria-describedby", "atlas-map-shortcuts");
|
|
58958
59024
|
_this.map.getCanvas().setAttribute("alt", "Interactive Map");
|
|
58959
59025
|
};
|
|
58960
59026
|
this.removeFromMap = function () {
|
|
@@ -58976,10 +59042,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
58976
59042
|
delete _this.atlasMapStyleInfo;
|
|
58977
59043
|
_this.map.getMapContainer().removeAttribute("role");
|
|
58978
59044
|
_this.map.getMapContainer().removeAttribute("aria-label");
|
|
59045
|
+
_this.map.getCanvasContainer().removeAttribute("aria-live");
|
|
59046
|
+
_this.map.getCanvasContainer().removeAttribute("aria-describedby");
|
|
58979
59047
|
_this.map.getCanvas().removeAttribute("aria-label");
|
|
58980
59048
|
_this.map.getCanvas().removeAttribute("aria-describedby");
|
|
58981
59049
|
_this.map.getCanvas().removeAttribute("alt");
|
|
58982
|
-
_this.map.events.remove("
|
|
59050
|
+
_this.map.events.remove("stylechanged", _this.updateMapStyle);
|
|
58983
59051
|
};
|
|
58984
59052
|
this.createMapKeyBindingInfo = function () {
|
|
58985
59053
|
_this.atlasMapKeyBindings = document.createElement("div");
|
|
@@ -59004,7 +59072,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59004
59072
|
"Jump focus to the map: Escape."
|
|
59005
59073
|
].join("\n");
|
|
59006
59074
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapKeyBindings);
|
|
59007
|
-
_this.atlasMapKeyBindings.setAttribute("aria-live", "polite");
|
|
59008
59075
|
var baseShortcutKeyCodes = [
|
|
59009
59076
|
// - (zoom out)
|
|
59010
59077
|
189,
|
|
@@ -59036,7 +59103,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59036
59103
|
_this.atlasMapLiveStateInfo.id = "atlas-map-state";
|
|
59037
59104
|
_this.atlasMapLiveStateInfo.classList.add("hidden-accessible-element");
|
|
59038
59105
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapLiveStateInfo);
|
|
59039
|
-
_this.atlasMapLiveStateInfo.setAttribute("aria-live", "assertive");
|
|
59040
59106
|
}
|
|
59041
59107
|
};
|
|
59042
59108
|
this.initializeMapStyleInfo = function () {
|
|
@@ -59045,10 +59111,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59045
59111
|
_this.atlasMapStyleInfo.setAttribute("aria-hidden", "true");
|
|
59046
59112
|
_this.atlasMapStyleInfo.id = "atlas-map-style";
|
|
59047
59113
|
_this.atlasMapStyleInfo.classList.add("hidden-accessible-element");
|
|
59048
|
-
_this.updateMapStyle
|
|
59049
|
-
_this.map.events.add("styledata", _this.updateMapStyle);
|
|
59114
|
+
_this.map.events.add("stylechanged", _this.updateMapStyle);
|
|
59050
59115
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapStyleInfo);
|
|
59051
|
-
_this.atlasMapStyleInfo.setAttribute("aria-live", "polite");
|
|
59052
59116
|
};
|
|
59053
59117
|
this.updateMapStyle = function () {
|
|
59054
59118
|
_this.atlasMapStyleInfo.innerHTML = "<p>Map style: " + _this.map.getStyle().style + ".</p>";
|
|
@@ -59346,15 +59410,106 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59346
59410
|
_this.map.layers.add(_this.incidentLayer, "labels");
|
|
59347
59411
|
}
|
|
59348
59412
|
//Create a popup but leave it closed so we can update it and display it later.
|
|
59349
|
-
_this.
|
|
59413
|
+
_this.clickPopup = new Popup({
|
|
59350
59414
|
position: [0, 0],
|
|
59351
59415
|
pixelOffset: [0, -18]
|
|
59352
59416
|
});
|
|
59353
59417
|
_this.map.addEventListener("mouseover", _this.incidentLayerName, _this.cursorToPointer);
|
|
59354
59418
|
_this.map.addEventListener("mouseleave", _this.incidentLayerName, _this.cursorToDefault);
|
|
59355
59419
|
_this.map.addEventListener("click", _this.incidentLayerName, _this.openIncidentPopup);
|
|
59420
|
+
_this.map.events.addOnce('idle', _this.setAccessiblePopups);
|
|
59421
|
+
_this.map.events.add('moveend', _this.setAccessiblePopups);
|
|
59356
59422
|
};
|
|
59423
|
+
this.accessiblePopups = [];
|
|
59424
|
+
this.setAccessiblePopups = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
59425
|
+
var features, localizedStrings, createPopup, insertHiddenBefore, insertHiddenInFront, addHidden;
|
|
59426
|
+
var _this = this;
|
|
59427
|
+
return __generator(this, function (_a) {
|
|
59428
|
+
switch (_a.label) {
|
|
59429
|
+
case 0:
|
|
59430
|
+
this.accessiblePopups.forEach(function (popup) { return popup.remove(); });
|
|
59431
|
+
this.accessiblePopups = [];
|
|
59432
|
+
features = this.map.layers.getRenderedShapes(this.map.getCamera().bounds, this.incidentLayer);
|
|
59433
|
+
return [4 /*yield*/, this.map._getLocalizedStrings()];
|
|
59434
|
+
case 1:
|
|
59435
|
+
localizedStrings = _a.sent();
|
|
59436
|
+
createPopup = function (features, idx) {
|
|
59437
|
+
var incidentFeature = features[idx];
|
|
59438
|
+
var incidentPosition = incidentFeature.geometry.coordinates;
|
|
59439
|
+
var point = new Point(new Position(incidentPosition[0], incidentPosition[1]));
|
|
59440
|
+
var incident = new Incident(incidentFeature.properties, point, localizedStrings);
|
|
59441
|
+
var popup = IncidentPopupFactory.build(incident, _this.incidentLanguage);
|
|
59442
|
+
var element = popup.getPopupContainer();
|
|
59443
|
+
element.addEventListener('focusin', function (event) {
|
|
59444
|
+
// side effects: clear other managed popups
|
|
59445
|
+
_this.clickPopup.remove();
|
|
59446
|
+
_this.accessiblePopups.filter(function (p) { return p !== popup; }).forEach(function (popup) { return popup.remove(); });
|
|
59447
|
+
// insert previous and next popups
|
|
59448
|
+
if (idx - 1 >= 0) {
|
|
59449
|
+
insertHiddenBefore(popup, createPopup(features, idx - 1));
|
|
59450
|
+
}
|
|
59451
|
+
if (idx + 1 < features.length) {
|
|
59452
|
+
addHidden(createPopup(features, idx + 1));
|
|
59453
|
+
}
|
|
59454
|
+
// if we are on boundaries: add the first / last popup
|
|
59455
|
+
// to maintain popups on full page navigation cycle
|
|
59456
|
+
if (idx >= 2 && idx == features.length - 1) {
|
|
59457
|
+
insertHiddenInFront(createPopup(features, 0));
|
|
59458
|
+
}
|
|
59459
|
+
if (idx == 0 && features.length >= 2) {
|
|
59460
|
+
addHidden(createPopup(features, features.length - 1));
|
|
59461
|
+
}
|
|
59462
|
+
});
|
|
59463
|
+
if (idx == features.length - 1) {
|
|
59464
|
+
element.addEventListener('focusout', function (event) {
|
|
59465
|
+
// close the popup if we detect the focus moving away from the page (relatedTarget === null)
|
|
59466
|
+
// (will remain open otherwise)
|
|
59467
|
+
if (event.relatedTarget === null) {
|
|
59468
|
+
popup.close();
|
|
59469
|
+
}
|
|
59470
|
+
});
|
|
59471
|
+
}
|
|
59472
|
+
_this.accessiblePopups.push(popup);
|
|
59473
|
+
return popup;
|
|
59474
|
+
};
|
|
59475
|
+
insertHiddenBefore = function (base, toInsert) {
|
|
59476
|
+
toInsert.open(_this.map);
|
|
59477
|
+
toInsert.close();
|
|
59478
|
+
var containerToSwapIn = toInsert.getPopupContainer();
|
|
59479
|
+
var baseContainer = base.getPopupContainer();
|
|
59480
|
+
baseContainer.parentElement.insertBefore(containerToSwapIn, baseContainer);
|
|
59481
|
+
};
|
|
59482
|
+
insertHiddenInFront = function (toInsert) {
|
|
59483
|
+
toInsert.open(_this.map);
|
|
59484
|
+
toInsert.close();
|
|
59485
|
+
var containerToSwapIn = toInsert.getPopupContainer();
|
|
59486
|
+
var parent = containerToSwapIn.parentElement;
|
|
59487
|
+
parent.insertBefore(containerToSwapIn, parent.firstElementChild);
|
|
59488
|
+
};
|
|
59489
|
+
addHidden = function (popup) {
|
|
59490
|
+
popup.open(_this.map);
|
|
59491
|
+
popup.close();
|
|
59492
|
+
};
|
|
59493
|
+
if (features.length > 0) {
|
|
59494
|
+
addHidden(createPopup(features, 0));
|
|
59495
|
+
}
|
|
59496
|
+
if (features.length > 1) {
|
|
59497
|
+
addHidden(createPopup(features, features.length - 1));
|
|
59498
|
+
}
|
|
59499
|
+
return [2 /*return*/];
|
|
59500
|
+
}
|
|
59501
|
+
});
|
|
59502
|
+
}); };
|
|
59357
59503
|
this.removeFromMap = function () {
|
|
59504
|
+
var _a;
|
|
59505
|
+
_this.map.removeEventListener("mouseover", _this.incidentLayerName, _this.cursorToPointer);
|
|
59506
|
+
_this.map.removeEventListener("mouseleave", _this.incidentLayerName, _this.cursorToDefault);
|
|
59507
|
+
_this.map.removeEventListener("click", _this.incidentLayerName, _this.openIncidentPopup);
|
|
59508
|
+
_this.map.events.remove('idle', _this.setAccessiblePopups);
|
|
59509
|
+
_this.map.events.remove('moveend', _this.setAccessiblePopups);
|
|
59510
|
+
_this.accessiblePopups.forEach(function (popup) { return popup.remove(); });
|
|
59511
|
+
_this.accessiblePopups = [];
|
|
59512
|
+
(_a = _this.clickPopup) === null || _a === void 0 ? void 0 : _a.remove();
|
|
59358
59513
|
if (_this.map.layers.getLayerById(_this.incidentLayerName) != null) {
|
|
59359
59514
|
_this.map.layers.remove(_this.incidentLayerName);
|
|
59360
59515
|
}
|
|
@@ -59369,14 +59524,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59369
59524
|
_this.map.getCanvas().style.cursor = "";
|
|
59370
59525
|
};
|
|
59371
59526
|
this.openIncidentPopup = function (data) {
|
|
59372
|
-
_this.
|
|
59527
|
+
_this.clickPopup.remove();
|
|
59528
|
+
_this.accessiblePopups.forEach(function (popup) { return popup.close(); });
|
|
59373
59529
|
var incidentPosition = data.position;
|
|
59374
59530
|
var incidentFeature = data.features[0];
|
|
59375
59531
|
_this.map._getLocalizedStrings().then(function (localizedStrings) {
|
|
59376
59532
|
var point = new Point(new Position(incidentPosition[0], incidentPosition[1]));
|
|
59377
59533
|
var incident = new Incident(incidentFeature.properties, point, localizedStrings);
|
|
59378
|
-
_this.
|
|
59379
|
-
_this.
|
|
59534
|
+
_this.clickPopup = IncidentPopupFactory.build(incident, _this.incidentLanguage);
|
|
59535
|
+
_this.clickPopup.open(_this.map);
|
|
59536
|
+
var element = _this.clickPopup.getPopupContainer();
|
|
59537
|
+
// ensures popup is closed on tabbing when the focus is moved away from the window
|
|
59538
|
+
element.addEventListener('focusout', function (event) {
|
|
59539
|
+
if (event.relatedTarget === null) {
|
|
59540
|
+
_this.clickPopup.close();
|
|
59541
|
+
}
|
|
59542
|
+
});
|
|
59380
59543
|
});
|
|
59381
59544
|
};
|
|
59382
59545
|
this.map = map;
|
|
@@ -65084,17 +65247,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65084
65247
|
* Triggers the user provided function to fetch the token and stores it.
|
|
65085
65248
|
* @internal
|
|
65086
65249
|
*/
|
|
65087
|
-
this._triggerTokenFetch = function () {
|
|
65250
|
+
this._triggerTokenFetch = function (isAnonymousAuth) {
|
|
65251
|
+
if (isAnonymousAuth === void 0) { isAnonymousAuth = false; }
|
|
65088
65252
|
return new Promise(function (resolve, reject) {
|
|
65253
|
+
if (typeof _this.options.getToken !== "function") {
|
|
65254
|
+
reject(new Error("Token cannot be " + (isAnonymousAuth ? 'fetched' : 'renewed') + " because getToken was not set or is not a function."));
|
|
65255
|
+
return;
|
|
65256
|
+
}
|
|
65089
65257
|
_this.options.getToken(function (token) {
|
|
65090
65258
|
try {
|
|
65091
65259
|
// Try to get the timeout first as this will guarantee the token is correctly formatted.
|
|
65092
65260
|
var timeout = _this._getTokenExpiry(token) - AuthenticationManager.constants.tokenRefreshClockSkew;
|
|
65093
|
-
_this.
|
|
65094
|
-
|
|
65095
|
-
// @ts-ignore
|
|
65096
|
-
// tslint:disable-next-line: no-string-based-set-timeout
|
|
65097
|
-
_this.tokenTimeOutHandle = setTimeout(_this._triggerTokenFetch, timeout * 1000);
|
|
65261
|
+
_this._storeToken(token);
|
|
65262
|
+
_this._setTimeoutTokenFetch(timeout);
|
|
65098
65263
|
resolve();
|
|
65099
65264
|
}
|
|
65100
65265
|
catch (_a) {
|
|
@@ -65105,6 +65270,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65105
65270
|
}, _this.map);
|
|
65106
65271
|
});
|
|
65107
65272
|
};
|
|
65273
|
+
/**
|
|
65274
|
+
* Create a timer to trigger the user provided function to fetch the token.
|
|
65275
|
+
* @param seconds delay in seconds
|
|
65276
|
+
* @internal
|
|
65277
|
+
*/
|
|
65278
|
+
this._setTimeoutTokenFetch = function (seconds) {
|
|
65279
|
+
clearTimeout(_this.tokenTimeOutHandle); // Clear the previous refresh timeout in case it hadn't triggered yet.
|
|
65280
|
+
// @ts-ignore
|
|
65281
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
65282
|
+
_this.tokenTimeOutHandle = setTimeout(_this._triggerTokenFetch, Math.min(seconds * 1000, 0x7fffffff) // setTimeout will fire immediately if the delay is greater than 2^31-1.
|
|
65283
|
+
);
|
|
65284
|
+
};
|
|
65108
65285
|
var serviceOptions = map.getServiceOptions();
|
|
65109
65286
|
this.options = serviceOptions.authOptions;
|
|
65110
65287
|
this.sessionId = serviceOptions.sessionId;
|
|
@@ -65146,6 +65323,28 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65146
65323
|
}
|
|
65147
65324
|
else if (_this.options.authType === exports.AuthenticationType.anonymous) {
|
|
65148
65325
|
// Anonymous authentication, just call the users provided callback.
|
|
65326
|
+
resolve(_this._triggerTokenFetch(true));
|
|
65327
|
+
}
|
|
65328
|
+
else if (_this.options.authType === exports.AuthenticationType.sas) {
|
|
65329
|
+
if (_this.options.sasToken) {
|
|
65330
|
+
var expiresIn = -1;
|
|
65331
|
+
try {
|
|
65332
|
+
expiresIn = _this._getTokenExpiry(_this.options.sasToken);
|
|
65333
|
+
}
|
|
65334
|
+
catch (_a) {
|
|
65335
|
+
reject(new Error("An invalid sasToken was provided."));
|
|
65336
|
+
return;
|
|
65337
|
+
}
|
|
65338
|
+
if (expiresIn > AuthenticationManager.constants.tokenRefreshClockSkew) {
|
|
65339
|
+
// Save the initial token
|
|
65340
|
+
_this._storeToken(_this.options.sasToken);
|
|
65341
|
+
// Create a timer to refresh the token
|
|
65342
|
+
_this._setTimeoutTokenFetch(expiresIn - AuthenticationManager.constants.tokenRefreshClockSkew);
|
|
65343
|
+
resolve();
|
|
65344
|
+
return;
|
|
65345
|
+
}
|
|
65346
|
+
}
|
|
65347
|
+
// Call the users provided callback to fetch the token.
|
|
65149
65348
|
resolve(_this._triggerTokenFetch());
|
|
65150
65349
|
}
|
|
65151
65350
|
else {
|
|
@@ -65271,8 +65470,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65271
65470
|
}
|
|
65272
65471
|
return token_1;
|
|
65273
65472
|
}
|
|
65274
|
-
else if (this.options.authType === exports.AuthenticationType.anonymous
|
|
65275
|
-
|
|
65473
|
+
else if (this.options.authType === exports.AuthenticationType.anonymous
|
|
65474
|
+
|| this.options.authType === exports.AuthenticationType.sas) {
|
|
65475
|
+
var token = this._getItem(AuthenticationManager.constants.storage.tokenKey);
|
|
65276
65476
|
if (!token) {
|
|
65277
65477
|
// Cached Token not present, invoke the user provided callback function to fetch function
|
|
65278
65478
|
this._triggerTokenFetch();
|
|
@@ -65287,7 +65487,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65287
65487
|
}
|
|
65288
65488
|
else if (expiresIn <= 0) {
|
|
65289
65489
|
// token renew failed and dont have a token.
|
|
65290
|
-
this._saveItem(AuthenticationManager.constants.storage.
|
|
65490
|
+
this._saveItem(AuthenticationManager.constants.storage.tokenKey, "");
|
|
65291
65491
|
throw new Error(AuthenticationManager.constants.errors.tokenExpired);
|
|
65292
65492
|
}
|
|
65293
65493
|
}
|
|
@@ -65316,9 +65516,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65316
65516
|
* @param token token fetched from the user's server endpoint
|
|
65317
65517
|
* @internal
|
|
65318
65518
|
*/
|
|
65319
|
-
AuthenticationManager.prototype.
|
|
65519
|
+
AuthenticationManager.prototype._storeToken = function (token) {
|
|
65320
65520
|
// Store the value
|
|
65321
|
-
this._saveItem(AuthenticationManager.constants.storage.
|
|
65521
|
+
this._saveItem(AuthenticationManager.constants.storage.tokenKey, token);
|
|
65322
65522
|
var tokenEvent = {
|
|
65323
65523
|
map: this.map,
|
|
65324
65524
|
type: AuthenticationManager.constants.events.tokenAcquired
|
|
@@ -65407,7 +65607,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65407
65607
|
}
|
|
65408
65608
|
};
|
|
65409
65609
|
/**
|
|
65410
|
-
* Return the number of
|
|
65610
|
+
* Return the number of seconds since 1970/01/01
|
|
65411
65611
|
* @ignore
|
|
65412
65612
|
*/
|
|
65413
65613
|
AuthenticationManager.prototype._getCurrentTime = function () {
|
|
@@ -65426,6 +65626,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65426
65626
|
request.headers[constants.msClientIdHeaderName] = this.options.clientId;
|
|
65427
65627
|
request.headers[constants.authorizationHeaderName] = constants.authorizationTokenPrefix + token;
|
|
65428
65628
|
break;
|
|
65629
|
+
case exports.AuthenticationType.sas:
|
|
65630
|
+
request.headers[constants.authorizationHeaderName] = constants.jwtSasPrefix + token;
|
|
65631
|
+
break;
|
|
65429
65632
|
case exports.AuthenticationType.subscriptionKey:
|
|
65430
65633
|
request.headers["subscription-key"] = token;
|
|
65431
65634
|
break;
|
|
@@ -65441,7 +65644,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65441
65644
|
// Enable localStorage for IE, as sessionStorage does not work for localhost.
|
|
65442
65645
|
preferredCacheLocation: "localStorage",
|
|
65443
65646
|
storage: {
|
|
65444
|
-
|
|
65647
|
+
tokenKey: "access.token.key",
|
|
65445
65648
|
testStorageKey: "testStorage"
|
|
65446
65649
|
},
|
|
65447
65650
|
events: {
|
|
@@ -68026,6 +68229,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68026
68229
|
* @default true
|
|
68027
68230
|
*/
|
|
68028
68231
|
_this.showLogo = true;
|
|
68232
|
+
/**
|
|
68233
|
+
* Specifies if the map should display labels
|
|
68234
|
+
* @default true
|
|
68235
|
+
*/
|
|
68236
|
+
_this.showLabels = true;
|
|
68029
68237
|
/**
|
|
68030
68238
|
* Additional custom attribution appended to map attribution.
|
|
68031
68239
|
* Default `undefined`
|
|
@@ -68597,6 +68805,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68597
68805
|
}
|
|
68598
68806
|
StyleManager.prototype.updateIndoorState = function (theme, tilesetId) {
|
|
68599
68807
|
var _this = this;
|
|
68808
|
+
var _a;
|
|
68600
68809
|
var styleset = this.map.styles.getMapConfiguration();
|
|
68601
68810
|
if (styleset) {
|
|
68602
68811
|
this.preservedPreindoorStyleset = styleset;
|
|
@@ -68606,6 +68815,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68606
68815
|
this.map.styles.setMapConfiguration("defaultIndoor_" + tilesetId, styleset === 'microsoft-maps:default' ? desiredIndoorStyle : undefined);
|
|
68607
68816
|
}
|
|
68608
68817
|
else {
|
|
68818
|
+
var didTilesetIdChange_1 = ((_a = this.indoorState) === null || _a === void 0 ? void 0 : _a.tilesetId) !== tilesetId;
|
|
68609
68819
|
this.indoorState = {
|
|
68610
68820
|
tilesetId: tilesetId,
|
|
68611
68821
|
theme: theme
|
|
@@ -68619,7 +68829,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68619
68829
|
var targetStylePrefix = currentStyle + "_indoor";
|
|
68620
68830
|
var candidateStyle = definitions.styles.find(function (style) { return style.name.startsWith(targetStylePrefix); });
|
|
68621
68831
|
if (candidateStyle) {
|
|
68622
|
-
|
|
68832
|
+
// force style reload if tileset id has changed to make sure the tiles will be re-requested with new tileset applied in indoor source placeholder
|
|
68833
|
+
_this.map.setStyle({ style: candidateStyle.name }, !didTilesetIdChange_1);
|
|
68623
68834
|
}
|
|
68624
68835
|
});
|
|
68625
68836
|
}
|
|
@@ -68657,7 +68868,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68657
68868
|
return baseName in styleNamesMap ? styleNamesMap[baseName] : baseName;
|
|
68658
68869
|
};
|
|
68659
68870
|
if (!this.serviceOptions.styleSet) {
|
|
68660
|
-
newPromise = new HijackablePromise(this._request(this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions").then(function (definitions) { return ({
|
|
68871
|
+
newPromise = new HijackablePromise(this._request(this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", { version: this.serviceOptions.styleDefinitionsVersion }).then(function (definitions) { return ({
|
|
68661
68872
|
version: isNaN(definitions.version) ? 0 : parseFloat(definitions.version),
|
|
68662
68873
|
defaultStyle: definitions.defaultStyle,
|
|
68663
68874
|
styles: definitions.styles
|
|
@@ -68684,9 +68895,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68684
68895
|
domain: _this.serviceOptions.staticAssetsDomain,
|
|
68685
68896
|
path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
|
|
68686
68897
|
queryParams: {
|
|
68687
|
-
|
|
68688
|
-
// thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
|
|
68689
|
-
//language: styleOptions.language
|
|
68898
|
+
styleVersion: _this.serviceOptions.styleDefinitionsVersion,
|
|
68690
68899
|
},
|
|
68691
68900
|
protocol: "https"
|
|
68692
68901
|
}).toString(),
|
|
@@ -68730,10 +68939,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68730
68939
|
/**
|
|
68731
68940
|
* @internal
|
|
68732
68941
|
*/
|
|
68733
|
-
StyleManager.prototype.setStyle = function (styleOptions) {
|
|
68942
|
+
StyleManager.prototype.setStyle = function (styleOptions, diff) {
|
|
68943
|
+
if (diff === void 0) { diff = true; }
|
|
68734
68944
|
try {
|
|
68735
68945
|
this.map._getMap().setStyle(this.getStyle(styleOptions), {
|
|
68736
|
-
diff:
|
|
68946
|
+
diff: diff,
|
|
68737
68947
|
stylePatch: this._stylePatch.bind(this),
|
|
68738
68948
|
validate: this.serviceOptions.validateStyle
|
|
68739
68949
|
});
|
|
@@ -68844,7 +69054,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68844
69054
|
currentLayerGroupLayers = [];
|
|
68845
69055
|
};
|
|
68846
69056
|
nextStyle.layers.forEach(function (nextLayer) {
|
|
68847
|
-
var _a, _b, _c;
|
|
69057
|
+
var _a, _b, _c, _d, _e;
|
|
68848
69058
|
var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer);
|
|
68849
69059
|
currentLayerGroupId = currentLayerGroupId ? currentLayerGroupId : layerGroup;
|
|
68850
69060
|
// Set visiblity of fill-extrusion layers according to StyleOptions.showBuildingModels
|
|
@@ -68866,6 +69076,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68866
69076
|
nextLayer.layout.visibility = "visible";
|
|
68867
69077
|
}
|
|
68868
69078
|
}
|
|
69079
|
+
// Set visibility of labels
|
|
69080
|
+
var isLabelLayerGroup = layerGroup === 'labels' || layerGroup === 'labels_places' || layerGroup === 'labels_indoor';
|
|
69081
|
+
if (isLabelLayerGroup && nextLayer.type === 'symbol') {
|
|
69082
|
+
if (styleOptions.showLabels) {
|
|
69083
|
+
updateLayoutProperty(nextLayer.id, "visibility", "visible");
|
|
69084
|
+
nextLayer.layout = (_d = nextLayer.layout) !== null && _d !== void 0 ? _d : {};
|
|
69085
|
+
nextLayer.layout.visibility = "visible";
|
|
69086
|
+
}
|
|
69087
|
+
else {
|
|
69088
|
+
updateLayoutProperty(nextLayer.id, "visibility", "none");
|
|
69089
|
+
nextLayer.layout = (_e = nextLayer.layout) !== null && _e !== void 0 ? _e : {};
|
|
69090
|
+
nextLayer.layout.visibility = "none";
|
|
69091
|
+
}
|
|
69092
|
+
}
|
|
68869
69093
|
// Once this _stylePatch returns control to maplibre the next style will be applied immediately in the same context.
|
|
68870
69094
|
// To avoid potential data races update LayerManager with new a new set of FundamentalMapLayers from here instead of
|
|
68871
69095
|
// waiting for a styledata.load event to trigger a sync in a different context.
|
|
@@ -68928,7 +69152,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68928
69152
|
// If there was a previous styledata change event attached, remove it.
|
|
68929
69153
|
// When the sprite url changes between style changes then mapbox can't perform the diff
|
|
68930
69154
|
// In such cases it recalculate the style again. Removing previous attached
|
|
68931
|
-
// event
|
|
69155
|
+
// event listener makes sure that style changed event is not fired twice in these cases.
|
|
68932
69156
|
this.map.events.remove("styledata", this._onStyleData);
|
|
68933
69157
|
this.map.events.addOnce("styledata", this._onStyleData);
|
|
68934
69158
|
};
|
|
@@ -68957,8 +69181,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68957
69181
|
if (url.includes(constants.styleResourcePlaceholder)) {
|
|
68958
69182
|
params.url = params.url.replace(constants.styleResourcePlaceholder, constants.styleResourcePath);
|
|
68959
69183
|
}
|
|
68960
|
-
params.url
|
|
68961
|
-
|
|
69184
|
+
if (params.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase()) ||
|
|
69185
|
+
params.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase())) {
|
|
69186
|
+
// Only add API version param for Azure maps domain requests
|
|
69187
|
+
var targetUrl = new URL(params.url);
|
|
69188
|
+
if (!targetUrl.searchParams.get(constants.apiVersionQueryParameter)) {
|
|
69189
|
+
targetUrl.searchParams.set(constants.apiVersionQueryParameter, this.serviceOptions.styleAPIVersion);
|
|
69190
|
+
params.url = targetUrl.href;
|
|
69191
|
+
}
|
|
69192
|
+
(_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(params);
|
|
69193
|
+
}
|
|
68962
69194
|
};
|
|
68963
69195
|
/**
|
|
68964
69196
|
* Fetches a json resource at the specified domain and path.
|
|
@@ -69363,8 +69595,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69363
69595
|
/**
|
|
69364
69596
|
* Set the map control's style options. Any options not specified will default to their current values.
|
|
69365
69597
|
* @param options The options for setting the style of the map control.
|
|
69598
|
+
* @param diff [true] If false, forces a 'full' style update, removing the current style and building the given one instead of attempting a diff-based update. Defaults to true.
|
|
69366
69599
|
*/
|
|
69367
|
-
Map.prototype.setStyle = function (options) {
|
|
69600
|
+
Map.prototype.setStyle = function (options, diff) {
|
|
69601
|
+
if (diff === void 0) { diff = true; }
|
|
69368
69602
|
// This option may only be set when initializing the map.
|
|
69369
69603
|
// The delete operation will handle non-exist property.
|
|
69370
69604
|
delete options.preserveDrawingBuffer;
|
|
@@ -69402,7 +69636,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69402
69636
|
// if the language is changed, then either those delegates need changed
|
|
69403
69637
|
// or the styledata event manually invoked.
|
|
69404
69638
|
this.styleOptions = newOptions;
|
|
69405
|
-
this._setStyleComponents(newOptions);
|
|
69639
|
+
this._setStyleComponents(newOptions, diff);
|
|
69406
69640
|
};
|
|
69407
69641
|
/**
|
|
69408
69642
|
* Returns the map control's current style settings.
|
|
@@ -70064,10 +70298,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70064
70298
|
/**
|
|
70065
70299
|
* @internal
|
|
70066
70300
|
*/
|
|
70067
|
-
Map.prototype._rebuildStyle = function () {
|
|
70301
|
+
Map.prototype._rebuildStyle = function (diff) {
|
|
70302
|
+
if (diff === void 0) { diff = true; }
|
|
70068
70303
|
return __awaiter(this, void 0, void 0, function () {
|
|
70069
70304
|
return __generator(this, function (_a) {
|
|
70070
|
-
this.styles.setStyle(this.styleOptions);
|
|
70305
|
+
this.styles.setStyle(this.styleOptions, diff);
|
|
70071
70306
|
this.imageSprite._restoreImages();
|
|
70072
70307
|
return [2 /*return*/];
|
|
70073
70308
|
});
|
|
@@ -70148,7 +70383,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70148
70383
|
requestParams.url = requestParams.url.replace(constants.domainPlaceHolder, this.serviceOptions.domain);
|
|
70149
70384
|
}
|
|
70150
70385
|
}
|
|
70151
|
-
(
|
|
70386
|
+
if (requestParams.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase()) ||
|
|
70387
|
+
requestParams.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase())) {
|
|
70388
|
+
(_a = this.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
|
|
70389
|
+
}
|
|
70152
70390
|
if (url.includes(constants.languagePlaceHolder)) {
|
|
70153
70391
|
requestParams.url = requestParams.url.replace(constants.languagePlaceHolder, this.styleOptions.language);
|
|
70154
70392
|
}
|
|
@@ -70175,8 +70413,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70175
70413
|
* Removes sources and layers that aren't used by the new style or any remaining layers.
|
|
70176
70414
|
* @private
|
|
70177
70415
|
*/
|
|
70178
|
-
Map.prototype._setStyleComponents = function (styleOptions) {
|
|
70416
|
+
Map.prototype._setStyleComponents = function (styleOptions, diff) {
|
|
70179
70417
|
var _this = this;
|
|
70418
|
+
if (diff === void 0) { diff = true; }
|
|
70180
70419
|
if (this.removed) {
|
|
70181
70420
|
return;
|
|
70182
70421
|
}
|
|
@@ -70186,7 +70425,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70186
70425
|
_this.styleOptions.style = styleSet.defaultStyle;
|
|
70187
70426
|
}
|
|
70188
70427
|
_this.styleOptions = styleOptions;
|
|
70189
|
-
_this._rebuildStyle();
|
|
70428
|
+
_this._rebuildStyle(diff);
|
|
70190
70429
|
});
|
|
70191
70430
|
return;
|
|
70192
70431
|
};
|
|
@@ -70232,7 +70471,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70232
70471
|
var w = BoundingBox.getWest(bounds);
|
|
70233
70472
|
var n = BoundingBox.getNorth(bounds);
|
|
70234
70473
|
var e = BoundingBox.getEast(bounds);
|
|
70235
|
-
if (
|
|
70474
|
+
if (!isFinite(s) || !isFinite(w) || !isFinite(n) || !isFinite(e)) {
|
|
70236
70475
|
throw new Error("The bounds specified are invalid: [" + bounds + "]");
|
|
70237
70476
|
}
|
|
70238
70477
|
while (w > e) {
|