@syncfusion/ej2-maps 20.4.40 → 20.4.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.
@@ -8276,7 +8276,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8276
8276
  EventHandler.add(this.element, 'keydown', this.keyDownHandler, this);
8277
8277
  EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);
8278
8278
  // EventHandler.add(this.element, cancelEvent, this.mouseLeaveOnMap, this);
8279
- window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize.bind(this));
8279
+ this.resizeEvent = this.mapsOnResize.bind(this);
8280
+ window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.resizeEvent);
8280
8281
  };
8281
8282
  /**
8282
8283
  * To unbind event handlers from maps.
@@ -8295,7 +8296,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8295
8296
  EventHandler.remove(this.element, 'keydown', this.keyDownHandler);
8296
8297
  EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
8297
8298
  //EventHandler.remove(this.element, cancelEvent, this.mouseLeaveOnMap);
8298
- window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize);
8299
+ window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.resizeEvent);
8299
8300
  };
8300
8301
  /**
8301
8302
  * This method is used to perform operations when mouse pointer leave from maps.
@@ -9141,6 +9142,9 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9141
9142
  */
9142
9143
  Maps.prototype.destroy = function () {
9143
9144
  this.unWireEVents();
9145
+ if (!isNullOrUndefined(this.mapsTooltipModule)) {
9146
+ this.mapsTooltipModule.removeEventListener();
9147
+ }
9144
9148
  _super.prototype.destroy.call(this);
9145
9149
  this.shapeSelectionItem = [];
9146
9150
  this.toggledShapeElementId = [];
@@ -11238,14 +11242,14 @@ var Legend = /** @__PURE__ @class */ (function () {
11238
11242
  ' L ' + (rightPageX - width) + ' ' + (locY + height) + ' z ';
11239
11243
  var leftPath = ' M ' + leftPageX + ' ' + locY + ' L ' + (leftPageX + width) + ' ' + (locY - height) +
11240
11244
  ' L ' + (leftPageX + width) + ' ' + (locY + height) + ' z ';
11241
- var leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === 1 ? 0.5 : 1), 1, '', leftPath);
11245
+ var leftPageOptions = new PathOption(map.element.id + '_Left_Page', this.maps.themeStyle.legendTextColor, 0, this.maps.themeStyle.legendTextColor, ((page + 1) === 1 ? 0.5 : 1), 1, '', leftPath);
11242
11246
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
11243
11247
  var leftRectPageOptions = new RectOption(map.element.id + '_Left_Page_Rect', 'transparent', {}, 1, new Rect(leftPageX - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
11244
11248
  var pathEle = render.drawRectangle(leftRectPageOptions);
11245
11249
  pathEle.tabIndex = (page + 1) === 1 ? -1 : (map.tabIndex + 1);
11246
11250
  leftPageElement.appendChild(pathEle);
11247
11251
  this.wireEvents(leftPageElement);
11248
- var rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
11252
+ var rightPageOptions = new PathOption(map.element.id + '_Right_Page', this.maps.themeStyle.legendTextColor, 0, this.maps.themeStyle.legendTextColor, ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
11249
11253
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
11250
11254
  var rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(rightPageX - spacing - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
11251
11255
  pathEle = render.drawRectangle(rightRectPageOptions);
@@ -11259,7 +11263,7 @@ var Legend = /** @__PURE__ @class */ (function () {
11259
11263
  'id': map.element.id + '_Paging_Text',
11260
11264
  'x': pageTextX,
11261
11265
  'y': locY + (pagingTextSize.height / 4),
11262
- 'fill': '#a6a6a6',
11266
+ 'fill': this.maps.themeStyle.legendTextColor,
11263
11267
  'font-size': '14px',
11264
11268
  'font-style': pagingFont.fontStyle,
11265
11269
  'font-family': pagingFont.fontFamily,
@@ -12509,22 +12513,10 @@ var Legend = /** @__PURE__ @class */ (function () {
12509
12513
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
12510
12514
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12511
12515
  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);
12516
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
12518
12517
  }
12519
12518
  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());
12519
+ 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
12520
  }
12529
12521
  }
12530
12522
  }
@@ -12537,16 +12529,11 @@ var Legend = /** @__PURE__ @class */ (function () {
12537
12529
  }
12538
12530
  if (targetEle !== null) {
12539
12531
  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']);
12532
+ legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12533
+ 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
12534
  if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
12546
12535
  legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
12547
12536
  }
12548
- legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12549
- legendTextId.setAttribute('fill', '#757575');
12550
12537
  }
12551
12538
  }
12552
12539
  }
@@ -12593,9 +12580,13 @@ var Legend = /** @__PURE__ @class */ (function () {
12593
12580
  }
12594
12581
  if (targetEle !== null) {
12595
12582
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12596
- legendTextId.setAttribute('fill', '#E5E5E5');
12597
12583
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
12598
- legendShapeId.setAttribute('fill', '#E5E5E5');
12584
+ if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
12585
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
12586
+ }
12587
+ else {
12588
+ 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);
12589
+ }
12599
12590
  }
