@syncfusion/ej2-maps 20.4.40 → 20.4.42

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.
@@ -12509,22 +12509,10 @@ var Legend = /** @__PURE__ @class */ (function () {
12509
12509
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
12510
12510
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12511
12511
  if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
12512
- legendShapeId.setAttribute('fill', legendToggleFill);
12513
- legendShapeId.setAttribute('fill-opacity', (legendToggleOpacity).toString());
12514
- legendShapeId.setAttribute('stroke', legendToggleBorderColor);
12515
- legendShapeId.setAttribute('stroke-width', (legendToggleBorderWidth).toString());
12516
- legendShapeId.setAttribute('stroke-opacity', (legendToggleBorderOpacity).toString());
12517
- legendTextId.setAttribute('fill', legendToggleFill);
12512
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
12518
12513
  }
12519
12514
  else {
12520
- legendTextId.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
12521
- legendShapeId.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
12522
- legendShapeId.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
12523
- legendShapeId.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
12524
- legendShapeId.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
12525
- legendShapeId.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
12526
- this.maps.layers[k].shapeSettings.opacity :
12527
- this.maps.layers[k].shapeSettings.border.opacity).toString());
12515
+ this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[k].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity, this.maps.layers[k].shapeSettings.border.color, isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width, isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ? this.maps.layers[k].shapeSettings.opacity : this.maps.layers[k].shapeSettings.border.opacity, this.maps.layers[k].shapeSettings.fill);
12528
12516
  }
12529
12517
  }
12530
12518
  }
@@ -12537,16 +12525,11 @@ var Legend = /** @__PURE__ @class */ (function () {
12537
12525
  }
12538
12526
  if (targetEle !== null) {
12539
12527
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
12540
- legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
12541
- legendShapeId.setAttribute('fill-opacity', this.legendCollection[legendIndex]['opacity']);
12542
- legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['shapeBorder']['color']);
12543
- legendShapeId.setAttribute('stroke-width', this.legendCollection[legendIndex]['shapeBorder']['width']);
12544
- legendShapeId.setAttribute('stroke-opacity', this.legendCollection[legendIndex]['shapeBorder']['opacity']);
12528
+ legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12529
+ this.setToggleAttributes(legendTextId, legendShapeId, this.legendCollection[legendIndex]['fill'], this.legendCollection[legendIndex]['opacity'], this.legendCollection[legendIndex]['shapeBorder']['color'], this.legendCollection[legendIndex]['shapeBorder']['width'], this.legendCollection[legendIndex]['shapeBorder']['opacity'], '#757575');
12545
12530
  if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
12546
12531
  legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
12547
12532
  }
12548
- legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12549
- legendTextId.setAttribute('fill', '#757575');
12550
12533
  }
12551
12534
  }
12552
12535
  }
@@ -12593,9 +12576,13 @@ var Legend = /** @__PURE__ @class */ (function () {
12593
12576
  }
12594
12577
  if (targetEle !== null) {
12595
12578
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12596
- legendTextId.setAttribute('fill', '#E5E5E5');
12597
12579
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
12598
- legendShapeId.setAttribute('fill', '#E5E5E5');
12580
+ if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
12581
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
12582
+ }
12583
+ else {
12584
+ this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[j].shapeSettings.fill, this.maps.layers[j].shapeSettings.opacity, this.maps.layers[j].shapeSettings.border.color, isNullOrUndefined(this.maps.layers[j].shapeSettings.border.width) ? 0 : this.maps.layers[j].shapeSettings.border.width, isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity) ? this.maps.layers[j].shapeSettings.opacity : this.maps.layers[j].shapeSettings.border.opacity, this.maps.layers[j].shapeSettings.fill);
12585
+ }
12599
12586
  }
12600
12587
  }
