@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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.4.40
3
+ * version : 20.4.44
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-maps@*",
3
- "_id": "@syncfusion/ej2-maps@20.4.38",
3
+ "_id": "@syncfusion/ej2-maps@20.4.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-TH0dxa2Csh7v1sPf5o9M+jb/cC1ETE/UGwP7jI3lTF205CryE9vgFj3S1GAiQAWYhHjplmjIT+ZBljVE34LlBA==",
5
+ "_integrity": "sha512-FlGB9hzYRQaPAPqR1i5fQ9YGgBECHXzjDLzJb7czFS6EO2Gr0798kZqhMCK8W8TSPENB14TAeyJuFKNZGDkKLw==",
6
6
  "_location": "/@syncfusion/ej2-maps",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-maps",
24
24
  "/@syncfusion/ej2-vue-maps"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-20.4.38.tgz",
27
- "_shasum": "250b32850a0db25e999cb2c563a4955b5b780a35",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-20.4.42.tgz",
27
+ "_shasum": "7d8a8fb9a0b0124b6d513fa680db3d7dcfed9953",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
29
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
30
30
  "author": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~20.4.40",
39
- "@syncfusion/ej2-buttons": "~20.4.40",
40
- "@syncfusion/ej2-compression": "~20.4.40",
41
- "@syncfusion/ej2-data": "~20.4.40",
42
- "@syncfusion/ej2-file-utils": "~20.4.40",
43
- "@syncfusion/ej2-pdf-export": "~20.4.40",
44
- "@syncfusion/ej2-svg-base": "~20.4.40"
38
+ "@syncfusion/ej2-base": "~20.4.44",
39
+ "@syncfusion/ej2-buttons": "~20.4.44",
40
+ "@syncfusion/ej2-compression": "~20.4.42",
41
+ "@syncfusion/ej2-data": "~20.4.44",
42
+ "@syncfusion/ej2-file-utils": "~20.4.42",
43
+ "@syncfusion/ej2-pdf-export": "~20.4.42",
44
+ "@syncfusion/ej2-svg-base": "~20.4.42"
45
45
  },
46
46
  "deprecated": false,
47
47
  "description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
@@ -93,6 +93,6 @@
93
93
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
94
94
  },
95
95
  "typings": "index.d.ts",
96
- "version": "20.4.40",
96
+ "version": "20.4.44",
97
97
  "sideEffects": false
98
98
  }
@@ -143,6 +143,7 @@ export declare class Legend {
143
143
  private removeCollections;
144
144
  removeEventListener(): void;
145
145
  private getLegendData;
146
+ private setToggleAttributes;
146
147
  legendGradientColor(colorMap: ColorMappingSettings, legendIndex: number): string;
147
148
  /**
148
149
  * Get module name.
@@ -538,14 +538,14 @@ var Legend = /** @class */ (function () {
538
538
  ' L ' + (rightPageX - width) + ' ' + (locY + height) + ' z ';
539
539
  var leftPath = ' M ' + leftPageX + ' ' + locY + ' L ' + (leftPageX + width) + ' ' + (locY - height) +
540
540
  ' L ' + (leftPageX + width) + ' ' + (locY + height) + ' z ';
541
- var leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === 1 ? 0.5 : 1), 1, '', leftPath);
541
+ 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);
542
542
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
543
543
  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, '', '');
544
544
  var pathEle = render.drawRectangle(leftRectPageOptions);
545
545
  pathEle.tabIndex = (page + 1) === 1 ? -1 : (map.tabIndex + 1);
546
546
  leftPageElement.appendChild(pathEle);
547
547
  this.wireEvents(leftPageElement);
548
- var rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
548
+ 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);
549
549
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
550
550
  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, '', '');
551
551
  pathEle = render.drawRectangle(rightRectPageOptions);
@@ -559,7 +559,7 @@ var Legend = /** @class */ (function () {
559
559
  'id': map.element.id + '_Paging_Text',
560
560
  'x': pageTextX,
561
561
  'y': locY + (pagingTextSize.height / 4),
562
- 'fill': '#a6a6a6',
562
+ 'fill': this.maps.themeStyle.legendTextColor,
563
563
  'font-size': '14px',
564
564
  'font-style': pagingFont.fontStyle,
565
565
  'font-family': pagingFont.fontFamily,
@@ -1814,22 +1814,10 @@ var Legend = /** @class */ (function () {
1814
1814
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1815
1815
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1816
1816
  if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
1817
- legendShapeId.setAttribute('fill', legendToggleFill);
1818
- legendShapeId.setAttribute('fill-opacity', (legendToggleOpacity).toString());
1819
- legendShapeId.setAttribute('stroke', legendToggleBorderColor);
1820
- legendShapeId.setAttribute('stroke-width', (legendToggleBorderWidth).toString());
1821
- legendShapeId.setAttribute('stroke-opacity', (legendToggleBorderOpacity).toString());
1822
- legendTextId.setAttribute('fill', legendToggleFill);
1817
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
1823
1818
  }
1824
1819
  else {
1825
- legendTextId.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
1826
- legendShapeId.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
1827
- legendShapeId.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
1828
- legendShapeId.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
1829
- legendShapeId.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
1830
- legendShapeId.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
1831
- this.maps.layers[k].shapeSettings.opacity :
1832
- this.maps.layers[k].shapeSettings.border.opacity).toString());
1820
+ 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);
1833
1821
  }
