@syncfusion/ej2-maps 26.1.41 → 26.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.
@@ -1552,10 +1552,10 @@ function calculateShapes(maps, shape, options, size, location, markerEle) {
1552
1552
  + ' ' + location.y + ' Z';
1553
1553
  break;
1554
1554
  case 'Star':
1555
- options.d = 'M ' + (location.x + size.width / 3) + ' ' + (location.y - size.height / 2) + ' L ' + (location.x - size.width / 2)
1556
- + ' ' + (location.y + size.height / 6) + ' L ' + (location.x + size.width / 2) + ' ' + (location.y + size.height / 6)
1557
- + ' L ' + (location.x - size.width / 3) + ' ' + (location.y - size.height / 2) + ' L ' + location.x + ' ' +
1558
- (location.y + size.height / 2) + ' L ' + (location.x + size.width / 3) + ' ' + (location.y - size.height / 2) + ' Z';
1555
+ options.d = 'M ' + (location.x + size.width / 3) + ' ' + (location.y + size.height / 2) + ' L ' + (location.x - size.width / 2)
1556
+ + ' ' + (location.y - size.height / 6) + ' L ' + (location.x + size.width / 2) + ' ' + (location.y - size.height / 6)
1557
+ + ' L ' + (location.x - size.width / 3) + ' ' + (location.y + size.height / 2) + ' L ' + location.x + ' ' +
1558
+ (location.y - size.height / 2) + ' L ' + (location.x + size.width / 3) + ' ' + (location.y + size.height / 2) + ' Z';
1559
1559
  break;
1560
1560
  case 'Triangle':
1561
1561
  options.d = 'M ' + location.x + ' ' + (location.y - size.height / 2) + ' L ' + (location.x + size.width / 2) + ' ' +
@@ -1681,10 +1681,10 @@ function drawVerticalLine(maps, options, size, location, element) {
1681
1681
  * @private
1682
1682
  */
1683
1683
  function drawStar(maps, options, size, location, element) {
1684
- options.d = 'M ' + (location.x + size.width / 3) + ' ' + (location.y - size.height / 2) + ' L ' + (location.x - size.width / 2)
1685
- + ' ' + (location.y + size.height / 6) + ' L ' + (location.x + size.width / 2) + ' ' + (location.y + size.height / 6) + ' L '
1686
- + (location.x - size.width / 3) + ' ' + (location.y - size.height / 2) + ' L ' + location.x + ' ' + (location.y + size.height / 2)
1687
- + ' L ' + (location.x + size.width / 3) + ' ' + (location.y - size.height / 2) + ' Z';
1684
+ options.d = 'M ' + (location.x + size.width / 3) + ' ' + (location.y + size.height / 2) + ' L ' + (location.x - size.width / 2)
1685
+ + ' ' + (location.y - size.height / 6) + ' L ' + (location.x + size.width / 2) + ' ' + (location.y - size.height / 6) + ' L '
1686
+ + (location.x - size.width / 3) + ' ' + (location.y + size.height / 2) + ' L ' + location.x + ' ' + (location.y - size.height / 2)
1687
+ + ' L ' + (location.x + size.width / 3) + ' ' + (location.y + size.height / 2) + ' Z';
1688
1688
  return appendShape(maps.renderer.drawPath(options), element);
1689
1689
  }
1690
1690
  /**
@@ -3041,10 +3041,10 @@ function renderLegendShape(location, size, shape, options, url) {
3041
3041
  merge(options, { 'd': renderPath });
3042
3042
  break;
3043
3043
  case 'Star':
3044
- renderPath = 'M ' + (location.x + size.width / 3) + ' ' + (location.y - size.height / 2) + ' L ' + (location.x - size.width / 2)
3045
- + ' ' + (location.y + size.height / 6) + ' L ' + (location.x + size.width / 2) + ' ' + (location.y + size.height / 6)
3046
- + ' L ' + (location.x - size.width / 3) + ' ' + (location.y - size.height / 2) + ' L ' + location.x + ' ' +
3047
- (location.y + size.height / 2) + ' L ' + (location.x + size.width / 3) + ' ' + (location.y - size.height / 2) + ' Z';
3044
+ renderPath = 'M ' + (location.x + size.width / 3) + ' ' + (location.y + size.height / 2) + ' L ' + (location.x - size.width / 2)
3045
+ + ' ' + (location.y - size.height / 6) + ' L ' + (location.x + size.width / 2) + ' ' + (location.y - size.height / 6)
3046
+ + ' L ' + (location.x - size.width / 3) + ' ' + (location.y + size.height / 2) + ' L ' + location.x + ' ' +
3047
+ (location.y - size.height / 2) + ' L ' + (location.x + size.width / 3) + ' ' + (location.y + size.height / 2) + ' Z';
3048
3048
  merge(options, { 'd': renderPath });
3049
3049
  break;
3050
3050
  case 'Cross':
@@ -14633,34 +14633,41 @@ class MapsTooltip {
14633
14633
  layer.shapePropertyPath : [layer.shapePropertyPath]);
14634
14634
  if (!isNullOrUndefined(properties)) {
14635
14635
  for (let k = 0; k < properties.length; k++) {
14636
- for (let i = 0; i < layer['dataSource']['length']; i++) {
14637
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14638
- const data = layer.dataSource[i];
14639
- const dataPath = (layer.shapeDataPath.indexOf('.') > -1) ?
14640
- (getValueFromObject(data, layer.shapeDataPath)) : data[layer.shapeDataPath];
14641
- const dataPathValue = !isNullOrUndefined(dataPath) && isNaN(data[layer.shapeDataPath])
14642
- ? dataPath.toLowerCase() : dataPath;
14643
- const propertyValue = !isNullOrUndefined(value[properties[k]])
14644
- && isNaN(value[properties[k]]) ? value[properties[k]].toLowerCase() :
14645
- value[properties[k]];
14646
- if (dataPathValue === propertyValue) {
14647
- isShape = true;
14648
- index = i;
14649
- k = properties.length;
14650
- break;
14636
+ if (!isNullOrUndefined(layer.dataSource)) {
14637
+ for (let i = 0; i < layer['dataSource']['length']; i++) {
14638
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14639
+ const data = layer.dataSource[i];
14640
+ const dataPath = (layer.shapeDataPath.indexOf('.') > -1) ?
14641
+ (getValueFromObject(data, layer.shapeDataPath)) : data[layer.shapeDataPath];
14642
+ const dataPathValue = !isNullOrUndefined(dataPath) && isNaN(data[layer.shapeDataPath])
14643
+ ? dataPath.toLowerCase() : dataPath;
14644
+ const propertyValue = !isNullOrUndefined(value[properties[k]])
14645
+ && isNaN(value[properties[k]]) ? value[properties[k]].toLowerCase() :
14646
+ value[properties[k]];
14647
+ if (dataPathValue === propertyValue) {
14648
+ isShape = true;
14649
+ index = i;
14650
+ k = properties.length;
14651
+ break;
14652
+ }
14651
14653
  }
14652
14654
  }
14653
14655
  }
14654
14656
  index = isShape ? index : null;
14655
- if (!isNullOrUndefined(layer.dataSource[index])) {
14656
- templateData = JSON.parse(JSON.stringify(layer.dataSource[index]));
14657
- for (keyString in value) {
14658
- // eslint-disable-next-line no-prototype-builtins
14659
- if (!templateData.hasOwnProperty(keyString)) {
14660
- templateData[keyString] = value[keyString];
14657
+ if (layer['dataSource'] && layer['dataSource']['length'] > 0) {
14658
+ if (!isNullOrUndefined(layer.dataSource[index])) {
14659
+ templateData = JSON.parse(JSON.stringify(layer.dataSource[index]));
14660
+ for (keyString in value) {
14661
+ // eslint-disable-next-line no-prototype-builtins
14662
+ if (!templateData.hasOwnProperty(keyString)) {
14663
+ templateData[keyString] = value[keyString];
14664
+ }
14661
14665
  }
14662
14666
  }
14663
14667
  }
14668
+ else {
14669
+ templateData = value;
14670
+ }
14664
14671
  }
14665
14672
  if (option.visible && ((!isNullOrUndefined(index) && !isNaN(index)) || (!isNullOrUndefined(value)))) {
14666
14673
  if (layer.tooltipSettings.format) {