@syncfusion/ej2-maps 20.2.45 → 20.3.49

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/dist/ej2-maps.min.js +10 -0
  3. package/dist/ej2-maps.umd.min.js +2 -2
  4. package/dist/ej2-maps.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-maps.es2015.js +329 -268
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +333 -273
  8. package/dist/es6/ej2-maps.es5.js.map +1 -1
  9. package/dist/global/ej2-maps.min.js +2 -2
  10. package/dist/global/ej2-maps.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/maps/layers/bing-map.d.ts +4 -0
  14. package/src/maps/layers/bing-map.js +7 -0
  15. package/src/maps/layers/bubble.d.ts +1 -2
  16. package/src/maps/layers/bubble.js +4 -5
  17. package/src/maps/layers/data-label.d.ts +1 -4
  18. package/src/maps/layers/data-label.js +17 -19
  19. package/src/maps/layers/layer-panel.d.ts +5 -0
  20. package/src/maps/layers/layer-panel.js +28 -5
  21. package/src/maps/layers/legend.d.ts +1 -2
  22. package/src/maps/layers/legend.js +30 -8
  23. package/src/maps/layers/marker.d.ts +2 -4
  24. package/src/maps/layers/marker.js +44 -44
  25. package/src/maps/layers/navigation-selected-line.d.ts +1 -2
  26. package/src/maps/layers/navigation-selected-line.js +7 -13
  27. package/src/maps/maps.js +19 -10
  28. package/src/maps/model/export-image.d.ts +2 -4
  29. package/src/maps/model/export-image.js +19 -27
  30. package/src/maps/model/export-pdf.d.ts +4 -6
  31. package/src/maps/model/export-pdf.js +22 -30
  32. package/src/maps/model/interface.d.ts +8 -0
  33. package/src/maps/model/print.d.ts +2 -5
  34. package/src/maps/model/print.js +15 -23
  35. package/src/maps/user-interaction/annotation.d.ts +1 -2
  36. package/src/maps/user-interaction/annotation.js +2 -3
  37. package/src/maps/user-interaction/highlight.d.ts +1 -2
  38. package/src/maps/user-interaction/highlight.js +3 -5
  39. package/src/maps/user-interaction/selection.d.ts +1 -2
  40. package/src/maps/user-interaction/selection.js +3 -5
  41. package/src/maps/user-interaction/tooltip.d.ts +1 -4
  42. package/src/maps/user-interaction/tooltip.js +7 -2
  43. package/src/maps/user-interaction/zoom.d.ts +2 -7
  44. package/src/maps/user-interaction/zoom.js +83 -66
  45. package/src/maps/utils/helper.js +25 -13
@@ -42,9 +42,8 @@ export declare class Highlight {
42
42
  /**
43
43
  * To destroy the highlight.
44
44
  *
45
- * @param {Maps} maps - Specifies the maps instance
46
45
  * @returns {void}
47
46
  * @private
48
47
  */
49
- destroy(maps: Maps): void;
48
+ destroy(): void;
50
49
  }