12601
12588
  else {
@@ -12614,9 +12601,8 @@ var Legend = /** @__PURE__ @class */ (function () {
12614
12601
  layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
12615
12602
  if (targetEle !== null) {
12616
12603
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12617
- legendTextId.setAttribute('fill', '#757575');
12618
12604
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
12619
- legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
12605
+ this.setToggleAttributes(legendTextId, legendShapeId, this.legendCollection[legendIndex]['fill'], this.legendCollection[legendIndex]['opacity'], this.legendCollection[legendIndex]['shapeBorder']['color'], this.legendCollection[legendIndex]['shapeBorder']['width'], this.legendCollection[legendIndex]['shapeBorder']['opacity'], '#757575');
12620
12606
  }
12621
12607
  }
12622
12608
  }
@@ -12670,22 +12656,10 @@ var Legend = /** @__PURE__ @class */ (function () {
12670
12656
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
12671
12657
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
12672
12658
  if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
12673
- legendTextId.setAttribute('fill', legendToggleFill);
12674
- legendShapeId.setAttribute('fill', legendToggleFill);
12675
- legendShapeId.setAttribute('fill-opacity', (legendToggleOpacity).toString());
12676
- legendShapeId.setAttribute('stroke', legendToggleBorderColor);
12677
- legendShapeId.setAttribute('stroke-width', (legendToggleBorderWidth).toString());
12678
- legendShapeId.setAttribute('stroke-opacity', (legendToggleBorderOpacity).toString());
12659
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
12679
12660
  }
12680
12661
  else {
12681
- legendTextId.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
12682
- legendShapeId.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
12683
- legendShapeId.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
12684
- legendShapeId.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
12685
- legendShapeId.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
12686
- this.maps.layers[k].shapeSettings.opacity :
12687
- this.maps.layers[k].shapeSettings.border.opacity).toString());
12688
- legendShapeId.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
12662
+ this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[k].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity, this.maps.layers[k].shapeSettings.border.color, (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width), (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ? this.maps.layers[k].shapeSettings.opacity : this.maps.layers[k].shapeSettings.border.opacity), this.maps.layers[k].shapeSettings.fill);
12689
12663
  }
12690
12664
  }
12691
12665
  }
@@ -12751,9 +12725,13 @@ var Legend = /** @__PURE__ @class */ (function () {
12751
12725
  }
12752
12726
  if (targetEle !== null) {
12753
12727
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
12754
- legendShapeId.setAttribute('fill', '#E5E5E5');
12755
12728
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
12756
- legendTextId.setAttribute('fill', '#E5E5E5');
12729
+ if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
12730
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
12731
+ }
12732
+ else {
12733
+ this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[0].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity, this.maps.layers[0].shapeSettings.border.color, isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width, isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ? this.maps.layers[k].shapeSettings.opacity : this.maps.layers[k].shapeSettings.border.opacity, this.maps.layers[0].shapeSettings.fill);
12734
+ }
12757
12735
  }
12758
12736
  }
12759
12737
  else {
@@ -12773,9 +12751,8 @@ var Legend = /** @__PURE__ @class */ (function () {
12773
12751
  mapLegendElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
12774
12752
  if (targetEle !== null) {
12775
12753
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
12776
- legendTextId.setAttribute('fill', '#757575');
12777
12754
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
12778
- legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
12755
+ this.setToggleAttributes(legendTextId, legendShapeId, this.legendCollection[legendIndex]['fill'], this.legendCollection[legendIndex]['opacity'], this.legendCollection[legendIndex]['shapeBorder']['color'], this.legendCollection[legendIndex]['shapeBorder']['width'], this.legendCollection[legendIndex]['shapeBorder']['opacity'], '#757575');
12779
12756
  }
12780
12757
  }
12781
12758
  }
@@ -12852,6 +12829,16 @@ var Legend = /** @__PURE__ @class */ (function () {
12852
12829
  }
12853
12830
  return legendData;
12854
12831
  };
12832
+ Legend.prototype.setToggleAttributes = function (textElement, shapeElement, fillColor, fillOpacity, borderColor, borderWidth, borderOpacity, textColor) {
12833
+ textElement.setAttribute('fill', textColor);
12834
+ shapeElement.setAttribute('fill', fillColor);
12835
+ shapeElement.setAttribute('fill-opacity', (fillOpacity).toString());
12836
+ shapeElement.setAttribute('stroke', borderColor);
12837
+ shapeElement.setAttribute('stroke-width', (borderWidth).toString());
12838
+ if (!isNullOrUndefined(borderOpacity)) {
12839
+ shapeElement.setAttribute('stroke-opacity', (borderOpacity).toString());
12840
+ }
12841
+ };
12855
12842
  Legend.prototype.legendGradientColor = function (colorMap, legendIndex) {
12856
12843
  var legendFillColor;
12857
12844
  var xmlns = 'http://www.w3.org/2000/svg';