@syncfusion/ej2-maps 24.1.41 → 24.1.47

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.
@@ -976,46 +976,50 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
976
976
  width: clusters.width, imageUrl: clusters.imageUrl, shape: clusters.shape,
977
977
  data: data, maps: maps, cluster: clusters, border: clusters.border
978
978
  };
979
+ var containerRect = maps.element.getBoundingClientRect();
980
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
981
+ var translatePoint = (maps.isTileMap) ? new Object() : getTranslate(maps, currentLayer, false);
982
+ var factor;
983
+ if (!maps.isTileMap) {
984
+ factor = maps.mapLayerPanel.calculateFactor(currentLayer);
985
+ }
986
+ var isClusteringCompleted = false;
979
987
  maps.trigger('markerClusterRendering', eventArg, function (clusterargs) {
980
- for (var o = 0; o < markerTemplate.childElementCount; o++) {
988
+ Array.prototype.forEach.call(markerTemplate.childNodes, function (markerElement, o) {
981
989
  indexCollection = [];
982
- if (markerTemplate.childNodes[o]['style']['visibility'] !== 'hidden') {
983
- tempElement = markerTemplate.childNodes[o];
990
+ if (markerElement['style']['visibility'] !== 'hidden') {
991
+ tempElement = markerElement;
984
992
  bounds1 = tempElement.getBoundingClientRect();
985
993
  indexCollection.push(o);
986
994
  if (!isNullOrUndefined(bounds1)) {
987
- for (var p = o + 1; p < markerTemplate.childElementCount; p++) {
988
- if (markerTemplate.childNodes[p]['style']['visibility'] !== 'hidden') {
989
- tempElement = markerTemplate.childNodes[p];
995
+ Array.prototype.forEach.call(markerTemplate.childNodes, function (otherMarkerElement, p) {
996
+ if (p >= o + 1 && otherMarkerElement['style']['visibility'] !== 'hidden') {
997
+ tempElement = otherMarkerElement;
990
998
  bounds2 = tempElement.getBoundingClientRect();
991
999
  if (!isNullOrUndefined(bounds2)) {
992
1000
  if (!(bounds1.left > bounds2.right || bounds1.right < bounds2.left
993
1001
  || bounds1.top > bounds2.bottom || bounds1.bottom < bounds2.top)) {
994
1002
  colloideBounds.push(bounds2);
995
- markerTemplate.childNodes[p]['style']['visibility'] = 'hidden';
1003
+ otherMarkerElement['style']['visibility'] = 'hidden';
996
1004
  indexCollection.push(p);
997
1005
  }
998
1006
  }
999
1007
  }
1000
- }
1008
+ });
1001
1009
  tempX = bounds1.left + bounds1.width / 2;
1002
1010
  tempY = bounds1.top + bounds1.height;
1003
1011
  if (colloideBounds.length > 0) {
1004
1012
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1005
1013
  indexCollection = indexCollection.filter(function (item, index, value) { return value.indexOf(item) === index; });
1006
- var container = maps.element.getBoundingClientRect();
1007
- tempX = tempX - container['left'];
1008
- tempY = (tempY - ((maps.availableSize.height <= container['height']) ?
1009
- container['top'] : (container['bottom'] - container['top'])));
1010
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1011
- var translate = (maps.isTileMap) ? new Object() : getTranslate(maps, currentLayer, false);
1012
- var dataIndex = parseInt(markerTemplate.childNodes[o]['id'].split('_dataIndex_')[1].split('_')[0], 10);
1013
- var markerIndex = parseInt(markerTemplate.childNodes[o]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
1014
+ tempX = tempX - containerRect['left'];
1015
+ tempY = (tempY - ((maps.availableSize.height <= containerRect['height']) ?
1016
+ containerRect['top'] : (containerRect['bottom'] - containerRect['top'])));
1017
+ var dataIndex = parseInt(markerElement['id'].split('_dataIndex_')[1].split('_')[0], 10);
1018
+ var markerIndex = parseInt(markerElement['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
1014
1019
  var markerSetting = currentLayer.markerSettings[markerIndex];
1015
1020
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1016
1021
  var markerData = markerSetting.dataSource[dataIndex];
1017
- var factor = void 0;
1018
- var location_1 = void 0;
1022
+ var location_1;
1019
1023
  var longitude = (!isNullOrUndefined(markerSetting.longitudeValuePath)) ?
1020
1024
  Number(getValueFromObject(markerData, markerSetting.longitudeValuePath)) :
1021
1025
  !isNullOrUndefined(markerData['longitude']) ? parseFloat(markerData['longitude']) :
@@ -1025,45 +1029,30 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1025
1029
  !isNullOrUndefined(markerData['latitude']) ? parseFloat(markerData['latitude']) :
1026
1030
  !isNullOrUndefined(markerData['Latitude']) ? parseFloat(markerData['Latitude']) : 0;
1027
1031
  if (!maps.isTileMap) {
1028
- factor = maps.mapLayerPanel.calculateFactor(currentLayer);
1029
1032
  location_1 = convertGeoToPoint(latitude, longitude, factor, currentLayer, maps);
1030
1033
  }
1031
1034
  else if (maps.isTileMap && !maps.zoomSettings.enable) {
1032
1035
  location_1 = convertTileLatLongToPoint(new Point(longitude, latitude), maps.tileZoomLevel, maps.tileTranslatePoint, true);
1033
1036
  }
1034
- markerTemplate.childNodes[o]['style']['visibility'] = 'hidden';
1035
- var clusters_1 = currentLayer.markerClusterSettings;
1037
+ markerElement['style']['visibility'] = 'hidden';
1036
1038
  if (eventArg.cancel) {
1037
1039
  shapeCustom = {
1038
- size: new Size(clusters_1.width, clusters_1.height),
1039
- fill: clusters_1.fill, borderColor: clusters_1.border.color,
1040
- borderWidth: clusters_1.border.width, opacity: clusters_1.opacity,
1041
- dashArray: clusters_1.dashArray
1040
+ size: new Size(clusters.width, clusters.height),
1041
+ fill: clusters.fill, borderColor: clusters.border.color,
1042
+ borderWidth: clusters.border.width, opacity: clusters.opacity,
1043
+ dashArray: clusters.dashArray, imageUrl: clusters.imageUrl, shape: clusters.shape
1042
1044
  };
1043
- shapeCustom['fill'] = clusters_1.fill;
1044
- shapeCustom['size']['width'] = clusters_1.width;
1045
- shapeCustom['size']['height'] = clusters_1.height;
1046
- shapeCustom['imageUrl'] = clusters_1.imageUrl;
1047
- shapeCustom['shape'] = clusters_1.shape;
1048
- shapeCustom['borderColor'] = clusters_1.border.color;
1049
- shapeCustom['borderWidth'] = clusters_1.border.width;
1050
- shapeCustom['borderOpacity'] = isNullOrUndefined(clusters_1.border.opacity) ? clusters_1.opacity : clusters_1.border.opacity;
1045
+ shapeCustom['borderOpacity'] = isNullOrUndefined(clusters.border.opacity) ? clusters.opacity : clusters.border.opacity;
1051
1046
  }
1052
1047
  else {
1053
1048
  shapeCustom = {
1054
- size: new Size(clusters_1.width, clusters_1.height),
1055
- fill: clusters_1.fill, borderColor: clusters_1.border.color,
1056
- borderWidth: clusters_1.border.width, opacity: clusters_1.opacity,
1057
- dashArray: clusters_1.dashArray
1049
+ size: new Size(eventArg.width, eventArg.height),
1050
+ fill: eventArg.fill, borderColor: eventArg.border.color,
1051
+ borderWidth: eventArg.border.width, opacity: clusters.opacity,
1052
+ dashArray: clusters.dashArray, imageUrl: eventArg.imageUrl,
1053
+ shape: eventArg.shape
1058
1054
  };
1059
- shapeCustom['fill'] = eventArg.fill;
1060
- shapeCustom['size']['width'] = eventArg.width;
1061
- shapeCustom['size']['height'] = eventArg.height;
1062
- shapeCustom['imageUrl'] = eventArg.imageUrl;
1063
- shapeCustom['shape'] = eventArg.shape;
1064
- shapeCustom['borderColor'] = eventArg.border.color;
1065
- shapeCustom['borderWidth'] = eventArg.border.width;
1066
- shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters_1.opacity : eventArg.border.opacity;
1055
+ shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters.opacity : eventArg.border.opacity;
1067
1056
  }
1068
1057
  tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
1069
1058
  tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
@@ -1091,48 +1080,51 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1091
1080
  }
1092
1081
  colloideBounds = [];
1093
1082
  }
1094
- }
1083
+ isClusteringCompleted = true;
1084
+ });
1095
1085
  layerElement.appendChild(clusterGroup);
1096
1086
  maps.svgObject.appendChild(layerElement);
1097
1087
  maps.element.appendChild(maps.svgObject);
1098
- for (var o = 0; o < clusterGroup.childElementCount; o++) {
1099
- if (clusterGroup.childNodes[o]['style']['visibility'] !== 'hidden') {
1100
- tempElement = clusterGroup.childNodes[o];
1101
- bounds1 = tempElement.getBoundingClientRect();
1102
- if (!isNullOrUndefined(bounds1) && !(tempElement.id.indexOf('_datalabel_') > -1)) {
1103
- for (var p = o + 1; p < clusterGroup.childElementCount; p++) {
1104
- if (clusterGroup.childNodes[p]['style']['visibility'] !== 'hidden') {
1105
- tempElement1 = clusterGroup.childNodes[p];
1106
- bounds2 = tempElement1.getBoundingClientRect();
1107
- if (!isNullOrUndefined(bounds2) && !(tempElement1.id.indexOf('_datalabel_') > -1)) {
1108
- if (!(bounds1.left > bounds2.right || bounds1.right < bounds2.left
1109
- || bounds1.top > bounds2.bottom || bounds1.bottom < bounds2.top)) {
1110
- clusterColloideBounds.push(tempElement1);
1111
- clusterColloideBounds.push(clusterGroup.childNodes[p - 1]);
1112
- clusterGroup.childNodes[p]['style']['visibility'] = 'hidden';
1113
- clusterGroup.childNodes[p - 1]['style']['visibility'] = 'hidden';
1114
- indexCollection.push(p);
1088
+ if (clusters.allowDeepClustering) {
1089
+ Array.prototype.forEach.call(clusterGroup.childNodes, function (clusterElement, o) {
1090
+ if (clusterElement['style']['visibility'] !== 'hidden') {
1091
+ tempElement = clusterElement;
1092
+ bounds1 = tempElement.getBoundingClientRect();
1093
+ if (!isNullOrUndefined(bounds1) && !(tempElement.id.indexOf('_datalabel_') > -1)) {
1094
+ for (var p = o + 1; p < clusterGroup.childElementCount; p++) {
1095
+ if (clusterGroup.childNodes[p]['style']['visibility'] !== 'hidden') {
1096
+ tempElement1 = clusterGroup.childNodes[p];
1097
+ bounds2 = tempElement1.getBoundingClientRect();
1098
+ if (!isNullOrUndefined(bounds2) && !(tempElement1.id.indexOf('_datalabel_') > -1)) {
1099
+ if (!(bounds1.left > bounds2.right || bounds1.right < bounds2.left
1100
+ || bounds1.top > bounds2.bottom || bounds1.bottom < bounds2.top)) {
1101
+ clusterColloideBounds.push(tempElement1);
1102
+ clusterColloideBounds.push(clusterGroup.childNodes[p - 1]);
1103
+ clusterGroup.childNodes[p]['style']['visibility'] = 'hidden';
1104
+ clusterGroup.childNodes[p - 1]['style']['visibility'] = 'hidden';
1105
+ indexCollection.push(p);
1106
+ }
1115
1107
  }
1116
1108
  }
1117
1109
  }
1118
- }
1119
- if (clusterColloideBounds.length > 0) {
1120
- tempElement = clusterGroup.childNodes[o];
1121
- for (var i = 0; i < clusterColloideBounds.length; i++) {
1122
- if (tempElement.tagName === 'g') {
1123
- tempElement.childNodes[0].textContent = tempElement.childNodes[0].textContent + ',' +
1124
- clusterColloideBounds[i].textContent;
1125
- }
1126
- else {
1127
- tempElement.textContent = tempElement.textContent + ',' + clusterColloideBounds[i].textContent;
1110
+ if (clusterColloideBounds.length > 0) {
1111
+ tempElement = clusterElement;
1112
+ for (var i = 0; i < clusterColloideBounds.length; i++) {
1113
+ if (tempElement.tagName === 'g') {
1114
+ tempElement.childNodes[0].textContent = tempElement.childNodes[0].textContent + ',' +
1115
+ clusterColloideBounds[i].textContent;
1116
+ }
1117
+ else {
1118
+ tempElement.textContent = tempElement.textContent + ',' + clusterColloideBounds[i].textContent;
1119
+ }
1120
+ clusterGroup.childNodes[o - 1].textContent = ((+(clusterGroup.childNodes[o - 1].textContent)) + (+(clusterColloideBounds[i + 1].textContent))).toString();
1121
+ i++;
1128
1122
  }
1129
- clusterGroup.childNodes[o - 1].textContent = ((+(clusterGroup.childNodes[o - 1].textContent)) + (+(clusterColloideBounds[i + 1].textContent))).toString();
1130
- i++;
1131
1123
  }
1124
+ clusterColloideBounds = [];
1132
1125
  }
1133
- clusterColloideBounds = [];
1134
1126
  }
1135
- }
1127
+ });
1136
1128
  }
1137
1129
  while (0 < clusterGroup.childNodes.length) {
1138
1130
  markerCollection.insertBefore(clusterGroup.childNodes[0], markerCollection.firstChild);
@@ -1174,6 +1166,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1174
1166
  }
1175
1167
  }
1176
1168
  });
1169
+ return isClusteringCompleted;
1177
1170
  }
1178
1171
  /**
1179
1172
  *
@@ -4460,6 +4453,9 @@ var MarkerClusterSettings = /** @__PURE__ @class */ (function (_super) {
4460
4453
  __decorate$1([
4461
4454
  Property(false)
4462
4455
  ], MarkerClusterSettings.prototype, "allowClustering", void 0);
4456
+ __decorate$1([
4457
+ Property(true)
4458
+ ], MarkerClusterSettings.prototype, "allowDeepClustering", void 0);
4463
4459
  __decorate$1([
4464
4460
  Complex({ color: 'transparent', width: 1 }, Border)
4465
4461
  ], MarkerClusterSettings.prototype, "border", void 0);
@@ -10442,11 +10438,20 @@ var Marker = /** @__PURE__ @class */ (function () {
10442
10438
  'left:' + maps.mapAreaRect.x + 'px;' +
10443
10439
  'height:' + maps.mapAreaRect.height + 'px;' +
10444
10440
  'width:' + maps.mapAreaRect.width + 'px;';
10445
- currentLayer.markerSettings.map(function (markerSettings, markerIndex) {
10441
+ var allowAnimation = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
10442
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10443
+ var translatePoint;
10444
+ if (!maps.isTileMap) {
10445
+ translatePoint = !isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
10446
+ getZoomTranslate(maps, currentLayer, allowAnimation) :
10447
+ getTranslate(maps, currentLayer, allowAnimation);
10448
+ }
10449
+ var _loop_1 = function (markerIndex) {
10450
+ var markerSettings = currentLayer.markerSettings[markerIndex];
10446
10451
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10447
10452
  var markerData = markerSettings.dataSource;
10448
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10449
- Array.prototype.forEach.call(markerData, function (data, dataIndex) {
10453
+ var _loop_2 = function (dataIndex) {
10454
+ var data = markerData[dataIndex];
10450
10455
  maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
10451
10456
  var eventArgs = {
10452
10457
  cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
@@ -10469,14 +10474,11 @@ var Marker = /** @__PURE__ @class */ (function () {
10469
10474
  var markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
10470
10475
  + markerIndex + '_dataIndex_' + dataIndex;
10471
10476
  var location_1 = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
10472
- var animate$$1 = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
10473
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10474
- var translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location_1 = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
10475
- !isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
10476
- getZoomTranslate(maps, currentLayer, animate$$1) :
10477
- getTranslate(maps, currentLayer, animate$$1);
10478
- var scale = type === 'AddMarker' ? maps.scale : translate['scale'];
10479
- var transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
10477
+ if (maps.isTileMap) {
10478
+ translatePoint = (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location_1 = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object();
10479
+ }
10480
+ var scale = type === 'AddMarker' ? maps.scale : translatePoint['scale'];
10481
+ var transPoint = type === 'AddMarker' ? maps.translatePoint : translatePoint['location'];
10480
10482
  if (eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
10481
10483
  markerTemplateCount++;
10482
10484
  markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location_1, transPoint, scale, offset, maps);
@@ -10494,6 +10496,7 @@ var Marker = /** @__PURE__ @class */ (function () {
10494
10496
  maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
10495
10497
  maps.markerNullCount + 1 : maps.markerNullCount;
10496
10498
  var markerDataLength = markerData.length - maps.markerNullCount;
10499
+ var isMarkersClustered = false;
10497
10500
  if (_this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
10498
10501
  layerElement.appendChild(_this.markerSVGObject);
10499
10502
  if (currentLayer.markerClusterSettings.allowClustering) {
@@ -10501,11 +10504,11 @@ var Marker = /** @__PURE__ @class */ (function () {
10501
10504
  maps.element.appendChild(maps.svgObject);
10502
10505
  if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
10503
10506
  && maps.zoomSettings.enable) {
10504
- clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
10507
+ isMarkersClustered = clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
10505
10508
  layerElement.appendChild(_this.markerSVGObject);
10506
10509
  }
10507
10510
  else {
10508
- clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
10511
+ isMarkersClustered = clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
10509
10512
  }
10510
10513
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10511
10514
  maps.renderReactTemplates();
@@ -10514,7 +10517,7 @@ var Marker = /** @__PURE__ @class */ (function () {
10514
10517
  if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
10515
10518
  getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
10516
10519
  if (maps.checkInitialRender) {
10517
- if (currentLayer.markerClusterSettings.allowClustering) {
10520
+ if (currentLayer.markerClusterSettings.allowClustering && !isMarkersClustered) {
10518
10521
  clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, _this.markerSVGObject, layerElement, false, false);
10519
10522
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10520
10523
  maps.renderReactTemplates();
@@ -10522,8 +10525,15 @@ var Marker = /** @__PURE__ @class */ (function () {
10522
10525
  }
10523
10526
  }
10524
10527
  });
10525
- });
10526
- });
10528
+ };
10529
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10530
+ for (var dataIndex = 0; dataIndex < markerData.length; dataIndex++) {
10531
+ _loop_2(dataIndex);
10532
+ }
10533
+ };
10534
+ for (var markerIndex = 0; markerIndex < currentLayer.markerSettings.length; markerIndex++) {
10535
+ _loop_1(markerIndex);
10536
+ }
10527
10537
  };
10528
10538
  /**
10529
10539
  * To find zoom level for individual layers like India, USA.
@@ -15242,71 +15252,73 @@ var Zoom = /** @__PURE__ @class */ (function () {
15242
15252
  removeElement(maps.element.id + '_mapsTooltip');
15243
15253
  }
15244
15254
  if (this.layerCollectionEle) {
15245
- for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
15246
- var layerElement = this.layerCollectionEle.childNodes[i_1];
15255
+ var _loop_1 = function (i_1) {
15256
+ var layerElement = this_1.layerCollectionEle.childNodes[i_1];
15247
15257
  if (layerElement.tagName === 'g') {
15248
- this.templateCount++;
15249
- this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
15250
- this.currentLayer = maps.layersCollection[this.index];
15251
- var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
15258
+ this_1.templateCount++;
15259
+ this_1.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
15260
+ this_1.currentLayer = maps.layersCollection[this_1.index];
15261
+ var factor_1 = maps.mapLayerPanel.calculateFactor(this_1.currentLayer);
15252
15262
  var elementCount = layerElement.childElementCount;
15253
- for (var j = 0; j < elementCount; j++) {
15263
+ var _loop_2 = function (j) {
15254
15264
  var currentEle = layerElement.childNodes[j];
15255
15265
  if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
15256
15266
  && (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
15257
15267
  if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
15258
15268
  currentEle.remove();
15259
15269
  if (layerElement.children.length > 0 && layerElement.children[0]) {
15260
- layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
15270
+ layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this_1.currentLayer, maps.tileZoomLevel, this_1.index), layerElement.children[1]);
15261
15271
  }
15262
15272
  else {
15263
- layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
15273
+ layerElement.appendChild(maps.navigationLineModule.renderNavigation(this_1.currentLayer, maps.tileZoomLevel, this_1.index));
15264
15274
  }
15265
15275
  }
15266
15276
  else if (maps.isTileMap && (currentEle.id.indexOf('_Polygons_Group') > -1)) {
15267
- if (this.currentLayer.polygonSettings.polygons.length > 0) {
15268
- this.currentLayer.polygonSettings.polygons.map(function (polygonSettings, polygonIndex) {
15277
+ if (this_1.currentLayer.polygonSettings.polygons.length > 0) {
15278
+ this_1.currentLayer.polygonSettings.polygons.map(function (polygonSettings, polygonIndex) {
15269
15279
  var markerData = polygonSettings.points;
15270
15280
  var path = calculatePolygonPath(maps, maps.tileZoomLevel, _this.currentLayer, markerData);
15271
15281
  var element = document.getElementById(maps.element.id + '_LayerIndex_' + _this.index + '_PolygonIndex_' + polygonIndex);
15272
15282
  element.setAttribute('d', path);
15273
15283
  });
15274
- document.getElementById(maps.element.id + '_LayerIndex_' + this.index + '_Polygons_Group').style.visibility = '';
15284
+ document.getElementById(maps.element.id + '_LayerIndex_' + this_1.index + '_Polygons_Group').style.visibility = '';
15275
15285
  }
15276
15286
  }
15277
15287
  else if (currentEle.id.indexOf('Legend') === -1) {
15278
- changeBorderWidth(currentEle, this.index, scale, maps);
15288
+ changeBorderWidth(currentEle, this_1.index, scale, maps);
15279
15289
  maps.zoomTranslatePoint = maps.translatePoint;
15280
- this.animateTransform(currentEle, animate$$1, x, y, scale);
15290
+ this_1.animateTransform(currentEle, animate$$1, x, y, scale);
15281
15291
  }
15282
15292
  }
15283
15293
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
15284
- if ((!this.isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
15285
- this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
15294
+ if ((!this_1.isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
15295
+ this_1.markerTranslates(currentEle.childNodes[0], factor_1, x, y, scale, 'Marker', layerElement, animate$$1);
15286
15296
  }
15287
15297
  currentEle = layerElement.childNodes[j];
15288
- var markerAnimation = void 0;
15298
+ var markerAnimation_1;
15289
15299
  if (!isNullOrUndefined(currentEle) && currentEle.id.indexOf('Markers') !== -1) {
15290
- for (var k = 0; k < currentEle.childElementCount; k++) {
15291
- this.markerTranslate(currentEle.childNodes[k], factor, x, y, scale, 'Marker', animate$$1);
15292
- var layerIndex_1 = parseInt(currentEle.childNodes[k]['id'].split('_LayerIndex_')[1].split('_')[0], 10);
15293
- var dataIndex = parseInt(currentEle.childNodes[k]['id'].split('_dataIndex_')[1].split('_')[0], 10);
15294
- var markerIndex = parseInt(currentEle.childNodes[k]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
15295
- markerAnimation = this.currentLayer.markerSettings[markerIndex].animationDuration > 0 || animationMode === 'Enable';
15296
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15297
- var markerSelectionValues = this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
15298
- for (var x_1 = 0; x_1 < this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length; x_1++) {
15299
- if (this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['latitude'] ===
15300
- markerSelectionValues['latitude'] ||
15301
- this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
15302
- markerSelectionValues['longitude']) {
15303
- maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
15300
+ Array.prototype.forEach.call(currentEle.childNodes, function (childNode, k) {
15301
+ _this.markerTranslate(childNode, factor_1, x, y, scale, 'Marker', animate$$1);
15302
+ var layerIndex = parseInt(childNode['id'].split('_LayerIndex_')[1].split('_')[0], 10);
15303
+ var dataIndex = parseInt(childNode['id'].split('_dataIndex_')[1].split('_')[0], 10);
15304
+ var markerIndex = parseInt(childNode['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
15305
+ markerAnimation_1 = _this.currentLayer.markerSettings[markerIndex].animationDuration > 0 || animationMode === 'Enable';
15306
+ if (_this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length > 0) {
15307
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15308
+ var markerSelectionValues = _this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
15309
+ for (var x_1 = 0; x_1 < _this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length; x_1++) {
15310
+ if (_this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['latitude'] ===
15311
+ markerSelectionValues['latitude'] ||
15312
+ _this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
15313
+ markerSelectionValues['longitude']) {
15314
+ maps.markerSelection(_this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], _this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
15315
+ }
15304
15316
  }
15305
15317
  }
15306
- if (((this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
15318
+ if (((_this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && _this.currentLayer.type === 'SubLayer')) && !_this.isPanning) {
15307
15319
  if (maps.isTileMap) {
15308
15320
  var groupElement = document.querySelector('.GroupElement');
15309
- if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
15321
+ if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation_1) {
15310
15322
  groupElement.style.display = 'none';
15311
15323
  }
15312
15324
  }
@@ -15315,8 +15327,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
15315
15327
  currentEle.style.cssText = markerStyle;
15316
15328
  }
15317
15329
  }
15318
- }
15319
- if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
15330
+ });
15331
+ if (this_1.isPanning && maps.markerModule.sameMarkerData.length > 0) {
15320
15332
  clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
15321
15333
  }
15322
15334
  else if (maps.markerModule.sameMarkerData.length > 0) {
@@ -15326,7 +15338,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15326
15338
  }
15327
15339
  }
15328
15340
  if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
15329
- && !this.isPanning) {
15341
+ && !this_1.isPanning) {
15330
15342
  var mapsTooltip = maps.mapsTooltipModule;
15331
15343
  var tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
15332
15344
  if (!isNullOrUndefined(tooltipElement)) {
@@ -15364,7 +15376,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15364
15376
  var centerY = bubbleCollection['center']['y'];
15365
15377
  var currentX = ((centerX + x) * scale);
15366
15378
  var currentY = ((centerY + y) * scale);
15367
- var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
15379
+ var duration = this_1.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this_1.currentLayer.animationDuration;
15368
15380
  if (!animate$$1 || duration === 0) {
15369
15381
  childElement.setAttribute('transform', 'translate( ' + currentX + ' ' + currentY + ' )');
15370
15382
  }
@@ -15376,25 +15388,25 @@ var Zoom = /** @__PURE__ @class */ (function () {
15376
15388
  }
15377
15389
  }
15378
15390
  }
15379
- else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
15380
- this.intersect = [];
15391
+ else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this_1.index])) {
15392
+ this_1.intersect = [];
15381
15393
  maps.zoomLabelPositions = [];
15382
15394
  maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
15383
15395
  var labelAnimate = !maps.isTileMap && animate$$1;
15384
15396
  for (var k = 0; k < currentEle.childElementCount; k++) {
15385
15397
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
15386
15398
  var labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
15387
- this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
15388
- maps.zoomShapeCollection.push(this.zoomshapewidth);
15389
- this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
15390
- var dataLabel = maps.layers[this.index].dataLabelSettings;
15399
+ this_1.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
15400
+ maps.zoomShapeCollection.push(this_1.zoomshapewidth);
15401
+ this_1.dataLabelTranslate(currentEle.childNodes[k], factor_1, x, y, scale, 'DataLabel', labelAnimate);
15402
+ var dataLabel = maps.layers[this_1.index].dataLabelSettings;
15391
15403
  var border = dataLabel.border;
15392
15404
  if (k > 0 && border['width'] > 1) {
15393
15405
  if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
15394
15406
  var labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
15395
15407
  var labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
15396
15408
  var zoomtext = currentEle.childNodes[k]['textContent'];
15397
- var style = maps.layers[this.index].dataLabelSettings.textStyle;
15409
+ var style = maps.layers[this_1.index].dataLabelSettings.textStyle;
15398
15410
  var zoomtextSize = measureText(zoomtext, style);
15399
15411
  var padding = 5;
15400
15412
  var rectElement = currentEle.childNodes[k - 1];
@@ -15407,9 +15419,16 @@ var Zoom = /** @__PURE__ @class */ (function () {
15407
15419
  }
15408
15420
  }
15409
15421
  }
15422
+ };
15423
+ for (var j = 0; j < elementCount; j++) {
15424
+ _loop_2(j);
15410
15425
  }
15411
15426
  }
15412
15427
  maps.arrangeTemplate();
15428
+ };
15429
+ var this_1 = this;
15430
+ for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
15431
+ _loop_1(i_1);
15413
15432
  }
15414
15433
  if (!isNullOrUndefined(this.currentLayer)) {
15415
15434
  if (!animate$$1 || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
@@ -15449,7 +15468,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15449
15468
  removeElement(markerTemplateElements.id);
15450
15469
  }
15451
15470
  var currentLayers = this.maps.layersCollection[layerIndex];
15452
- currentLayers.markerSettings.map(function (markerSettings, markerIndex) {
15471
+ Array.prototype.forEach.call(currentLayers.markerSettings, function (markerSettings, markerIndex) {
15453
15472
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15454
15473
  var markerDatas = markerSettings.dataSource;
15455
15474
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -15498,6 +15517,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15498
15517
  _this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
15499
15518
  ? _this.maps.markerNullCount + 1 : _this.maps.markerNullCount;
15500
15519
  var markerDataLength = markerDatas.length - _this.maps.markerNullCount;
15520
+ var isMarkersClustered = false;
15501
15521
  if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
15502
15522
  if (_this.maps.isTileMap) {
15503
15523
  var polygonsElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
@@ -15520,13 +15540,13 @@ var Zoom = /** @__PURE__ @class */ (function () {
15520
15540
  if (currentLayers.markerClusterSettings.allowClustering) {
15521
15541
  _this.maps.svgObject.appendChild(markerSVGObject);
15522
15542
  _this.maps.element.appendChild(_this.maps.svgObject);
15523
- clusterTemplate(currentLayers, markerSVGObject, _this.maps, layerIndex, markerSVGObject, layerElement, true, true);
15543
+ isMarkersClustered = clusterTemplate(currentLayers, markerSVGObject, _this.maps, layerIndex, markerSVGObject, layerElement, true, true);
15524
15544
  }
15525
15545
  }
15526
15546
  if (markerTemplateElements.childElementCount === (markerDataLength - markerCounts - nullCount) && getElementByID(_this.maps.element.id + '_Secondary_Element')) {
15527
15547
  getElementByID(_this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
15528
15548
  if (scale >= 1) {
15529
- if (currentLayers.markerClusterSettings.allowClustering) {
15549
+ if (currentLayers.markerClusterSettings.allowClustering && !isMarkersClustered) {
15530
15550
  clusterTemplate(currentLayers, markerTemplateElements, _this.maps, layerIndex, markerSVGObject, layerElement, false, true);
15531
15551
  }
15532
15552
  }