@syncfusion/ej2-maps 23.1.42 → 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.
@@ -629,7 +629,7 @@ function renderTextElement(option, style, color, parent, isMinus = false) {
629
629
  * @private
630
630
  */
631
631
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
632
- function convertElement(element, markerId, data, index, mapObj) {
632
+ function convertElement(element, markerId, data, index, mapObj, templateType) {
633
633
  const childElement = createElement('div', {
634
634
  id: markerId, className: mapObj.element.id + '_marker_template_element'
635
635
  });
@@ -639,19 +639,21 @@ function convertElement(element, markerId, data, index, mapObj) {
639
639
  childElement.appendChild(element[0]);
640
640
  elementLength--;
641
641
  }
642
- let templateHtml = childElement.innerHTML;
643
- const properties = Object.keys(data);
644
- const regExp = RegExp;
645
- for (let i = 0; i < properties.length; i++) {
646
- if (typeof data[properties[i]] === 'object') {
647
- templateHtml = convertStringToValue(templateHtml, '', data, mapObj);
648
- // eslint-disable-next-line @typescript-eslint/ban-types
649
- }
650
- else if (properties[i].toLowerCase() !== 'latitude' && properties[i].toLowerCase() !== 'longitude') {
651
- templateHtml = templateHtml.replace(new regExp('{{:' + properties[i] + '}}', 'g'), data[properties[i].toString()]);
642
+ if (!mapObj.isReact || templateType !== 'function') {
643
+ let templateHtml = childElement.innerHTML;
644
+ const properties = Object.keys(data);
645
+ const regExp = RegExp;
646
+ for (let i = 0; i < properties.length; i++) {
647
+ if (typeof data[properties[i]] === 'object') {
648
+ templateHtml = convertStringToValue(templateHtml, '', data, mapObj);
649
+ // eslint-disable-next-line @typescript-eslint/ban-types
650
+ }
651
+ else if (properties[i].toLowerCase() !== 'latitude' && properties[i].toLowerCase() !== 'longitude') {
652
+ templateHtml = templateHtml.replace(new regExp('{{:' + properties[i] + '}}', 'g'), data[properties[i].toString()]);
653
+ }
652
654
  }
655
+ childElement.innerHTML = templateHtml;
653
656
  }
654
- childElement.innerHTML = templateHtml;
655
657
  return childElement;
656
658
  }
657
659
  /**
@@ -1256,7 +1258,7 @@ function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, mark
1256
1258
  templateFn = getTemplateFunction(eventArgs.template, maps);
1257
1259
  if (templateFn && (templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false).length)) {
1258
1260
  const templateElement = templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false);
1259
- const markerElement = convertElement(templateElement, markerID, data, markerIndex, maps);
1261
+ const markerElement = convertElement(templateElement, markerID, data, markerIndex, maps, typeof eventArgs.template);
1260
1262
  for (let i = 0; i < markerElement.children.length; i++) {
1261
1263
  markerElement.children[i].style.pointerEvents = 'auto';
1262
1264
  }