azure-maps-control 2.1.6 → 2.1.10
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 +200 -133
- package/dist/atlas-core.min.js +1 -1
- package/dist/atlas.css +126 -0
- package/dist/atlas.js +200 -133
- package/dist/atlas.min.css +1 -1
- package/dist/atlas.min.js +1 -1
- package/package.json +1 -1
- package/typings/index.d.ts +26 -0
package/dist/atlas-core.js
CHANGED
|
@@ -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.10";
|
|
43491
43491
|
|
|
43492
43492
|
/**
|
|
43493
43493
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -43532,7 +43532,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43532
43532
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
43533
43533
|
tooltipContent.classList.add('dark');
|
|
43534
43534
|
}
|
|
43535
|
-
window.matchMedia('(prefers-color-scheme: dark)')
|
|
43535
|
+
var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
43536
|
+
var onThemeChange = function (e) {
|
|
43536
43537
|
var isDark = e.matches;
|
|
43537
43538
|
if (isDark && !tooltipContent.classList.contains('dark')) {
|
|
43538
43539
|
tooltipContent.classList.add('dark');
|
|
@@ -43540,7 +43541,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43540
43541
|
else if (!isDark && tooltipContent.classList.contains('dark')) {
|
|
43541
43542
|
tooltipContent.classList.remove('dark');
|
|
43542
43543
|
}
|
|
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
|
+
}
|
|
43544
43552
|
return tooltipContent;
|
|
43545
43553
|
};
|
|
43546
43554
|
/**
|
|
@@ -46839,6 +46847,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46839
46847
|
var styleOpsGrid = this.buildStyleOpsGrid(container);
|
|
46840
46848
|
var currStyleButton = this.buildCurrStyleBtn(container, styleOpsGrid);
|
|
46841
46849
|
var tooltip = buildAccessibleTooltip("Select Style");
|
|
46850
|
+
styleOpsGrid.classList.add(options ? options.position || 'top-right' : 'top-right');
|
|
46842
46851
|
container.addEventListener("mouseover", function () {
|
|
46843
46852
|
_this.hasMouse = true;
|
|
46844
46853
|
container.classList.add(StyleControl.Css.inUse);
|
|
@@ -46904,6 +46913,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46904
46913
|
if (image.alt !== newAlt) {
|
|
46905
46914
|
image.alt = newAlt;
|
|
46906
46915
|
}
|
|
46916
|
+
if (image.parentElement.lastChild instanceof Text) {
|
|
46917
|
+
image.parentElement.lastChild.textContent = newAlt;
|
|
46918
|
+
}
|
|
46907
46919
|
}
|
|
46908
46920
|
};
|
|
46909
46921
|
/**
|
|
@@ -46934,15 +46946,21 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46934
46946
|
styleOptionButton.setAttribute("type", "button");
|
|
46935
46947
|
var styleIconImage = new Image();
|
|
46936
46948
|
styleIconImage.src = icon;
|
|
46937
|
-
|
|
46949
|
+
if (this.options.layout === "icons") {
|
|
46950
|
+
styleIconImage.alt = friendlyName;
|
|
46951
|
+
}
|
|
46938
46952
|
styleOptionButton.appendChild(styleIconImage);
|
|
46939
46953
|
if (this.options.layout === "icons") {
|
|
46940
46954
|
styleOptionButton.classList.add(StyleControl.Css.button);
|
|
46941
46955
|
}
|
|
46942
46956
|
else {
|
|
46957
|
+
styleOptionButton.classList.add(StyleControl.Css.listButton);
|
|
46958
|
+
styleOptionButton.classList.add(StyleControl.Css.expanded);
|
|
46943
46959
|
styleOptionButton.appendChild(document.createTextNode(friendlyName));
|
|
46944
46960
|
}
|
|
46945
46961
|
styleOptionButton.addEventListener("click", function () {
|
|
46962
|
+
_this.hasMouse = false;
|
|
46963
|
+
_this.hasFocus = false;
|
|
46946
46964
|
var styleButton = _this.styleButtons[name];
|
|
46947
46965
|
if (styleButton && !styleButton.hasAttribute("disabled")) {
|
|
46948
46966
|
_this._invokeEvent("styleselected", name);
|
|
@@ -46961,12 +46979,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46961
46979
|
return styleOptionButton;
|
|
46962
46980
|
};
|
|
46963
46981
|
StyleControl.prototype.buildCurrStyleBtn = function (container, opsGrid) {
|
|
46964
|
-
var selectCurrButton = document.createElement("
|
|
46965
|
-
|
|
46982
|
+
var selectCurrButton = document.createElement("div");
|
|
46983
|
+
if (this.options.layout == 'icons') {
|
|
46984
|
+
selectCurrButton.classList.add(StyleControl.Css.button);
|
|
46985
|
+
}
|
|
46986
|
+
else {
|
|
46987
|
+
selectCurrButton.classList.add(StyleControl.Css.listButton);
|
|
46988
|
+
}
|
|
46966
46989
|
selectCurrButton.classList.add(StyleControl.Css.currentStyle);
|
|
46967
46990
|
selectCurrButton.setAttribute("aria-label", "Select Style");
|
|
46968
46991
|
selectCurrButton.setAttribute("alt", "Select Style");
|
|
46969
|
-
selectCurrButton.setAttribute("type", "button");
|
|
46970
46992
|
this.currStyleImage = new Image();
|
|
46971
46993
|
selectCurrButton.appendChild(this.currStyleImage);
|
|
46972
46994
|
var selectCurrButtonIcon = document.createElement("div");
|
|
@@ -46978,7 +47000,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
46978
47000
|
var _this = this;
|
|
46979
47001
|
var styleOpsGrid = document.createElement("div");
|
|
46980
47002
|
styleOpsGrid.classList.add(StyleControl.Css.styleOptions);
|
|
46981
|
-
|
|
47003
|
+
if (this.options.layout === 'icons') {
|
|
47004
|
+
styleOpsGrid.classList.add(this.options.layout);
|
|
47005
|
+
}
|
|
47006
|
+
else {
|
|
47007
|
+
styleOpsGrid.classList.add(StyleControl.Css.dropdown);
|
|
47008
|
+
}
|
|
46982
47009
|
styleOpsGrid.setAttribute("aria-label", "Style Options");
|
|
46983
47010
|
styleOpsGrid.classList.add("hidden-accessible-element");
|
|
46984
47011
|
// Once the map's style definition is initialized create a map between style names and icons.
|
|
@@ -47012,6 +47039,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47012
47039
|
if (style.name === currStyle) {
|
|
47013
47040
|
_this.currStyleImage.src = iconUrl;
|
|
47014
47041
|
_this.currStyleImage.alt = _this.mapToFriendlyStyleName(style.name);
|
|
47042
|
+
_this.currStyleImage.parentElement.appendChild(document.createTextNode(_this.mapToFriendlyStyleName(style.name)));
|
|
47015
47043
|
}
|
|
47016
47044
|
}
|
|
47017
47045
|
}
|
|
@@ -47027,9 +47055,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47027
47055
|
var styleOptionButton = _this.buildSelectStyleBtn(styleName, iconUrl);
|
|
47028
47056
|
styleOpsGrid.appendChild(styleOptionButton);
|
|
47029
47057
|
_this.styleButtons[styleName] = styleOptionButton;
|
|
47030
|
-
|
|
47031
|
-
|
|
47032
|
-
|
|
47058
|
+
if (_this.options.layout === "icons") {
|
|
47059
|
+
var tooltip = buildAccessibleTooltip(_this.mapToFriendlyStyleName(styleName));
|
|
47060
|
+
styleOpsGrid.appendChild(tooltip);
|
|
47061
|
+
positionTooltip(tooltip, styleOptionButton);
|
|
47062
|
+
}
|
|
47033
47063
|
});
|
|
47034
47064
|
}
|
|
47035
47065
|
else {
|
|
@@ -47038,9 +47068,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47038
47068
|
var styleOptionButton = _this.buildSelectStyleBtn(styleName, iconUrl);
|
|
47039
47069
|
styleOpsGrid.appendChild(styleOptionButton);
|
|
47040
47070
|
_this.styleButtons[styleName] = styleOptionButton;
|
|
47041
|
-
|
|
47042
|
-
|
|
47043
|
-
|
|
47071
|
+
if (_this.options.layout === "icons") {
|
|
47072
|
+
var tooltip = buildAccessibleTooltip(_this.mapToFriendlyStyleName(styleName));
|
|
47073
|
+
styleOpsGrid.appendChild(tooltip);
|
|
47074
|
+
positionTooltip(tooltip, styleOptionButton);
|
|
47075
|
+
}
|
|
47044
47076
|
});
|
|
47045
47077
|
}
|
|
47046
47078
|
Object.entries(_this.styleButtons).forEach(function (_a) {
|
|
@@ -47062,9 +47094,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47062
47094
|
StyleControl.InvertOrderPositions = [exports.ControlPosition.TopRight, exports.ControlPosition.BottomRight];
|
|
47063
47095
|
StyleControl.Css = {
|
|
47064
47096
|
button: "azure-maps-control-button",
|
|
47097
|
+
listButton: "azure-maps-control-list-button",
|
|
47098
|
+
expanded: 'expanded',
|
|
47065
47099
|
currentStyle: "curr-style",
|
|
47066
47100
|
inUse: "in-use",
|
|
47067
|
-
styleOptions: "style-options"
|
|
47101
|
+
styleOptions: "style-options",
|
|
47102
|
+
dropdown: "azure-maps-control-dropdown"
|
|
47068
47103
|
};
|
|
47069
47104
|
StyleControl.StyleNamesMap = {
|
|
47070
47105
|
road: "Road",
|
|
@@ -49200,6 +49235,62 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
49200
49235
|
}
|
|
49201
49236
|
return geodesic;
|
|
49202
49237
|
}
|
|
49238
|
+
/**
|
|
49239
|
+
* Denormalizes path on antimeridian, this makes lines with coordinates on the opposite side of the antimeridian to always cross it. Note that the path crossing antimeridian will contain longitude outside of -180 to 180 range.
|
|
49240
|
+
* See getPathSplitByAntimeridian when this is not desired.
|
|
49241
|
+
* @param path Array of position objects or linestring to denormalize
|
|
49242
|
+
* @returns A denormalized array of position objects, path crossing antimeridian will contain longitude outside of -180 to 180 range.
|
|
49243
|
+
*/
|
|
49244
|
+
function getPathDenormalizedAtAntimerian(path) {
|
|
49245
|
+
var coords = Array.isArray(path) ? path : path.coordinates;
|
|
49246
|
+
return coords.reduce(function (targetPath, coord) {
|
|
49247
|
+
var last = targetPath.length > 0 ? targetPath[targetPath.length - 1] : null;
|
|
49248
|
+
// denormalize longitude on antimeridian crossing
|
|
49249
|
+
if (last && Math.abs(coord[0] - last[0]) > 180.0) {
|
|
49250
|
+
var denormLon = last[0] < 0 ? coord[0] - 360.0 : coord[0] + 360.0;
|
|
49251
|
+
targetPath.push([denormLon, coord[1]]);
|
|
49252
|
+
}
|
|
49253
|
+
else {
|
|
49254
|
+
targetPath.push(coord);
|
|
49255
|
+
}
|
|
49256
|
+
return targetPath;
|
|
49257
|
+
}, []);
|
|
49258
|
+
}
|
|
49259
|
+
/**
|
|
49260
|
+
* Split path on antimeridian into multiple paths.
|
|
49261
|
+
* See getPathDenormalizedAtAntimerian when this is not desired.
|
|
49262
|
+
* @param path Array of position objects or linestring to split
|
|
49263
|
+
* @returns A path split into multiple paths by antimeridian.
|
|
49264
|
+
*/
|
|
49265
|
+
function getPathSplitByAntimeridian(path) {
|
|
49266
|
+
var coords = Array.isArray(path) ? path : path.coordinates;
|
|
49267
|
+
var currentNonCrossing = [];
|
|
49268
|
+
var outputPaths = [];
|
|
49269
|
+
for (var k = 0; k < coords.length; k++) {
|
|
49270
|
+
currentNonCrossing.push(coords[k]);
|
|
49271
|
+
if (k + 1 >= coords.length) {
|
|
49272
|
+
continue;
|
|
49273
|
+
}
|
|
49274
|
+
var _a = __read(coords[k], 2), lon1 = _a[0], lat1 = _a[1];
|
|
49275
|
+
var _b = __read(coords[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
|
|
49276
|
+
// split the line by antimeridian
|
|
49277
|
+
// and break geodesic into two line segments
|
|
49278
|
+
if (Math.abs(lon2 - lon1) > 180.0) {
|
|
49279
|
+
var denormLon2 = lon1 > 0 ? lon2 + 360.0 : lon2 - 360.0;
|
|
49280
|
+
var antiLon = lon1 > 0 ? 180.0 : -180.0;
|
|
49281
|
+
var abs = Math.abs(denormLon2 - lon1);
|
|
49282
|
+
var antiAbs = Math.abs(antiLon - lon1);
|
|
49283
|
+
var f = antiAbs / abs;
|
|
49284
|
+
var dLat = (lat2 - lat1) * f;
|
|
49285
|
+
var antiLat = lat1 + dLat;
|
|
49286
|
+
currentNonCrossing.push([antiLon, antiLat]);
|
|
49287
|
+
outputPaths.push(currentNonCrossing);
|
|
49288
|
+
currentNonCrossing = [[-antiLon, antiLat]];
|
|
49289
|
+
}
|
|
49290
|
+
}
|
|
49291
|
+
outputPaths.push(currentNonCrossing);
|
|
49292
|
+
return outputPaths;
|
|
49293
|
+
}
|
|
49203
49294
|
/**
|
|
49204
49295
|
* Takes an array of positions objects and fills in the space between them with accurately positioned positions to form an approximated Geodesic path.
|
|
49205
49296
|
* @param path Array of position objects that form a path to fill in.
|
|
@@ -49223,18 +49314,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
49223
49314
|
// Convert positions from degrees to Radians
|
|
49224
49315
|
geodesic = geodesic.concat(_constructGeodesic(locs[i], locs[i + 1], nodeSize));
|
|
49225
49316
|
}
|
|
49226
|
-
return geodesic
|
|
49227
|
-
var last = targetPath.length > 0 ? targetPath[targetPath.length - 1] : null;
|
|
49228
|
-
// denormalize longitude on antimeridian crossing
|
|
49229
|
-
if (last && Math.abs(coord[0] - last[0]) > 180.0) {
|
|
49230
|
-
var denormLon = last[0] < 0 ? coord[0] - 360.0 : coord[0] + 360.0;
|
|
49231
|
-
targetPath.push([denormLon, coord[1]]);
|
|
49232
|
-
}
|
|
49233
|
-
else {
|
|
49234
|
-
targetPath.push(coord);
|
|
49235
|
-
}
|
|
49236
|
-
return targetPath;
|
|
49237
|
-
}, []);
|
|
49317
|
+
return getPathDenormalizedAtAntimerian(geodesic);
|
|
49238
49318
|
}
|
|
49239
49319
|
/**
|
|
49240
49320
|
* 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.
|
|
@@ -49361,15 +49441,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
49361
49441
|
return null;
|
|
49362
49442
|
}
|
|
49363
49443
|
/**
|
|
49364
|
-
*
|
|
49365
|
-
* @param origin Center of the regular polygon.
|
|
49366
|
-
* @param radius Radius of the regular polygon.
|
|
49367
|
-
* @param numberOfPositions Number of positions the polygon should have.
|
|
49368
|
-
* @param units Unit of distance measurement. Default is meters.
|
|
49369
|
-
* @param offset An offset to rotate the polygon. When 0 the first position will align with North.
|
|
49370
|
-
* @returns An array of position objects that form a regular polygon.
|
|
49444
|
+
* constructs raw regular polygon path that doesn't handle antimeridian crossing
|
|
49371
49445
|
*/
|
|
49372
|
-
function
|
|
49446
|
+
function _constructRegularPolygonPath(origin, radius, numberOfPositions, units, offset) {
|
|
49373
49447
|
units = units || "meters";
|
|
49374
49448
|
offset = (offset) ? offset : 0;
|
|
49375
49449
|
origin = getPosition(origin);
|
|
@@ -49378,9 +49452,32 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
49378
49452
|
for (var i = 0; i <= numberOfPositions; i++) {
|
|
49379
49453
|
points.push(getDestination(origin, (i * centralAngle + offset) % 360, radius, units));
|
|
49380
49454
|
}
|
|
49381
|
-
// TODO: Check for crossing the antimeridian, consider splitting path by -180/180 longitude
|
|
49382
49455
|
return points;
|
|
49383
49456
|
}
|
|
49457
|
+
/**
|
|
49458
|
+
* Calculates an array of position objects that are an equal distance away from a central point to create a regular polygon.
|
|
49459
|
+
* @param origin Center of the regular polygon.
|
|
49460
|
+
* @param radius Radius of the regular polygon.
|
|
49461
|
+
* @param numberOfPositions Number of positions the polygon should have.
|
|
49462
|
+
* @param units Unit of distance measurement. Default is meters.
|
|
49463
|
+
* @param offset An offset to rotate the polygon. When 0 the first position will align with North.
|
|
49464
|
+
* @returns An array of position objects that form a regular polygon. Path crossing antimeridian will contain longitude outside of -180 to 180 range. See getRegularPolygonPaths() when this is undesired.
|
|
49465
|
+
*/
|
|
49466
|
+
function getRegularPolygonPath(origin, radius, numberOfPositions, units, offset) {
|
|
49467
|
+
return getPathDenormalizedAtAntimerian(_constructRegularPolygonPath(origin, radius, numberOfPositions, units, offset));
|
|
49468
|
+
}
|
|
49469
|
+
/**
|
|
49470
|
+
* Calculates an array of position objects that are an equal distance away from a central point to create a regular polygon broken by antimeridian into multiple sub-paths.
|
|
49471
|
+
* @param origin Center of the regular polygon.
|
|
49472
|
+
* @param radius Radius of the regular polygon.
|
|
49473
|
+
* @param numberOfPositions Number of positions the polygon should have.
|
|
49474
|
+
* @param units Unit of distance measurement. Default is meters.
|
|
49475
|
+
* @param offset An offset to rotate the polygon. When 0 the first position will align with North.
|
|
49476
|
+
* @returns An array of paths that form a regular polygon. Comparing to getRegularPolygonPath, sub-paths will always contain longitude in -180 to 180 range
|
|
49477
|
+
*/
|
|
49478
|
+
function getRegularPolygonPaths(origin, radius, numberOfPositions, units, offset) {
|
|
49479
|
+
return getPathSplitByAntimeridian(_constructRegularPolygonPath(origin, radius, numberOfPositions, units, offset));
|
|
49480
|
+
}
|
|
49384
49481
|
/**
|
|
49385
49482
|
* Calculates a position object that is a fractional distance between two position objects.
|
|
49386
49483
|
* @param origin First position to calculate mid-point between.
|
|
@@ -50701,12 +50798,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
50701
50798
|
getDestination: getDestination,
|
|
50702
50799
|
getDistanceTo: getDistanceTo,
|
|
50703
50800
|
getEarthRadius: getEarthRadius,
|
|
50801
|
+
getPathDenormalizedAtAntimerian: getPathDenormalizedAtAntimerian,
|
|
50802
|
+
getPathSplitByAntimeridian: getPathSplitByAntimeridian,
|
|
50704
50803
|
getGeodesicPath: getGeodesicPath,
|
|
50705
50804
|
getGeodesicPaths: getGeodesicPaths,
|
|
50706
50805
|
getHeading: getHeading,
|
|
50707
50806
|
getLengthOfPath: getLengthOfPath,
|
|
50708
50807
|
getPositionAlongPath: getPositionAlongPath,
|
|
50709
50808
|
getRegularPolygonPath: getRegularPolygonPath,
|
|
50809
|
+
getRegularPolygonPaths: getRegularPolygonPaths,
|
|
50710
50810
|
interpolate: interpolate,
|
|
50711
50811
|
normalizeLatitude: normalizeLatitude,
|
|
50712
50812
|
normalizeLongitude: normalizeLongitude,
|
|
@@ -51870,9 +51970,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
51870
51970
|
var zoomOutDisabled = this.map.getCamera().zoom <= this.map._getMap().getMinZoom() || reachedLatitudeBoundaries;
|
|
51871
51971
|
if (this.zoomInButton && this.zoomInButton.disabled != zoomInDisabled) {
|
|
51872
51972
|
this.zoomInButton.disabled = zoomInDisabled;
|
|
51973
|
+
this.zoomInButton.setAttribute("aria-label", zoomInDisabled ? "Zoom In disabled" : "Zoom In");
|
|
51873
51974
|
}
|
|
51874
51975
|
if (this.zoomOutButton && this.zoomOutButton.disabled != zoomOutDisabled) {
|
|
51875
51976
|
this.zoomOutButton.disabled = zoomOutDisabled;
|
|
51977
|
+
this.zoomInButton.setAttribute("aria-label", zoomInDisabled ? "Zoom Out disabled" : "Zoom Out");
|
|
51876
51978
|
}
|
|
51877
51979
|
};
|
|
51878
51980
|
ZoomControl.prototype.constructZoomInButton = function (map) {
|
|
@@ -57890,10 +57992,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57890
57992
|
if (!_this._rotateTimeout) {
|
|
57891
57993
|
if (Date.now() - _this._lastHeadingTime >= _this._headUpdateLimit) {
|
|
57892
57994
|
// If the min required time has already passed just do the update.
|
|
57995
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
57893
57996
|
_this._rotateTimeout = setTimeout(_this._updateHeading, CompassControl.RotationDuration + 25);
|
|
57894
57997
|
}
|
|
57895
57998
|
else {
|
|
57896
57999
|
// If the min required time hasn't passed start a timeout if doesn't already exist.
|
|
58000
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
57897
58001
|
_this._rotateTimeout = setTimeout(_this._updateHeading, _this._headUpdateLimit - (Date.now() - _this._lastHeadingTime));
|
|
57898
58002
|
}
|
|
57899
58003
|
}
|
|
@@ -57915,6 +58019,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57915
58019
|
this._onMoveEnd = function (event) {
|
|
57916
58020
|
if (event.fromControl) {
|
|
57917
58021
|
// If the move end event originated from a control element delay the response to batch control clicks.
|
|
58022
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
57918
58023
|
_this._controlTimeout = setTimeout(_this._updateCam, _this._controlEventDelay);
|
|
57919
58024
|
}
|
|
57920
58025
|
else {
|
|
@@ -57926,6 +58031,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57926
58031
|
this._onStyleData = function () {
|
|
57927
58032
|
// Use setTimeout with no delay to allow mapbox time to
|
|
57928
58033
|
// update the value of .loaded() before we check it.
|
|
58034
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
57929
58035
|
setTimeout(_this._updateStyle);
|
|
57930
58036
|
};
|
|
57931
58037
|
/** Event handler for when the mouse or touch goes down */
|
|
@@ -58745,11 +58851,33 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
58745
58851
|
"Rotate 15 degrees counter clockwise: shift + left arrow.",
|
|
58746
58852
|
"Increase pitch 10 degrees: shift + up arrow.",
|
|
58747
58853
|
"Decrease pitch 10 degrees: shift + down arrow.",
|
|
58748
|
-
|
|
58854
|
+
// Interesting... i'm not sure that verbose map state was ever implemented
|
|
58855
|
+
// "Toggle verbose map state: control + alt + D.",
|
|
58749
58856
|
"Jump focus to the map: Escape."
|
|
58750
58857
|
].join("\n");
|
|
58751
58858
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapKeyBindings);
|
|
58752
58859
|
_this.atlasMapKeyBindings.setAttribute("aria-live", "polite");
|
|
58860
|
+
var baseShortcutKeyCodes = [
|
|
58861
|
+
// - (zoom out)
|
|
58862
|
+
189,
|
|
58863
|
+
// = (zoom in)
|
|
58864
|
+
187,
|
|
58865
|
+
// arrow up
|
|
58866
|
+
38,
|
|
58867
|
+
// arrow left
|
|
58868
|
+
37,
|
|
58869
|
+
// arrow right
|
|
58870
|
+
39,
|
|
58871
|
+
// arrow down
|
|
58872
|
+
40
|
|
58873
|
+
];
|
|
58874
|
+
// accessibility recommendation: After using any of the map shortcut keys, NVDA should not read all the shortcut keys again.
|
|
58875
|
+
var mapCanvas = _this.map._getMap()._canvas;
|
|
58876
|
+
mapCanvas === null || mapCanvas === void 0 ? void 0 : mapCanvas.addEventListener('keyup', function (event) {
|
|
58877
|
+
if (baseShortcutKeyCodes.find(function (code) { return event.keyCode === code; })) {
|
|
58878
|
+
_this.atlasMapKeyBindings.innerHTML = '';
|
|
58879
|
+
}
|
|
58880
|
+
});
|
|
58753
58881
|
};
|
|
58754
58882
|
this.initializeMapLiveStateInfo = function () {
|
|
58755
58883
|
_this.mapViewDesc = new MapViewDescriptor(_this.map, _this.updateMapState);
|
|
@@ -58759,7 +58887,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
58759
58887
|
_this.atlasMapLiveStateInfo.id = "atlas-map-state";
|
|
58760
58888
|
_this.atlasMapLiveStateInfo.classList.add("hidden-accessible-element");
|
|
58761
58889
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapLiveStateInfo);
|
|
58762
|
-
_this.atlasMapLiveStateInfo.setAttribute("aria-live", "
|
|
58890
|
+
_this.atlasMapLiveStateInfo.setAttribute("aria-live", "assertive");
|
|
58763
58891
|
};
|
|
58764
58892
|
this.initializeMapStyleInfo = function () {
|
|
58765
58893
|
_this.atlasMapStyleInfo = document.createElement("div");
|
|
@@ -59302,89 +59430,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59302
59430
|
return FocusShortcutHandler;
|
|
59303
59431
|
}());
|
|
59304
59432
|
|
|
59305
|
-
/** A handler that adds support for pitch gestures on mobile devices. */
|
|
59306
|
-
var MobilePitchHandler = /** @class */ (function () {
|
|
59307
|
-
function MobilePitchHandler(map) {
|
|
59308
|
-
var _this = this;
|
|
59309
|
-
// Constants for mobile pitch support.
|
|
59310
|
-
this.minDiffX = 70; // min x distance to recognize pitch gesture
|
|
59311
|
-
this.maxDiffY = 100; // max y distance to recognize pitch gesture
|
|
59312
|
-
this.minDiff = 30; // min distance to recognize zoom gesture
|
|
59313
|
-
this.delay = 160; // delay for pitch, in case it's a zoom gesture
|
|
59314
|
-
/** Callback for the touch start event */
|
|
59315
|
-
this._onTouchStart = function (data) {
|
|
59316
|
-
if (data.points.length === 2) {
|
|
59317
|
-
var diffY = data.points[0].y - data.points[1].y;
|
|
59318
|
-
var diffX = data.points[0].x - data.points[1].x;
|
|
59319
|
-
if (Math.abs(diffX) >= _this.minDiffX && Math.abs(diffY) <= _this.maxDiffY) {
|
|
59320
|
-
data.originalEvent.preventDefault(); // prevent browser refresh on pull down
|
|
59321
|
-
_this.map._getMap().touchZoomRotate.disable(); // disable native touch controls
|
|
59322
|
-
_this.map._getMap().dragPan.disable();
|
|
59323
|
-
_this.dpPoint = data.point;
|
|
59324
|
-
_this.dpPitch = _this.map._getMap().getPitch();
|
|
59325
|
-
_this.startTiming = Date.now();
|
|
59326
|
-
_this.startDistance = Math.hypot(diffX, diffY);
|
|
59327
|
-
_this.startEventData = data;
|
|
59328
|
-
}
|
|
59329
|
-
}
|
|
59330
|
-
};
|
|
59331
|
-
/** Callback for the touch move event */
|
|
59332
|
-
this._onTouchMove = function (data) {
|
|
59333
|
-
if (_this.dpPoint !== undefined && _this.dpPitch !== undefined) {
|
|
59334
|
-
data.preventDefault();
|
|
59335
|
-
data.originalEvent.preventDefault();
|
|
59336
|
-
var diffY = data.points[0].y - data.points[1].y;
|
|
59337
|
-
var diffX = data.points[0].x - data.points[1].x;
|
|
59338
|
-
var distance = Math.hypot(diffX, diffY);
|
|
59339
|
-
if (Math.abs(distance - _this.startDistance) >= _this.minDiff) {
|
|
59340
|
-
if (_this.dpPoint) {
|
|
59341
|
-
_this.map._getMap().touchZoomRotate.enable();
|
|
59342
|
-
_this.map._getMap().dragPan.enable();
|
|
59343
|
-
}
|
|
59344
|
-
_this.dpPoint = undefined;
|
|
59345
|
-
return;
|
|
59346
|
-
}
|
|
59347
|
-
if (Date.now() - _this.startTiming >= _this.delay) {
|
|
59348
|
-
var diff = (_this.dpPoint.y - data.point.y) * 0.5;
|
|
59349
|
-
_this.map._getMap().setPitch(_this.dpPitch + diff);
|
|
59350
|
-
}
|
|
59351
|
-
}
|
|
59352
|
-
};
|
|
59353
|
-
/** Callback for the touch end event */
|
|
59354
|
-
this._onTouchEnd = function () {
|
|
59355
|
-
if (_this.dpPoint) {
|
|
59356
|
-
_this.map._getMap().touchZoomRotate.enable();
|
|
59357
|
-
_this.map._getMap().dragPan.enable();
|
|
59358
|
-
}
|
|
59359
|
-
_this.dpPoint = undefined;
|
|
59360
|
-
};
|
|
59361
|
-
/** Callback for the touch cancel event */
|
|
59362
|
-
this._onTouchCancel = function () {
|
|
59363
|
-
if (_this.dpPoint) {
|
|
59364
|
-
_this.map._getMap().touchZoomRotate.enable();
|
|
59365
|
-
_this.map._getMap().dragPan.enable();
|
|
59366
|
-
}
|
|
59367
|
-
_this.dpPoint = undefined;
|
|
59368
|
-
};
|
|
59369
|
-
this.map = map;
|
|
59370
|
-
}
|
|
59371
|
-
/** Enables the mobile pitch gesture support. */
|
|
59372
|
-
MobilePitchHandler.prototype.enable = function () {
|
|
59373
|
-
this.map._getMap().on("touchstart", this._onTouchStart);
|
|
59374
|
-
this.map._getMap().on("touchmove", this._onTouchMove);
|
|
59375
|
-
this.map._getMap().on("touchend", this._onTouchEnd);
|
|
59376
|
-
this.map._getMap().on("touchcancel", this._onTouchCancel);
|
|
59377
|
-
};
|
|
59378
|
-
/** Disables the mobile pitch gesture support. */
|
|
59379
|
-
MobilePitchHandler.prototype.disable = function () {
|
|
59380
|
-
this.map._getMap().off("touchstart", this._onTouchStart);
|
|
59381
|
-
this.map._getMap().off("touchmove", this._onTouchMove);
|
|
59382
|
-
this.map._getMap().off("touchend", this._onTouchEnd);
|
|
59383
|
-
this.map._getMap().off("touchcancel", this._onTouchCancel);
|
|
59384
|
-
};
|
|
59385
|
-
return MobilePitchHandler;
|
|
59386
|
-
}());
|
|
59387
|
-
|
|
59388
59433
|
/** A handler that adds support for pinch and zoom gestures on devices without touch events. */
|
|
59389
59434
|
var PinchZoomHandler = /** @class */ (function () {
|
|
59390
59435
|
function PinchZoomHandler(map) {
|
|
@@ -59435,7 +59480,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59435
59480
|
function UserInteractionDelegate(map, options) {
|
|
59436
59481
|
this.added = false;
|
|
59437
59482
|
this.map = map;
|
|
59438
|
-
this.mobilePitch = new MobilePitchHandler(map);
|
|
59439
59483
|
this.focusShortcut = new FocusShortcutHandler(map);
|
|
59440
59484
|
this.pinchZoom = new PinchZoomHandler(map);
|
|
59441
59485
|
this.options = new UserInteractionOptions().merge(options);
|
|
@@ -59481,7 +59525,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59481
59525
|
this.focusShortcut.disable();
|
|
59482
59526
|
this.map._getMap().scrollZoom.disable();
|
|
59483
59527
|
this.map._getMap().touchZoomRotate.disable();
|
|
59484
|
-
this.mobilePitch.disable();
|
|
59485
59528
|
this.pinchZoom.disable();
|
|
59486
59529
|
}
|
|
59487
59530
|
else {
|
|
@@ -59533,12 +59576,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59533
59576
|
// Touch
|
|
59534
59577
|
if (options.touchInteraction) {
|
|
59535
59578
|
this.map._getMap().touchZoomRotate.enable();
|
|
59536
|
-
this.mobilePitch.enable();
|
|
59537
59579
|
this.pinchZoom.enable();
|
|
59538
59580
|
}
|
|
59539
59581
|
else {
|
|
59540
59582
|
this.map._getMap().touchZoomRotate.disable();
|
|
59541
|
-
this.mobilePitch.disable();
|
|
59542
59583
|
this.pinchZoom.enable();
|
|
59543
59584
|
}
|
|
59544
59585
|
}
|
|
@@ -62297,6 +62338,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
62297
62338
|
if (!cancel) {
|
|
62298
62339
|
originalMethod.apply(context, args);
|
|
62299
62340
|
shouldCancel.set(context, true);
|
|
62341
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
62300
62342
|
setTimeout(function () { return shouldCancel.delete(context); }, duration);
|
|
62301
62343
|
}
|
|
62302
62344
|
};
|
|
@@ -64876,6 +64918,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64876
64918
|
_this._storeAccessToken(token);
|
|
64877
64919
|
clearTimeout(_this.tokenTimeOutHandle); // Clear the previous refresh timeout in case it hadn't triggered yet.
|
|
64878
64920
|
// @ts-ignore
|
|
64921
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
64879
64922
|
_this.tokenTimeOutHandle = setTimeout(_this._triggerTokenFetch, timeout * 1000);
|
|
64880
64923
|
resolve();
|
|
64881
64924
|
}
|
|
@@ -64923,6 +64966,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64923
64966
|
}
|
|
64924
64967
|
// Login and acquire a token.
|
|
64925
64968
|
// Fire it async so that users can add any listeners for token acquire events first.
|
|
64969
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
64926
64970
|
setTimeout(function () { return _this._loginAndAcquire(resolve, reject); });
|
|
64927
64971
|
}
|
|
64928
64972
|
else if (_this.options.authType === exports.AuthenticationType.anonymous) {
|
|
@@ -65011,6 +65055,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65011
65055
|
_this.options.aadAppId));
|
|
65012
65056
|
}
|
|
65013
65057
|
}
|
|
65058
|
+
// tslint:disable-next-line: no-string-based-set-interval
|
|
65014
65059
|
}, 25);
|
|
65015
65060
|
}
|
|
65016
65061
|
};
|
|
@@ -65766,6 +65811,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65766
65811
|
// This is for consistency with the case where the load event hasn't already fired.
|
|
65767
65812
|
// If the load event hasn't already fired the callback will also be executed async once it does fire.
|
|
65768
65813
|
var loadData_1 = { type: "load", map: this.map };
|
|
65814
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
65769
65815
|
setTimeout(function () { return modifiedCallback(loadData_1); });
|
|
65770
65816
|
}
|
|
65771
65817
|
else if (eventType === "ready") {
|
|
@@ -65774,6 +65820,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
65774
65820
|
if (this.map._isReady()) {
|
|
65775
65821
|
// Manually execute the callback if the ready event has already fired.
|
|
65776
65822
|
var readyData_1 = { type: "ready", map: this.map };
|
|
65823
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
65777
65824
|
setTimeout(function () { return modifiedCallback(readyData_1); });
|
|
65778
65825
|
}
|
|
65779
65826
|
}
|
|
@@ -66159,6 +66206,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
66159
66206
|
timeoutId_1 = setTimeout(function () {
|
|
66160
66207
|
timedOut_1 = true;
|
|
66161
66208
|
reject("Failed to load image within specified timeout: " + _this.imageLoadTimeout + " ms.");
|
|
66209
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
66162
66210
|
}, _this.imageLoadTimeout);
|
|
66163
66211
|
}
|
|
66164
66212
|
});
|
|
@@ -68031,6 +68079,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68031
68079
|
* @default 'sans-serif'
|
|
68032
68080
|
*/
|
|
68033
68081
|
_this.localIdeographFontFamily = 'sans-serif';
|
|
68082
|
+
/**
|
|
68083
|
+
* True to validate styles before it's getting applied.
|
|
68084
|
+
* Validation takes significant(few hundred ms) time to process styles during initial load.
|
|
68085
|
+
* Can be set to false for production environment to improve performance.
|
|
68086
|
+
* @internal
|
|
68087
|
+
* @default 'true'
|
|
68088
|
+
*/
|
|
68089
|
+
_this.validateStyle = true;
|
|
68034
68090
|
return _this;
|
|
68035
68091
|
}
|
|
68036
68092
|
/**
|
|
@@ -68189,7 +68245,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68189
68245
|
* @internal
|
|
68190
68246
|
*/
|
|
68191
68247
|
function StyleManager(map, serviceOptions) {
|
|
68248
|
+
var _this = this;
|
|
68192
68249
|
this.apiVersion = "2.0";
|
|
68250
|
+
this._onStyleData = function () {
|
|
68251
|
+
_this.map.events.invoke("stylechanged", {
|
|
68252
|
+
style: _this._lookUp(_this.map.getStyle()).name,
|
|
68253
|
+
map: _this.map,
|
|
68254
|
+
type: "stylechanged"
|
|
68255
|
+
});
|
|
68256
|
+
};
|
|
68193
68257
|
this.map = map;
|
|
68194
68258
|
this.serviceOptions = serviceOptions;
|
|
68195
68259
|
}
|
|
@@ -68230,7 +68294,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68230
68294
|
StyleManager.prototype.setStyleUrl = function (styleOptions) {
|
|
68231
68295
|
var styleUrl = this.getStyleUrl(styleOptions);
|
|
68232
68296
|
try {
|
|
68233
|
-
this.map._getMap().setStyle(styleUrl, {
|
|
68297
|
+
this.map._getMap().setStyle(styleUrl, {
|
|
68298
|
+
diff: true,
|
|
68299
|
+
stylePatch: this._stylePatch.bind(this),
|
|
68300
|
+
validate: this.serviceOptions.validateStyle
|
|
68301
|
+
});
|
|
68234
68302
|
}
|
|
68235
68303
|
catch (e) {
|
|
68236
68304
|
throw e;
|
|
@@ -68402,13 +68470,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68402
68470
|
preserveLayer(userLayer.layer.getId(), before === null || before === void 0 ? void 0 : before.id);
|
|
68403
68471
|
});
|
|
68404
68472
|
this.map.sources._syncSources(nextStyle.sources);
|
|
68405
|
-
|
|
68406
|
-
|
|
68407
|
-
|
|
68408
|
-
|
|
68409
|
-
|
|
68410
|
-
|
|
68411
|
-
});
|
|
68473
|
+
// If there was a previous styledata change event attached, remove it.
|
|
68474
|
+
// When the sprite url changes between style changes then mapbox can't perform the diff
|
|
68475
|
+
// In such cases it recalculate the style again. Removing previous attached
|
|
68476
|
+
// event listner makes sure that style changed event is not fired twice in these cases.
|
|
68477
|
+
this.map.events.remove("styledata", this._onStyleData);
|
|
68478
|
+
this.map.events.addOnce("styledata", this._onStyleData);
|
|
68412
68479
|
};
|
|
68413
68480
|
StyleManager.prototype._buildFundamentalLayerFrom = function (layers, id) {
|
|
68414
68481
|
if (layers && layers.length > 0) {
|