@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.
@@ -1106,11 +1106,14 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1106
1106
  while (0 < clusterGroup.childNodes.length) {
1107
1107
  markerCollection.insertBefore(clusterGroup.childNodes[0], markerCollection.firstChild);
1108
1108
  }
1109
- if (check) {
1110
- layerElement.appendChild(markerCollection);
1109
+ if (!check) {
1110
+ getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
1111
+ }
1112
+ var element = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
1113
+ if (isNullOrUndefined(element)) {
1114
+ layerElement.insertBefore(markerCollection, layerElement.firstChild);
1111
1115
  }
1112
1116
  else {
1113
- getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
1114
1117
  layerElement.appendChild(markerCollection);
1115
1118
  }
1116
1119
  var markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
@@ -1119,7 +1122,11 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1119
1122
  }
1120
1123
  if (zoomCheck) {
1121
1124
  var layerGroupElement = document.getElementById(maps.element.id + '_Layer_Collections');
1122
- if (!isNullOrUndefined(layerGroupElement)) {
1125
+ var element_1 = document.getElementById(maps.element.id + '_LayerIndex_' + (layerIndex + 1));
1126
+ if (!isNullOrUndefined(layerGroupElement) && !isNullOrUndefined(element_1)) {
1127
+ layerGroupElement.insertBefore(layerElement, element_1);
1128
+ }
1129
+ else if (!isNullOrUndefined(layerGroupElement)) {
1123
1130
  layerGroupElement.appendChild(layerElement);
1124
1131
  }
1125
1132
  }
@@ -2195,6 +2202,9 @@ function getZoomTranslate(mapObject, layer, animate) {
2195
2202
  // eslint-disable-next-line no-self-assign
2196
2203
  mapObject.mapScaleValue = mapObject.mapScaleValue;
2197
2204
  }
2205
+ else if (!isNullOrUndefined(mapObject.mapScaleValue) && mapObject.mapScaleValue <= mapObject.scale) {
2206
+ mapObject.mapScaleValue = mapObject.scale;
2207
+ }
2198
2208
  else {
2199
2209
  mapObject.mapScaleValue = zoomFactorValue;
2200
2210
  }
@@ -5318,6 +5328,7 @@ var Marker = /** @__PURE__ @class */ (function () {
5318
5328
  maps.element.appendChild(maps.svgObject);
5319
5329
  if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
5320
5330
  && maps.zoomSettings.enable) {
5331
+ clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
5321
5332
  layerElement.appendChild(_this.markerSVGObject);
5322
5333
  }
5323
5334
  else {
@@ -5500,6 +5511,12 @@ var Marker = /** @__PURE__ @class */ (function () {
5500
5511
  */
5501
5512
  Marker.prototype.markerClick = function (e) {
5502
5513
  var target = e.target.id;
5514
+ if (target.indexOf(this.maps.element.id) === -1) {
5515
+ var ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
5516
+ if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
5517
+ target = ancestor.id;
5518
+ }
5519
+ }
5503
5520
  if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
5504
5521
  return;
5505
5522
  }
@@ -6806,7 +6823,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
6806
6823
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
6807
6824
  (currentShapeData['property'][properties]) : ''));
6808
6825
  if (this.currentLayer.selectionSettings.enable || this.currentLayer.highlightSettings.enable) {
6809
- pathEle.tabIndex = this.mapObject.tabIndex + index + 3;
6826
+ pathEle.tabIndex = this.mapObject.tabIndex;
6810
6827
  pathEle.setAttribute('role', 'button');
6811
6828
  pathEle.style.cursor = this.currentLayer.highlightSettings.enable && !this.currentLayer.selectionSettings.enable ? 'default' : 'pointer';
6812
6829
  }
@@ -8397,7 +8414,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8397
8414
  */
8398
8415
  Maps.prototype.addTabIndex = function () {
8399
8416
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
8400
- this.element.setAttribute('role', '');
8417
+ this.element.setAttribute('role', 'region');
8401
8418
  this.element.tabIndex = this.tabIndex;
8402
8419
  };
8403
8420
  Maps.prototype.setSecondaryElementPosition = function () {
@@ -8645,7 +8662,6 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8645
8662
  var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
8646
8663
  var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
8647
8664
  element.setAttribute('aria-label', this.description || title.text);
8648
- element.setAttribute('role', '');
8649
8665
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
8650
8666
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
8651
8667
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -9398,6 +9414,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9398
9414
  if (!this.isDestroyed) {
9399
9415
  this.zoomNotApplied = false;
9400
9416
  var isRefresh = this.zoomSettings.zoomFactor === zoomFactor;
9417
+ this.previousProjection = null;
9401
9418
  if (!this.isTileMap && this.zoomModule) {
9402
9419
  if (!isNullOrUndefined(centerPosition)) {
9403
9420
  this.zoomSettings.zoomFactor = zoomFactor;
@@ -10316,7 +10333,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
10316
10333
  Property(null)
10317
10334
  ], Maps.prototype, "description", void 0);
10318
10335
  __decorate([
10319
- Property(1)
10336
+ Property(0)
10320
10337
  ], Maps.prototype, "tabIndex", void 0);
10321
10338
  __decorate([
10322
10339
  Complex({ latitude: null, longitude: null }, CenterPosition)
@@ -11856,14 +11873,34 @@ var Legend = /** @__PURE__ @class */ (function () {
11856
11873
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
11857
11874
  var 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, '', '');
11858
11875
  var pathEle = render.drawRectangle(leftRectPageOptions);
11859
- pathEle.tabIndex = (page + 1) === 1 ? -1 : (map.tabIndex + 1);
11876
+ pathEle.setAttribute('aria-label', 'Navigate to the previous legend items');
11877
+ pathEle.setAttribute('role', 'button');
11878
+ pathEle.tabIndex = (page + 1) === 1 ? -1 : map.tabIndex;
11879
+ if ((page + 1) === 1) {
11880
+ pathEle.style.cursor = 'default';
11881
+ pathEle.style.setProperty('outline', 'none');
11882
+ }
11883
+ else {
11884
+ pathEle.style.cursor = 'pointer';
11885
+ pathEle.style.removeProperty('outline');
11886
+ }
11860
11887
  leftPageElement.appendChild(pathEle);
11861
11888
  this.wireEvents(leftPageElement);
11862
11889
  var 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);
11863
11890
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
11864
11891
  var 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, '', '');
11865
11892
  pathEle = render.drawRectangle(rightRectPageOptions);
11866
- pathEle.tabIndex = (page + 1) === this.totalPages.length ? -1 : (map.tabIndex + 2);
11893
+ pathEle.setAttribute('aria-label', 'Navigate to the next legend items');
11894
+ pathEle.setAttribute('role', 'button');
11895
+ pathEle.tabIndex = (page + 1) === this.totalPages.length ? -1 : map.tabIndex;
11896
+ if ((page + 1) === this.totalPages.length) {
11897
+ pathEle.style.cursor = 'default';
11898
+ pathEle.style.setProperty('outline', 'none');
11899
+ }
11900
+ else {
11901
+ pathEle.style.cursor = 'pointer';
11902
+ pathEle.style.removeProperty('outline');
11903
+ }
11867
11904
  rightPageElement.appendChild(pathEle);
11868
11905
  this.wireEvents(rightPageElement);
11869
11906
  pagingGroup.appendChild(leftPageElement);
@@ -14304,7 +14341,8 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
14304
14341
  areaBounds: _this.maps.mapAreaRect,
14305
14342
  textStyle: option['textStyle'],
14306
14343
  availableSize: _this.maps.availableSize,
14307
- fill: option.fill || _this.maps.themeStyle.tooltipFillColor
14344
+ fill: option.fill || _this.maps.themeStyle.tooltipFillColor,
14345
+ enableShadow: true
14308
14346
  });
14309
14347
  }
14310
14348
  else {
@@ -14321,7 +14359,8 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
14321
14359
  areaBounds: _this.maps.mapAreaRect,
14322
14360
  textStyle: tooltipArgs.options['textStyle'],
14323
14361
  availableSize: _this.maps.availableSize,
14324
- fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor
14362
+ fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor,
14363
+ enableShadow: true
14325
14364
  });
14326
14365
  }
