@syncfusion/ej2-maps 23.1.38 → 23.1.40
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/CHANGELOG.md +8 -0
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +54 -14
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +54 -14
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +7 -7
- package/src/maps/layers/layer-panel.js +1 -1
- package/src/maps/layers/legend.js +22 -2
- package/src/maps/layers/marker.js +1 -0
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +1 -1
- package/src/maps/maps.js +3 -3
- package/src/maps/user-interaction/tooltip.js +4 -2
- package/src/maps/user-interaction/zoom.js +9 -2
- package/src/maps/utils/helper.js +14 -4
|
@@ -1053,11 +1053,14 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1053
1053
|
while (0 < clusterGroup.childNodes.length) {
|
|
1054
1054
|
markerCollection.insertBefore(clusterGroup.childNodes[0], markerCollection.firstChild);
|
|
1055
1055
|
}
|
|
1056
|
-
if (check) {
|
|
1057
|
-
|
|
1056
|
+
if (!check) {
|
|
1057
|
+
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1058
|
+
}
|
|
1059
|
+
const element = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
1060
|
+
if (isNullOrUndefined(element)) {
|
|
1061
|
+
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1058
1062
|
}
|
|
1059
1063
|
else {
|
|
1060
|
-
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1061
1064
|
layerElement.appendChild(markerCollection);
|
|
1062
1065
|
}
|
|
1063
1066
|
const markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
@@ -1066,7 +1069,11 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1066
1069
|
}
|
|
1067
1070
|
if (zoomCheck) {
|
|
1068
1071
|
const layerGroupElement = document.getElementById(maps.element.id + '_Layer_Collections');
|
|
1069
|
-
|
|
1072
|
+
const element = document.getElementById(maps.element.id + '_LayerIndex_' + (layerIndex + 1));
|
|
1073
|
+
if (!isNullOrUndefined(layerGroupElement) && !isNullOrUndefined(element)) {
|
|
1074
|
+
layerGroupElement.insertBefore(layerElement, element);
|
|
1075
|
+
}
|
|
1076
|
+
else if (!isNullOrUndefined(layerGroupElement)) {
|
|
1070
1077
|
layerGroupElement.appendChild(layerElement);
|
|
1071
1078
|
}
|
|
1072
1079
|
}
|
|
@@ -2139,6 +2146,9 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2139
2146
|
// eslint-disable-next-line no-self-assign
|
|
2140
2147
|
mapObject.mapScaleValue = mapObject.mapScaleValue;
|
|
2141
2148
|
}
|
|
2149
|
+
else if (!isNullOrUndefined(mapObject.mapScaleValue) && mapObject.mapScaleValue <= mapObject.scale) {
|
|
2150
|
+
mapObject.mapScaleValue = mapObject.scale;
|
|
2151
|
+
}
|
|
2142
2152
|
else {
|
|
2143
2153
|
mapObject.mapScaleValue = zoomFactorValue;
|
|
2144
2154
|
}
|
|
@@ -5084,6 +5094,7 @@ class Marker {
|
|
|
5084
5094
|
maps.element.appendChild(maps.svgObject);
|
|
5085
5095
|
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
5086
5096
|
&& maps.zoomSettings.enable) {
|
|
5097
|
+
clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
5087
5098
|
layerElement.appendChild(this.markerSVGObject);
|
|
5088
5099
|
}
|
|
5089
5100
|
else {
|
|
@@ -6560,7 +6571,7 @@ class LayerPanel {
|
|
|
6560
6571
|
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
6561
6572
|
(currentShapeData['property'][properties]) : ''));
|
|
6562
6573
|
if (this.currentLayer.selectionSettings.enable || this.currentLayer.highlightSettings.enable) {
|
|
6563
|
-
pathEle.tabIndex = this.mapObject.tabIndex
|
|
6574
|
+
pathEle.tabIndex = this.mapObject.tabIndex;
|
|
6564
6575
|
pathEle.setAttribute('role', 'button');
|
|
6565
6576
|
pathEle.style.cursor = this.currentLayer.highlightSettings.enable && !this.currentLayer.selectionSettings.enable ? 'default' : 'pointer';
|
|
6566
6577
|
}
|
|
@@ -8107,7 +8118,7 @@ let Maps = class Maps extends Component {
|
|
|
8107
8118
|
*/
|
|
8108
8119
|
addTabIndex() {
|
|
8109
8120
|
this.element.setAttribute('aria-label', this.description || 'Maps Element');
|
|
8110
|
-
this.element.setAttribute('role', '');
|
|
8121
|
+
this.element.setAttribute('role', 'region');
|
|
8111
8122
|
this.element.tabIndex = this.tabIndex;
|
|
8112
8123
|
}
|
|
8113
8124
|
setSecondaryElementPosition() {
|
|
@@ -8354,7 +8365,6 @@ let Maps = class Maps extends Component {
|
|
|
8354
8365
|
const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
|
|
8355
8366
|
const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
8356
8367
|
element.setAttribute('aria-label', this.description || title.text);
|
|
8357
|
-
element.setAttribute('role', '');
|
|
8358
8368
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
8359
8369
|
height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
|
|
8360
8370
|
this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
|
|
@@ -9105,6 +9115,7 @@ let Maps = class Maps extends Component {
|
|
|
9105
9115
|
if (!this.isDestroyed) {
|
|
9106
9116
|
this.zoomNotApplied = false;
|
|
9107
9117
|
let isRefresh = this.zoomSettings.zoomFactor === zoomFactor;
|
|
9118
|
+
this.previousProjection = null;
|
|
9108
9119
|
if (!this.isTileMap && this.zoomModule) {
|
|
9109
9120
|
if (!isNullOrUndefined(centerPosition)) {
|
|
9110
9121
|
this.zoomSettings.zoomFactor = zoomFactor;
|
|
@@ -10008,7 +10019,7 @@ __decorate([
|
|
|
10008
10019
|
Property(null)
|
|
10009
10020
|
], Maps.prototype, "description", void 0);
|
|
10010
10021
|
__decorate([
|
|
10011
|
-
Property(
|
|
10022
|
+
Property(0)
|
|
10012
10023
|
], Maps.prototype, "tabIndex", void 0);
|
|
10013
10024
|
__decorate([
|
|
10014
10025
|
Complex({ latitude: null, longitude: null }, CenterPosition)
|
|
@@ -11539,14 +11550,34 @@ class Legend {
|
|
|
11539
11550
|
leftPageElement.appendChild(render.drawPath(leftPageOptions));
|
|
11540
11551
|
const leftRectPageOptions = new RectOption(map.element.id + '_Left_Page_Rect', 'transparent', {}, 1, new Rect(leftPageX - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
|
|
11541
11552
|
let pathEle = render.drawRectangle(leftRectPageOptions);
|
|
11542
|
-
pathEle.
|
|
11553
|
+
pathEle.setAttribute('aria-label', 'Navigate to the previous legend items');
|
|
11554
|
+
pathEle.setAttribute('role', 'button');
|
|
11555
|
+
pathEle.tabIndex = (page + 1) === 1 ? -1 : map.tabIndex;
|
|
11556
|
+
if ((page + 1) === 1) {
|
|
11557
|
+
pathEle.style.cursor = 'default';
|
|
11558
|
+
pathEle.style.setProperty('outline', 'none');
|
|
11559
|
+
}
|
|
11560
|
+
else {
|
|
11561
|
+
pathEle.style.cursor = 'pointer';
|
|
11562
|
+
pathEle.style.removeProperty('outline');
|
|
11563
|
+
}
|
|
11543
11564
|
leftPageElement.appendChild(pathEle);
|
|
11544
11565
|
this.wireEvents(leftPageElement);
|
|
11545
11566
|
const rightPageOptions = new PathOption(map.element.id + '_Right_Page', this.maps.themeStyle.legendTextColor, 0, this.maps.themeStyle.legendTextColor, ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
|
|
11546
11567
|
rightPageElement.appendChild(render.drawPath(rightPageOptions));
|
|
11547
11568
|
const rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(rightPageX - spacing - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
|
|
11548
11569
|
pathEle = render.drawRectangle(rightRectPageOptions);
|
|
11549
|
-
pathEle.
|
|
11570
|
+
pathEle.setAttribute('aria-label', 'Navigate to the next legend items');
|
|
11571
|
+
pathEle.setAttribute('role', 'button');
|
|
11572
|
+
pathEle.tabIndex = (page + 1) === this.totalPages.length ? -1 : map.tabIndex;
|
|
11573
|
+
if ((page + 1) === this.totalPages.length) {
|
|
11574
|
+
pathEle.style.cursor = 'default';
|
|
11575
|
+
pathEle.style.setProperty('outline', 'none');
|
|
11576
|
+
}
|
|
11577
|
+
else {
|
|
11578
|
+
pathEle.style.cursor = 'pointer';
|
|
11579
|
+
pathEle.style.removeProperty('outline');
|
|
11580
|
+
}
|
|
11550
11581
|
rightPageElement.appendChild(pathEle);
|
|
11551
11582
|
this.wireEvents(rightPageElement);
|
|
11552
11583
|
pagingGroup.appendChild(leftPageElement);
|
|
@@ -13966,7 +13997,8 @@ class MapsTooltip {
|
|
|
13966
13997
|
areaBounds: this.maps.mapAreaRect,
|
|
13967
13998
|
textStyle: option['textStyle'],
|
|
13968
13999
|
availableSize: this.maps.availableSize,
|
|
13969
|
-
fill: option.fill || this.maps.themeStyle.tooltipFillColor
|
|
14000
|
+
fill: option.fill || this.maps.themeStyle.tooltipFillColor,
|
|
14001
|
+
enableShadow: true
|
|
13970
14002
|
});
|
|
13971
14003
|
}
|
|
13972
14004
|
else {
|
|
@@ -13983,7 +14015,8 @@ class MapsTooltip {
|
|
|
13983
14015
|
areaBounds: this.maps.mapAreaRect,
|
|
13984
14016
|
textStyle: tooltipArgs.options['textStyle'],
|
|
13985
14017
|
availableSize: this.maps.availableSize,
|
|
13986
|
-
fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor
|
|
14018
|
+
fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor,
|
|
14019
|
+
enableShadow: true
|
|
13987
14020
|
});
|
|
13988
14021
|
}
|
|
13989
14022
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -14459,6 +14492,7 @@ class Zoom {
|
|
|
14459
14492
|
const availSize = map.mapAreaRect;
|
|
14460
14493
|
map.previousScale = map.scale;
|
|
14461
14494
|
map.previousPoint = map.translatePoint;
|
|
14495
|
+
map.previousProjection = map.projectionType;
|
|
14462
14496
|
const prevTilePoint = map.tileTranslatePoint;
|
|
14463
14497
|
const scale = calculateScale(this.touchStartList, this.touchMoveList);
|
|
14464
14498
|
const touchCenter = getTouchCenter(getTouches(this.touchMoveList, this.maps));
|
|
@@ -14522,6 +14556,7 @@ class Zoom {
|
|
|
14522
14556
|
map.mapLayerPanel.generateTiles(newTileFactor, map.tileTranslatePoint);
|
|
14523
14557
|
}
|
|
14524
14558
|
}
|
|
14559
|
+
map.mapScaleValue = zoomCalculationFactor;
|
|
14525
14560
|
if (!isZoomCancelled) {
|
|
14526
14561
|
this.applyTransform(map);
|
|
14527
14562
|
}
|
|
@@ -14837,7 +14872,12 @@ class Zoom {
|
|
|
14837
14872
|
? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
|
|
14838
14873
|
const markerDataLength = markerDatas.length - this.maps.markerNullCount;
|
|
14839
14874
|
if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
14840
|
-
|
|
14875
|
+
if (this.maps.isTileMap) {
|
|
14876
|
+
layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
|
|
14877
|
+
}
|
|
14878
|
+
else {
|
|
14879
|
+
layerElement.appendChild(markerSVGObject);
|
|
14880
|
+
}
|
|
14841
14881
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
14842
14882
|
this.maps.svgObject.appendChild(markerSVGObject);
|
|
14843
14883
|
this.maps.element.appendChild(this.maps.svgObject);
|
|
@@ -15232,7 +15272,7 @@ class Zoom {
|
|
|
15232
15272
|
const size = map.mapAreaRect;
|
|
15233
15273
|
const translatePoint = map.previousPoint = map.translatePoint;
|
|
15234
15274
|
const prevTilePoint = map.tileTranslatePoint;
|
|
15235
|
-
map.previousProjection = map.projectionType;
|
|
15275
|
+
map.previousProjection = (type !== 'Reset') ? map.projectionType : null;
|
|
15236
15276
|
zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
|
|
15237
15277
|
zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
|
|
15238
15278
|
zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;
|