@@ -217,15 +217,13 @@ var Highlight = /** @class */ (function () {
217
217
  /**
218
218
  * To destroy the highlight.
219
219
  *
220
- * @param {Maps} maps - Specifies the maps instance
221
220
  * @returns {void}
222
221
  * @private
223
222
  */
224
- Highlight.prototype.destroy = function (maps) {
225
- /**
226
- * Destroy method performed here
227
- */
223
+ Highlight.prototype.destroy = function () {
224
+ this.highlightSettings = null;
228
225
  this.removeEventListener();
226
+ this.maps = null;
229
227
  };
230
228
  return Highlight;
231
229
  }());
@@ -64,9 +64,8 @@ export declare class Selection {
64
64
  /**
65
65
  * To destroy the selection.
66
66
  *
67
- * @param {Maps} maps - Specifies the maps instance.
68
67
  * @returns {void}
69
68
  * @private
70
69
  */
71
- destroy(maps: Maps): void;
70
+ destroy(): void;
72
71
  }
@@ -297,15 +297,13 @@ var Selection = /** @class */ (function () {
297
297
  /**
298
298
  * To destroy the selection.
299
299
  *
300
- * @param {Maps} maps - Specifies the maps instance.
301
300
  * @returns {void}
302
301
  * @private
303
302
  */
304
- Selection.prototype.destroy = function (maps) {
305
- /**
306
- * Destroy method performed here
307
- */
303
+ Selection.prototype.destroy = function () {
304
+ this.selectionsettings = null;
308
305
  this.removeEventListener();
306
+ this.maps = null;
309
307
  };
310
308
  return Selection;
311
309
  }());
@@ -5,14 +5,12 @@ import { Tooltip } from '@syncfusion/ej2-svg-base';
5
5
  */
6
6
  export declare class MapsTooltip {
7
7
  private maps;
8
- private tooltipSettings;
9
8
  /**
10
9
  * @private
11
10
  */
12
11
  svgTooltip: Tooltip;
13
12
  private isTouch;
14
13
  private tooltipId;
15
- private currentTime;
16
14
  private clearTimeout;
17
15
  tooltipTargetID: string;
18
16
  constructor(maps: Maps);
@@ -43,9 +41,8 @@ export declare class MapsTooltip {
43
41
  /**
44
42
  * To destroy the tooltip.
45
43
  *
46
- * @param {Maps} maps Specifies the maps instance
47
44
  * @returns {void}
48
45
  * @private
49
46
  */
50
- destroy(maps: Maps): void;
47
+ destroy(): void;
51
48
  }
@@ -376,12 +376,17 @@ var MapsTooltip = /** @class */ (function () {
376
376
  /**
377
377
  * To destroy the tooltip.
378
378
  *
379
- * @param {Maps} maps Specifies the maps instance
380
379
  * @returns {void}
381
380
  * @private
382
381
  */
383
- MapsTooltip.prototype.destroy = function (maps) {
382
+ MapsTooltip.prototype.destroy = function () {
383
+ if (!isNullOrUndefined(this.svgTooltip)) {
384
+ this.svgTooltip.destroy();
385
+ }
386
+ this.svgTooltip = null;
384
387
  this.removeEventListener();
388
+ //TODO: Calling the below code throws spec issue.
389
+ //this.maps = null;
385
390
  };
386
391
  return MapsTooltip;
387
392
  }());
@@ -8,13 +8,10 @@ import { PanDirection } from '../utils/enum';
8
8
  export declare class Zoom {
9
9
  private maps;
10
10
  toolBarGroup: Element;
11
- private groupElements;
12
11
  private currentToolbarEle;
13
12
  zoomingRect: Rect;
14
13
  selectionColor: string;
15
14
  private fillColor;
16
- private zoomInElements;
17
- private zoomOutElements;
18
15
  private zoomElements;
19
16
  private panElements;
20
17
  isPanning: boolean;
@@ -28,7 +25,6 @@ export declare class Zoom {
28
25
  touchStartList: ITouches[] | TouchList;
29
26
  touchMoveList: ITouches[] | TouchList;
30
27
  previousTouchMoveList: ITouches[] | TouchList;
31
- private pinchRect;
32
28
  mouseDownPoints: Point;
33
29
  mouseMovePoints: Point;
34
30
  isDragZoom: boolean;
@@ -87,7 +83,7 @@ export declare class Zoom {
87
83
  * @returns {void}
88
84
  */
89
85
  private animateTransform;
90
- applyTransform(animate?: boolean): void;
86
+ applyTransform(maps: Maps, animate?: boolean): void;
91
87
  private markerTranslates;
92
88
  /**
93
89
  * To translate the layer template elements
@@ -156,9 +152,8 @@ export declare class Zoom {
156
152
  /**
157
153
  * To destroy the zoom.
158
154
  *
159
- * @param {Maps} maps - Specifies the instance of the maps.
160
155
  * @returns {void}
161
156
  * @private
162
157
  */
163
- destroy(maps: Maps): void;
158
+ destroy(): void;
164
159
  }
@@ -16,7 +16,6 @@ var Zoom = /** @class */ (function () {
16
16
  this.mouseEnter = false;
17
17
  this.isTouch = false;
18
18
  this.rectZoomingStart = false;
19
- this.pinchRect = new Rect(0, 0, 0, 0);
20
19
  this.browserName = Browser.info.name;
21
20
  // eslint-disable-next-line @typescript-eslint/ban-types
22
21
  this.isPointer = Browser.isPointer;
@@ -40,7 +39,6 @@ var Zoom = /** @class */ (function () {
40
39
  this.selectionColor = this.maps.zoomSettings.selectionColor;
41
40
  this.fillColor = this.maps.zoomSettings.color;
42
41
  this.addEventListener();
43
- this.groupElements = [];
44
42
  }
45
43
  /**
46
44
  * To perform zooming for maps
@@ -81,6 +79,7 @@ var Zoom = /** @class */ (function () {
81
79
  mapTotalHeight = availSize.height;
82
80
  }
83
81
  newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
82
+ newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
84
83
  map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
85
84
  }
86
85
  else {
@@ -98,7 +97,7 @@ var Zoom = /** @class */ (function () {
98
97
  map.scale = map.mapScaleValue = map.previousScale;
99
98
  }
100
99
  else {
101
- this.applyTransform();
100
+ this.applyTransform(map);
102
101
  }
103
102
  }
104
103
  else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
@@ -142,7 +141,7 @@ var Zoom = /** @class */ (function () {
142
141
  // element1 = element1;
143
142
  // }
144
143
  // }
145
- _this.applyTransform();
144
+ _this.applyTransform(_this.maps);
146
145
  if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
147
146
  document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
148
147
  }
@@ -244,7 +243,7 @@ var Zoom = /** @class */ (function () {
244
243
  }
245
244
  if (!isZoomCancelled) {
246
245
  map.mapScaleValue = zoomCalculationFactor;
247
- this.applyTransform(true);
246
+ this.applyTransform(map, true);
248
247
  this.maps.zoomNotApplied = false;
249
248
  this.zoomingRect = null;
250
249
  }
@@ -294,6 +293,7 @@ var Zoom = /** @class */ (function () {
294
293
  mapTotalHeight = availSize.height;
295
294
  }
296
295
  zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
296
+ zoomCalculationFactor = zoomCalculationFactor > 1.05 ? 1 : zoomCalculationFactor;
297
297
  map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
298
298
  }
299
299
  else {
@@ -332,7 +332,7 @@ var Zoom = /** @class */ (function () {
332
332
  }
333
333
  }
334
334
  if (!isZoomCancelled) {
335
- this.applyTransform();
335
+ this.applyTransform(map);
336
336
  }
337
337
  };
338
338
  Zoom.prototype.drawZoomRectangle = function () {
@@ -379,7 +379,7 @@ var Zoom = /** @class */ (function () {
379
379
  zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
380
380
  }
381
381
  };
382
- Zoom.prototype.applyTransform = function (animate) {
382
+ Zoom.prototype.applyTransform = function (maps, animate) {
383
383
  var layerIndex;
384
384
  this.templateCount = 0;
385
385
  var layer;
@@ -387,14 +387,14 @@ var Zoom = /** @class */ (function () {
387
387
  var zoomshapelocation;
388
388
  var i;
389
389
  var markerStyle;
390
- var scale = this.maps.scale;
391
- var x = this.maps.translatePoint.x;
392
- var y = this.maps.translatePoint.y;
390
+ var scale = maps.scale;
391
+ var x = maps.translatePoint.x;
392
+ var y = maps.translatePoint.y;
393
393
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
394
394
  var collection = [];
395
- this.maps.zoomShapeCollection = [];
396
- if (document.getElementById(this.maps.element.id + '_mapsTooltip')) {
397
- removeElement(this.maps.element.id + '_mapsTooltip');
395
+ maps.zoomShapeCollection = [];
396
+ if (document.getElementById(maps.element.id + '_mapsTooltip')) {
397
+ removeElement(maps.element.id + '_mapsTooltip');
398
398
  }
399
399
  if (this.layerCollectionEle) {
400
400
  for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
@@ -402,29 +402,29 @@ var Zoom = /** @class */ (function () {
402
402
  if (layerElement.tagName === 'g') {
403
403
  this.templateCount++;
404
404
  this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
405
- this.currentLayer = this.maps.layersCollection[this.index];
406
- var factor = this.maps.mapLayerPanel.calculateFactor(this.currentLayer);
405
+ this.currentLayer = maps.layersCollection[this.index];
406
+ var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
407
407
  for (var j = 0; j < layerElement.childElementCount; j++) {
408
408
  var currentEle = layerElement.childNodes[j];
409
409
  if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
410
410
  && (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
411
- if (this.maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
411
+ if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
412
412
  currentEle.remove();
413
413
  if (layerElement.children.length > 0 && layerElement.children[0]) {
414
- layerElement.insertBefore(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index), layerElement.children[1]);
414
+ layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
415
415
  }
416
416
  else {
417
- layerElement.appendChild(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index));
417
+ layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
418
418
  }
419
419
  }
420
420
  else if (currentEle.id.indexOf('Legend') == -1) {
421
- changeBorderWidth(currentEle, this.index, scale, this.maps);
422
- this.maps.zoomTranslatePoint = this.maps.translatePoint;
421
+ changeBorderWidth(currentEle, this.index, scale, maps);
422
+ maps.zoomTranslatePoint = maps.translatePoint;
423
423
  this.animateTransform(currentEle, animate, x, y, scale);
424
424
  }
425
425
  }
426
426
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
427
- if (!this.isPanning) {
427
+ if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
428
428
  this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate);
429
429
  }
430
430
  currentEle = layerElement.childNodes[j];
@@ -443,11 +443,11 @@ var Zoom = /** @class */ (function () {
443
443
  markerSelectionValues['latitude'] ||
444
444
  this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
445
445
  markerSelectionValues['longitude']) {
446
- this.maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, this.maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
446
+ maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
447
447
  }
448
448
  }
449
- if ((this.currentLayer.animationDuration > 0 || (this.maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
450
- if (this.maps.isTileMap) {
449
+ if ((this.currentLayer.animationDuration > 0 || (maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
450
+ if (maps.isTileMap) {
451
451
  var groupElement = document.querySelector('.GroupElement');
452
452
  if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
453
453
  groupElement.style.display = 'none';
@@ -459,29 +459,29 @@ var Zoom = /** @class */ (function () {
459
459
  }
460
460
  }
461
461
  }
462
- if (this.isPanning && this.maps.markerModule.sameMarkerData.length > 0) {
463
- clusterSeparate(this.maps.markerModule.sameMarkerData, this.maps, currentEle, true);
462
+ if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
463
+ clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
464
464
  }
465
- else if (this.maps.markerModule.sameMarkerData.length > 0) {
466
- this.maps.markerModule.sameMarkerData = [];
467
- if (document.getElementById(this.maps.element.id + '_mapsTooltip')) {
468
- removeElement(this.maps.element.id + '_mapsTooltip');
465
+ else if (maps.markerModule.sameMarkerData.length > 0) {
466
+ maps.markerModule.sameMarkerData = [];
467
+ if (document.getElementById(maps.element.id + '_mapsTooltip')) {
468
+ removeElement(maps.element.id + '_mapsTooltip');
469
469
  }
470
470
  }
471
- if (document.getElementById(this.maps.element.id + '_mapsTooltip') && this.maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
471
+ if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
472
472
  && !this.isPanning) {
473
- var mapsTooltip = this.maps.mapsTooltipModule;
473
+ var mapsTooltip = maps.mapsTooltipModule;
474
474
  var tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
475
475
  if (!isNullOrUndefined(tooltipElement)) {
476
476
  if (tooltipElement['style']['visibility'] === 'hidden') {
477
- removeElement(this.maps.element.id + '_mapsTooltip');
477
+ removeElement(maps.element.id + '_mapsTooltip');
478
478
  }
479
479
  else {
480
480
  var x_2 = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[1]);
481
481
  var y_1 = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[2]);
482
- if (this.maps.isTileMap) {
483
- x_2 += +getElement(this.maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
484
- y_1 += +getElement(this.maps.element.id + '_tile_parent')['style']['top'].split('px')[0];
482
+ if (maps.isTileMap) {
483
+ x_2 += +getElement(maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
484
+ y_1 += +getElement(maps.element.id + '_tile_parent')['style']['top'].split('px')[0];
485
485
  }
486
486
  mapsTooltip.svgTooltip.location.x = x_2;
487
487
  mapsTooltip.svgTooltip.location.y = y_1;
@@ -499,9 +499,9 @@ var Zoom = /** @class */ (function () {
499
499
  layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
500
500
  var bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
501
501
  var dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
502
- for (var l = 0; l < this.maps.bubbleModule.bubbleCollection.length; l++) {
502
+ for (var l = 0; l < maps.bubbleModule.bubbleCollection.length; l++) {
503
503
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
504
- var bubbleCollection = this.maps.bubbleModule.bubbleCollection[l];
504
+ var bubbleCollection = maps.bubbleModule.bubbleCollection[l];
505
505
  if (bubbleCollection['LayerIndex'] === layerIndex && bubbleCollection['BubbleIndex'] === bubleIndex &&
506
506
  bubbleCollection['DataIndex'] === dataIndex) {
507
507
  var centerX = bubbleCollection['center']['x'];
@@ -520,25 +520,25 @@ var Zoom = /** @class */ (function () {
520
520
  }
521
521
  }
522
522
  }
523
- else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(this.maps.layers[this.index])) {
523
+ else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
524
524
  this.intersect = [];
525
- this.maps.zoomLabelPositions = [];
526
- this.maps.zoomLabelPositions = this.maps.dataLabelModule.dataLabelCollections;
527
- var labelAnimate = !this.maps.isTileMap && animate;
525
+ maps.zoomLabelPositions = [];
526
+ maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
527
+ var labelAnimate = !maps.isTileMap && animate;
528
528
  for (var k = 0; k < currentEle.childElementCount; k++) {
529
529
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
530
530
  var labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
531
531
  this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
532
- this.maps.zoomShapeCollection.push(this.zoomshapewidth);
532
+ maps.zoomShapeCollection.push(this.zoomshapewidth);
533
533
  this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
534
- var dataLabel = this.maps.layers[this.index].dataLabelSettings;
534
+ var dataLabel = maps.layers[this.index].dataLabelSettings;
535
535
  var border = dataLabel.border;
536
536
  if (k > 0 && border['width'] > 1) {
537
- if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1) {
538
- var labelX = ((this.maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
539
- var labelY = ((this.maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
537
+ if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
538
+ var labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
539
+ var labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
540
540
  var zoomtext = currentEle.childNodes[k]['innerHTML'];
541
- var style = this.maps.layers[this.index].dataLabelSettings.textStyle;
541
+ var style = maps.layers[this.index].dataLabelSettings.textStyle;
542
542
  var zoomtextSize = measureText(zoomtext, style);
543
543
  var padding = 5;
544
544
  var rectElement = currentEle.childNodes[k - 1];
@@ -553,11 +553,11 @@ var Zoom = /** @class */ (function () {
553
553
  }
554
554
  }
555
555
  }
556
- this.maps.arrangeTemplate();
556
+ maps.arrangeTemplate();
557
557
  }
558
558
  if (!isNullOrUndefined(this.currentLayer)) {
559
- if (!animate || this.currentLayer.animationDuration === 0 || this.maps.isTileMap) {
560
- this.processTemplate(x, y, scale, this.maps);
559
+ if (!animate || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
560
+ this.processTemplate(x, y, scale, maps);
561
561
  }
562
562
  }
563
563
  }
@@ -961,15 +961,15 @@ var Zoom = /** @class */ (function () {
961
961
  if (!panArgs.cancel) {
962
962
  if (panningXDirection && panningYDirection) {
963
963
  map.translatePoint = new Point(x, y);
964
- this.applyTransform();
964
+ this.applyTransform(map);
965
965
  }
966
966
  else if (panningXDirection) {
967
967
  map.translatePoint = new Point(x, map.translatePoint.y);
968
- this.applyTransform();
968
+ this.applyTransform(map);
969
969
  }
970
970
  else if (panningYDirection) {
971
971
  map.translatePoint = new Point(map.translatePoint.x, y);
972
- this.applyTransform();
972
+ this.applyTransform(map);
973
973
  }
974
974
  }
975
975
  this.maps.zoomNotApplied = false;
@@ -997,7 +997,7 @@ var Zoom = /** @class */ (function () {
997
997
  };
998
998
  map.trigger(pan, panArgs);
999
999
  map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
1000
- this.applyTransform();
1000
+ this.applyTransform(map);
1001
1001
  }
1002
1002
  map.zoomTranslatePoint = map.translatePoint;
1003
1003
  this.mouseDownPoints = this.mouseMovePoints;
@@ -1009,7 +1009,7 @@ var Zoom = /** @class */ (function () {
1009
1009
  (this.distanceX / this.maps.scale)) : this.maps.translatePoint.x;
1010
1010
  this.maps.translatePoint.y = !isNullOrUndefined(this.distanceY) ? this.maps.translatePoint.y -
1011
1011
  (this.distanceY / this.maps.scale) : this.maps.translatePoint.y;
1012
- this.applyTransform(false);
1012
+ this.applyTransform(this.maps, false);
1013
1013
  };
1014
1014
  Zoom.prototype.toolBarZooming = function (zoomFactor, type) {
1015
1015
  var _this = this;
@@ -1048,6 +1048,7 @@ var Zoom = /** @class */ (function () {
1048
1048
  mapHeight = size.height;
1049
1049
  }
1050
1050
  zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
1051
+ zoomFactor = zoomFactor > 1.05 ? 1 : zoomFactor;
1051
1052
  map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
1052
1053
  }
1053
1054
  else {
@@ -1067,7 +1068,7 @@ var Zoom = /** @class */ (function () {
1067
1068
  map.scale = map.previousScale;
1068
1069
  }
1069
1070
  else {
1070
- this.applyTransform(true);
1071
+ this.applyTransform(map, true);
1071
1072
  }
1072
1073
  }
1073
1074
  else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
@@ -1109,7 +1110,7 @@ var Zoom = /** @class */ (function () {
1109
1110
  // element1.removeChild(element1.children[element1.childElementCount - 1]);
1110
1111
  // element1.childElementCount ? element1.removeChild(element1.children[element1.childElementCount - 1]) : element1;
1111
1112
  }
1112
- _this.applyTransform(true);
1113
+ _this.applyTransform(_this.maps, true);
1113
1114
  if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
1114
1115
  document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
1115
1116
  }
@@ -1122,6 +1123,8 @@ var Zoom = /** @class */ (function () {
1122
1123
  };
1123
1124
  Zoom.prototype.createZoomingToolbars = function () {
1124
1125
  var map = this.maps;
1126
+ var zoomInElements;
1127
+ var zoomOutElements;
1125
1128
  this.toolBarGroup = map.renderer.createGroup({
1126
1129
  id: map.element.id + '_Zooming_KitCollection',
1127
1130
  opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
@@ -1139,7 +1142,6 @@ var Zoom = /** @class */ (function () {
1139
1142
  var toolBarLength = map.zoomSettings.toolbars.length;
1140
1143
  var toolWidth = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (toolBarLength * kitWidth) + (toolBarLength * padding) : (kitWidth * 2);
1141
1144
  var toolHeight = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (kitHeight * 2) : (toolBarLength * kitHeight) + (toolBarLength * padding);
1142
- this.toolBarGroup.appendChild(map.renderer.drawRectangle(new RectOption(map.element.id + '_Zooming_Rect', 'transparent', { color: 'transparent', width: 1 }, 1, new Rect(0, 0, toolWidth, toolHeight), 0, 0)));
1143
1145
  var defElement = map.renderer.createDefs();
1144
1146
  defElement.innerHTML = shadowElement;
1145
1147
  this.toolBarGroup.appendChild(defElement);
@@ -1193,13 +1195,13 @@ var Zoom = /** @class */ (function () {
1193
1195
  case 'zoomin':
1194
1196
  direction = 'M 8, 0 L 8, 16 M 0, 8 L 16, 8';
1195
1197
  this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Path', fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
1196
- this.zoomInElements = this.currentToolbarEle;
1198
+ zoomInElements = this.currentToolbarEle;
1197
1199
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
1198
1200
  break;
1199
1201
  case 'zoomout':
1200
1202
  direction = 'M 0, 8 L 16, 8';
1201
1203
  this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
1202
- this.zoomOutElements = this.currentToolbarEle;
1204
+ zoomOutElements = this.currentToolbarEle;
1203
1205
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
1204
1206
  break;
1205
1207
  case 'pan': {
@@ -1699,15 +1701,30 @@ var Zoom = /** @class */ (function () {
1699
1701
  /**
1700
1702
  * To destroy the zoom.
1701
1703
  *
1702
- * @param {Maps} maps - Specifies the instance of the maps.
1703
1704
  * @returns {void}
1704
1705
  * @private
1705
1706
  */
1706
- Zoom.prototype.destroy = function (maps) {
1707
+ Zoom.prototype.destroy = function () {
1708
+ this.toolBarGroup = null;
1709
+ this.currentToolbarEle = null;
1710
+ this.zoomingRect = null;
1711
+ this.zoomElements = null;
1712
+ this.panElements = null;
1713
+ this.baseTranslatePoint = null;
1714
+ this.touchStartList = null;
1715
+ this.touchMoveList = null;
1716
+ this.previousTouchMoveList = null;
1717
+ this.mouseDownPoints = null;
1718
+ this.mouseMovePoints = null;
1719
+ this.startTouches = [];
1720
+ this.zoomshapewidth = null;
1721
+ this.intersect = [];
1722
+ this.mouseDownLatLong = null;
1723
+ this.mouseMoveLatLong = null;
1707
1724
  this.removeEventListener();
1708
- /**
1709
- * Destroy method performed here
1710
- */
1725
+ //TODO: Calling the below code throws spec issue.
1726
+ //this.maps = null;
1727
+ this.currentLayer = null;
1711
1728
  };
1712
1729
  return Zoom;
1713
1730
  }());