azure-maps-control 2.1.3 → 2.1.8
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.js +498 -171
- package/dist/atlas-core.min.js +1 -1
- package/dist/atlas.css +184 -21
- package/dist/atlas.js +498 -171
- package/dist/atlas.min.css +1 -1
- package/dist/atlas.min.js +1 -1
- package/package.json +97 -78
- package/thirdpartynotices.txt +0 -0
- package/typings/index.d.ts +55 -4
package/dist/atlas.js
CHANGED
|
@@ -77,7 +77,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
var azuremapsMaplibreGlUnminified = createCommonjsModule(function (module, exports) {
|
|
80
|
-
/* The Azure Maps fork of MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v1.14.0-
|
|
80
|
+
/* The Azure Maps fork of MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v1.14.0-rc4/LICENSE.txt */
|
|
81
81
|
(function (global, factory) {
|
|
82
82
|
module.exports = factory() ;
|
|
83
83
|
}(commonjsGlobal, (function () {
|
|
@@ -109,7 +109,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
109
109
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
var version = "1.14.0-
|
|
112
|
+
var version = "1.14.0-rc4";
|
|
113
113
|
|
|
114
114
|
var unitbezier = UnitBezier;
|
|
115
115
|
function UnitBezier(p1x, p1y, p2x, p2y) {
|
|
@@ -33075,7 +33075,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33075
33075
|
}
|
|
33076
33076
|
};
|
|
33077
33077
|
Style.prototype.update = function update(parameters) {
|
|
33078
|
-
if (!this.
|
|
33078
|
+
if (!this._loaded) {
|
|
33079
33079
|
return;
|
|
33080
33080
|
}
|
|
33081
33081
|
var changed = this._changed;
|
|
@@ -33096,7 +33096,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33096
33096
|
this._updateTilesForChangedImages();
|
|
33097
33097
|
for (var id$1 in this._updatedPaintProps) {
|
|
33098
33098
|
this._layers[id$1].updateTransitions(parameters);
|
|
33099
|
-
this.
|
|
33099
|
+
this._serializedLayers[id$1] = this._layers[id$1].serialize();
|
|
33100
33100
|
}
|
|
33101
33101
|
this.light.updateTransitions(parameters);
|
|
33102
33102
|
this._resetUpdates();
|
|
@@ -33477,7 +33477,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33477
33477
|
return;
|
|
33478
33478
|
}
|
|
33479
33479
|
layer.setLayoutProperty(name, value, options);
|
|
33480
|
-
this.
|
|
33480
|
+
this._serializedLayers[layerId] = layer.serialize();
|
|
33481
33481
|
this._updateLayer(layer);
|
|
33482
33482
|
};
|
|
33483
33483
|
Style.prototype.getLayoutProperty = function getLayoutProperty(layerId, name) {
|
|
@@ -43487,7 +43487,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43487
43487
|
return Url;
|
|
43488
43488
|
}());
|
|
43489
43489
|
|
|
43490
|
-
var version = "2.1.
|
|
43490
|
+
var version = "2.1.8";
|
|
43491
43491
|
|
|
43492
43492
|
/**
|
|
43493
43493
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -43519,6 +43519,78 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43519
43519
|
return Version;
|
|
43520
43520
|
}());
|
|
43521
43521
|
|
|
43522
|
+
/** The vertical distance between the tooltip and its target */
|
|
43523
|
+
var tooltipVerticalOffset = 4;
|
|
43524
|
+
/**
|
|
43525
|
+
* Creates tooltip content element
|
|
43526
|
+
*/
|
|
43527
|
+
var buildAccessibleTooltip = function (name) {
|
|
43528
|
+
var tooltipContent = document.createElement("span");
|
|
43529
|
+
tooltipContent.innerText = name;
|
|
43530
|
+
tooltipContent.classList.add('tooltiptext');
|
|
43531
|
+
// mimics default edge tooltip theming
|
|
43532
|
+
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
43533
|
+
tooltipContent.classList.add('dark');
|
|
43534
|
+
}
|
|
43535
|
+
var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
43536
|
+
var onThemeChange = function (e) {
|
|
43537
|
+
var isDark = e.matches;
|
|
43538
|
+
if (isDark && !tooltipContent.classList.contains('dark')) {
|
|
43539
|
+
tooltipContent.classList.add('dark');
|
|
43540
|
+
}
|
|
43541
|
+
else if (!isDark && tooltipContent.classList.contains('dark')) {
|
|
43542
|
+
tooltipContent.classList.remove('dark');
|
|
43543
|
+
}
|
|
43544
|
+
};
|
|
43545
|
+
// compensate for browsers where MediaQueryList is not derived from EventTarget (pre iOS13 Safari)
|
|
43546
|
+
if (typeof themeQuery.addEventListener === 'function') {
|
|
43547
|
+
themeQuery.addEventListener('change', function (e) { return onThemeChange(e); });
|
|
43548
|
+
}
|
|
43549
|
+
else if (typeof themeQuery.addListener === 'function') {
|
|
43550
|
+
themeQuery.addListener(function (e) { return onThemeChange(e); });
|
|
43551
|
+
}
|
|
43552
|
+
return tooltipContent;
|
|
43553
|
+
};
|
|
43554
|
+
/**
|
|
43555
|
+
* Determines tooltip position
|
|
43556
|
+
* @param tooltip tooltip to position
|
|
43557
|
+
* @param eventTarget target element that tooltip is bound to
|
|
43558
|
+
* @param forceAbsolute position:fixed is generally desired, however since tooltip is positioned alongside the target,
|
|
43559
|
+
* the runtime transform of the parent container(maplibre marker) will apply to tooltip as well, in such case resort to position:absolute
|
|
43560
|
+
*/
|
|
43561
|
+
var positionTooltip = function (tooltip, eventTarget, forceAbsolute) {
|
|
43562
|
+
if (forceAbsolute === void 0) { forceAbsolute = false; }
|
|
43563
|
+
var positionTooltip = function (event) {
|
|
43564
|
+
var buttonRect = eventTarget.getBoundingClientRect();
|
|
43565
|
+
var tooltipRect = tooltip.getBoundingClientRect();
|
|
43566
|
+
var left, top;
|
|
43567
|
+
if ((buttonRect.x + tooltipRect.width) > window.innerWidth) {
|
|
43568
|
+
// the tooltip body may not fit the visible window width
|
|
43569
|
+
left = window.innerWidth - tooltipRect.width;
|
|
43570
|
+
}
|
|
43571
|
+
else {
|
|
43572
|
+
left = buttonRect.x;
|
|
43573
|
+
}
|
|
43574
|
+
if ((buttonRect.y + buttonRect.height + tooltipRect.height + tooltipVerticalOffset) > window.innerHeight) {
|
|
43575
|
+
// the tooltip body may not fit the visible window height
|
|
43576
|
+
// position above the target element
|
|
43577
|
+
top = buttonRect.y - tooltipRect.height - tooltipVerticalOffset;
|
|
43578
|
+
}
|
|
43579
|
+
else {
|
|
43580
|
+
top = buttonRect.y + buttonRect.height + tooltipVerticalOffset;
|
|
43581
|
+
}
|
|
43582
|
+
if (forceAbsolute && eventTarget.parentElement) {
|
|
43583
|
+
var parentRect = eventTarget.parentElement ? eventTarget.parentElement.getBoundingClientRect() : null;
|
|
43584
|
+
tooltip.style.position = 'absolute';
|
|
43585
|
+
left = left - parentRect.x;
|
|
43586
|
+
top = top - parentRect.y;
|
|
43587
|
+
}
|
|
43588
|
+
tooltip.style.transform = "translate(" + left + "px, " + top + "px)";
|
|
43589
|
+
};
|
|
43590
|
+
eventTarget.addEventListener("mouseover", positionTooltip);
|
|
43591
|
+
eventTarget.addEventListener("focusin", positionTooltip);
|
|
43592
|
+
};
|
|
43593
|
+
|
|
43522
43594
|
(function (ControlPosition) {
|
|
43523
43595
|
/**
|
|
43524
43596
|
* Places the control in the top left of the map.
|
|
@@ -43856,6 +43928,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43856
43928
|
var container = this.buildContainer(map, this.options.style, "Rotation Control");
|
|
43857
43929
|
var rotationButton = this.constructRotationButton(map);
|
|
43858
43930
|
var grid = this.constructRotationGrid(map, options);
|
|
43931
|
+
var tooltip = buildAccessibleTooltip("Reset to Default Rotation");
|
|
43859
43932
|
container.addEventListener("mouseover", function (event) {
|
|
43860
43933
|
_this.lastActiveTime = _this.lastActiveTime || event.timeStamp;
|
|
43861
43934
|
_this.hasMouse = true;
|
|
@@ -43891,9 +43964,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43891
43964
|
if (options && CompassControl.InvertOrderPositions.includes(options.position)) {
|
|
43892
43965
|
container.appendChild(grid);
|
|
43893
43966
|
container.appendChild(rotationButton);
|
|
43967
|
+
container.appendChild(tooltip);
|
|
43968
|
+
positionTooltip(tooltip, rotationButton);
|
|
43894
43969
|
}
|
|
43895
43970
|
else {
|
|
43896
43971
|
container.appendChild(rotationButton);
|
|
43972
|
+
container.appendChild(tooltip);
|
|
43973
|
+
positionTooltip(tooltip, rotationButton);
|
|
43897
43974
|
container.appendChild(grid);
|
|
43898
43975
|
}
|
|
43899
43976
|
return container;
|
|
@@ -43904,13 +43981,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43904
43981
|
grid.classList.add("hidden-accessible-element");
|
|
43905
43982
|
var rotationRightButton = this.constructRightRotationButton(map);
|
|
43906
43983
|
var rotationLeftButton = this.constructLeftRotationButton(map);
|
|
43984
|
+
var tooltipLeft = buildAccessibleTooltip("Rotate Left");
|
|
43985
|
+
var tooltipRight = buildAccessibleTooltip("Rotate Right");
|
|
43907
43986
|
if (options && CompassControl.InvertOrderPositions.includes(options.position)) {
|
|
43908
43987
|
grid.appendChild(rotationRightButton);
|
|
43988
|
+
grid.appendChild(tooltipRight);
|
|
43989
|
+
positionTooltip(tooltipRight, rotationRightButton);
|
|
43909
43990
|
grid.appendChild(rotationLeftButton);
|
|
43991
|
+
grid.appendChild(tooltipLeft);
|
|
43992
|
+
positionTooltip(tooltipLeft, rotationLeftButton);
|
|
43910
43993
|
}
|
|
43911
43994
|
else {
|
|
43912
43995
|
grid.appendChild(rotationLeftButton);
|
|
43996
|
+
grid.appendChild(tooltipLeft);
|
|
43997
|
+
positionTooltip(tooltipLeft, rotationLeftButton);
|
|
43913
43998
|
grid.appendChild(rotationRightButton);
|
|
43999
|
+
grid.appendChild(tooltipRight);
|
|
44000
|
+
positionTooltip(tooltipRight, rotationRightButton);
|
|
43914
44001
|
}
|
|
43915
44002
|
return grid;
|
|
43916
44003
|
};
|
|
@@ -43919,7 +44006,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43919
44006
|
var rotationButton = document.createElement("button");
|
|
43920
44007
|
rotationButton.classList.add("azure-maps-control-button");
|
|
43921
44008
|
rotationButton.classList.add("rotation");
|
|
43922
|
-
rotationButton.setAttribute("
|
|
44009
|
+
rotationButton.setAttribute("aria-label", "Reset to Default Rotation");
|
|
43923
44010
|
rotationButton.setAttribute("alt", "Reset to Default Rotation");
|
|
43924
44011
|
rotationButton.setAttribute("type", "button");
|
|
43925
44012
|
var icon = document.createElement("div");
|
|
@@ -43942,7 +44029,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43942
44029
|
var rotationRightButton = document.createElement("button");
|
|
43943
44030
|
rotationRightButton.classList.add("azure-maps-control-button");
|
|
43944
44031
|
rotationRightButton.classList.add("rotation-right");
|
|
43945
|
-
rotationRightButton.setAttribute("
|
|
44032
|
+
rotationRightButton.setAttribute("aria-label", "Rotate Right");
|
|
43946
44033
|
rotationRightButton.setAttribute("alt", "Rotate Right");
|
|
43947
44034
|
rotationRightButton.setAttribute("type", "button");
|
|
43948
44035
|
rotationRightButton.addEventListener("click", function () {
|
|
@@ -43959,7 +44046,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43959
44046
|
var rotationLeftButton = document.createElement("button");
|
|
43960
44047
|
rotationLeftButton.classList.add("azure-maps-control-button");
|
|
43961
44048
|
rotationLeftButton.classList.add("rotation-left");
|
|
43962
|
-
rotationLeftButton.setAttribute("
|
|
44049
|
+
rotationLeftButton.setAttribute("aria-label", "Rotate Left");
|
|
43963
44050
|
rotationLeftButton.setAttribute("alt", "Rotate Left");
|
|
43964
44051
|
rotationLeftButton.setAttribute("type", "button");
|
|
43965
44052
|
rotationLeftButton.addEventListener("click", function () {
|
|
@@ -44043,6 +44130,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44043
44130
|
var container = this.buildContainer(map, this.options.style, "Pitch Control");
|
|
44044
44131
|
var pitchButton = this.constructPitchButton(map);
|
|
44045
44132
|
var grid = this.constructPitchGrid(map, options);
|
|
44133
|
+
var tooltip = buildAccessibleTooltip("Reset to Default Pitch");
|
|
44046
44134
|
container.addEventListener("mouseover", function (event) {
|
|
44047
44135
|
_this.lastActiveTime = _this.lastActiveTime || event.timeStamp;
|
|
44048
44136
|
_this.hasMouse = true;
|
|
@@ -44078,9 +44166,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44078
44166
|
if (options && PitchControl.INVERT_ORDER_POSITIONS.includes(options.position)) {
|
|
44079
44167
|
container.appendChild(grid);
|
|
44080
44168
|
container.appendChild(pitchButton);
|
|
44169
|
+
container.appendChild(tooltip);
|
|
44170
|
+
positionTooltip(tooltip, container);
|
|
44081
44171
|
}
|
|
44082
44172
|
else {
|
|
44083
44173
|
container.appendChild(pitchButton);
|
|
44174
|
+
container.appendChild(tooltip);
|
|
44175
|
+
positionTooltip(tooltip, container);
|
|
44084
44176
|
container.appendChild(grid);
|
|
44085
44177
|
}
|
|
44086
44178
|
this.map = map;
|
|
@@ -44106,13 +44198,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44106
44198
|
grid.classList.add("hidden-accessible-element");
|
|
44107
44199
|
this.pitchIncrementButton = this.constructPitchIncrementButton(map);
|
|
44108
44200
|
this.pitchDecrementButton = this.constructPitchDecrementButton(map);
|
|
44201
|
+
var tooltipIncrement = buildAccessibleTooltip("Increase Pitch");
|
|
44202
|
+
var tooltipDecrease = buildAccessibleTooltip("Decrease Pitch");
|
|
44109
44203
|
if (options && PitchControl.INVERT_ORDER_POSITIONS.includes(options.position)) {
|
|
44110
44204
|
grid.appendChild(this.pitchDecrementButton);
|
|
44205
|
+
grid.appendChild(tooltipDecrease);
|
|
44206
|
+
positionTooltip(tooltipDecrease, this.pitchDecrementButton);
|
|
44111
44207
|
grid.appendChild(this.pitchIncrementButton);
|
|
44208
|
+
grid.appendChild(tooltipIncrement);
|
|
44209
|
+
positionTooltip(tooltipIncrement, this.pitchIncrementButton);
|
|
44112
44210
|
}
|
|
44113
44211
|
else {
|
|
44114
44212
|
grid.appendChild(this.pitchIncrementButton);
|
|
44213
|
+
grid.appendChild(tooltipIncrement);
|
|
44214
|
+
positionTooltip(tooltipIncrement, this.pitchIncrementButton);
|
|
44115
44215
|
grid.appendChild(this.pitchDecrementButton);
|
|
44216
|
+
grid.appendChild(tooltipDecrease);
|
|
44217
|
+
positionTooltip(tooltipDecrease, this.pitchDecrementButton);
|
|
44116
44218
|
}
|
|
44117
44219
|
return grid;
|
|
44118
44220
|
};
|
|
@@ -44121,7 +44223,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44121
44223
|
var pitchButton = document.createElement("button");
|
|
44122
44224
|
pitchButton.classList.add("azure-maps-control-button");
|
|
44123
44225
|
pitchButton.classList.add("pitch");
|
|
44124
|
-
pitchButton.setAttribute("
|
|
44226
|
+
pitchButton.setAttribute("aria-label", "Reset to Default Pitch");
|
|
44125
44227
|
pitchButton.setAttribute("alt", "Reset to Default Pitch");
|
|
44126
44228
|
pitchButton.setAttribute("type", "button");
|
|
44127
44229
|
pitchButton.addEventListener("click", function () {
|
|
@@ -44139,7 +44241,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44139
44241
|
var pitchDecrementButton = document.createElement("button");
|
|
44140
44242
|
pitchDecrementButton.classList.add("azure-maps-control-button");
|
|
44141
44243
|
pitchDecrementButton.classList.add("pitch-down");
|
|
44142
|
-
pitchDecrementButton.setAttribute("
|
|
44244
|
+
pitchDecrementButton.setAttribute("aria-label", "Decrease Pitch");
|
|
44143
44245
|
pitchDecrementButton.setAttribute("alt", "Decrease Pitch");
|
|
44144
44246
|
pitchDecrementButton.setAttribute("type", "button");
|
|
44145
44247
|
pitchDecrementButton.addEventListener("click", function () {
|
|
@@ -44156,7 +44258,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
44156
44258
|
var pitchIncrementButton = document.createElement("button");
|
|
44157
44259
|
pitchIncrementButton.classList.add("azure-maps-control-button");
|
|
44158
44260
|
pitchIncrementButton.classList.add("pitch-up");
|
|
44159
|
-
pitchIncrementButton.setAttribute("
|
|
44261
|
+
pitchIncrementButton.setAttribute("aria-label", "Increase Pitch");
|
|
44160
44262
|
pitchIncrementButton.setAttribute("alt", "Increase Pitch");
|
|
44161
44263
|
pitchIncrementButton.setAttribute("type", "button");
|
|
44162
44264
|
pitchIncrementButton.addEventListener("click", function () {
|
|
@@ -46744,6 +46846,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46744
46846
|
var container = this.buildContainer(map, this.options.style, "Map Style Control");
|
|
46745
46847
|
var styleOpsGrid = this.buildStyleOpsGrid(container);
|
|
46746
46848
|
var currStyleButton = this.buildCurrStyleBtn(container, styleOpsGrid);
|
|
46849
|
+
var tooltip = buildAccessibleTooltip("Select Style");
|
|
46850
|
+
styleOpsGrid.classList.add(options ? options.position || 'top-right' : 'top-right');
|
|
46747
46851
|
container.addEventListener("mouseover", function () {
|
|
46748
46852
|
_this.hasMouse = true;
|
|
46749
46853
|
container.classList.add(StyleControl.Css.inUse);
|
|
@@ -46773,9 +46877,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46773
46877
|
if (options && StyleControl.InvertOrderPositions.includes(options.position)) {
|
|
46774
46878
|
container.appendChild(styleOpsGrid);
|
|
46775
46879
|
container.appendChild(currStyleButton);
|
|
46880
|
+
container.appendChild(tooltip);
|
|
46881
|
+
positionTooltip(tooltip, currStyleButton);
|
|
46776
46882
|
}
|
|
46777
46883
|
else {
|
|
46778
46884
|
container.appendChild(currStyleButton);
|
|
46885
|
+
container.appendChild(tooltip);
|
|
46886
|
+
positionTooltip(tooltip, currStyleButton);
|
|
46779
46887
|
container.appendChild(styleOpsGrid);
|
|
46780
46888
|
}
|
|
46781
46889
|
return container;
|
|
@@ -46805,6 +46913,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46805
46913
|
if (image.alt !== newAlt) {
|
|
46806
46914
|
image.alt = newAlt;
|
|
46807
46915
|
}
|
|
46916
|
+
if (image.parentElement.lastChild instanceof Text) {
|
|
46917
|
+
image.parentElement.lastChild.textContent = newAlt;
|
|
46918
|
+
}
|
|
46808
46919
|
}
|
|
46809
46920
|
};
|
|
46810
46921
|
/**
|
|
@@ -46831,17 +46942,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46831
46942
|
var _this = this;
|
|
46832
46943
|
var styleOptionButton = document.createElement("button");
|
|
46833
46944
|
var friendlyName = this.mapToFriendlyStyleName(name);
|
|
46834
|
-
styleOptionButton.setAttribute("title", friendlyName);
|
|
46835
46945
|
styleOptionButton.setAttribute("alt", friendlyName);
|
|
46836
46946
|
styleOptionButton.setAttribute("type", "button");
|
|
46837
46947
|
var styleIconImage = new Image();
|
|
46838
46948
|
styleIconImage.src = icon;
|
|
46839
|
-
|
|
46949
|
+
if (this.options.layout === "icons") {
|
|
46950
|
+
styleIconImage.alt = friendlyName;
|
|
46951
|
+
}
|
|
46840
46952
|
styleOptionButton.appendChild(styleIconImage);
|
|
46841
46953
|
if (this.options.layout === "icons") {
|
|
46842
46954
|
styleOptionButton.classList.add(StyleControl.Css.button);
|
|
46843
46955
|
}
|
|
46844
46956
|
else {
|
|
46957
|
+
styleOptionButton.classList.add(StyleControl.Css.listButton);
|
|
46958
|
+
styleOptionButton.classList.add(StyleControl.Css.expanded);
|
|
46845
46959
|
styleOptionButton.appendChild(document.createTextNode(friendlyName));
|
|
46846
46960
|
}
|
|
46847
46961
|
styleOptionButton.addEventListener("click", function () {
|
|
@@ -46851,15 +46965,27 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46851
46965
|
if (_this.options.autoSelectionMode) {
|
|
46852
46966
|
_this.map.setStyle({ style: name });
|
|
46853
46967
|
}
|
|
46968
|
+
Object.entries(_this.styleButtons).forEach(function (_a) {
|
|
46969
|
+
var _b = __read(_a, 2), styleName = _b[0], button = _b[1];
|
|
46970
|
+
return button.setAttribute('aria-current', styleName === name ? 'true' : 'false');
|
|
46971
|
+
});
|
|
46854
46972
|
}
|
|
46855
46973
|
});
|
|
46974
|
+
var iconDiv = document.createElement('div');
|
|
46975
|
+
iconDiv.classList.add('selected-icon');
|
|
46976
|
+
styleOptionButton.appendChild(iconDiv);
|
|
46856
46977
|
return styleOptionButton;
|
|
46857
46978
|
};
|
|
46858
46979
|
StyleControl.prototype.buildCurrStyleBtn = function (container, opsGrid) {
|
|
46859
46980
|
var selectCurrButton = document.createElement("button");
|
|
46860
|
-
|
|
46981
|
+
if (this.options.layout == 'icons') {
|
|
46982
|
+
selectCurrButton.classList.add(StyleControl.Css.button);
|
|
46983
|
+
}
|
|
46984
|
+
else {
|
|
46985
|
+
selectCurrButton.classList.add(StyleControl.Css.listButton);
|
|
46986
|
+
}
|
|
46861
46987
|
selectCurrButton.classList.add(StyleControl.Css.currentStyle);
|
|
46862
|
-
selectCurrButton.setAttribute("
|
|
46988
|
+
selectCurrButton.setAttribute("aria-label", "Select Style");
|
|
46863
46989
|
selectCurrButton.setAttribute("alt", "Select Style");
|
|
46864
46990
|
selectCurrButton.setAttribute("type", "button");
|
|
46865
46991
|
this.currStyleImage = new Image();
|
|
@@ -46873,7 +46999,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46873
46999
|
var _this = this;
|
|
46874
47000
|
var styleOpsGrid = document.createElement("div");
|
|
46875
47001
|
styleOpsGrid.classList.add(StyleControl.Css.styleOptions);
|
|
46876
|
-
|
|
47002
|
+
if (this.options.layout === 'icons') {
|
|
47003
|
+
styleOpsGrid.classList.add(this.options.layout);
|
|
47004
|
+
}
|
|
47005
|
+
else {
|
|
47006
|
+
styleOpsGrid.classList.add(StyleControl.Css.dropdown);
|
|
47007
|
+
}
|
|
46877
47008
|
styleOpsGrid.setAttribute("aria-label", "Style Options");
|
|
46878
47009
|
styleOpsGrid.classList.add("hidden-accessible-element");
|
|
46879
47010
|
// Once the map's style definition is initialized create a map between style names and icons.
|
|
@@ -46907,6 +47038,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46907
47038
|
if (style.name === currStyle) {
|
|
46908
47039
|
_this.currStyleImage.src = iconUrl;
|
|
46909
47040
|
_this.currStyleImage.alt = _this.mapToFriendlyStyleName(style.name);
|
|
47041
|
+
_this.currStyleImage.parentElement.appendChild(document.createTextNode(_this.mapToFriendlyStyleName(style.name)));
|
|
46910
47042
|
}
|
|
46911
47043
|
}
|
|
46912
47044
|
}
|
|
@@ -46922,6 +47054,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46922
47054
|
var styleOptionButton = _this.buildSelectStyleBtn(styleName, iconUrl);
|
|
46923
47055
|
styleOpsGrid.appendChild(styleOptionButton);
|
|
46924
47056
|
_this.styleButtons[styleName] = styleOptionButton;
|
|
47057
|
+
if (_this.options.layout === "icons") {
|
|
47058
|
+
var tooltip = buildAccessibleTooltip(_this.mapToFriendlyStyleName(styleName));
|
|
47059
|
+
styleOpsGrid.appendChild(tooltip);
|
|
47060
|
+
positionTooltip(tooltip, styleOptionButton);
|
|
47061
|
+
}
|
|
46925
47062
|
});
|
|
46926
47063
|
}
|
|
46927
47064
|
else {
|
|
@@ -46930,8 +47067,17 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46930
47067
|
var styleOptionButton = _this.buildSelectStyleBtn(styleName, iconUrl);
|
|
46931
47068
|
styleOpsGrid.appendChild(styleOptionButton);
|
|
46932
47069
|
_this.styleButtons[styleName] = styleOptionButton;
|
|
47070
|
+
if (_this.options.layout === "icons") {
|
|
47071
|
+
var tooltip = buildAccessibleTooltip(_this.mapToFriendlyStyleName(styleName));
|
|
47072
|
+
styleOpsGrid.appendChild(tooltip);
|
|
47073
|
+
positionTooltip(tooltip, styleOptionButton);
|
|
47074
|
+
}
|
|
46933
47075
|
});
|
|
46934
47076
|
}
|
|
47077
|
+
Object.entries(_this.styleButtons).forEach(function (_a) {
|
|
47078
|
+
var _b = __read(_a, 2), styleName = _b[0], button = _b[1];
|
|
47079
|
+
return button.setAttribute('aria-current', styleName === currStyle ? 'true' : 'false');
|
|
47080
|
+
});
|
|
46935
47081
|
_this.map.events.add("styledata", _this.onStyleChange);
|
|
46936
47082
|
});
|
|
46937
47083
|
return styleOpsGrid;
|
|
@@ -46947,9 +47093,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46947
47093
|
StyleControl.InvertOrderPositions = [exports.ControlPosition.TopRight, exports.ControlPosition.BottomRight];
|
|
46948
47094
|
StyleControl.Css = {
|
|
46949
47095
|
button: "azure-maps-control-button",
|
|
47096
|
+
listButton: "azure-maps-control-list-button",
|
|
47097
|
+
expanded: 'expanded',
|
|
46950
47098
|
currentStyle: "curr-style",
|
|
46951
47099
|
inUse: "in-use",
|
|
46952
|
-
styleOptions: "style-options"
|
|
47100
|
+
styleOptions: "style-options",
|
|
47101
|
+
dropdown: "azure-maps-control-dropdown"
|
|
46953
47102
|
};
|
|
46954
47103
|
StyleControl.StyleNamesMap = {
|
|
46955
47104
|
road: "Road",
|
|
@@ -46968,11 +47117,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46968
47117
|
}(ControlBase));
|
|
46969
47118
|
|
|
46970
47119
|
/**
|
|
46971
|
-
* The options for
|
|
47120
|
+
* The options for setting traffic on the map.
|
|
46972
47121
|
*/
|
|
46973
|
-
var
|
|
46974
|
-
__extends(
|
|
46975
|
-
function
|
|
47122
|
+
var TrafficOptions = /** @class */ (function (_super) {
|
|
47123
|
+
__extends(TrafficOptions, _super);
|
|
47124
|
+
function TrafficOptions() {
|
|
46976
47125
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
46977
47126
|
/**
|
|
46978
47127
|
* The type of traffic flow to display:
|
|
@@ -46981,16 +47130,28 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46981
47130
|
* <p>"absolute" is the absolute speed of the road</p>
|
|
46982
47131
|
* <p>"relative-delay" displays relative speed only where they differ from free-flow;
|
|
46983
47132
|
* false to stop displaying the traffic flow.</p>
|
|
46984
|
-
* default `"
|
|
46985
|
-
* @default "
|
|
47133
|
+
* default `"none"``
|
|
47134
|
+
* @default "none"
|
|
46986
47135
|
*/
|
|
46987
|
-
_this.flow = "
|
|
47136
|
+
_this.flow = "none";
|
|
46988
47137
|
/**
|
|
46989
47138
|
* Whether to display incidents on the map.
|
|
46990
|
-
* default `
|
|
46991
|
-
* @default
|
|
47139
|
+
* default `false`
|
|
47140
|
+
* @default false
|
|
46992
47141
|
*/
|
|
46993
|
-
_this.incidents =
|
|
47142
|
+
_this.incidents = false;
|
|
47143
|
+
return _this;
|
|
47144
|
+
}
|
|
47145
|
+
return TrafficOptions;
|
|
47146
|
+
}(Options));
|
|
47147
|
+
|
|
47148
|
+
/**
|
|
47149
|
+
* The options for a TrafficControl object.
|
|
47150
|
+
*/
|
|
47151
|
+
var TrafficControlOptions = /** @class */ (function (_super) {
|
|
47152
|
+
__extends(TrafficControlOptions, _super);
|
|
47153
|
+
function TrafficControlOptions() {
|
|
47154
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
46994
47155
|
/**
|
|
46995
47156
|
* Specifies if the control is in the active state (displaying traffic).
|
|
46996
47157
|
* Default: false
|
|
@@ -47006,7 +47167,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47006
47167
|
return _this;
|
|
47007
47168
|
}
|
|
47008
47169
|
return TrafficControlOptions;
|
|
47009
|
-
}(
|
|
47170
|
+
}(TrafficOptions));
|
|
47010
47171
|
|
|
47011
47172
|
/**
|
|
47012
47173
|
* A control that toggles traffic data on the map.
|
|
@@ -47021,9 +47182,49 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47021
47182
|
var _this = _super.call(this) || this;
|
|
47022
47183
|
_this.hasMouse = false;
|
|
47023
47184
|
_this.hasFocus = false;
|
|
47024
|
-
|
|
47185
|
+
// desired map traffic state when control is enabled
|
|
47186
|
+
_this.options = new TrafficOptions().merge({
|
|
47187
|
+
flow: 'relative',
|
|
47188
|
+
incidents: true
|
|
47189
|
+
});
|
|
47190
|
+
_this.style = exports.ControlStyle.light;
|
|
47191
|
+
_this.container = null;
|
|
47192
|
+
_this.trafficButton = null;
|
|
47193
|
+
_this.map = null;
|
|
47194
|
+
if (options) {
|
|
47195
|
+
_this.initIsActive = options.isActive || false;
|
|
47196
|
+
_this.options.flow = options.flow || 'relative';
|
|
47197
|
+
_this.options.incidents = options.incidents || true;
|
|
47198
|
+
_this.style = options.style || exports.ControlStyle.light;
|
|
47199
|
+
}
|
|
47025
47200
|
return _this;
|
|
47026
47201
|
}
|
|
47202
|
+
Object.defineProperty(TrafficControl.prototype, "isActive", {
|
|
47203
|
+
/**
|
|
47204
|
+
* Current control state (is traffic information displayed?)
|
|
47205
|
+
*/
|
|
47206
|
+
get: function () {
|
|
47207
|
+
if (!this.map) {
|
|
47208
|
+
return false;
|
|
47209
|
+
}
|
|
47210
|
+
var trafficState = this.map.getTraffic();
|
|
47211
|
+
return trafficState.flow !== "none" || trafficState.incidents;
|
|
47212
|
+
},
|
|
47213
|
+
/**
|
|
47214
|
+
* Sets the control state
|
|
47215
|
+
*/
|
|
47216
|
+
set: function (newValue) {
|
|
47217
|
+
if (!this.map) {
|
|
47218
|
+
return;
|
|
47219
|
+
}
|
|
47220
|
+
this.map.setTraffic({
|
|
47221
|
+
flow: newValue ? this.options.flow : 'none',
|
|
47222
|
+
incidents: newValue ? this.options.incidents : false
|
|
47223
|
+
});
|
|
47224
|
+
},
|
|
47225
|
+
enumerable: false,
|
|
47226
|
+
configurable: true
|
|
47227
|
+
});
|
|
47027
47228
|
/**
|
|
47028
47229
|
* Initialization method for the control which is called when added to the map.
|
|
47029
47230
|
* @param map The map that the control will be added to.
|
|
@@ -47031,49 +47232,63 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47031
47232
|
* @return An HTMLElement to be placed on the map for the control.
|
|
47032
47233
|
*/
|
|
47033
47234
|
TrafficControl.prototype.onAdd = function (map) {
|
|
47034
|
-
this.
|
|
47235
|
+
this.map = map;
|
|
47236
|
+
var trafficState = map.getTraffic();
|
|
47237
|
+
// bring map traffic state in sync with desired if initIsActive have been set
|
|
47238
|
+
if (this.initIsActive !== undefined) {
|
|
47239
|
+
this.isActive = this.initIsActive;
|
|
47240
|
+
}
|
|
47241
|
+
this.container = this.buildContainer(map, this.style, "Traffic Control");
|
|
47035
47242
|
this.container.style.flexDirection = "column";
|
|
47036
47243
|
var trafficButton = this.constructTrafficButton(map);
|
|
47037
47244
|
this.container.appendChild(trafficButton);
|
|
47245
|
+
var tooltip = buildAccessibleTooltip("Toggle Traffic Display");
|
|
47246
|
+
this.container.appendChild(tooltip);
|
|
47247
|
+
positionTooltip(tooltip, trafficButton);
|
|
47038
47248
|
return this.container;
|
|
47039
47249
|
};
|
|
47250
|
+
TrafficControl.prototype.onRemove = function () {
|
|
47251
|
+
this.map = null;
|
|
47252
|
+
};
|
|
47040
47253
|
/**
|
|
47041
47254
|
* Get the TrafficControlOptions
|
|
47042
47255
|
*/
|
|
47043
47256
|
TrafficControl.prototype.getOptions = function () {
|
|
47044
|
-
return
|
|
47257
|
+
return new TrafficControlOptions().merge({
|
|
47258
|
+
isActive: this.isActive,
|
|
47259
|
+
flow: this.options.flow,
|
|
47260
|
+
incidents: this.options.incidents,
|
|
47261
|
+
style: this.style
|
|
47262
|
+
});
|
|
47263
|
+
};
|
|
47264
|
+
/**
|
|
47265
|
+
* Updates the button state according to current traffic state
|
|
47266
|
+
* This is invoked on init in constructTrafficButton and on each Map.setTraffic()
|
|
47267
|
+
*/
|
|
47268
|
+
TrafficControl.prototype.updateButtonState = function () {
|
|
47269
|
+
if (this.isActive) {
|
|
47270
|
+
this.container.classList.add("in-use");
|
|
47271
|
+
}
|
|
47272
|
+
else {
|
|
47273
|
+
this.container.classList.remove("in-use");
|
|
47274
|
+
}
|
|
47275
|
+
if (this.trafficButton) {
|
|
47276
|
+
this.trafficButton.setAttribute("aria-pressed", this.isActive ? "true" : "false");
|
|
47277
|
+
}
|
|
47045
47278
|
};
|
|
47046
47279
|
TrafficControl.prototype.constructTrafficButton = function (map) {
|
|
47047
47280
|
var _this = this;
|
|
47048
47281
|
var trafficButton = document.createElement("button");
|
|
47049
47282
|
trafficButton.classList.add("azure-maps-control-button");
|
|
47050
47283
|
trafficButton.classList.add("traffic");
|
|
47051
|
-
trafficButton.setAttribute("
|
|
47284
|
+
trafficButton.setAttribute("aria-label", "Toggle Traffic Display");
|
|
47052
47285
|
trafficButton.setAttribute("alt", "Toggle Traffic Display");
|
|
47053
47286
|
trafficButton.setAttribute("type", "button");
|
|
47287
|
+
this.trafficButton = trafficButton;
|
|
47288
|
+
this.updateButtonState();
|
|
47054
47289
|
// toggle button
|
|
47055
47290
|
trafficButton.addEventListener("click", function () {
|
|
47056
|
-
|
|
47057
|
-
_this.options.isActive = !(t.flow !== "none" || t.incidents);
|
|
47058
|
-
if (_this.options.isActive) {
|
|
47059
|
-
map.setTraffic({
|
|
47060
|
-
flow: _this.options.flow,
|
|
47061
|
-
incidents: _this.options.incidents
|
|
47062
|
-
});
|
|
47063
|
-
_this.container.classList.add("in-use");
|
|
47064
|
-
}
|
|
47065
|
-
else {
|
|
47066
|
-
map.setTraffic({
|
|
47067
|
-
flow: "none",
|
|
47068
|
-
incidents: false
|
|
47069
|
-
});
|
|
47070
|
-
_this.container.classList.remove("in-use");
|
|
47071
|
-
}
|
|
47072
|
-
});
|
|
47073
|
-
map.events.addOnce("styledata", function () {
|
|
47074
|
-
if (_this.options.isActive) {
|
|
47075
|
-
trafficButton.dispatchEvent(new Event("click"));
|
|
47076
|
-
}
|
|
47291
|
+
_this.isActive = !_this.isActive;
|
|
47077
47292
|
});
|
|
47078
47293
|
return trafficButton;
|
|
47079
47294
|
};
|
|
@@ -47111,18 +47326,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47111
47326
|
var e_1, _a, e_2, _b;
|
|
47112
47327
|
var trafficLegend = document.createElement("div");
|
|
47113
47328
|
trafficLegend.classList.add("traffic-legend", "hidden");
|
|
47114
|
-
trafficLegend.setAttribute("title", "Traffic Legend");
|
|
47115
47329
|
trafficLegend.setAttribute("alt", "Traffic Legend");
|
|
47116
47330
|
var trafficLegendTable = document.createElement("table");
|
|
47117
47331
|
// legend table title
|
|
47118
47332
|
var tr1 = document.createElement("tr");
|
|
47119
47333
|
var td = document.createElement("td");
|
|
47120
|
-
td.setAttribute("title", "Traffic");
|
|
47121
47334
|
td.setAttribute("alt", "Traffic");
|
|
47122
47335
|
td.appendChild(document.createTextNode("Traffic"));
|
|
47336
|
+
var tooltip = buildAccessibleTooltip("Traffic");
|
|
47123
47337
|
td.classList.add("traffic-legend-title");
|
|
47124
47338
|
td.colSpan = 6;
|
|
47125
47339
|
tr1.appendChild(td);
|
|
47340
|
+
tr1.appendChild(tooltip);
|
|
47341
|
+
positionTooltip(tooltip, td);
|
|
47126
47342
|
trafficLegendTable.appendChild(tr1);
|
|
47127
47343
|
// legend table contents
|
|
47128
47344
|
var tr2 = document.createElement("tr");
|
|
@@ -47131,13 +47347,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47131
47347
|
var col = _d.value;
|
|
47132
47348
|
var data = document.createElement("td");
|
|
47133
47349
|
if (col === "Fast" || col === "Slow") {
|
|
47134
|
-
data.setAttribute("title", col);
|
|
47135
47350
|
data.setAttribute("alt", col);
|
|
47136
47351
|
data.appendChild(document.createTextNode(col));
|
|
47137
47352
|
data.classList.add("traffic-legend-text");
|
|
47138
47353
|
}
|
|
47139
47354
|
else {
|
|
47140
47355
|
data.classList.add("traffic-legend-colors");
|
|
47356
|
+
data.setAttribute("aria-label", "Traffic Legend");
|
|
47357
|
+
data.setAttribute("role", "img");
|
|
47141
47358
|
try {
|
|
47142
47359
|
for (var col_1 = (e_2 = void 0, __values(col)), col_1_1 = col_1.next(); !col_1_1.done; col_1_1 = col_1.next()) {
|
|
47143
47360
|
var color = col_1_1.value;
|
|
@@ -47155,6 +47372,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47155
47372
|
}
|
|
47156
47373
|
}
|
|
47157
47374
|
tr2.appendChild(data);
|
|
47375
|
+
var tooltip_1 = buildAccessibleTooltip(col instanceof Array ? "Traffic Legend" : col);
|
|
47376
|
+
tr2.appendChild(tooltip_1);
|
|
47377
|
+
positionTooltip(tooltip_1, data);
|
|
47158
47378
|
}
|
|
47159
47379
|
}
|
|
47160
47380
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -48105,6 +48325,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
48105
48325
|
* Cached array of powers of 10. This will be faster than call Math.pow.
|
|
48106
48326
|
*/
|
|
48107
48327
|
var POWERS_OF_10 = [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000];
|
|
48328
|
+
/**
|
|
48329
|
+
* Maximum latitude as defined in WebMercator
|
|
48330
|
+
*/
|
|
48331
|
+
var WEBMERCATOR_MAXLAT = 85.0511;
|
|
48108
48332
|
//////////////////////
|
|
48109
48333
|
/// Private Functions
|
|
48110
48334
|
//////////////////////
|
|
@@ -48979,11 +49203,42 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
48979
49203
|
var normalUnit = _normalizeDistanceUnit(units);
|
|
48980
49204
|
return convertDistance(EARTH_RADIUS_SEMI_MAJOR_AXIS, DistanceUnits.meters, normalUnit);
|
|
48981
49205
|
}
|
|
49206
|
+
/**
|
|
49207
|
+
* constructs raw geodesic path that doesn't handle antimeridian crossing
|
|
49208
|
+
*/
|
|
49209
|
+
function _constructGeodesic(position, nextPosition, nodeSize) {
|
|
49210
|
+
var geodesic = [];
|
|
49211
|
+
// Convert positions from degrees to Radians
|
|
49212
|
+
var lat1 = _toRadians(position[1]);
|
|
49213
|
+
var lon1 = _toRadians(position[0]);
|
|
49214
|
+
var lat2 = _toRadians(nextPosition[1]);
|
|
49215
|
+
var lon2 = _toRadians(nextPosition[0]);
|
|
49216
|
+
// Calculate the total extent of the route
|
|
49217
|
+
var d = 2 * Math.asin(Math.sqrt(Math.pow((Math.sin((lat1 - lat2) / 2)), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow((Math.sin((lon1 - lon2) / 2)), 2)));
|
|
49218
|
+
// Calculate positions at fixed intervals along the route
|
|
49219
|
+
for (var k = 0; k <= nodeSize; k++) {
|
|
49220
|
+
var f = (k / nodeSize);
|
|
49221
|
+
var A = Math.sin((1 - f) * d) / Math.sin(d);
|
|
49222
|
+
var B = Math.sin(f * d) / Math.sin(d);
|
|
49223
|
+
// Obtain 3D Cartesian coordinates of each point
|
|
49224
|
+
var x = A * Math.cos(lat1) * Math.cos(lon1) + B * Math.cos(lat2) * Math.cos(lon2);
|
|
49225
|
+
var y = A * Math.cos(lat1) * Math.sin(lon1) + B * Math.cos(lat2) * Math.sin(lon2);
|
|
49226
|
+
var z = A * Math.sin(lat1) + B * Math.sin(lat2);
|
|
49227
|
+
// Convert these to latitude/longitude
|
|
49228
|
+
var lat = Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));
|
|
49229
|
+
var lon = Math.atan2(y, x);
|
|
49230
|
+
lat = _clip(_toDegrees(lat), -85, 85);
|
|
49231
|
+
lon = _toDegrees(lon);
|
|
49232
|
+
// Add this to the array
|
|
49233
|
+
geodesic.push([lon, lat]);
|
|
49234
|
+
}
|
|
49235
|
+
return geodesic;
|
|
49236
|
+
}
|
|
48982
49237
|
/**
|
|
48983
49238
|
* Takes an array of positions objects and fills in the space between them with accurately positioned positions to form an approximated Geodesic path.
|
|
48984
49239
|
* @param path Array of position objects that form a path to fill in.
|
|
48985
49240
|
* @param nodeSize Number of nodes to insert between each position. Default: 15
|
|
48986
|
-
* @returns An array of position objects that form a geodesic paths.
|
|
49241
|
+
* @returns An array of position objects that form a geodesic paths, geodesic path crossing antimeridian will contain longitude outside of -180 to 180 range. See getGeodesicPaths() when this is undesired.
|
|
48987
49242
|
*/
|
|
48988
49243
|
function getGeodesicPath(path, nodeSize) {
|
|
48989
49244
|
if (!nodeSize || nodeSize <= 0) {
|
|
@@ -48997,34 +49252,70 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
48997
49252
|
locs = path.coordinates;
|
|
48998
49253
|
}
|
|
48999
49254
|
var len = locs.length - 1;
|
|
49000
|
-
var
|
|
49255
|
+
var geodesic = [];
|
|
49001
49256
|
for (var i = 0; i < len; i++) {
|
|
49002
49257
|
// Convert positions from degrees to Radians
|
|
49003
|
-
|
|
49004
|
-
|
|
49005
|
-
|
|
49006
|
-
var
|
|
49007
|
-
//
|
|
49008
|
-
|
|
49009
|
-
|
|
49010
|
-
|
|
49011
|
-
var f = (k / nodeSize);
|
|
49012
|
-
var A = Math.sin((1 - f) * d) / Math.sin(d);
|
|
49013
|
-
var B = Math.sin(f * d) / Math.sin(d);
|
|
49014
|
-
// Obtain 3D Cartesian coordinates of each point
|
|
49015
|
-
var x = A * Math.cos(lat1) * Math.cos(lon1) + B * Math.cos(lat2) * Math.cos(lon2);
|
|
49016
|
-
var y = A * Math.cos(lat1) * Math.sin(lon1) + B * Math.cos(lat2) * Math.sin(lon2);
|
|
49017
|
-
var z = A * Math.sin(lat1) + B * Math.sin(lat2);
|
|
49018
|
-
// Convert these to latitude/longitude
|
|
49019
|
-
var lat = Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));
|
|
49020
|
-
var lon = Math.atan2(y, x);
|
|
49021
|
-
lat = _clip(_toDegrees(lat), -85, 85);
|
|
49022
|
-
lon = _toDegrees(lon);
|
|
49023
|
-
// Add this to the array
|
|
49024
|
-
outputLocs.push([lon, lat]);
|
|
49258
|
+
geodesic = geodesic.concat(_constructGeodesic(locs[i], locs[i + 1], nodeSize));
|
|
49259
|
+
}
|
|
49260
|
+
return geodesic.reduce(function (targetPath, coord) {
|
|
49261
|
+
var last = targetPath.length > 0 ? targetPath[targetPath.length - 1] : null;
|
|
49262
|
+
// denormalize longitude on antimeridian crossing
|
|
49263
|
+
if (last && Math.abs(coord[0] - last[0]) > 180.0) {
|
|
49264
|
+
var denormLon = last[0] < 0 ? coord[0] - 360.0 : coord[0] + 360.0;
|
|
49265
|
+
targetPath.push([denormLon, coord[1]]);
|
|
49025
49266
|
}
|
|
49267
|
+
else {
|
|
49268
|
+
targetPath.push(coord);
|
|
49269
|
+
}
|
|
49270
|
+
return targetPath;
|
|
49271
|
+
}, []);
|
|
49272
|
+
}
|
|
49273
|
+
/**
|
|
49274
|
+
* Takes an array of positions objects and fills in the space between them with accurately positioned positions to form an approximated Geodesic path broken by antimeridian into multiple sub-paths.
|
|
49275
|
+
* @param path Array of position objects that form a path to fill in.
|
|
49276
|
+
* @param nodeSize Number of nodes to insert between each position. Default: 15
|
|
49277
|
+
* @returns An array of paths that form geodesic paths, Comparing to getGeodesicPath, sub-paths will always contain longitude in -180 to 180 range
|
|
49278
|
+
*/
|
|
49279
|
+
function getGeodesicPaths(path, nodeSize) {
|
|
49280
|
+
if (!nodeSize || nodeSize <= 0) {
|
|
49281
|
+
nodeSize = 15;
|
|
49026
49282
|
}
|
|
49027
|
-
|
|
49283
|
+
var locs;
|
|
49284
|
+
if (Array.isArray(path)) {
|
|
49285
|
+
locs = path;
|
|
49286
|
+
}
|
|
49287
|
+
else if (path.type && path.type === "LineString") {
|
|
49288
|
+
locs = path.coordinates;
|
|
49289
|
+
}
|
|
49290
|
+
var len = locs.length - 1;
|
|
49291
|
+
var currentNonCrossing = [];
|
|
49292
|
+
var outputLocs = [];
|
|
49293
|
+
for (var i = 0; i < len; i++) {
|
|
49294
|
+
var geodesic = _constructGeodesic(locs[i], locs[i + 1], nodeSize);
|
|
49295
|
+
for (var k = 0; k < geodesic.length; k++) {
|
|
49296
|
+
currentNonCrossing.push(geodesic[k]);
|
|
49297
|
+
if (k + 1 >= geodesic.length) {
|
|
49298
|
+
continue;
|
|
49299
|
+
}
|
|
49300
|
+
var _a = __read(geodesic[k], 2), lon1 = _a[0], lat1 = _a[1];
|
|
49301
|
+
var _b = __read(geodesic[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
|
|
49302
|
+
// split the line by antimeridian
|
|
49303
|
+
// and break geodesic into two line segments
|
|
49304
|
+
if (Math.abs(lon2 - lon1) > 180.0) {
|
|
49305
|
+
var denormLon2 = lon1 > 0 ? lon2 + 360.0 : lon2 - 360.0;
|
|
49306
|
+
var antiLon = lon1 > 0 ? 180.0 : -180.0;
|
|
49307
|
+
var abs = Math.abs(denormLon2 - lon1);
|
|
49308
|
+
var antiAbs = Math.abs(antiLon - lon1);
|
|
49309
|
+
var f = antiAbs / abs;
|
|
49310
|
+
var dLat = (lat2 - lat1) * f;
|
|
49311
|
+
var antiLat = lat1 + dLat;
|
|
49312
|
+
currentNonCrossing.push([antiLon, antiLat]);
|
|
49313
|
+
outputLocs.push(currentNonCrossing);
|
|
49314
|
+
currentNonCrossing = [[-antiLon, antiLat]];
|
|
49315
|
+
}
|
|
49316
|
+
}
|
|
49317
|
+
}
|
|
49318
|
+
outputLocs.push(currentNonCrossing);
|
|
49028
49319
|
return outputLocs;
|
|
49029
49320
|
}
|
|
49030
49321
|
/**
|
|
@@ -50431,6 +50722,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
50431
50722
|
var index$1 = /*#__PURE__*/Object.freeze({
|
|
50432
50723
|
__proto__: null,
|
|
50433
50724
|
AffineTransform: AffineTransform,
|
|
50725
|
+
WEBMERCATOR_MAXLAT: WEBMERCATOR_MAXLAT,
|
|
50434
50726
|
_precision: _precision,
|
|
50435
50727
|
get AreaUnits () { return AreaUnits; },
|
|
50436
50728
|
get DistanceUnits () { return DistanceUnits; },
|
|
@@ -50444,6 +50736,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
50444
50736
|
getDistanceTo: getDistanceTo,
|
|
50445
50737
|
getEarthRadius: getEarthRadius,
|
|
50446
50738
|
getGeodesicPath: getGeodesicPath,
|
|
50739
|
+
getGeodesicPaths: getGeodesicPaths,
|
|
50447
50740
|
getHeading: getHeading,
|
|
50448
50741
|
getLengthOfPath: getLengthOfPath,
|
|
50449
50742
|
getPositionAlongPath: getPositionAlongPath,
|
|
@@ -51573,8 +51866,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
51573
51866
|
this.container.style.flexDirection = "column";
|
|
51574
51867
|
this.zoomInButton = this.constructZoomInButton(map);
|
|
51575
51868
|
this.zoomOutButton = this.constructZoomOutButton(map);
|
|
51869
|
+
var tooltipZoomIn = buildAccessibleTooltip("Zoom In");
|
|
51870
|
+
var tooltipZoomOut = buildAccessibleTooltip("Zoom Out");
|
|
51576
51871
|
this.container.appendChild(this.zoomInButton);
|
|
51872
|
+
this.container.appendChild(tooltipZoomIn);
|
|
51577
51873
|
this.container.appendChild(this.zoomOutButton);
|
|
51874
|
+
this.container.appendChild(tooltipZoomOut);
|
|
51875
|
+
positionTooltip(tooltipZoomIn, this.zoomInButton);
|
|
51876
|
+
positionTooltip(tooltipZoomOut, this.zoomOutButton);
|
|
51578
51877
|
map.events.add('zoom', this.zoomChanged);
|
|
51579
51878
|
map.events.add('minzoomchanged', this.minZoomChanged);
|
|
51580
51879
|
map.events.add('maxzoomchanged', this.maxZoomChanged);
|
|
@@ -51600,8 +51899,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
51600
51899
|
// small values need special handling, since depending on the height of the map view
|
|
51601
51900
|
// the actual zoom we can zoom out to can be above or below 0 when the entire map fits the height into the view
|
|
51602
51901
|
// use web mercator bounds to check if entire latitude range is visible
|
|
51603
|
-
var reachedLatitudeBoundaries = BoundingBox.getSouth(this.map.getCamera().bounds) <= -
|
|
51604
|
-
&& BoundingBox.getNorth(this.map.getCamera().bounds) >=
|
|
51902
|
+
var reachedLatitudeBoundaries = BoundingBox.getSouth(this.map.getCamera().bounds) <= -WEBMERCATOR_MAXLAT
|
|
51903
|
+
&& BoundingBox.getNorth(this.map.getCamera().bounds) >= WEBMERCATOR_MAXLAT;
|
|
51605
51904
|
var zoomOutDisabled = this.map.getCamera().zoom <= this.map._getMap().getMinZoom() || reachedLatitudeBoundaries;
|
|
51606
51905
|
if (this.zoomInButton && this.zoomInButton.disabled != zoomInDisabled) {
|
|
51607
51906
|
this.zoomInButton.disabled = zoomInDisabled;
|
|
@@ -51615,7 +51914,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
51615
51914
|
var zoomInButton = document.createElement("button");
|
|
51616
51915
|
zoomInButton.classList.add("azure-maps-control-button");
|
|
51617
51916
|
zoomInButton.classList.add("zoom-in");
|
|
51618
|
-
zoomInButton.setAttribute("
|
|
51917
|
+
zoomInButton.setAttribute("aria-label", "Zoom In");
|
|
51619
51918
|
zoomInButton.setAttribute("alt", "Zoom In");
|
|
51620
51919
|
zoomInButton.setAttribute("type", "button");
|
|
51621
51920
|
zoomInButton.addEventListener("click", function () {
|
|
@@ -51632,7 +51931,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
51632
51931
|
var zoomOutButton = document.createElement("button");
|
|
51633
51932
|
zoomOutButton.classList.add("azure-maps-control-button");
|
|
51634
51933
|
zoomOutButton.classList.add("zoom-out");
|
|
51635
|
-
zoomOutButton.setAttribute("
|
|
51934
|
+
zoomOutButton.setAttribute("aria-label", "Zoom Out");
|
|
51636
51935
|
zoomOutButton.setAttribute("alt", "Zoom Out");
|
|
51637
51936
|
zoomOutButton.setAttribute("type", "button");
|
|
51638
51937
|
zoomOutButton.addEventListener("click", function () {
|
|
@@ -51644,7 +51943,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
51644
51943
|
});
|
|
51645
51944
|
return zoomOutButton;
|
|
51646
51945
|
};
|
|
51647
|
-
ZoomControl.WEBMERCATOR_MAXLAT = 85.0511;
|
|
51648
51946
|
ZoomControl.ZOOM_DURATION_MS = 200;
|
|
51649
51947
|
return ZoomControl;
|
|
51650
51948
|
}(ControlBase));
|
|
@@ -52507,6 +52805,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
52507
52805
|
if (value instanceof Source) {
|
|
52508
52806
|
return value;
|
|
52509
52807
|
}
|
|
52808
|
+
else {
|
|
52809
|
+
return undefined;
|
|
52810
|
+
}
|
|
52510
52811
|
};
|
|
52511
52812
|
return LayerOptions;
|
|
52512
52813
|
}(Options));
|
|
@@ -52763,6 +53064,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
52763
53064
|
if (value instanceof Source) {
|
|
52764
53065
|
return value;
|
|
52765
53066
|
}
|
|
53067
|
+
else {
|
|
53068
|
+
return undefined;
|
|
53069
|
+
}
|
|
52766
53070
|
};
|
|
52767
53071
|
return HeatMapLayerOptions;
|
|
52768
53072
|
}(LayerOptions));
|
|
@@ -52958,6 +53262,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
52958
53262
|
if (value instanceof Source) {
|
|
52959
53263
|
return value;
|
|
52960
53264
|
}
|
|
53265
|
+
else {
|
|
53266
|
+
return undefined;
|
|
53267
|
+
}
|
|
52961
53268
|
};
|
|
52962
53269
|
return ImageLayerOptions;
|
|
52963
53270
|
}(MediaLayerOptions));
|
|
@@ -54745,6 +55052,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54745
55052
|
if (_this.options.closeButton) {
|
|
54746
55053
|
_this.closeBtn = _this._createCloseButton();
|
|
54747
55054
|
_this.contentDiv.appendChild(_this.closeBtn);
|
|
55055
|
+
var tooltip = buildAccessibleTooltip("close");
|
|
55056
|
+
_this.contentDiv.appendChild(tooltip);
|
|
55057
|
+
positionTooltip(tooltip, _this.closeBtn, true);
|
|
54748
55058
|
}
|
|
54749
55059
|
return _this;
|
|
54750
55060
|
}
|
|
@@ -54778,6 +55088,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54778
55088
|
if (newOptions.closeButton && !this.closeBtn) {
|
|
54779
55089
|
this.closeBtn = this._createCloseButton();
|
|
54780
55090
|
this.contentDiv.appendChild(this.closeBtn);
|
|
55091
|
+
var tooltip = buildAccessibleTooltip("close");
|
|
55092
|
+
this.contentDiv.appendChild(tooltip);
|
|
55093
|
+
positionTooltip(tooltip, this.closeBtn, true);
|
|
54781
55094
|
}
|
|
54782
55095
|
else if (!newOptions.closeButton && this.closeBtn) {
|
|
54783
55096
|
this.contentDiv.removeChild(this.closeBtn);
|
|
@@ -54955,7 +55268,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54955
55268
|
ele.addEventListener("click", this.close);
|
|
54956
55269
|
ele.classList.add(Popup.Css.close);
|
|
54957
55270
|
ele.setAttribute("aria-label", "close");
|
|
54958
|
-
ele.setAttribute("title", "close");
|
|
54959
55271
|
ele.setAttribute("tabindex", "0");
|
|
54960
55272
|
ele.innerHTML = "×";
|
|
54961
55273
|
return ele;
|
|
@@ -55248,7 +55560,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
55248
55560
|
(newOptions.color !== this.options.color ||
|
|
55249
55561
|
newOptions.text !== this.options.text ||
|
|
55250
55562
|
newOptions.secondaryColor !== this.options.secondaryColor)) {
|
|
55251
|
-
this.element.innerHTML = this._getSubbedHtmlString(newOptions);
|
|
55563
|
+
this.element.innerHTML = this._getSubbedHtmlString(newOptions) || "";
|
|
55252
55564
|
}
|
|
55253
55565
|
if (newOptions.draggable !== this.options.draggable) {
|
|
55254
55566
|
this._setDraggable(newOptions.draggable);
|
|
@@ -55343,7 +55655,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
55343
55655
|
// Must converts a HTML string to a HTMLElement (div with innerHTML == htmlContent).
|
|
55344
55656
|
// Must also handle the substitution of HTML string placeholders.
|
|
55345
55657
|
if (typeof options.htmlContent === "string") {
|
|
55346
|
-
var subbedContent = this._getSubbedHtmlString(options);
|
|
55658
|
+
var subbedContent = this._getSubbedHtmlString(options) || "";
|
|
55347
55659
|
this.element = Html.convertHtmlString(subbedContent);
|
|
55348
55660
|
}
|
|
55349
55661
|
else {
|
|
@@ -55394,6 +55706,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
55394
55706
|
.replace(/{secondaryColor}/ig, options.secondaryColor || "")
|
|
55395
55707
|
.replace(/{text}/ig, options.text || "");
|
|
55396
55708
|
}
|
|
55709
|
+
else {
|
|
55710
|
+
return null;
|
|
55711
|
+
}
|
|
55397
55712
|
};
|
|
55398
55713
|
/**
|
|
55399
55714
|
* Returns the element that should contain all the markers.
|
|
@@ -67250,16 +67565,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
67250
67565
|
}
|
|
67251
67566
|
this.options.copyrightContent = newOptions.copyrightContent;
|
|
67252
67567
|
}
|
|
67253
|
-
if (!newOptions.showLogo && this.
|
|
67568
|
+
if (!newOptions.showLogo && this.logoAnchor) {
|
|
67254
67569
|
this.addRemoveLogo(false);
|
|
67255
67570
|
}
|
|
67256
|
-
else if (newOptions.showLogo && !this.
|
|
67571
|
+
else if (newOptions.showLogo && !this.logoAnchor) {
|
|
67257
67572
|
this.addRemoveLogo(true);
|
|
67258
67573
|
}
|
|
67259
|
-
if (!newOptions.showFeedbackLink && this.
|
|
67574
|
+
if (!newOptions.showFeedbackLink && this.feedbackAnchor) {
|
|
67260
67575
|
this.addRemoveFeedbackDiv(false);
|
|
67261
67576
|
}
|
|
67262
|
-
else if (newOptions.showFeedbackLink && !this.
|
|
67577
|
+
else if (newOptions.showFeedbackLink && !this.feedbackAnchor) {
|
|
67263
67578
|
this.addRemoveFeedbackDiv(true);
|
|
67264
67579
|
}
|
|
67265
67580
|
this.options = newOptions;
|
|
@@ -67278,56 +67593,45 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
67278
67593
|
return copyright;
|
|
67279
67594
|
};
|
|
67280
67595
|
CopyrightControl.prototype.buildFeedbackLink = function () {
|
|
67281
|
-
var _this = this;
|
|
67282
67596
|
var link = document.createElement("a");
|
|
67597
|
+
link.setAttribute("alt", "Give Feedback");
|
|
67598
|
+
link.setAttribute("aria-label", "Give Feedback");
|
|
67283
67599
|
link.href = "https://feedback.azuremaps.com";
|
|
67284
67600
|
link.target = "_blank";
|
|
67285
67601
|
link.rel = "noopener";
|
|
67286
67602
|
link.className = "azure-map-feedback";
|
|
67287
|
-
link.onmouseover = function () {
|
|
67288
|
-
_this.tooltip.style.visibility = "visible";
|
|
67289
|
-
};
|
|
67290
|
-
link.onmouseout = function () {
|
|
67291
|
-
_this.tooltip.style.visibility = "hidden";
|
|
67292
|
-
};
|
|
67293
67603
|
return link;
|
|
67294
67604
|
};
|
|
67295
|
-
CopyrightControl.prototype.addToolTip = function () {
|
|
67296
|
-
var tooltip = document.createElement("div");
|
|
67297
|
-
var tooltipText = document.createElement("div");
|
|
67298
|
-
tooltipText.innerText = "Give Feedback";
|
|
67299
|
-
tooltipText.className = "azure-map-feedback-tooltip";
|
|
67300
|
-
var tooltipBeak = document.createElement("div");
|
|
67301
|
-
tooltipBeak.className = "azure-map-feedback-tooltip-beak";
|
|
67302
|
-
tooltip.appendChild(tooltipText);
|
|
67303
|
-
tooltip.appendChild(tooltipBeak);
|
|
67304
|
-
tooltip.style.visibility = "hidden";
|
|
67305
|
-
tooltip.style.zIndex = "1000";
|
|
67306
|
-
return tooltip;
|
|
67307
|
-
};
|
|
67308
67605
|
CopyrightControl.prototype.addRemoveFeedbackDiv = function (add) {
|
|
67309
67606
|
if (add) {
|
|
67310
|
-
this.
|
|
67311
|
-
this.
|
|
67312
|
-
this.
|
|
67607
|
+
this.feedbackAnchor = this.buildFeedbackLink();
|
|
67608
|
+
this.tooltip = buildAccessibleTooltip("Give Feedback");
|
|
67609
|
+
this.container.appendChild(this.feedbackAnchor);
|
|
67313
67610
|
this.container.appendChild(this.tooltip);
|
|
67611
|
+
positionTooltip(this.tooltip, this.feedbackAnchor);
|
|
67314
67612
|
}
|
|
67315
67613
|
else {
|
|
67316
|
-
this.
|
|
67614
|
+
this.feedbackAnchor.remove();
|
|
67317
67615
|
this.tooltip.remove();
|
|
67318
67616
|
delete this.tooltip;
|
|
67319
|
-
delete this.
|
|
67617
|
+
delete this.feedbackAnchor;
|
|
67320
67618
|
}
|
|
67321
67619
|
};
|
|
67322
67620
|
CopyrightControl.prototype.addRemoveLogo = function (add) {
|
|
67323
67621
|
if (add) {
|
|
67324
|
-
this.
|
|
67325
|
-
this.
|
|
67326
|
-
this.
|
|
67622
|
+
this.logoAnchor = document.createElement("a");
|
|
67623
|
+
this.logoAnchor.className = "azure-map-logo";
|
|
67624
|
+
this.logoAnchor.href = "https://microsoft.com";
|
|
67625
|
+
this.logoAnchor.setAttribute("aria-label", "Microsoft");
|
|
67626
|
+
this.container.appendChild(this.logoAnchor);
|
|
67627
|
+
this.logoTooltip = buildAccessibleTooltip("Visit microsoft.com");
|
|
67628
|
+
this.container.appendChild(this.logoTooltip);
|
|
67629
|
+
positionTooltip(this.logoTooltip, this.logoAnchor);
|
|
67327
67630
|
}
|
|
67328
67631
|
else {
|
|
67329
|
-
this.
|
|
67330
|
-
|
|
67632
|
+
this.logoAnchor.remove();
|
|
67633
|
+
this.logoTooltip.remove();
|
|
67634
|
+
delete this.logoAnchor;
|
|
67331
67635
|
}
|
|
67332
67636
|
};
|
|
67333
67637
|
return CopyrightControl;
|
|
@@ -68380,6 +68684,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68380
68684
|
if (this._getCanonicalZoom(this._lastCam.zoom) !== this._getCanonicalZoom(cam.zoom)) {
|
|
68381
68685
|
msg.push("to " + this._getCanonicalZoom(cam.zoom) + " level");
|
|
68382
68686
|
}
|
|
68687
|
+
// announce maximum zoom reached
|
|
68688
|
+
if (cam.zoom >= cam.maxZoom) {
|
|
68689
|
+
msg.push("Zoom In button disabled, maximum zoom level reached");
|
|
68690
|
+
}
|
|
68691
|
+
var reachedLatitudeBoundaries = BoundingBox.getSouth(cam.bounds) <= -WEBMERCATOR_MAXLAT
|
|
68692
|
+
&& BoundingBox.getNorth(cam.bounds) >= WEBMERCATOR_MAXLAT;
|
|
68693
|
+
// annouce minimum zoom level reached
|
|
68694
|
+
if (cam.zoom <= cam.minZoom || reachedLatitudeBoundaries) {
|
|
68695
|
+
msg.push("Zoom Out button disabled, minimum zoom level reached");
|
|
68696
|
+
}
|
|
68383
68697
|
// Add the complete message to the actions array.
|
|
68384
68698
|
actions.push(msg.join(" "));
|
|
68385
68699
|
}
|
|
@@ -68880,14 +69194,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68880
69194
|
var titleEl = document.createElement("div");
|
|
68881
69195
|
titleEl.classList.add("incident-popup-title");
|
|
68882
69196
|
titleEl.classList.add("font-segoeui-b");
|
|
68883
|
-
titleEl.setAttribute("tabindex", "0");
|
|
68884
69197
|
titleEl.innerText = incident.properties.incidentType;
|
|
68885
69198
|
titleEl.setAttribute("aria-label", "Incident Type " + incident.properties.incidentType);
|
|
68886
69199
|
var subtitleEl = document.createElement("div");
|
|
68887
69200
|
subtitleEl.classList.add("incident-popup-subtitle");
|
|
68888
69201
|
subtitleEl.classList.add("font-segoeui-b");
|
|
68889
69202
|
subtitleEl.setAttribute("aria-label", "Incident Description " + incident.properties.description);
|
|
68890
|
-
subtitleEl.setAttribute("tabindex", "0");
|
|
68891
69203
|
subtitleEl.innerText = incident.properties.description;
|
|
68892
69204
|
var headerEl = document.createElement("div");
|
|
68893
69205
|
headerEl.classList.add("incident-popup-header");
|
|
@@ -68947,7 +69259,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68947
69259
|
messageEl.classList.add("message");
|
|
68948
69260
|
messageEl.classList.add("font-segoeui");
|
|
68949
69261
|
messageEl.setAttribute("aria-label", "Incident " + iconName + " " + message);
|
|
68950
|
-
messageEl.setAttribute("tabindex", "0");
|
|
68951
69262
|
messageEl.innerText = message;
|
|
68952
69263
|
infoSectionEl.appendChild(iconEl);
|
|
68953
69264
|
infoSectionEl.appendChild(messageEl);
|
|
@@ -69244,9 +69555,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69244
69555
|
if (_this.dpPoint) {
|
|
69245
69556
|
_this.map._getMap().touchZoomRotate.enable();
|
|
69246
69557
|
_this.map._getMap().dragPan.enable();
|
|
69247
|
-
_this.map._getMap().touchZoomRotate.onStart(Date.now() - _this.startTiming >= _this.delay
|
|
69248
|
-
? data.originalEvent
|
|
69249
|
-
: _this.startEventData.originalEvent);
|
|
69250
69558
|
}
|
|
69251
69559
|
_this.dpPoint = undefined;
|
|
69252
69560
|
return;
|
|
@@ -74983,6 +75291,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
74983
75291
|
else if (this.options.authType === exports.AuthenticationType.subscriptionKey) {
|
|
74984
75292
|
return this.options.subscriptionKey;
|
|
74985
75293
|
}
|
|
75294
|
+
else {
|
|
75295
|
+
return undefined;
|
|
75296
|
+
}
|
|
74986
75297
|
};
|
|
74987
75298
|
/**
|
|
74988
75299
|
* Given a token, calculate the time left for token expiry
|
|
@@ -75719,7 +76030,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75719
76030
|
*/
|
|
75720
76031
|
EventManager.prototype._invokeListeners = function (eventType, layer, args) {
|
|
75721
76032
|
var _this = this;
|
|
75722
|
-
|
|
76033
|
+
// copy event callbacks in order to prevent being mutated during iteration below (even callbacks added as part of other event callbacks)
|
|
76034
|
+
var callbacks = new Dictionary(this.mapCallbackHandler.getEventCallbacks(eventType, layer));
|
|
75723
76035
|
if (callbacks) {
|
|
75724
76036
|
callbacks.forEach(function (_a, callback) {
|
|
75725
76037
|
var _b = __read(_a, 2), _ = _b[0], once = _b[1];
|
|
@@ -76033,11 +76345,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
76033
76345
|
var timedOut_1 = false;
|
|
76034
76346
|
// Use the map to send the request so transformRequest is used.
|
|
76035
76347
|
_this.map._sendRequest(imageSrc, "Image").then(function (response) {
|
|
76036
|
-
|
|
76037
|
-
return response.blob();
|
|
76038
|
-
}
|
|
76348
|
+
return !timedOut_1 ? response.blob() : undefined;
|
|
76039
76349
|
}).then(function (blob) {
|
|
76040
|
-
if (!timedOut_1) {
|
|
76350
|
+
if (!timedOut_1 && blob) {
|
|
76041
76351
|
clearTimeout(timeoutId_1);
|
|
76042
76352
|
var imageEle_1 = new Image();
|
|
76043
76353
|
// Wait for the blob to load into the element.
|
|
@@ -77798,35 +78108,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
77798
78108
|
return StyleOptions;
|
|
77799
78109
|
}(Options));
|
|
77800
78110
|
|
|
77801
|
-
/**
|
|
77802
|
-
* The options for setting traffic on the map.
|
|
77803
|
-
*/
|
|
77804
|
-
var TrafficOptions = /** @class */ (function (_super) {
|
|
77805
|
-
__extends(TrafficOptions, _super);
|
|
77806
|
-
function TrafficOptions() {
|
|
77807
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
77808
|
-
/**
|
|
77809
|
-
* The type of traffic flow to display:
|
|
77810
|
-
* <p>"none" is to display no traffic flow data</p>
|
|
77811
|
-
* <p>"relative" is the speed of the road relative to free-flow</p>
|
|
77812
|
-
* <p>"absolute" is the absolute speed of the road</p>
|
|
77813
|
-
* <p>"relative-delay" displays relative speed only where they differ from free-flow;
|
|
77814
|
-
* false to stop displaying the traffic flow.</p>
|
|
77815
|
-
* default `"none"``
|
|
77816
|
-
* @default "none"
|
|
77817
|
-
*/
|
|
77818
|
-
_this.flow = "none";
|
|
77819
|
-
/**
|
|
77820
|
-
* Whether to display incidents on the map.
|
|
77821
|
-
* default `false`
|
|
77822
|
-
* @default false
|
|
77823
|
-
*/
|
|
77824
|
-
_this.incidents = false;
|
|
77825
|
-
return _this;
|
|
77826
|
-
}
|
|
77827
|
-
return TrafficOptions;
|
|
77828
|
-
}(Options));
|
|
77829
|
-
|
|
77830
78111
|
var composeTransformers = function (transformers) { return transformers.length == 0
|
|
77831
78112
|
? undefined
|
|
77832
78113
|
: transformers.slice(1).reduce(function (chained, transform) {
|
|
@@ -77948,6 +78229,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
77948
78229
|
* By default, it is set to half the number of CPU cores (capped at 6).
|
|
77949
78230
|
*/
|
|
77950
78231
|
_this.workerCount = getWorkerCount();
|
|
78232
|
+
/**
|
|
78233
|
+
* Controls the duration of the fade-in/fade-out animation for label collisions, in milliseconds.
|
|
78234
|
+
* This setting affects all symbol layers.
|
|
78235
|
+
* This setting does not affect the duration of runtime styling transitions or raster tile cross-fading.
|
|
78236
|
+
* @default 300
|
|
78237
|
+
*/
|
|
78238
|
+
_this.fadeDuration = 300;
|
|
78239
|
+
/**
|
|
78240
|
+
* Defines a CSS font-family for locally overriding generation of glyphs in the
|
|
78241
|
+
* 'CJK Unified Ideographs', 'Hiragana', 'Katakana' and 'Hangul Syllables' ranges.
|
|
78242
|
+
* In these ranges, font settings from the map's style will be ignored,
|
|
78243
|
+
* except for font-weight keywords (light/regular/medium/bold). Set to false,
|
|
78244
|
+
* to enable font settings from the map's style for these glyph ranges.
|
|
78245
|
+
* The purpose of this option is to avoid bandwidth-intensive glyph server requests.
|
|
78246
|
+
* @default 'sans-serif'
|
|
78247
|
+
*/
|
|
78248
|
+
_this.localIdeographFontFamily = 'sans-serif';
|
|
78249
|
+
/**
|
|
78250
|
+
* True to validate styles before it's getting applied.
|
|
78251
|
+
* Validation takes significant(few hundred ms) time to process styles during initial load.
|
|
78252
|
+
* Can be set to false for production environment to improve performance.
|
|
78253
|
+
* @internal
|
|
78254
|
+
* @default 'true'
|
|
78255
|
+
*/
|
|
78256
|
+
_this.validateStyle = true;
|
|
77951
78257
|
return _this;
|
|
77952
78258
|
}
|
|
77953
78259
|
/**
|
|
@@ -78084,13 +78390,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78084
78390
|
var _a, _b;
|
|
78085
78391
|
var layerId = (_b = (_a = layer) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : layer;
|
|
78086
78392
|
if (!layerId.startsWith("microsoft.")) {
|
|
78087
|
-
return;
|
|
78393
|
+
return undefined;
|
|
78088
78394
|
}
|
|
78089
78395
|
var idTokens = layerId.split('.');
|
|
78090
78396
|
if (idTokens.length >= 4) {
|
|
78091
78397
|
return idTokens[3];
|
|
78092
78398
|
}
|
|
78093
|
-
return;
|
|
78399
|
+
return undefined;
|
|
78094
78400
|
};
|
|
78095
78401
|
return LayerGroupComparator;
|
|
78096
78402
|
}());
|
|
@@ -78147,7 +78453,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78147
78453
|
StyleManager.prototype.setStyleUrl = function (styleOptions) {
|
|
78148
78454
|
var styleUrl = this.getStyleUrl(styleOptions);
|
|
78149
78455
|
try {
|
|
78150
|
-
this.map._getMap().setStyle(styleUrl, {
|
|
78456
|
+
this.map._getMap().setStyle(styleUrl, {
|
|
78457
|
+
diff: true,
|
|
78458
|
+
stylePatch: this._stylePatch.bind(this),
|
|
78459
|
+
validate: this.serviceOptions.validateStyle
|
|
78460
|
+
});
|
|
78151
78461
|
}
|
|
78152
78462
|
catch (e) {
|
|
78153
78463
|
throw e;
|
|
@@ -78211,6 +78521,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78211
78521
|
*/
|
|
78212
78522
|
StyleManager.prototype._stylePatch = function (previousStyle, nextStyle, preserveLayer, updatePaintProperty, updateLayoutProperty, updateFilter) {
|
|
78213
78523
|
var _this = this;
|
|
78524
|
+
// Layers in the next style with default properties that do not align with current StyleOptions
|
|
78525
|
+
// should be modified before they are applied to the map.
|
|
78526
|
+
var styleOptions = this.map.getStyle();
|
|
78527
|
+
var trafficOptions = this.map.getTraffic();
|
|
78528
|
+
// force a replacement of language placeholder in the tileset url to avoid resolution to a same cache with placeholders on language change
|
|
78529
|
+
nextStyle.sources = Object.entries(nextStyle.sources).reduce(function (newSources, _a) {
|
|
78530
|
+
var _b = __read(_a, 2), sourceKey = _b[0], source = _b[1];
|
|
78531
|
+
var newSource = __assign({}, source);
|
|
78532
|
+
if ('url' in newSource && typeof newSource.url === 'string') {
|
|
78533
|
+
if (newSource.url.includes(constants.languagePlaceHolder)) {
|
|
78534
|
+
newSource.url = newSource.url.replace(constants.languagePlaceHolder, styleOptions.language);
|
|
78535
|
+
}
|
|
78536
|
+
}
|
|
78537
|
+
newSources[sourceKey] = newSource;
|
|
78538
|
+
return newSources;
|
|
78539
|
+
}, {});
|
|
78214
78540
|
// A FundamentalMapLayer (grouped layer) representation of the next style must be built.
|
|
78215
78541
|
var previousLayers = this.map.layers.getLayers();
|
|
78216
78542
|
var nextLayers = [];
|
|
@@ -78221,10 +78547,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78221
78547
|
currentLayerGroupId = nextLayerGroup;
|
|
78222
78548
|
currentLayerGroupLayers = [];
|
|
78223
78549
|
};
|
|
78224
|
-
// Layers in the next style with default properties that do not align with current StyleOptions
|
|
78225
|
-
// should be modified before they are applied to the map.
|
|
78226
|
-
var styleOptions = this.map.getStyle();
|
|
78227
|
-
var trafficOptions = this.map.getTraffic();
|
|
78228
78550
|
nextStyle.layers.forEach(function (nextLayer) {
|
|
78229
78551
|
var _a, _b, _c;
|
|
78230
78552
|
var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer.id);
|
|
@@ -78490,6 +78812,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78490
78812
|
var mapboxMapOptions = {
|
|
78491
78813
|
attributionControl: false,
|
|
78492
78814
|
container: container,
|
|
78815
|
+
fadeDuration: _this.serviceOptions.fadeDuration,
|
|
78816
|
+
localIdeographFontFamily: _this.serviceOptions.localIdeographFontFamily,
|
|
78493
78817
|
preserveDrawingBuffer: _this.styleOptions.preserveDrawingBuffer,
|
|
78494
78818
|
refreshExpiredTiles: _this.serviceOptions.refreshExpiredTiles,
|
|
78495
78819
|
renderWorldCopies: _this.styleOptions.renderWorldCopies,
|
|
@@ -79324,6 +79648,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
79324
79648
|
var previousIncidentsOption = this.trafficOptions.incidents;
|
|
79325
79649
|
var previousFlowOption = this.trafficOptions.flow;
|
|
79326
79650
|
this.trafficOptions = new TrafficOptions().merge(this.trafficOptions, options);
|
|
79651
|
+
this.controls.getControls().filter(function (control) { return control instanceof TrafficControl; }).forEach(function (control) {
|
|
79652
|
+
return control.updateButtonState();
|
|
79653
|
+
});
|
|
79327
79654
|
if (this.incidentDelegate) {
|
|
79328
79655
|
if (this.trafficOptions.incidents) {
|
|
79329
79656
|
if (!previousIncidentsOption) {
|