1834
1822
  }
1835
1823
  }
@@ -1842,16 +1830,11 @@ var Legend = /** @class */ (function () {
1842
1830
  }
1843
1831
  if (targetEle !== null) {
1844
1832
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1845
- legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
1846
- legendShapeId.setAttribute('fill-opacity', this.legendCollection[legendIndex]['opacity']);
1847
- legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['shapeBorder']['color']);
1848
- legendShapeId.setAttribute('stroke-width', this.legendCollection[legendIndex]['shapeBorder']['width']);
1849
- legendShapeId.setAttribute('stroke-opacity', this.legendCollection[legendIndex]['shapeBorder']['opacity']);
1833
+ legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1834
+ 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');
1850
1835
  if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
1851
1836
  legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
1852
1837
  }
1853
- legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1854
- legendTextId.setAttribute('fill', '#757575');
1855
1838
  }
1856
1839
  }
1857
1840
  }
@@ -1898,9 +1881,13 @@ var Legend = /** @class */ (function () {
1898
1881
  }
1899
1882
  if (targetEle !== null) {
1900
1883
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1901
- legendTextId.setAttribute('fill', '#E5E5E5');
1902
1884
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1903
- legendShapeId.setAttribute('fill', '#E5E5E5');
1885
+ if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
1886
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
1887
+ }
1888
+ else {
1889
+ 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);
1890
+ }
1904
1891
  }
1905
1892
  }
1906
1893
  else {
@@ -1919,9 +1906,8 @@ var Legend = /** @class */ (function () {
1919
1906
  layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
1920
1907
  if (targetEle !== null) {
1921
1908
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1922
- legendTextId.setAttribute('fill', '#757575');
1923
1909
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1924
- legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
1910
+ 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');
1925
1911
  }
1926
1912
  }
1927
1913
  }
@@ -1975,22 +1961,10 @@ var Legend = /** @class */ (function () {
1975
1961
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
1976
1962
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
1977
1963
  if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
1978
- legendTextId.setAttribute('fill', legendToggleFill);
1979
- legendShapeId.setAttribute('fill', legendToggleFill);
1980
- legendShapeId.setAttribute('fill-opacity', (legendToggleOpacity).toString());
1981
- legendShapeId.setAttribute('stroke', legendToggleBorderColor);
1982
- legendShapeId.setAttribute('stroke-width', (legendToggleBorderWidth).toString());
1983
- legendShapeId.setAttribute('stroke-opacity', (legendToggleBorderOpacity).toString());
1964
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
1984
1965
  }
1985
1966
  else {
1986
- legendTextId.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
1987
- legendShapeId.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
1988
- legendShapeId.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
1989
- legendShapeId.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
1990
- legendShapeId.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
1991
- this.maps.layers[k].shapeSettings.opacity :
1992
- this.maps.layers[k].shapeSettings.border.opacity).toString());
1993
- legendShapeId.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
1967
+ 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);
1994
1968
  }
1995
1969
  }
1996
1970
  }
@@ -2056,9 +2030,13 @@ var Legend = /** @class */ (function () {
2056
2030
  }
2057
2031
  if (targetEle !== null) {
2058
2032
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
2059
- legendShapeId.setAttribute('fill', '#E5E5E5');
2060
2033
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
2061
- legendTextId.setAttribute('fill', '#E5E5E5');
2034
+ if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
2035
+ this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
2036
+ }
2037
+ else {
2038
+ 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);
2039
+ }
2062
2040
  }
2063
2041
  }
2064
2042
  else {
@@ -2078,9 +2056,8 @@ var Legend = /** @class */ (function () {
2078
2056
  mapLegendElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
2079
2057
  if (targetEle !== null) {
2080
2058
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
2081
- legendTextId.setAttribute('fill', '#757575');
2082
2059
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex, this.maps.element.id);
2083
- legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
2060
+ 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');
2084
2061
  }
2085
2062
  }
2086
2063
  }
@@ -2157,6 +2134,16 @@ var Legend = /** @class */ (function () {
2157
2134
  }
2158
2135
  return legendData;
2159
2136
  };
