@syncfusion/ej2-maps 21.2.3 → 21.2.5

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.
@@ -993,10 +993,10 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
993
993
  const ele = drawSymbols(shapeCustom['shape'], shapeCustom['imageUrl'], { x: 0, y: 0 }, clusterID, shapeCustom, markerCollection, maps);
994
994
  ele.setAttribute('transform', 'translate( ' + tempX + ' ' + tempY + ' )');
995
995
  if (eventArg.shape === 'Balloon') {
996
- ele.children[0].innerText = indexCollection.toString();
996
+ ele.children[0].textContent = indexCollection.toString();
997
997
  }
998
998
  else {
999
- ele.innerText = indexCollection.toString();
999
+ ele.textContent = indexCollection.toString();
1000
1000
  }
1001
1001
  options = new TextOption(labelID, (0), postionY, 'middle', (colloideBounds.length + 1).toString(), '', '');
1002
1002
  textElement = renderTextElement(options, style, style.color, markerCollection);
@@ -1095,7 +1095,7 @@ function mergeSeparateCluster(sameMarkerData, maps, markerElement) {
1095
1095
  let markerEle;
1096
1096
  const markerDataLength = sameMarkerData[0].data.length;
1097
1097
  for (let i = 0; i < markerDataLength; i++) {
1098
- markerEle = marker.shape === 'Balloon' ? getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
1098
+ markerEle = marker.shape === 'Balloon' && isNullOrUndefined(marker.template) ? getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
1099
1099
  markerEle['style']['visibility'] = 'hidden';
1100
1100
  }
1101
1101
  removeElement(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine');
@@ -1124,7 +1124,7 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1124
1124
  const clusterEleLabel = getElementFunction(getQueryConnect + '' + clusterId + '_datalabel_' + clusterIndex);
1125
1125
  clusterEle.setAttribute('visibility', 'hidden');
1126
1126
  clusterEleLabel.setAttribute('visibility', 'hidden');
1127
- let markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
1127
+ let markerEle = marker.shape === 'Balloon' && isNullOrUndefined(marker.template) ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
1128
1128
  const height = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().height : marker.height;
1129
1129
  const width = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().width : marker.width;
1130
1130
  const centerX = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[0];
@@ -1160,7 +1160,7 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1160
1160
  const x1 = centerX + radius * Math.sin((Math.PI * 2 * newAngle) / 360);
1161
1161
  const y1 = centerY + radius * Math.cos((Math.PI * 2 * newAngle) / 360);
1162
1162
  path += start + 'L ' + (x1) + ' ' + y1 + ' ';
1163
- markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
1163
+ markerEle = marker.shape === 'Balloon' && isNullOrUndefined(marker.template) ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
1164
1164
  if (markerEle.parentElement.id.indexOf('Template_Group') > -1) {
1165
1165
  markerEle['style']['transform'] = '';
1166
1166
  markerEle['style']['left'] = maps.isTileMap ? x1 - (width / 2) + 'px' : (x1 - (width / 2) - 10) + 'px';
@@ -5264,7 +5264,7 @@ class Marker {
5264
5264
  if ((target.indexOf('_cluster_') > -1)) {
5265
5265
  let isClusterSame = false;
5266
5266
  const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? layer.markerClusterSettings.shape === 'Balloon' ? target.split('_datalabel_')[0] + '_Group' : target.split('_datalabel_')[0] : layer.markerClusterSettings.shape === 'Balloon' ? target + '_Group' : target);
5267
- const indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].innerText.split(',').map(Number) : clusterElement.innerText.split(',').map(Number);
5267
+ const indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].textContent.split(',').map(Number) : clusterElement.textContent.split(',').map(Number);
5268
5268
  collection = [];
5269
5269
  for (const i of indexes) {
5270
5270
  collection.push({ data: marker$$1.dataSource[i], index: i });
@@ -13815,7 +13815,7 @@ class MapsTooltip {
13815
13815
  }
13816
13816
  }
13817
13817
  else {
13818
- this.clearTooltip();
13818
+ this.clearTooltip(e.target);
13819
13819
  }
13820
13820
  });
13821
13821
  if (this.svgTooltip) {
@@ -13830,7 +13830,7 @@ class MapsTooltip {
13830
13830
  });
13831
13831
  }
13832
13832
  else {
13833
- this.clearTooltip();
13833
+ this.clearTooltip(e.target);
13834
13834
  }
13835
13835
  }
13836
13836
  else {
@@ -13840,7 +13840,7 @@ class MapsTooltip {
13840
13840
  this.maps.notify(click, this);
13841
13841
  }
13842
13842
  else {
13843
- this.clearTooltip();
13843
+ this.clearTooltip(e.target);
13844
13844
  }
13845
13845
  }
13846
13846
  }
@@ -13897,11 +13897,14 @@ class MapsTooltip {
13897
13897
  }
13898
13898
  return isTooltipRemoved;
13899
13899
  }
13900
- clearTooltip() {
13901
- const isTooltipRemoved = this.removeTooltip();
13902
- if (isTooltipRemoved) {
13903
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13904
- this.maps.clearTemplate();
13900
+ clearTooltip(element) {
13901
+ let tooltipElement = element.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
13902
+ if (isNullOrUndefined(tooltipElement)) {
13903
+ const isTooltipRemoved = this.removeTooltip();
13904
+ if (isTooltipRemoved) {
13905
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13906
+ this.maps.clearTemplate();
13907
+ }
13905
13908
  }
13906
13909
  }
13907
13910
  // eslint-disable-next-line valid-jsdoc