@syncfusion/ej2-maps 23.1.38 → 23.1.42

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.
@@ -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
- layerElement.appendChild(markerCollection);
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
- if (!isNullOrUndefined(layerGroupElement)) {
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 {
@@ -5265,7 +5276,13 @@ class Marker {
5265
5276
  * @private
5266
5277
  */
5267
5278
  markerClick(e) {
5268
- const target = e.target.id;
5279
+ let target = e.target.id;
5280
+ if (target.indexOf(this.maps.element.id) === -1) {
5281
+ const ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
5282
+ if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
5283
+ target = ancestor.id;
5284
+ }
5285
+ }
5269
5286
  if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
5270
5287
  return;
5271
5288
  }
@@ -6560,7 +6577,7 @@ class LayerPanel {
6560
6577
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
6561
6578
  (currentShapeData['property'][properties]) : ''));
6562
6579
  if (this.currentLayer.selectionSettings.enable || this.currentLayer.highlightSettings.enable) {
6563
- pathEle.tabIndex = this.mapObject.tabIndex + index + 3;
6580
+ pathEle.tabIndex = this.mapObject.tabIndex;
6564
6581
  pathEle.setAttribute('role', 'button');
6565
6582
  pathEle.style.cursor = this.currentLayer.highlightSettings.enable && !this.currentLayer.selectionSettings.enable ? 'default' : 'pointer';
6566
6583
  }
@@ -8107,7 +8124,7 @@ let Maps = class Maps extends Component {
8107
8124
  */
8108
8125
  addTabIndex() {
8109
8126
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
8110
- this.element.setAttribute('role', '');
8127
+ this.element.setAttribute('role', 'region');
8111
8128
  this.element.tabIndex = this.tabIndex;
8112
8129
  }
8113
8130
  setSecondaryElementPosition() {
@@ -8354,7 +8371,6 @@ let Maps = class Maps extends Component {
8354
8371
  const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
8355
8372
  const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
8356
8373
  element.setAttribute('aria-label', this.description || title.text);
8357
- element.setAttribute('role', '');
8358
8374
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
8359
8375
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
8360
8376
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -9105,6 +9121,7 @@ let Maps = class Maps extends Component {
9105
9121
  if (!this.isDestroyed) {
9106
9122
  this.zoomNotApplied = false;
9107
9123
  let isRefresh = this.zoomSettings.zoomFactor === zoomFactor;
9124
+ this.previousProjection = null;
9108
9125
  if (!this.isTileMap && this.zoomModule) {
9109
9126
  if (!isNullOrUndefined(centerPosition)) {
9110
9127
  this.zoomSettings.zoomFactor = zoomFactor;
@@ -10008,7 +10025,7 @@ __decorate([
10008
10025
  Property(null)
10009
10026
  ], Maps.prototype, "description", void 0);
10010
10027
  __decorate([
10011
- Property(1)
10028
+ Property(0)
10012
10029
  ], Maps.prototype, "tabIndex", void 0);
10013
10030
  __decorate([
10014
10031
  Complex({ latitude: null, longitude: null }, CenterPosition)
@@ -11539,14 +11556,34 @@ class Legend {
11539
11556
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
11540
11557
  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
11558
  let pathEle = render.drawRectangle(leftRectPageOptions);
11542
- pathEle.tabIndex = (page + 1) === 1 ? -1 : (map.tabIndex + 1);
11559
+ pathEle.setAttribute('aria-label', 'Navigate to the previous legend items');
11560
+ pathEle.setAttribute('role', 'button');
11561
+ pathEle.tabIndex = (page + 1) === 1 ? -1 : map.tabIndex;
11562
+ if ((page + 1) === 1) {
11563
+ pathEle.style.cursor = 'default';
11564
+ pathEle.style.setProperty('outline', 'none');
11565
+ }
11566
+ else {
11567
+ pathEle.style.cursor = 'pointer';
11568
+ pathEle.style.removeProperty('outline');
11569
+ }
11543
11570
  leftPageElement.appendChild(pathEle);
11544
11571
  this.wireEvents(leftPageElement);
11545
11572
  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
11573
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
11547
11574
  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
11575
  pathEle = render.drawRectangle(rightRectPageOptions);
11549
- pathEle.tabIndex = (page + 1) === this.totalPages.length ? -1 : (map.tabIndex + 2);
11576
+ pathEle.setAttribute('aria-label', 'Navigate to the next legend items');
11577
+ pathEle.setAttribute('role', 'button');
11578
+ pathEle.tabIndex = (page + 1) === this.totalPages.length ? -1 : map.tabIndex;
11579
+ if ((page + 1) === this.totalPages.length) {
11580
+ pathEle.style.cursor = 'default';
11581
+ pathEle.style.setProperty('outline', 'none');
11582
+ }
11583
+ else {
11584
+ pathEle.style.cursor = 'pointer';
11585
+ pathEle.style.removeProperty('outline');
11586
+ }
11550
11587
  rightPageElement.appendChild(pathEle);
11551
11588
  this.wireEvents(rightPageElement);
11552
11589
  pagingGroup.appendChild(leftPageElement);
@@ -13966,7 +14003,8 @@ class MapsTooltip {
13966
14003
  areaBounds: this.maps.mapAreaRect,
13967
14004
  textStyle: option['textStyle'],
13968
14005
  availableSize: this.maps.availableSize,
13969
- fill: option.fill || this.maps.themeStyle.tooltipFillColor
14006
+ fill: option.fill || this.maps.themeStyle.tooltipFillColor,
14007
+ enableShadow: true
13970
14008
  });
13971
14009
  }
13972
14010
  else {
@@ -13983,7 +14021,8 @@ class MapsTooltip {
13983
14021
  areaBounds: this.maps.mapAreaRect,
13984
14022
  textStyle: tooltipArgs.options['textStyle'],
13985
14023
  availableSize: this.maps.availableSize,
13986
- fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor
14024
+ fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor,
14025
+ enableShadow: true
13987
14026
  });
13988
14027
  }
13989
14028
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -14459,6 +14498,7 @@ class Zoom {
14459
14498
  const availSize = map.mapAreaRect;
14460
14499
  map.previousScale = map.scale;
14461
14500
  map.previousPoint = map.translatePoint;
14501
+ map.previousProjection = map.projectionType;
14462
14502
  const prevTilePoint = map.tileTranslatePoint;
14463
14503
  const scale = calculateScale(this.touchStartList, this.touchMoveList);
14464
14504
  const touchCenter = getTouchCenter(getTouches(this.touchMoveList, this.maps));
@@ -14522,6 +14562,7 @@ class Zoom {
14522
14562
  map.mapLayerPanel.generateTiles(newTileFactor, map.tileTranslatePoint);
14523
14563
  }
14524
14564
  }
14565
+ map.mapScaleValue = zoomCalculationFactor;
14525
14566
  if (!isZoomCancelled) {
14526
14567
  this.applyTransform(map);
14527
14568
  }
@@ -14837,7 +14878,12 @@ class Zoom {
14837
14878
  ? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
14838
14879
  const markerDataLength = markerDatas.length - this.maps.markerNullCount;
14839
14880
  if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
14840
- layerElement.appendChild(markerSVGObject);
14881
+ if (this.maps.isTileMap) {
14882
+ layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
14883
+ }
14884
+ else {
14885
+ layerElement.appendChild(markerSVGObject);
14886
+ }
14841
14887
  if (currentLayers.markerClusterSettings.allowClustering) {
14842
14888
  this.maps.svgObject.appendChild(markerSVGObject);
14843
14889
  this.maps.element.appendChild(this.maps.svgObject);
@@ -15232,7 +15278,7 @@ class Zoom {
15232
15278
  const size = map.mapAreaRect;
15233
15279
  const translatePoint = map.previousPoint = map.translatePoint;
15234
15280
  const prevTilePoint = map.tileTranslatePoint;
15235
- map.previousProjection = map.projectionType;
15281
+ map.previousProjection = (type !== 'Reset') ? map.projectionType : null;
15236
15282
  zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
15237
15283
  zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
15238
15284
  zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;