@syncfusion/ej2-maps 23.1.40 → 23.1.44

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.
@@ -682,7 +682,7 @@ function renderTextElement(option, style, color, parent, isMinus) {
682
682
  * @private
683
683
  */
684
684
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
685
- function convertElement(element, markerId, data, index, mapObj) {
685
+ function convertElement(element, markerId, data, index, mapObj, templateType) {
686
686
  var childElement = createElement('div', {
687
687
  id: markerId, className: mapObj.element.id + '_marker_template_element'
688
688
  });
@@ -692,19 +692,21 @@ function convertElement(element, markerId, data, index, mapObj) {
692
692
  childElement.appendChild(element[0]);
693
693
  elementLength--;
694
694
  }
695
- var templateHtml = childElement.innerHTML;
696
- var properties = Object.keys(data);
697
- var regExp = RegExp;
698
- for (var i = 0; i < properties.length; i++) {
699
- if (typeof data[properties[i]] === 'object') {
700
- templateHtml = convertStringToValue(templateHtml, '', data, mapObj);
701
- // eslint-disable-next-line @typescript-eslint/ban-types
702
- }
703
- else if (properties[i].toLowerCase() !== 'latitude' && properties[i].toLowerCase() !== 'longitude') {
704
- templateHtml = templateHtml.replace(new regExp('{{:' + properties[i] + '}}', 'g'), data[properties[i].toString()]);
695
+ if (!mapObj.isReact || templateType !== 'function') {
696
+ var templateHtml = childElement.innerHTML;
697
+ var properties = Object.keys(data);
698
+ var regExp = RegExp;
699
+ for (var i = 0; i < properties.length; i++) {
700
+ if (typeof data[properties[i]] === 'object') {
701
+ templateHtml = convertStringToValue(templateHtml, '', data, mapObj);
702
+ // eslint-disable-next-line @typescript-eslint/ban-types
703
+ }
704
+ else if (properties[i].toLowerCase() !== 'latitude' && properties[i].toLowerCase() !== 'longitude') {
705
+ templateHtml = templateHtml.replace(new regExp('{{:' + properties[i] + '}}', 'g'), data[properties[i].toString()]);
706
+ }
705
707
  }
708
+ childElement.innerHTML = templateHtml;
706
709
  }
707
- childElement.innerHTML = templateHtml;
708
710
  return childElement;
709
711
  }
710
712
  /**
@@ -1309,7 +1311,7 @@ function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, mark
1309
1311
  templateFn = getTemplateFunction(eventArgs.template, maps);
1310
1312
  if (templateFn && (templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false).length)) {
1311
1313
  var templateElement = templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false);
1312
- var markerElement = convertElement(templateElement, markerID, data, markerIndex, maps);
1314
+ var markerElement = convertElement(templateElement, markerID, data, markerIndex, maps, typeof eventArgs.template);
1313
1315
  for (var i = 0; i < markerElement.children.length; i++) {
1314
1316
  markerElement.children[i].style.pointerEvents = 'auto';
1315
1317
  }
@@ -5511,6 +5513,12 @@ var Marker = /** @__PURE__ @class */ (function () {
5511
5513
  */
5512
5514
  Marker.prototype.markerClick = function (e) {
5513
5515
  var target = e.target.id;
5516
+ if (target.indexOf(this.maps.element.id) === -1) {
5517
+ var ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
5518
+ if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
5519
+ target = ancestor.id;
5520
+ }
5521
+ }
5514
5522
  if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
5515
5523
  return;
5516
5524
  }