14327
14366
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -14801,6 +14840,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
14801
14840
  var availSize = map.mapAreaRect;
14802
14841
  map.previousScale = map.scale;
14803
14842
  map.previousPoint = map.translatePoint;
14843
+ map.previousProjection = map.projectionType;
14804
14844
  var prevTilePoint = map.tileTranslatePoint;
14805
14845
  var scale = calculateScale(this.touchStartList, this.touchMoveList);
14806
14846
  var touchCenter = getTouchCenter(getTouches(this.touchMoveList, this.maps));
@@ -14864,6 +14904,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
14864
14904
  map.mapLayerPanel.generateTiles(newTileFactor, map.tileTranslatePoint);
14865
14905
  }
14866
14906
  }
14907
+ map.mapScaleValue = zoomCalculationFactor;
14867
14908
  if (!isZoomCancelled) {
14868
14909
  this.applyTransform(map);
14869
14910
  }
@@ -15181,7 +15222,12 @@ var Zoom = /** @__PURE__ @class */ (function () {
15181
15222
  ? _this.maps.markerNullCount + 1 : _this.maps.markerNullCount;
15182
15223
  var markerDataLength = markerDatas.length - _this.maps.markerNullCount;
15183
15224
  if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
15184
- layerElement.appendChild(markerSVGObject);
15225
+ if (_this.maps.isTileMap) {
15226
+ layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
15227
+ }
15228
+ else {
15229
+ layerElement.appendChild(markerSVGObject);
15230
+ }
15185
15231
  if (currentLayers.markerClusterSettings.allowClustering) {
15186
15232
  _this.maps.svgObject.appendChild(markerSVGObject);
15187
15233
  _this.maps.element.appendChild(_this.maps.svgObject);
@@ -15579,7 +15625,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15579
15625
  var size = map.mapAreaRect;
15580
15626
  var translatePoint = map.previousPoint = map.translatePoint;
15581
15627
  var prevTilePoint = map.tileTranslatePoint;
15582
- map.previousProjection = map.projectionType;
15628
+ map.previousProjection = (type !== 'Reset') ? map.projectionType : null;
15583
15629
  zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
15584
15630
  zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
15585
15631
  zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;