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.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) {
|
|
@@ -68071,10 +68173,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68071
68173
|
if (!_this._rotateTimeout) {
|
|
68072
68174
|
if (Date.now() - _this._lastHeadingTime >= _this._headUpdateLimit) {
|
|
68073
68175
|
// If the min required time has already passed just do the update.
|
|
68176
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
68074
68177
|
_this._rotateTimeout = setTimeout(_this._updateHeading, CompassControl.RotationDuration + 25);
|
|
68075
68178
|
}
|
|
68076
68179
|
else {
|
|
68077
68180
|
// If the min required time hasn't passed start a timeout if doesn't already exist.
|
|
68181
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
68078
68182
|
_this._rotateTimeout = setTimeout(_this._updateHeading, _this._headUpdateLimit - (Date.now() - _this._lastHeadingTime));
|
|
68079
68183
|
}
|
|
68080
68184
|
}
|
|
@@ -68096,6 +68200,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68096
68200
|
this._onMoveEnd = function (event) {
|
|
68097
68201
|
if (event.fromControl) {
|
|
68098
68202
|
// If the move end event originated from a control element delay the response to batch control clicks.
|
|
68203
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
68099
68204
|
_this._controlTimeout = setTimeout(_this._updateCam, _this._controlEventDelay);
|
|
68100
68205
|
}
|
|
68101
68206
|
else {
|
|
@@ -68107,6 +68212,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68107
68212
|
this._onStyleData = function () {
|
|
68108
68213
|
// Use setTimeout with no delay to allow mapbox time to
|
|
68109
68214
|
// update the value of .loaded() before we check it.
|
|
68215
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
68110
68216
|
setTimeout(_this._updateStyle);
|
|
68111
68217
|
};
|
|
68112
68218
|
/** Event handler for when the mouse or touch goes down */
|
|
@@ -68926,11 +69032,33 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68926
69032
|
"Rotate 15 degrees counter clockwise: shift + left arrow.",
|
|
68927
69033
|
"Increase pitch 10 degrees: shift + up arrow.",
|
|
68928
69034
|
"Decrease pitch 10 degrees: shift + down arrow.",
|
|
68929
|
-
|
|
69035
|
+
// Interesting... i'm not sure that verbose map state was ever implemented
|
|
69036
|
+
// "Toggle verbose map state: control + alt + D.",
|
|
68930
69037
|
"Jump focus to the map: Escape."
|
|
68931
69038
|
].join("\n");
|
|
68932
69039
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapKeyBindings);
|
|
68933
69040
|
_this.atlasMapKeyBindings.setAttribute("aria-live", "polite");
|
|
69041
|
+
var baseShortcutKeyCodes = [
|
|
69042
|
+
// - (zoom out)
|
|
69043
|
+
189,
|
|
69044
|
+
// = (zoom in)
|
|
69045
|
+
187,
|
|
69046
|
+
// arrow up
|
|
69047
|
+
38,
|
|
69048
|
+
// arrow left
|
|
69049
|
+
37,
|
|
69050
|
+
// arrow right
|
|
69051
|
+
39,
|
|
69052
|
+
// arrow down
|
|
69053
|
+
40
|
|
69054
|
+
];
|
|
69055
|
+
// accessibility recommendation: After using any of the map shortcut keys, NVDA should not read all the shortcut keys again.
|
|
69056
|
+
var mapCanvas = _this.map._getMap()._canvas;
|
|
69057
|
+
mapCanvas === null || mapCanvas === void 0 ? void 0 : mapCanvas.addEventListener('keyup', function (event) {
|
|
69058
|
+
if (baseShortcutKeyCodes.find(function (code) { return event.keyCode === code; })) {
|
|
69059
|
+
_this.atlasMapKeyBindings.innerHTML = '';
|
|
69060
|
+
}
|
|
69061
|
+
});
|
|
68934
69062
|
};
|
|
68935
69063
|
this.initializeMapLiveStateInfo = function () {
|
|
68936
69064
|
_this.mapViewDesc = new MapViewDescriptor(_this.map, _this.updateMapState);
|
|
@@ -68940,7 +69068,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68940
69068
|
_this.atlasMapLiveStateInfo.id = "atlas-map-state";
|
|
68941
69069
|
_this.atlasMapLiveStateInfo.classList.add("hidden-accessible-element");
|
|
68942
69070
|
_this.map.getCanvasContainer().appendChild(_this.atlasMapLiveStateInfo);
|
|
68943
|
-
_this.atlasMapLiveStateInfo.setAttribute("aria-live", "
|
|
69071
|
+
_this.atlasMapLiveStateInfo.setAttribute("aria-live", "assertive");
|
|
68944
69072
|
};
|
|
68945
69073
|
this.initializeMapStyleInfo = function () {
|
|
68946
69074
|
_this.atlasMapStyleInfo = document.createElement("div");
|
|
@@ -69483,89 +69611,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69483
69611
|
return FocusShortcutHandler;
|
|
69484
69612
|
}());
|
|
69485
69613
|
|
|
69486
|
-
/** A handler that adds support for pitch gestures on mobile devices. */
|
|
69487
|
-
var MobilePitchHandler = /** @class */ (function () {
|
|
69488
|
-
function MobilePitchHandler(map) {
|
|
69489
|
-
var _this = this;
|
|
69490
|
-
// Constants for mobile pitch support.
|
|
69491
|
-
this.minDiffX = 70; // min x distance to recognize pitch gesture
|
|
69492
|
-
this.maxDiffY = 100; // max y distance to recognize pitch gesture
|
|
69493
|
-
this.minDiff = 30; // min distance to recognize zoom gesture
|
|
69494
|
-
this.delay = 160; // delay for pitch, in case it's a zoom gesture
|
|
69495
|
-
/** Callback for the touch start event */
|
|
69496
|
-
this._onTouchStart = function (data) {
|
|
69497
|
-
if (data.points.length === 2) {
|
|
69498
|
-
var diffY = data.points[0].y - data.points[1].y;
|
|
69499
|
-
var diffX = data.points[0].x - data.points[1].x;
|
|
69500
|
-
if (Math.abs(diffX) >= _this.minDiffX && Math.abs(diffY) <= _this.maxDiffY) {
|
|
69501
|
-
data.originalEvent.preventDefault(); // prevent browser refresh on pull down
|
|
69502
|
-
_this.map._getMap().touchZoomRotate.disable(); // disable native touch controls
|
|
69503
|
-
_this.map._getMap().dragPan.disable();
|
|
69504
|
-
_this.dpPoint = data.point;
|
|
69505
|
-
_this.dpPitch = _this.map._getMap().getPitch();
|
|
69506
|
-
_this.startTiming = Date.now();
|
|
69507
|
-
_this.startDistance = Math.hypot(diffX, diffY);
|
|
69508
|
-
_this.startEventData = data;
|
|
69509
|
-
}
|
|
69510
|
-
}
|
|
69511
|
-
};
|
|
69512
|
-
/** Callback for the touch move event */
|
|
69513
|
-
this._onTouchMove = function (data) {
|
|
69514
|
-
if (_this.dpPoint !== undefined && _this.dpPitch !== undefined) {
|
|
69515
|
-
data.preventDefault();
|
|
69516
|
-
data.originalEvent.preventDefault();
|
|
69517
|
-
var diffY = data.points[0].y - data.points[1].y;
|
|
69518
|
-
var diffX = data.points[0].x - data.points[1].x;
|
|
69519
|
-
var distance = Math.hypot(diffX, diffY);
|
|
69520
|
-
if (Math.abs(distance - _this.startDistance) >= _this.minDiff) {
|
|
69521
|
-
if (_this.dpPoint) {
|
|
69522
|
-
_this.map._getMap().touchZoomRotate.enable();
|
|
69523
|
-
_this.map._getMap().dragPan.enable();
|
|
69524
|
-
}
|
|
69525
|
-
_this.dpPoint = undefined;
|
|
69526
|
-
return;
|
|
69527
|
-
}
|
|
69528
|
-
if (Date.now() - _this.startTiming >= _this.delay) {
|
|
69529
|
-
var diff = (_this.dpPoint.y - data.point.y) * 0.5;
|
|
69530
|
-
_this.map._getMap().setPitch(_this.dpPitch + diff);
|
|
69531
|
-
}
|
|
69532
|
-
}
|
|
69533
|
-
};
|
|
69534
|
-
/** Callback for the touch end event */
|
|
69535
|
-
this._onTouchEnd = function () {
|
|
69536
|
-
if (_this.dpPoint) {
|
|
69537
|
-
_this.map._getMap().touchZoomRotate.enable();
|
|
69538
|
-
_this.map._getMap().dragPan.enable();
|
|
69539
|
-
}
|
|
69540
|
-
_this.dpPoint = undefined;
|
|
69541
|
-
};
|
|
69542
|
-
/** Callback for the touch cancel event */
|
|
69543
|
-
this._onTouchCancel = function () {
|
|
69544
|
-
if (_this.dpPoint) {
|
|
69545
|
-
_this.map._getMap().touchZoomRotate.enable();
|
|
69546
|
-
_this.map._getMap().dragPan.enable();
|
|
69547
|
-
}
|
|
69548
|
-
_this.dpPoint = undefined;
|
|
69549
|
-
};
|
|
69550
|
-
this.map = map;
|
|
69551
|
-
}
|
|
69552
|
-
/** Enables the mobile pitch gesture support. */
|
|
69553
|
-
MobilePitchHandler.prototype.enable = function () {
|
|
69554
|
-
this.map._getMap().on("touchstart", this._onTouchStart);
|
|
69555
|
-
this.map._getMap().on("touchmove", this._onTouchMove);
|
|
69556
|
-
this.map._getMap().on("touchend", this._onTouchEnd);
|
|
69557
|
-
this.map._getMap().on("touchcancel", this._onTouchCancel);
|
|
69558
|
-
};
|
|
69559
|
-
/** Disables the mobile pitch gesture support. */
|
|
69560
|
-
MobilePitchHandler.prototype.disable = function () {
|
|
69561
|
-
this.map._getMap().off("touchstart", this._onTouchStart);
|
|
69562
|
-
this.map._getMap().off("touchmove", this._onTouchMove);
|
|
69563
|
-
this.map._getMap().off("touchend", this._onTouchEnd);
|
|
69564
|
-
this.map._getMap().off("touchcancel", this._onTouchCancel);
|
|
69565
|
-
};
|
|
69566
|
-
return MobilePitchHandler;
|
|
69567
|
-
}());
|
|
69568
|
-
|
|
69569
69614
|
/** A handler that adds support for pinch and zoom gestures on devices without touch events. */
|
|
69570
69615
|
var PinchZoomHandler = /** @class */ (function () {
|
|
69571
69616
|
function PinchZoomHandler(map) {
|
|
@@ -69616,7 +69661,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69616
69661
|
function UserInteractionDelegate(map, options) {
|
|
69617
69662
|
this.added = false;
|
|
69618
69663
|
this.map = map;
|
|
69619
|
-
this.mobilePitch = new MobilePitchHandler(map);
|
|
69620
69664
|
this.focusShortcut = new FocusShortcutHandler(map);
|
|
69621
69665
|
this.pinchZoom = new PinchZoomHandler(map);
|
|
69622
69666
|
this.options = new UserInteractionOptions().merge(options);
|
|
@@ -69662,7 +69706,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69662
69706
|
this.focusShortcut.disable();
|
|
69663
69707
|
this.map._getMap().scrollZoom.disable();
|
|
69664
69708
|
this.map._getMap().touchZoomRotate.disable();
|
|
69665
|
-
this.mobilePitch.disable();
|
|
69666
69709
|
this.pinchZoom.disable();
|
|
69667
69710
|
}
|
|
69668
69711
|
else {
|
|
@@ -69714,12 +69757,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69714
69757
|
// Touch
|
|
69715
69758
|
if (options.touchInteraction) {
|
|
69716
69759
|
this.map._getMap().touchZoomRotate.enable();
|
|
69717
|
-
this.mobilePitch.enable();
|
|
69718
69760
|
this.pinchZoom.enable();
|
|
69719
69761
|
}
|
|
69720
69762
|
else {
|
|
69721
69763
|
this.map._getMap().touchZoomRotate.disable();
|
|
69722
|
-
this.mobilePitch.disable();
|
|
69723
69764
|
this.pinchZoom.enable();
|
|
69724
69765
|
}
|
|
69725
69766
|
}
|
|
@@ -72478,6 +72519,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72478
72519
|
if (!cancel) {
|
|
72479
72520
|
originalMethod.apply(context, args);
|
|
72480
72521
|
shouldCancel.set(context, true);
|
|
72522
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
72481
72523
|
setTimeout(function () { return shouldCancel.delete(context); }, duration);
|
|
72482
72524
|
}
|
|
72483
72525
|
};
|
|
@@ -75057,6 +75099,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75057
75099
|
_this._storeAccessToken(token);
|
|
75058
75100
|
clearTimeout(_this.tokenTimeOutHandle); // Clear the previous refresh timeout in case it hadn't triggered yet.
|
|
75059
75101
|
// @ts-ignore
|
|
75102
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
75060
75103
|
_this.tokenTimeOutHandle = setTimeout(_this._triggerTokenFetch, timeout * 1000);
|
|
75061
75104
|
resolve();
|
|
75062
75105
|
}
|
|
@@ -75104,6 +75147,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75104
75147
|
}
|
|
75105
75148
|
// Login and acquire a token.
|
|
75106
75149
|
// Fire it async so that users can add any listeners for token acquire events first.
|
|
75150
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
75107
75151
|
setTimeout(function () { return _this._loginAndAcquire(resolve, reject); });
|
|
75108
75152
|
}
|
|
75109
75153
|
else if (_this.options.authType === exports.AuthenticationType.anonymous) {
|
|
@@ -75192,6 +75236,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75192
75236
|
_this.options.aadAppId));
|
|
75193
75237
|
}
|
|
75194
75238
|
}
|
|
75239
|
+
// tslint:disable-next-line: no-string-based-set-interval
|
|
75195
75240
|
}, 25);
|
|
75196
75241
|
}
|
|
75197
75242
|
};
|
|
@@ -75947,6 +75992,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75947
75992
|
// This is for consistency with the case where the load event hasn't already fired.
|
|
75948
75993
|
// If the load event hasn't already fired the callback will also be executed async once it does fire.
|
|
75949
75994
|
var loadData_1 = { type: "load", map: this.map };
|
|
75995
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
75950
75996
|
setTimeout(function () { return modifiedCallback(loadData_1); });
|
|
75951
75997
|
}
|
|
75952
75998
|
else if (eventType === "ready") {
|
|
@@ -75955,6 +76001,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
75955
76001
|
if (this.map._isReady()) {
|
|
75956
76002
|
// Manually execute the callback if the ready event has already fired.
|
|
75957
76003
|
var readyData_1 = { type: "ready", map: this.map };
|
|
76004
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
75958
76005
|
setTimeout(function () { return modifiedCallback(readyData_1); });
|
|
75959
76006
|
}
|
|
75960
76007
|
}
|
|
@@ -76340,6 +76387,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
76340
76387
|
timeoutId_1 = setTimeout(function () {
|
|
76341
76388
|
timedOut_1 = true;
|
|
76342
76389
|
reject("Failed to load image within specified timeout: " + _this.imageLoadTimeout + " ms.");
|
|
76390
|
+
// tslint:disable-next-line: no-string-based-set-timeout
|
|
76343
76391
|
}, _this.imageLoadTimeout);
|
|
76344
76392
|
}
|
|
76345
76393
|
});
|
|
@@ -78212,6 +78260,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78212
78260
|
* @default 'sans-serif'
|
|
78213
78261
|
*/
|
|
78214
78262
|
_this.localIdeographFontFamily = 'sans-serif';
|
|
78263
|
+
/**
|
|
78264
|
+
* True to validate styles before it's getting applied.
|
|
78265
|
+
* Validation takes significant(few hundred ms) time to process styles during initial load.
|
|
78266
|
+
* Can be set to false for production environment to improve performance.
|
|
78267
|
+
* @internal
|
|
78268
|
+
* @default 'true'
|
|
78269
|
+
*/
|
|
78270
|
+
_this.validateStyle = true;
|
|
78215
78271
|
return _this;
|
|
78216
78272
|
}
|
|
78217
78273
|
/**
|
|
@@ -78370,7 +78426,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78370
78426
|
* @internal
|
|
78371
78427
|
*/
|
|
78372
78428
|
function StyleManager(map, serviceOptions) {
|
|
78429
|
+
var _this = this;
|
|
78373
78430
|
this.apiVersion = "2.0";
|
|
78431
|
+
this._onStyleData = function () {
|
|
78432
|
+
_this.map.events.invoke("stylechanged", {
|
|
78433
|
+
style: _this._lookUp(_this.map.getStyle()).name,
|
|
78434
|
+
map: _this.map,
|
|
78435
|
+
type: "stylechanged"
|
|
78436
|
+
});
|
|
78437
|
+
};
|
|
78374
78438
|
this.map = map;
|
|
78375
78439
|
this.serviceOptions = serviceOptions;
|
|
78376
78440
|
}
|
|
@@ -78411,7 +78475,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78411
78475
|
StyleManager.prototype.setStyleUrl = function (styleOptions) {
|
|
78412
78476
|
var styleUrl = this.getStyleUrl(styleOptions);
|
|
78413
78477
|
try {
|
|
78414
|
-
this.map._getMap().setStyle(styleUrl, {
|
|
78478
|
+
this.map._getMap().setStyle(styleUrl, {
|
|
78479
|
+
diff: true,
|
|
78480
|
+
stylePatch: this._stylePatch.bind(this),
|
|
78481
|
+
validate: this.serviceOptions.validateStyle
|
|
78482
|
+
});
|
|
78415
78483
|
}
|
|
78416
78484
|
catch (e) {
|
|
78417
78485
|
throw e;
|
|
@@ -78583,13 +78651,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
78583
78651
|
preserveLayer(userLayer.layer.getId(), before === null || before === void 0 ? void 0 : before.id);
|
|
78584
78652
|
});
|
|
78585
78653
|
this.map.sources._syncSources(nextStyle.sources);
|
|
78586
|
-
|
|
78587
|
-
|
|
78588
|
-
|
|
78589
|
-
|
|
78590
|
-
|
|
78591
|
-
|
|
78592
|
-
});
|
|
78654
|
+
// If there was a previous styledata change event attached, remove it.
|
|
78655
|
+
// When the sprite url changes between style changes then mapbox can't perform the diff
|
|
78656
|
+
// In such cases it recalculate the style again. Removing previous attached
|
|
78657
|
+
// event listner makes sure that style changed event is not fired twice in these cases.
|
|
78658
|
+
this.map.events.remove("styledata", this._onStyleData);
|
|
78659
|
+
this.map.events.addOnce("styledata", this._onStyleData);
|
|
78593
78660
|
};
|
|
78594
78661
|
StyleManager.prototype._buildFundamentalLayerFrom = function (layers, id) {
|
|
78595
78662
|
if (layers && layers.length > 0) {
|