2137
+ Legend.prototype.setToggleAttributes = function (textElement, shapeElement, fillColor, fillOpacity, borderColor, borderWidth, borderOpacity, textColor) {
2138
+ textElement.setAttribute('fill', textColor);
2139
+ shapeElement.setAttribute('fill', fillColor);
2140
+ shapeElement.setAttribute('fill-opacity', (fillOpacity).toString());
2141
+ shapeElement.setAttribute('stroke', borderColor);
2142
+ shapeElement.setAttribute('stroke-width', (borderWidth).toString());
2143
+ if (!isNullOrUndefined(borderOpacity)) {
2144
+ shapeElement.setAttribute('stroke-opacity', (borderOpacity).toString());
2145
+ }
2146
+ };
2160
2147
  Legend.prototype.legendGradientColor = function (colorMap, legendIndex) {
2161
2148
  var legendFillColor;
2162
2149
  var xmlns = 'http://www.w3.org/2000/svg';
@@ -531,6 +531,7 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
531
531
  baseMapBounds: GeoLocation;
532
532
  /** @private */
533
533
  baseMapRectBounds: any;
534
+ private resizeEvent;
534
535
  /** @public */
535
536
  translatePoint: Point;
536
537
  /** @private */
package/src/maps/maps.js CHANGED
@@ -889,7 +889,8 @@ var Maps = /** @class */ (function (_super) {
889
889
  EventHandler.add(this.element, 'keydown', this.keyDownHandler, this);
890
890
  EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);
891
891
  // EventHandler.add(this.element, cancelEvent, this.mouseLeaveOnMap, this);
892
- window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize.bind(this));
892
+ this.resizeEvent = this.mapsOnResize.bind(this);
893
+ window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.resizeEvent);
893
894
  };
894
895
  /**
895
896
  * To unbind event handlers from maps.
@@ -908,7 +909,7 @@ var Maps = /** @class */ (function (_super) {
908
909
  EventHandler.remove(this.element, 'keydown', this.keyDownHandler);
909
910
  EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
910
911
  //EventHandler.remove(this.element, cancelEvent, this.mouseLeaveOnMap);
911
- window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize);
912
+ window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.resizeEvent);
912
913
  };
913
914
  /**
914
915
  * This method is used to perform operations when mouse pointer leave from maps.
@@ -1766,6 +1767,9 @@ var Maps = /** @class */ (function (_super) {
1766
1767
  */
1767
1768
  Maps.prototype.destroy = function () {
1768
1769
  this.unWireEVents();
1770
+ if (!isNullOrUndefined(this.mapsTooltipModule)) {
1771
+ this.mapsTooltipModule.removeEventListener();
1772
+ }
1769
1773
  _super.prototype.destroy.call(this);
1770
1774
  this.shapeSelectionItem = [];
1771
1775
  this.toggledShapeElementId = [];
@@ -347,23 +347,26 @@ var MapsTooltip = /** @class */ (function () {
347
347
  else {
348
348
  this.maps.on(Browser.touchMoveEvent, this.renderTooltip, this);
349
349
  }
350
- this.maps.element.addEventListener('contextmenu', this.removeTooltip);
351
350
  this.maps.on(Browser.touchCancelEvent, this.removeTooltip, this);
351
+ this.maps.element.addEventListener('contextmenu', this.removeTooltip);
352
352
  };
353
353
  MapsTooltip.prototype.removeEventListener = function () {
354
- if (this.maps.isDestroyed) {
355
- return;
356
- }
357
- if (this.maps.tooltipDisplayMode === 'DoubleClick') {
358
- this.maps.off('dblclick', this.removeTooltip);
359
- }
360
- else if (this.maps.tooltipDisplayMode === 'Click') {
361
- this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
362
- }
363
- else {
364
- this.maps.off(Browser.touchMoveEvent, this.renderTooltip);
354
+ if (this.maps) {
355
+ if (this.maps.isDestroyed) {
356
+ return;
357
+ }
358
+ if (this.maps.tooltipDisplayMode === 'DoubleClick') {
359
+ this.maps.off('dblclick', this.removeTooltip);
360
+ }
361
+ else if (this.maps.tooltipDisplayMode === 'Click') {
362
+ this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
363
+ }
364
+ else {
365
+ this.maps.off(Browser.touchMoveEvent, this.renderTooltip);
366
+ }
367
+ this.maps.off(Browser.touchCancelEvent, this.removeTooltip);
368
+ this.maps.element.removeEventListener('contextmenu', this.removeTooltip);
365
369
  }
366
- this.maps.off(Browser.touchCancelEvent, this.removeTooltip);
367
370
  };
368
371
  /**
369
372
  * Get module name.
@@ -384,7 +387,6 @@ var MapsTooltip = /** @class */ (function () {
384
387
  this.svgTooltip.destroy();
385
388
  }
386
389
  this.svgTooltip = null;
387
- this.removeEventListener();
388
390
  //TODO: Calling the below code throws spec issue.
389
391
  //this.maps = null;
390
392
  };