12600
12591
  }
12601
12592
  else {
@@ -12614,9 +12605,8 @@ var Legend = /** @__PURE__ @class */ (function () {
12614
12605
  layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
12615
12606
  if (targetEle !== null) {
12616
12607
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
12617
- legendTextId.setAttribute('fill', '#757575');
12618
12608
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
12619
- legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
12609
+ 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
12610
  }
12621
12611
  }
12622
12612
  }
@@ -12670,22 +12660,10 @@ var Legend = /** @__PURE__ @class */ (function () {
12670
12660
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
12671
12661
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
12672
12662
  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());
12663
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
12679
12664
  }
12680
12665
  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());
12666
+ 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
12667
  }
12690
12668
  }
12691
12669
  }
@@ -12751,9 +12729,13 @@ var Legend = /** @__PURE__ @class */ (function () {
12751
12729
  }
12752
12730
  if (targetEle !== null) {
12753
12731
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
12754
- legendShapeId.setAttribute('fill', '#E5E5E5');
12755
12732
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
12756
- legendTextId.setAttribute('fill', '#E5E5E5');
12733
+ if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
12734
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
12735
+ }
12736
+ else {
12737
+ 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);
12738
+ }
12757
12739
  }
12758
12740
  }
12759
12741
  else {
@@ -12773,9 +12755,8 @@ var Legend = /** @__PURE__ @class */ (function () {
12773
12755
  mapLegendElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
12774
12756
  if (targetEle !== null) {
12775
12757
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
12776
- legendTextId.setAttribute('fill', '#757575');
12777
12758
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
12778
- legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
12759
+ 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
12760
  }
12780
12761
  }
12781
12762
  }
@@ -12852,6 +12833,16 @@ var Legend = /** @__PURE__ @class */ (function () {
12852
12833
  }
12853
12834
  return legendData;
12854
12835
  };
12836
+ Legend.prototype.setToggleAttributes = function (textElement, shapeElement, fillColor, fillOpacity, borderColor, borderWidth, borderOpacity, textColor) {
12837
+ textElement.setAttribute('fill', textColor);
12838
+ shapeElement.setAttribute('fill', fillColor);
12839
+ shapeElement.setAttribute('fill-opacity', (fillOpacity).toString());
12840
+ shapeElement.setAttribute('stroke', borderColor);
12841
+ shapeElement.setAttribute('stroke-width', (borderWidth).toString());
12842
+ if (!isNullOrUndefined(borderOpacity)) {
12843
+ shapeElement.setAttribute('stroke-opacity', (borderOpacity).toString());
12844
+ }
12845
+ };
12855
12846
  Legend.prototype.legendGradientColor = function (colorMap, legendIndex) {
12856
12847
  var legendFillColor;
12857
12848
  var xmlns = 'http://www.w3.org/2000/svg';
@@ -13821,23 +13812,26 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
13821
13812
  else {
13822
13813
  this.maps.on(Browser.touchMoveEvent, this.renderTooltip, this);
13823
13814
  }
13824
- this.maps.element.addEventListener('contextmenu', this.removeTooltip);
13825
13815
  this.maps.on(Browser.touchCancelEvent, this.removeTooltip, this);
13816
+ this.maps.element.addEventListener('contextmenu', this.removeTooltip);
13826
13817
  };
13827
13818
  MapsTooltip.prototype.removeEventListener = function () {
13828
- if (this.maps.isDestroyed) {
13829
- return;
13830
- }
13831
- if (this.maps.tooltipDisplayMode === 'DoubleClick') {
13832
- this.maps.off('dblclick', this.removeTooltip);
13833
- }
13834
- else if (this.maps.tooltipDisplayMode === 'Click') {
13835
- this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
13836
- }
13837
- else {
13838
- this.maps.off(Browser.touchMoveEvent, this.renderTooltip);
13819
+ if (this.maps) {
13820
+ if (this.maps.isDestroyed) {
13821
+ return;
13822
+ }
13823
+ if (this.maps.tooltipDisplayMode === 'DoubleClick') {
13824
+ this.maps.off('dblclick', this.removeTooltip);
13825
+ }
13826
+ else if (this.maps.tooltipDisplayMode === 'Click') {
13827
+ this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
13828
+ }
13829
+ else {
13830
+ this.maps.off(Browser.touchMoveEvent, this.renderTooltip);
13831
+ }
13832
+ this.maps.off(Browser.touchCancelEvent, this.removeTooltip);
13833
+ this.maps.element.removeEventListener('contextmenu', this.removeTooltip);
13839
13834
  }
13840
- this.maps.off(Browser.touchCancelEvent, this.removeTooltip);
13841
13835
  };
13842
13836
  /**
13843
13837
  * Get module name.
@@ -13858,7 +13852,6 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
13858
13852
  this.svgTooltip.destroy();
13859
13853
  }
13860
13854
  this.svgTooltip = null;
13861
- this.removeEventListener();
13862
13855
  //TODO: Calling the below code throws spec issue.
13863
13856
  //this.maps = null;
13864
13857
  };