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.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;
|
|
@@ -67930,7 +67994,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
67930
67994
|
path: "search/address/reverse/json",
|
|
67931
67995
|
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 }))
|
|
67932
67996
|
};
|
|
67933
|
-
return new Url((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(urlOptions)).get();
|
|
67997
|
+
return new Url(((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(urlOptions)) || urlOptions).get();
|
|
67934
67998
|
};
|
|
67935
67999
|
return NearbyGeographySearchService;
|
|
67936
68000
|
}());
|
|
@@ -69134,8 +69198,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69134
69198
|
_this.createMapKeyBindingInfo();
|
|
69135
69199
|
_this.map.getMapContainer().setAttribute("role", "application");
|
|
69136
69200
|
_this.map.getMapContainer().setAttribute("aria-label", "Map Application");
|
|
69201
|
+
_this.map.getCanvasContainer().setAttribute("aria-live", "polite");
|
|
69202
|
+
_this.map.getCanvasContainer().setAttribute("aria-describedby", "atlas-map-state atlas-map-style");
|
|
69137
69203
|
_this.map.getCanvas().setAttribute("aria-label", "Interactive Map");
|
|
69138
|
-
_this.map.getCanvas().setAttribute("aria-describedby", "atlas-map-
|
|
69204
|
+
_this.map.getCanvas().setAttribute("aria-describedby", "atlas-map-shortcuts");
|
|
69139
69205
|
_this.map.getCanvas().setAttribute("alt", "Interactive Map");
|
|
69140
69206
|
};
|
|
69141
69207
|
this.removeFromMap = function () {
|
|
@@ -69157,10 +69223,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69157
69223
|
delete _this.atlasMapStyleInfo;
|
|
69158
69224
|
_this.map.getMapContainer().removeAttribute("role");
|
|
69159
69225
|
_this.map.getMapContainer().removeAttribute("aria-label");
|
|
69226
|
+
_this.map.getCanvasContainer().removeAttribute("aria-live");
|
|
69227
|
+
_this.map.getCanvasContainer().removeAttribute("aria-describedby");
|
|
69160
69228
|
_this.map.getCanvas().removeAttribute("aria-label");
|
|
69161
69229
|
_this.map.getCanvas().removeAttribute("aria-describedby");
|
|
69162
69230
|
_this.map.getCanvas().removeAttribute("alt");
|
|
69163
|
-
_this.map.events.remove("
|
|
69231
|
+
_this.map.events.remove("stylechanged", _this.updateMapStyle);
|
|
69164
69232
|
};
|
|
69165
69233
|
this.createMapKeyBindingInfo = function () {
|
|
69166
69234
|
_this.atlasMapKeyBindings = document.createElement("div");
|
|
@@ -69185,7 +69253,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69185
69253
|
"Jump focus to the map: Escape."
|
|
69186
69254
|
].join("\n");
|
|
69187
69255
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapKeyBindings);
|
|
69188
|
-
_this.atlasMapKeyBindings.setAttribute("aria-live", "polite");
|
|
69189
69256
|
var baseShortcutKeyCodes = [
|
|
69190
69257
|
// - (zoom out)
|
|
69191
69258
|
189,
|
|
@@ -69217,7 +69284,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69217
69284
|
_this.atlasMapLiveStateInfo.id = "atlas-map-state";
|
|
69218
69285
|
_this.atlasMapLiveStateInfo.classList.add("hidden-accessible-element");
|
|
69219
69286
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapLiveStateInfo);
|
|
69220
|
-
_this.atlasMapLiveStateInfo.setAttribute("aria-live", "assertive");
|
|
69221
69287
|
}
|
|
69222
69288
|
};
|
|
69223
69289
|
this.initializeMapStyleInfo = function () {
|
|
@@ -69226,10 +69292,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69226
69292
|
_this.atlasMapStyleInfo.setAttribute("aria-hidden", "true");
|
|
69227
69293
|
_this.atlasMapStyleInfo.id = "atlas-map-style";
|
|
69228
69294
|
_this.atlasMapStyleInfo.classList.add("hidden-accessible-element");
|
|
69229
|
-
_this.updateMapStyle
|
|
69230
|
-
_this.map.events.add("styledata", _this.updateMapStyle);
|
|
69295
|
+
_this.map.events.add("stylechanged", _this.updateMapStyle);
|
|
69231
69296
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapStyleInfo);
|
|
69232
|
-
_this.atlasMapStyleInfo.setAttribute("aria-live", "polite");
|
|
69233
69297
|
};
|
|
69234
69298
|
this.updateMapStyle = function () {
|
|
69235
69299
|
_this.atlasMapStyleInfo.innerHTML = "<p>Map style: " + _this.map.getStyle().style + ".</p>";
|
|
@@ -69527,15 +69591,106 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69527
69591
|
_this.map.layers.add(_this.incidentLayer, "labels");
|
|
69528
69592
|
}
|
|
69529
69593
|
//Create a popup but leave it closed so we can update it and display it later.
|
|
69530
|
-
_this.
|
|
69594
|
+
_this.clickPopup = new Popup({
|
|
69531
69595
|
position: [0, 0],
|
|
69532
69596
|
pixelOffset: [0, -18]
|
|
69533
69597
|
});
|
|
69534
69598
|
_this.map.addEventListener("mouseover", _this.incidentLayerName, _this.cursorToPointer);
|
|
69535
69599
|
_this.map.addEventListener("mouseleave", _this.incidentLayerName, _this.cursorToDefault);
|
|
69536
69600
|
_this.map.addEventListener("click", _this.incidentLayerName, _this.openIncidentPopup);
|
|
69601
|
+
_this.map.events.addOnce('idle', _this.setAccessiblePopups);
|
|
69602
|
+
_this.map.events.add('moveend', _this.setAccessiblePopups);
|
|
69537
69603
|
};
|
|
69604
|
+
this.accessiblePopups = [];
|
|
69605
|
+
this.setAccessiblePopups = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
69606
|
+
var features, localizedStrings, createPopup, insertHiddenBefore, insertHiddenInFront, addHidden;
|
|
69607
|
+
var _this = this;
|
|
69608
|
+
return __generator(this, function (_a) {
|
|
69609
|
+
switch (_a.label) {
|
|
69610
|
+
case 0:
|
|
69611
|
+
this.accessiblePopups.forEach(function (popup) { return popup.remove(); });
|
|
69612
|
+
this.accessiblePopups = [];
|
|
69613
|
+
features = this.map.layers.getRenderedShapes(this.map.getCamera().bounds, this.incidentLayer);
|
|
69614
|
+
return [4 /*yield*/, this.map._getLocalizedStrings()];
|
|
69615
|
+
case 1:
|
|
69616
|
+
localizedStrings = _a.sent();
|
|
69617
|
+
createPopup = function (features, idx) {
|
|
69618
|
+
var incidentFeature = features[idx];
|
|
69619
|
+
var incidentPosition = incidentFeature.geometry.coordinates;
|
|
69620
|
+
var point = new Point(new Position(incidentPosition[0], incidentPosition[1]));
|
|
69621
|
+
var incident = new Incident(incidentFeature.properties, point, localizedStrings);
|
|
69622
|
+
var popup = IncidentPopupFactory.build(incident, _this.incidentLanguage);
|
|
69623
|
+
var element = popup.getPopupContainer();
|
|
69624
|
+
element.addEventListener('focusin', function (event) {
|
|
69625
|
+
// side effects: clear other managed popups
|
|
69626
|
+
_this.clickPopup.remove();
|
|
69627
|
+
_this.accessiblePopups.filter(function (p) { return p !== popup; }).forEach(function (popup) { return popup.remove(); });
|
|
69628
|
+
// insert previous and next popups
|
|
69629
|
+
if (idx - 1 >= 0) {
|
|
69630
|
+
insertHiddenBefore(popup, createPopup(features, idx - 1));
|
|
69631
|
+
}
|
|
69632
|
+
if (idx + 1 < features.length) {
|
|
69633
|
+
addHidden(createPopup(features, idx + 1));
|
|
69634
|
+
}
|
|
69635
|
+
// if we are on boundaries: add the first / last popup
|
|
69636
|
+
// to maintain popups on full page navigation cycle
|
|
69637
|
+
if (idx >= 2 && idx == features.length - 1) {
|
|
69638
|
+
insertHiddenInFront(createPopup(features, 0));
|
|
69639
|
+
}
|
|
69640
|
+
if (idx == 0 && features.length >= 2) {
|
|
69641
|
+
addHidden(createPopup(features, features.length - 1));
|
|
69642
|
+
}
|
|
69643
|
+
});
|
|
69644
|
+
if (idx == features.length - 1) {
|
|
69645
|
+
element.addEventListener('focusout', function (event) {
|
|
69646
|
+
// close the popup if we detect the focus moving away from the page (relatedTarget === null)
|
|
69647
|
+
// (will remain open otherwise)
|
|
69648
|
+
if (event.relatedTarget === null) {
|
|
69649
|
+
popup.close();
|
|
69650
|
+
}
|
|
69651
|
+
});
|
|
69652
|
+
}
|
|
69653
|
+
_this.accessiblePopups.push(popup);
|
|
69654
|
+
return popup;
|
|
69655
|
+
};
|
|
69656
|
+
insertHiddenBefore = function (base, toInsert) {
|
|
69657
|
+
toInsert.open(_this.map);
|
|
69658
|
+
toInsert.close();
|
|
69659
|
+
var containerToSwapIn = toInsert.getPopupContainer();
|
|
69660
|
+
var baseContainer = base.getPopupContainer();
|
|
69661
|
+
baseContainer.parentElement.insertBefore(containerToSwapIn, baseContainer);
|
|
69662
|
+
};
|
|
69663
|
+
insertHiddenInFront = function (toInsert) {
|
|
69664
|
+
toInsert.open(_this.map);
|
|
69665
|
+
toInsert.close();
|
|
69666
|
+
var containerToSwapIn = toInsert.getPopupContainer();
|
|
69667
|
+
var parent = containerToSwapIn.parentElement;
|
|
69668
|
+
parent.insertBefore(containerToSwapIn, parent.firstElementChild);
|
|
69669
|
+
};
|
|
69670
|
+
addHidden = function (popup) {
|
|
69671
|
+
popup.open(_this.map);
|
|
69672
|
+
popup.close();
|
|
69673
|
+
};
|
|
69674
|
+
if (features.length > 0) {
|
|
69675
|
+
addHidden(createPopup(features, 0));
|
|
69676
|
+
}
|
|
69677
|
+
if (features.length > 1) {
|
|
69678
|
+
addHidden(createPopup(features, features.length - 1));
|
|
69679
|
+
}
|
|
69680
|
+
return [2 /*return*/];
|
|
69681
|
+
}
|
|
69682
|
+
});
|
|
69683
|
+
}); };
|
|
69538
69684
|
this.removeFromMap = function () {
|
|
69685
|
+
var _a;
|
|
69686
|
+
_this.map.removeEventListener("mouseover", _this.incidentLayerName, _this.cursorToPointer);
|
|
69687
|
+
_this.map.removeEventListener("mouseleave", _this.incidentLayerName, _this.cursorToDefault);
|
|
69688
|
+
_this.map.removeEventListener("click", _this.incidentLayerName, _this.openIncidentPopup);
|
|
69689
|
+
_this.map.events.remove('idle', _this.setAccessiblePopups);
|
|
69690
|
+
_this.map.events.remove('moveend', _this.setAccessiblePopups);
|
|
69691
|
+
_this.accessiblePopups.forEach(function (popup) { return popup.remove(); });
|
|
69692
|
+
_this.accessiblePopups = [];
|
|
69693
|
+
(_a = _this.clickPopup) === null || _a === void 0 ? void 0 : _a.remove();
|
|
69539
69694
|
if (_this.map.layers.getLayerById(_this.incidentLayerName) != null) {
|
|
69540
69695
|
_this.map.layers.remove(_this.incidentLayerName);
|
|
69541
69696
|
}
|
|
@@ -69550,14 +69705,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69550
69705
|
_this.map.getCanvas().style.cursor = "";
|
|
69551
69706
|
};
|
|
69552
69707
|
this.openIncidentPopup = function (data) {
|
|
69553
|
-
_this.
|
|
69708
|
+
_this.clickPopup.remove();
|
|
69709
|
+
_this.accessiblePopups.forEach(function (popup) { return popup.close(); });
|
|
69554
69710
|
var incidentPosition = data.position;
|
|
69555
69711
|
var incidentFeature = data.features[0];
|
|
69556
69712
|
_this.map._getLocalizedStrings().then(function (localizedStrings) {
|
|
69557
69713
|
var point = new Point(new Position(incidentPosition[0], incidentPosition[1]));
|
|
69558
69714
|
var incident = new Incident(incidentFeature.properties, point, localizedStrings);
|
|
69559
|
-
_this.
|
|
69560
|
-
_this.
|
|
69715
|
+
_this.clickPopup = IncidentPopupFactory.build(incident, _this.incidentLanguage);
|
|
69716
|
+
_this.clickPopup.open(_this.map);
|
|
69717
|
+
var element = _this.clickPopup.getPopupContainer();
|
|
69718
|
+
// ensures popup is closed on tabbing when the focus is moved away from the window
|
|
69719
|
+
element.addEventListener('focusout', function (event) {
|
|
69720
|
+
if (event.relatedTarget === null) {
|
|
69721
|
+
_this.clickPopup.close();
|
|
69722
|
+
}
|
|
69723
|
+
});
|
|
69561
69724
|
});
|
|
69562
69725
|
};
|
|
69563
69726
|
this.map = map;
|
|
@@ -75265,17 +75428,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75265
75428
|
* Triggers the user provided function to fetch the token and stores it.
|
|
75266
75429
|
* @internal
|
|
75267
75430
|
*/
|
|
75268
|
-
this._triggerTokenFetch = function () {
|
|
75431
|
+
this._triggerTokenFetch = function (isAnonymousAuth) {
|
|
75432
|
+
if (isAnonymousAuth === void 0) { isAnonymousAuth = false; }
|
|
75269
75433
|
return new Promise(function (resolve, reject) {
|
|
75434
|
+
if (typeof _this.options.getToken !== "function") {
|
|
75435
|
+
reject(new Error("Token cannot be " + (isAnonymousAuth ? 'fetched' : 'renewed') + " because getToken was not set or is not a function."));
|
|
75436
|
+
return;
|
|
75437
|
+
}
|
|
75270
75438
|
_this.options.getToken(function (token) {
|
|
75271
75439
|
try {
|
|
75272
75440
|
// Try to get the timeout first as this will guarantee the token is correctly formatted.
|
|
75273
75441
|
var timeout = _this._getTokenExpiry(token) - AuthenticationManager.constants.tokenRefreshClockSkew;
|
|
75274
|
-
_this.
|
|
75275
|
-
|
|
75276
|
-
// @ts-ignore
|
|
75277
|
-
// tslint:disable-next-line: no-string-based-set-timeout
|
|
75278
|
-
_this.tokenTimeOutHandle = setTimeout(_this._triggerTokenFetch, timeout * 1000);
|
|
75442
|
+
_this._storeToken(token);
|
|
75443
|
+
_this._setTimeoutTokenFetch(timeout);
|
|
75279
75444
|
resolve();
|
|
75280
75445
|
}
|
|
75281
75446
|
catch (_a) {
|
|
@@ -75286,6 +75451,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75286
75451
|
}, _this.map);
|
|
75287
75452
|
});
|
|
75288
75453
|
};
|
|
75454
|
+
/**
|
|
75455
|
+
* Create a timer to trigger the user provided function to fetch the token.
|
|
75456
|
+
* @param seconds delay in seconds
|
|
75457
|
+
* @internal
|
|
75458
|
+
*/
|
|
75459
|
+
this._setTimeoutTokenFetch = function (seconds) {
|
|
75460
|
+
clearTimeout(_this.tokenTimeOutHandle); // Clear the previous refresh timeout in case it hadn't triggered yet.
|
|
75461
|
+
// @ts-ignore
|
|
75462
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
75463
|
+
_this.tokenTimeOutHandle = setTimeout(_this._triggerTokenFetch, Math.min(seconds * 1000, 0x7fffffff) // setTimeout will fire immediately if the delay is greater than 2^31-1.
|
|
75464
|
+
);
|
|
75465
|
+
};
|
|
75289
75466
|
var serviceOptions = map.getServiceOptions();
|
|
75290
75467
|
this.options = serviceOptions.authOptions;
|
|
75291
75468
|
this.sessionId = serviceOptions.sessionId;
|
|
@@ -75327,6 +75504,28 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75327
75504
|
}
|
|
75328
75505
|
else if (_this.options.authType === exports.AuthenticationType.anonymous) {
|
|
75329
75506
|
// Anonymous authentication, just call the users provided callback.
|
|
75507
|
+
resolve(_this._triggerTokenFetch(true));
|
|
75508
|
+
}
|
|
75509
|
+
else if (_this.options.authType === exports.AuthenticationType.sas) {
|
|
75510
|
+
if (_this.options.sasToken) {
|
|
75511
|
+
var expiresIn = -1;
|
|
75512
|
+
try {
|
|
75513
|
+
expiresIn = _this._getTokenExpiry(_this.options.sasToken);
|
|
75514
|
+
}
|
|
75515
|
+
catch (_a) {
|
|
75516
|
+
reject(new Error("An invalid sasToken was provided."));
|
|
75517
|
+
return;
|
|
75518
|
+
}
|
|
75519
|
+
if (expiresIn > AuthenticationManager.constants.tokenRefreshClockSkew) {
|
|
75520
|
+
// Save the initial token
|
|
75521
|
+
_this._storeToken(_this.options.sasToken);
|
|
75522
|
+
// Create a timer to refresh the token
|
|
75523
|
+
_this._setTimeoutTokenFetch(expiresIn - AuthenticationManager.constants.tokenRefreshClockSkew);
|
|
75524
|
+
resolve();
|
|
75525
|
+
return;
|
|
75526
|
+
}
|
|
75527
|
+
}
|
|
75528
|
+
// Call the users provided callback to fetch the token.
|
|
75330
75529
|
resolve(_this._triggerTokenFetch());
|
|
75331
75530
|
}
|
|
75332
75531
|
else {
|
|
@@ -75452,8 +75651,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75452
75651
|
}
|
|
75453
75652
|
return token_1;
|
|
75454
75653
|
}
|
|
75455
|
-
else if (this.options.authType === exports.AuthenticationType.anonymous
|
|
75456
|
-
|
|
75654
|
+
else if (this.options.authType === exports.AuthenticationType.anonymous
|
|
75655
|
+
|| this.options.authType === exports.AuthenticationType.sas) {
|
|
75656
|
+
var token = this._getItem(AuthenticationManager.constants.storage.tokenKey);
|
|
75457
75657
|
if (!token) {
|
|
75458
75658
|
// Cached Token not present, invoke the user provided callback function to fetch function
|
|
75459
75659
|
this._triggerTokenFetch();
|
|
@@ -75468,7 +75668,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75468
75668
|
}
|
|
75469
75669
|
else if (expiresIn <= 0) {
|
|
75470
75670
|
// token renew failed and dont have a token.
|
|
75471
|
-
this._saveItem(AuthenticationManager.constants.storage.
|
|
75671
|
+
this._saveItem(AuthenticationManager.constants.storage.tokenKey, "");
|
|
75472
75672
|
throw new Error(AuthenticationManager.constants.errors.tokenExpired);
|
|
75473
75673
|
}
|
|
75474
75674
|
}
|
|
@@ -75497,9 +75697,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75497
75697
|
* @param token token fetched from the user's server endpoint
|
|
75498
75698
|
* @internal
|
|
75499
75699
|
*/
|
|
75500
|
-
AuthenticationManager.prototype.
|
|
75700
|
+
AuthenticationManager.prototype._storeToken = function (token) {
|
|
75501
75701
|
// Store the value
|
|
75502
|
-
this._saveItem(AuthenticationManager.constants.storage.
|
|
75702
|
+
this._saveItem(AuthenticationManager.constants.storage.tokenKey, token);
|
|
75503
75703
|
var tokenEvent = {
|
|
75504
75704
|
map: this.map,
|
|
75505
75705
|
type: AuthenticationManager.constants.events.tokenAcquired
|
|
@@ -75588,7 +75788,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75588
75788
|
}
|
|
75589
75789
|
};
|
|
75590
75790
|
/**
|
|
75591
|
-
* Return the number of
|
|
75791
|
+
* Return the number of seconds since 1970/01/01
|
|
75592
75792
|
* @ignore
|
|
75593
75793
|
*/
|
|
75594
75794
|
AuthenticationManager.prototype._getCurrentTime = function () {
|
|
@@ -75607,6 +75807,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75607
75807
|
request.headers[constants.msClientIdHeaderName] = this.options.clientId;
|
|
75608
75808
|
request.headers[constants.authorizationHeaderName] = constants.authorizationTokenPrefix + token;
|
|
75609
75809
|
break;
|
|
75810
|
+
case exports.AuthenticationType.sas:
|
|
75811
|
+
request.headers[constants.authorizationHeaderName] = constants.jwtSasPrefix + token;
|
|
75812
|
+
break;
|
|
75610
75813
|
case exports.AuthenticationType.subscriptionKey:
|
|
75611
75814
|
request.headers["subscription-key"] = token;
|
|
75612
75815
|
break;
|
|
@@ -75622,7 +75825,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75622
75825
|
// Enable localStorage for IE, as sessionStorage does not work for localhost.
|
|
75623
75826
|
preferredCacheLocation: "localStorage",
|
|
75624
75827
|
storage: {
|
|
75625
|
-
|
|
75828
|
+
tokenKey: "access.token.key",
|
|
75626
75829
|
testStorageKey: "testStorage"
|
|
75627
75830
|
},
|
|
75628
75831
|
events: {
|
|
@@ -78207,6 +78410,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78207
78410
|
* @default true
|
|
78208
78411
|
*/
|
|
78209
78412
|
_this.showLogo = true;
|
|
78413
|
+
/**
|
|
78414
|
+
* Specifies if the map should display labels
|
|
78415
|
+
* @default true
|
|
78416
|
+
*/
|
|
78417
|
+
_this.showLabels = true;
|
|
78210
78418
|
/**
|
|
78211
78419
|
* Additional custom attribution appended to map attribution.
|
|
78212
78420
|
* Default `undefined`
|
|
@@ -78778,6 +78986,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78778
78986
|
}
|
|
78779
78987
|
StyleManager.prototype.updateIndoorState = function (theme, tilesetId) {
|
|
78780
78988
|
var _this = this;
|
|
78989
|
+
var _a;
|
|
78781
78990
|
var styleset = this.map.styles.getMapConfiguration();
|
|
78782
78991
|
if (styleset) {
|
|
78783
78992
|
this.preservedPreindoorStyleset = styleset;
|
|
@@ -78787,6 +78996,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78787
78996
|
this.map.styles.setMapConfiguration("defaultIndoor_" + tilesetId, styleset === 'microsoft-maps:default' ? desiredIndoorStyle : undefined);
|
|
78788
78997
|
}
|
|
78789
78998
|
else {
|
|
78999
|
+
var didTilesetIdChange_1 = ((_a = this.indoorState) === null || _a === void 0 ? void 0 : _a.tilesetId) !== tilesetId;
|
|
78790
79000
|
this.indoorState = {
|
|
78791
79001
|
tilesetId: tilesetId,
|
|
78792
79002
|
theme: theme
|
|
@@ -78800,7 +79010,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78800
79010
|
var targetStylePrefix = currentStyle + "_indoor";
|
|
78801
79011
|
var candidateStyle = definitions.styles.find(function (style) { return style.name.startsWith(targetStylePrefix); });
|
|
78802
79012
|
if (candidateStyle) {
|
|
78803
|
-
|
|
79013
|
+
// 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
|
|
79014
|
+
_this.map.setStyle({ style: candidateStyle.name }, !didTilesetIdChange_1);
|
|
78804
79015
|
}
|
|
78805
79016
|
});
|
|
78806
79017
|
}
|
|
@@ -78838,7 +79049,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78838
79049
|
return baseName in styleNamesMap ? styleNamesMap[baseName] : baseName;
|
|
78839
79050
|
};
|
|
78840
79051
|
if (!this.serviceOptions.styleSet) {
|
|
78841
|
-
newPromise = new HijackablePromise(this._request(this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions").then(function (definitions) { return ({
|
|
79052
|
+
newPromise = new HijackablePromise(this._request(this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", { version: this.serviceOptions.styleDefinitionsVersion }).then(function (definitions) { return ({
|
|
78842
79053
|
version: isNaN(definitions.version) ? 0 : parseFloat(definitions.version),
|
|
78843
79054
|
defaultStyle: definitions.defaultStyle,
|
|
78844
79055
|
styles: definitions.styles
|
|
@@ -78865,9 +79076,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78865
79076
|
domain: _this.serviceOptions.staticAssetsDomain,
|
|
78866
79077
|
path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
|
|
78867
79078
|
queryParams: {
|
|
78868
|
-
|
|
78869
|
-
// thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
|
|
78870
|
-
//language: styleOptions.language
|
|
79079
|
+
styleVersion: _this.serviceOptions.styleDefinitionsVersion,
|
|
78871
79080
|
},
|
|
78872
79081
|
protocol: "https"
|
|
78873
79082
|
}).toString(),
|
|
@@ -78911,10 +79120,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78911
79120
|
/**
|
|
78912
79121
|
* @internal
|
|
78913
79122
|
*/
|
|
78914
|
-
StyleManager.prototype.setStyle = function (styleOptions) {
|
|
79123
|
+
StyleManager.prototype.setStyle = function (styleOptions, diff) {
|
|
79124
|
+
if (diff === void 0) { diff = true; }
|
|
78915
79125
|
try {
|
|
78916
79126
|
this.map._getMap().setStyle(this.getStyle(styleOptions), {
|
|
78917
|
-
diff:
|
|
79127
|
+
diff: diff,
|
|
78918
79128
|
stylePatch: this._stylePatch.bind(this),
|
|
78919
79129
|
validate: this.serviceOptions.validateStyle
|
|
78920
79130
|
});
|
|
@@ -79025,7 +79235,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
79025
79235
|
currentLayerGroupLayers = [];
|
|
79026
79236
|
};
|
|
79027
79237
|
nextStyle.layers.forEach(function (nextLayer) {
|
|
79028
|
-
var _a, _b, _c;
|
|
79238
|
+
var _a, _b, _c, _d, _e;
|
|
79029
79239
|
var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer);
|
|
79030
79240
|
currentLayerGroupId = currentLayerGroupId ? currentLayerGroupId : layerGroup;
|
|
79031
79241
|
// Set visiblity of fill-extrusion layers according to StyleOptions.showBuildingModels
|
|
@@ -79047,6 +79257,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
79047
79257
|
nextLayer.layout.visibility = "visible";
|
|
79048
79258
|
}
|
|
79049
79259
|
}
|
|
79260
|
+
// Set visibility of labels
|
|
79261
|
+
var isLabelLayerGroup = layerGroup === 'labels' || layerGroup === 'labels_places' || layerGroup === 'labels_indoor';
|
|
79262
|
+
if (isLabelLayerGroup && nextLayer.type === 'symbol') {
|
|
79263
|
+
if (styleOptions.showLabels) {
|
|
79264
|
+
updateLayoutProperty(nextLayer.id, "visibility", "visible");
|
|
79265
|
+
nextLayer.layout = (_d = nextLayer.layout) !== null && _d !== void 0 ? _d : {};
|
|
79266
|
+
nextLayer.layout.visibility = "visible";
|
|
79267
|
+
}
|
|
79268
|
+
else {
|
|
79269
|
+
updateLayoutProperty(nextLayer.id, "visibility", "none");
|
|
79270
|
+
nextLayer.layout = (_e = nextLayer.layout) !== null && _e !== void 0 ? _e : {};
|
|
79271
|
+
nextLayer.layout.visibility = "none";
|
|
79272
|
+
}
|
|
79273
|
+
}
|
|
79050
79274
|
// Once this _stylePatch returns control to maplibre the next style will be applied immediately in the same context.
|
|
79051
79275
|
// To avoid potential data races update LayerManager with new a new set of FundamentalMapLayers from here instead of
|
|
79052
79276
|
// waiting for a styledata.load event to trigger a sync in a different context.
|
|
@@ -79109,7 +79333,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
79109
79333
|
// If there was a previous styledata change event attached, remove it.
|
|
79110
79334
|
// When the sprite url changes between style changes then mapbox can't perform the diff
|
|
79111
79335
|
// In such cases it recalculate the style again. Removing previous attached
|
|
79112
|
-
// event
|
|
79336
|
+
// event listener makes sure that style changed event is not fired twice in these cases.
|
|
79113
79337
|
this.map.events.remove("styledata", this._onStyleData);
|
|
79114
79338
|
this.map.events.addOnce("styledata", this._onStyleData);
|
|
79115
79339
|
};
|
|
@@ -79138,8 +79362,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
79138
79362
|
if (url.includes(constants.styleResourcePlaceholder)) {
|
|
79139
79363
|
params.url = params.url.replace(constants.styleResourcePlaceholder, constants.styleResourcePath);
|
|
79140
79364
|
}
|
|
79141
|
-
params.url
|
|
79142
|
-
|
|
79365
|
+
if (params.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase()) ||
|
|
79366
|
+
params.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase())) {
|
|
79367
|
+
// Only add API version param for Azure maps domain requests
|
|
79368
|
+
var targetUrl = new URL(params.url);
|
|
79369
|
+
if (!targetUrl.searchParams.get(constants.apiVersionQueryParameter)) {
|
|
79370
|
+
targetUrl.searchParams.set(constants.apiVersionQueryParameter, this.serviceOptions.styleAPIVersion);
|
|
79371
|
+
params.url = targetUrl.href;
|
|
79372
|
+
}
|
|
79373
|
+
(_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(params);
|
|
79374
|
+
}
|
|
79143
79375
|
};
|
|
79144
79376
|
/**
|
|
79145
79377
|
* Fetches a json resource at the specified domain and path.
|
|
@@ -79547,8 +79779,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
79547
79779
|
/**
|
|
79548
79780
|
* Set the map control's style options. Any options not specified will default to their current values.
|
|
79549
79781
|
* @param options The options for setting the style of the map control.
|
|
79782
|
+
* @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.
|
|
79550
79783
|
*/
|
|
79551
|
-
Map.prototype.setStyle = function (options) {
|
|
79784
|
+
Map.prototype.setStyle = function (options, diff) {
|
|
79785
|
+
if (diff === void 0) { diff = true; }
|
|
79552
79786
|
// This option may only be set when initializing the map.
|
|
79553
79787
|
// The delete operation will handle non-exist property.
|
|
79554
79788
|
delete options.preserveDrawingBuffer;
|
|
@@ -79586,7 +79820,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
79586
79820
|
// if the language is changed, then either those delegates need changed
|
|
79587
79821
|
// or the styledata event manually invoked.
|
|
79588
79822
|
this.styleOptions = newOptions;
|
|
79589
|
-
this._setStyleComponents(newOptions);
|
|
79823
|
+
this._setStyleComponents(newOptions, diff);
|
|
79590
79824
|
};
|
|
79591
79825
|
/**
|
|
79592
79826
|
* Returns the map control's current style settings.
|
|
@@ -80248,10 +80482,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
80248
80482
|
/**
|
|
80249
80483
|
* @internal
|
|
80250
80484
|
*/
|
|
80251
|
-
Map.prototype._rebuildStyle = function () {
|
|
80485
|
+
Map.prototype._rebuildStyle = function (diff) {
|
|
80486
|
+
if (diff === void 0) { diff = true; }
|
|
80252
80487
|
return __awaiter(this, void 0, void 0, function () {
|
|
80253
80488
|
return __generator(this, function (_a) {
|
|
80254
|
-
this.styles.setStyle(this.styleOptions);
|
|
80489
|
+
this.styles.setStyle(this.styleOptions, diff);
|
|
80255
80490
|
this.imageSprite._restoreImages();
|
|
80256
80491
|
return [2 /*return*/];
|
|
80257
80492
|
});
|
|
@@ -80332,7 +80567,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
80332
80567
|
requestParams.url = requestParams.url.replace(constants.domainPlaceHolder, this.serviceOptions.domain);
|
|
80333
80568
|
}
|
|
80334
80569
|
}
|
|
80335
|
-
(
|
|
80570
|
+
if (requestParams.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase()) ||
|
|
80571
|
+
requestParams.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase())) {
|
|
80572
|
+
(_a = this.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
|
|
80573
|
+
}
|
|
80336
80574
|
if (url.includes(constants.languagePlaceHolder)) {
|
|
80337
80575
|
requestParams.url = requestParams.url.replace(constants.languagePlaceHolder, this.styleOptions.language);
|
|
80338
80576
|
}
|
|
@@ -80359,8 +80597,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
80359
80597
|
* Removes sources and layers that aren't used by the new style or any remaining layers.
|
|
80360
80598
|
* @private
|
|
80361
80599
|
*/
|
|
80362
|
-
Map.prototype._setStyleComponents = function (styleOptions) {
|
|
80600
|
+
Map.prototype._setStyleComponents = function (styleOptions, diff) {
|
|
80363
80601
|
var _this = this;
|
|
80602
|
+
if (diff === void 0) { diff = true; }
|
|
80364
80603
|
if (this.removed) {
|
|
80365
80604
|
return;
|
|
80366
80605
|
}
|
|
@@ -80370,7 +80609,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
80370
80609
|
_this.styleOptions.style = styleSet.defaultStyle;
|
|
80371
80610
|
}
|
|
80372
80611
|
_this.styleOptions = styleOptions;
|
|
80373
|
-
_this._rebuildStyle();
|
|
80612
|
+
_this._rebuildStyle(diff);
|
|
80374
80613
|
});
|
|
80375
80614
|
return;
|
|
80376
80615
|
};
|
|
@@ -80416,7 +80655,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
80416
80655
|
var w = BoundingBox.getWest(bounds);
|
|
80417
80656
|
var n = BoundingBox.getNorth(bounds);
|
|
80418
80657
|
var e = BoundingBox.getEast(bounds);
|
|
80419
|
-
if (
|
|
80658
|
+
if (!isFinite(s) || !isFinite(w) || !isFinite(n) || !isFinite(e)) {
|
|
80420
80659
|
throw new Error("The bounds specified are invalid: [" + bounds + "]");
|
|
80421
80660
|
}
|
|
80422
80661
|
while (w > e) {
|