@syncfusion/ej2-maps 20.2.43 → 20.3.47

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 +19 -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 +317 -258
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +321 -263
  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 +13 -15
  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 +26 -5
  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 +18 -9
  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 +22 -11
@@ -29,9 +29,6 @@ var NavigationLine = /** @class */ (function () {
29
29
  var dashArray;
30
30
  var pathOption;
31
31
  var direction;
32
- var markerWidth;
33
- var arcId;
34
- var radius;
35
32
  var showArrow;
36
33
  var arrowColor;
37
34
  var arrowSize;
@@ -69,8 +66,8 @@ var NavigationLine = /** @class */ (function () {
69
66
  for (var j = 0; j < point['length'] - 1; j++) {
70
67
  angle = (-1 > angle) ? -1 : angle;
71
68
  angle = (1 < angle) ? 1 : angle;
72
- var arcId_1 = this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationIndex_' + i + '_Line' + j + '';
73
- var radius_1 = this.convertRadius(point[j], point[j + 1]);
69
+ var arcId = this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationIndex_' + i + '_Line' + j + '';
70
+ var radius = this.convertRadius(point[j], point[j + 1]);
74
71
  if (angle <= 1 && angle > 0) {
75
72
  direction = 0;
76
73
  if (point[j]['x'] > point[j + 1]['x']) {
@@ -115,10 +112,10 @@ var NavigationLine = /** @class */ (function () {
115
112
  angle = Math.abs(angle);
116
113
  d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
117
114
  + ',' + point[j + 1]['y'] + ' ' :
118
- 'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius_1 / 2 + (1 - angle) * radius_1 / (angle * 10)) +
119
- ' ' + (radius_1 / 2 + (1 - angle) * radius_1 / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
115
+ 'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
116
+ ' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
120
117
  + direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
121
- pathOption = new PathOption(arcId_1, 'none', width, color, 1, 1, dashArray, d);
118
+ pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
122
119
  navigationEle = this.maps.renderer.drawPath(pathOption);
123
120
  if (!isNullOrUndefined(arrowPosition)) {
124
121
  var position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
@@ -151,14 +148,11 @@ var NavigationLine = /** @class */ (function () {
151
148
  /**
152
149
  * To destroy the layers.
153
150
  *
154
- * @param {Maps} maps - Specifies the instance of the map
155
151
  * @returns {void}
156
152
  * @private
157
153
  */
158
- NavigationLine.prototype.destroy = function (maps) {
159
- /**
160
- * Destroy method performed here
161
- */
154
+ NavigationLine.prototype.destroy = function () {
155
+ this.maps = null;
162
156
  };
163
157
  return NavigationLine;
164
158
  }());
package/src/maps/maps.js CHANGED
@@ -390,7 +390,9 @@ var Maps = /** @class */ (function (_super) {
390
390
  this.dataLabelShape = [];
391
391
  }
392
392
  this.mapLayerPanel.measureLayerPanel();
393
- this.element.appendChild(this.svgObject);
393
+ if (!isNullOrUndefined(this.svgObject)) {
394
+ this.element.appendChild(this.svgObject);
395
+ }
394
396
  var position = this.getExtraPosition();
395
397
  for (var i = 0; i < this.layers.length; i++) {
396
398
  if (position.x !== 0 || position.y !== 0) {
@@ -579,6 +581,7 @@ var Maps = /** @class */ (function (_super) {
579
581
  */
580
582
  Maps.prototype.addTabIndex = function () {
581
583
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
584
+ this.element.setAttribute('role', '');
582
585
  this.element.setAttribute('tabindex', this.tabIndex.toString());
583
586
  };
584
587
  // private setSecondaryElementPosition(): void {
@@ -643,7 +646,7 @@ var Maps = /** @class */ (function (_super) {
643
646
  }
644
647
  }
645
648
  if (this.zoomModule && (this.previousScale !== this.scale)) {
646
- this.zoomModule.applyTransform(true);
649
+ this.zoomModule.applyTransform(this, true);
647
650
  }
648
651
  }
649
652
  };
@@ -821,6 +824,7 @@ var Maps = /** @class */ (function (_super) {
821
824
  var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
822
825
  var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
823
826
  element.setAttribute('aria-label', this.description || title.text);
827
+ element.setAttribute('role', '');
824
828
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
825
829
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
826
830
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -1410,7 +1414,7 @@ var Maps = /** @class */ (function (_super) {
1410
1414
  this.scale = zoomFactor;
1411
1415
  this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
1412
1416
  this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
1413
- this.zoomModule.applyTransform();
1417
+ this.zoomModule.applyTransform(this);
1414
1418
  }
1415
1419
  else {
1416
1420
  position = { x: size.width / 2, y: size.height / 2 };
@@ -1489,7 +1493,7 @@ var Maps = /** @class */ (function (_super) {
1489
1493
  this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
1490
1494
  }
1491
1495
  var markerModule = new Marker(this);
1492
- markerModule.markerRender(layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
1496
+ markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
1493
1497
  this.arrangeTemplate();
1494
1498
  }
1495
1499
  };
@@ -1696,7 +1700,8 @@ var Maps = /** @class */ (function (_super) {
1696
1700
  Zoom: 'Zoom',
1697
1701
  ZoomOut: 'Zoom out',
1698
1702
  Pan: 'Pan',
1699
- Reset: 'Reset'
1703
+ Reset: 'Reset',
1704
+ ImageNotFound: 'Image Not Found'
1700
1705
  };
1701
1706
  };
1702
1707
  /**
@@ -1704,6 +1709,7 @@ var Maps = /** @class */ (function (_super) {
1704
1709
  */
1705
1710
  Maps.prototype.destroy = function () {
1706
1711
  this.unWireEVents();
1712
+ _super.prototype.destroy.call(this);
1707
1713
  this.shapeSelectionItem = [];
1708
1714
  this.toggledShapeElementId = [];
1709
1715
  this.toggledLegendId = [];
@@ -1718,11 +1724,14 @@ var Maps = /** @class */ (function (_super) {
1718
1724
  this.zoomLabelPositions = [];
1719
1725
  this.mouseDownEvent = { x: null, y: null };
1720
1726
  this.mouseClickEvent = { x: null, y: null };
1727
+ this.formatFunction = null;
1728
+ //TODO: Calling the below code throws spec issue.
1729
+ //this.renderer = null;
1730
+ this.availableSize = new Size(0, 0);
1721
1731
  if (document.getElementById('mapsmeasuretext')) {
1722
1732
  document.getElementById('mapsmeasuretext').remove();
1723
1733
  }
1724
1734
  this.removeSvg();
1725
- _super.prototype.destroy.call(this);
1726
1735
  };
1727
1736
  /**
1728
1737
  * Gets component name
@@ -2038,7 +2047,7 @@ var Maps = /** @class */ (function (_super) {
2038
2047
  */
2039
2048
  Maps.prototype.print = function (id) {
2040
2049
  if ((this.allowPrint) && (this.printModule)) {
2041
- this.printModule.print(id);
2050
+ this.printModule.print(this, id);
2042
2051
  }
2043
2052
  };
2044
2053
  /**
@@ -2057,12 +2066,12 @@ var Maps = /** @class */ (function (_super) {
2057
2066
  }
2058
2067
  if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
2059
2068
  return new Promise(function (resolve, reject) {
2060
- resolve(_this.imageExportModule.export(type, fileName, allowDownload));
2069
+ resolve(_this.imageExportModule.export(_this, type, fileName, allowDownload));
2061
2070
  });
2062
2071
  }
2063
2072
  else if ((this.allowPdfExport) && (this.pdfExportModule)) {
2064
2073
  return new Promise(function (resolve, reject) {
2065
- resolve(_this.pdfExportModule.export(type, fileName, allowDownload, orientation));
2074
+ resolve(_this.pdfExportModule.export(_this, type, fileName, allowDownload, orientation));
2066
2075
  });
2067
2076
  }
2068
2077
  return null;
@@ -6,7 +6,6 @@ import { ExportType } from '../utils/enum';
6
6
  * @hidden
7
7
  */
8
8
  export declare class ImageExport {
9
- private control;
10
9
  /**
11
10
  * Constructor for Maps
12
11
  *
@@ -22,7 +21,7 @@ export declare class ImageExport {
22
21
  * @returns {Promise<string>} - Returns the promise string.
23
22
  * @private
24
23
  */
25
- export(type: ExportType, fileName: string, allowDownload?: boolean): Promise<string>;
24
+ export(maps: Maps, type: ExportType, fileName: string, allowDownload?: boolean): Promise<string>;
26
25
  /**
27
26
  * Get module name.
28
27
  *
@@ -32,9 +31,8 @@ export declare class ImageExport {
32
31
  /**
33
32
  * To destroy the ImageExport.
34
33
  *
35
- * @param {Maps} maps - Specifies the instance of the maps.
36
34
  * @returns {void}
37
35
  * @private
38
36
  */
39
- destroy(maps: Maps): void;
37
+ destroy(): void;
40
38
  }
@@ -13,7 +13,6 @@ var ImageExport = /** @class */ (function () {
13
13
  * @param {Maps} control - Specifies the instance of the map
14
14
  */
15
15
  function ImageExport(control) {
16
- this.control = control;
17
16
  }
18
17
  /**
19
18
  * To export the file as image/svg format
@@ -24,29 +23,28 @@ var ImageExport = /** @class */ (function () {
24
23
  * @returns {Promise<string>} - Returns the promise string.
25
24
  * @private
26
25
  */
27
- ImageExport.prototype.export = function (type, fileName, allowDownload) {
28
- var _this = this;
26
+ ImageExport.prototype.export = function (maps, type, fileName, allowDownload) {
29
27
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
28
  var promise = new Promise(function (resolve, reject) {
31
29
  var imageCanvasElement = createElement('canvas', {
32
30
  id: 'ej2-canvas',
33
31
  attrs: {
34
- 'width': _this.control.availableSize.width.toString(),
35
- 'height': _this.control.availableSize.height.toString()
32
+ 'width': maps.availableSize.width.toString(),
33
+ 'height': maps.availableSize.height.toString()
36
34
  }
37
35
  });
38
36
  var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
39
- var toolbarEle = document.getElementById(_this.control.element.id + '_ToolBar');
40
- var svgParent = document.getElementById(_this.control.element.id + '_Tile_SVG_Parent');
37
+ var toolbarEle = document.getElementById(maps.element.id + '_ToolBar');
38
+ var svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
41
39
  var svgDataElement;
42
40
  var tileSvg;
43
- var svgObject = getElementByID(_this.control.element.id + '_svg').cloneNode(true);
44
- if (!_this.control.isTileMap) {
41
+ var svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
42
+ if (!maps.isTileMap) {
45
43
  svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
46
- _this.control.svgObject.outerHTML + '</svg>';
44
+ maps.svgObject.outerHTML + '</svg>';
47
45
  }
48
46
  else {
49
- tileSvg = getElementByID(_this.control.element.id + '_Tile_SVG').cloneNode(true);
47
+ tileSvg = getElementByID(maps.element.id + '_Tile_SVG').cloneNode(true);
50
48
  svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
51
49
  svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
52
50
  }
@@ -63,7 +61,7 @@ var ImageExport = /** @class */ (function () {
63
61
  else {
64
62
  var image_1 = new Image();
65
63
  var ctxt_1 = imageCanvasElement.getContext('2d');
66
- if (!_this.control.isTileMap) {
64
+ if (!maps.isTileMap) {
67
65
  image_1.onload = (function () {
68
66
  ctxt_1.drawImage(image_1, 0, 0);
69
67
  window.URL.revokeObjectURL(url);
@@ -82,22 +80,22 @@ var ImageExport = /** @class */ (function () {
82
80
  image_1.src = url;
83
81
  }
84
82
  else {
85
- var svgParentElement = document.getElementById(_this.control.element.id + '_MapAreaBorder');
83
+ var svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
86
84
  var top_1 = parseFloat(svgParentElement.getAttribute('y'));
87
85
  var left_1 = parseFloat(svgParentElement.getAttribute('x'));
88
86
  var imgxHttp = new XMLHttpRequest();
89
- var imgTileLength_1 = _this.control.mapLayerPanel.tiles.length;
87
+ var imgTileLength_1 = maps.mapLayerPanel.tiles.length;
90
88
  var _loop_1 = function (i) {
91
- var tile = document.getElementById(_this.control.element.id + '_tile_' + (i - 1));
89
+ var tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
92
90
  var exportTileImg = new Image();
93
91
  exportTileImg.crossOrigin = 'Anonymous';
94
- ctxt_1.fillStyle = _this.control.background ? _this.control.background : '#FFFFFF';
95
- ctxt_1.fillRect(0, 0, _this.control.availableSize.width, _this.control.availableSize.height);
96
- ctxt_1.font = _this.control.titleSettings.textStyle.size + ' Arial';
97
- var titleElement = document.getElementById(_this.control.element.id + '_Map_title');
92
+ ctxt_1.fillStyle = maps.background ? maps.background : '#FFFFFF';
93
+ ctxt_1.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
94
+ ctxt_1.font = maps.titleSettings.textStyle.size + ' Arial';
95
+ var titleElement = document.getElementById(maps.element.id + '_Map_title');
98
96
  if (!isNullOrUndefined(titleElement)) {
99
97
  ctxt_1.fillStyle = titleElement.getAttribute('fill');
100
- ctxt_1.fillText(_this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
98
+ ctxt_1.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
101
99
  }
102
100
  exportTileImg.onload = (function () {
103
101
  if (i === 0 || i === imgTileLength_1 + 1) {
@@ -111,7 +109,6 @@ var ImageExport = /** @class */ (function () {
111
109
  }
112
110
  }
113
111
  else {
114
- var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
115
112
  ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left_1, parseFloat(tile.style.top) +
116
113
  top_1);
117
114
  }
@@ -168,15 +165,10 @@ var ImageExport = /** @class */ (function () {
168
165
  /**
169
166
  * To destroy the ImageExport.
170
167
  *
171
- * @param {Maps} maps - Specifies the instance of the maps.
172
168
  * @returns {void}
173
169
  * @private
174
170
  */
175
- ImageExport.prototype.destroy = function (maps) {
176
- /**
177
- * Destroy method performed here
178
- */
179
- };
171
+ ImageExport.prototype.destroy = function () { };
180
172
  return ImageExport;
181
173
  }());
182
174
  export { ImageExport };
@@ -7,13 +7,12 @@ import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';
7
7
  * @hidden
8
8
  */
9
9
  export declare class PdfExport {
10
- private control;
11
10
  /**
12
11
  * Constructor for Maps
13
12
  *
14
13
  * @param {Maps} control Specifies the instance of the map
15
14
  */
16
- constructor(control: Maps);
15
+ constructor();
17
16
  /**
18
17
  * To export the file as image/svg format
19
18
  *
@@ -24,7 +23,7 @@ export declare class PdfExport {
24
23
  * @returns {Promise<string>} - Returns the promise string
25
24
  * @private
26
25
  */
27
- export(type: ExportType, fileName: string, allowDownload?: boolean, orientation?: PdfPageOrientation): Promise<string>;
26
+ export(maps: Maps, type: ExportType, fileName: string, allowDownload?: boolean, orientation?: PdfPageOrientation): Promise<string>;
28
27
  /**
29
28
  * Get module name.
30
29
  *
@@ -32,11 +31,10 @@ export declare class PdfExport {
32
31
  */
33
32
  protected getModuleName(): string;
34
33
  /**
35
- * To destroy the PdfExports.
34
+ * To destroy the PdfExport.
36
35
  *
37
- * @param {Maps} maps - Specifies the instance of the maps.
38
36
  * @returns {void}
39
37
  * @private
40
38
  */
41
- destroy(maps: Maps): void;
39
+ destroy(): void;
42
40
  }
@@ -12,8 +12,7 @@ var PdfExport = /** @class */ (function () {
12
12
  *
13
13
  * @param {Maps} control Specifies the instance of the map
14
14
  */
15
- function PdfExport(control) {
16
- this.control = control;
15
+ function PdfExport() {
17
16
  }
18
17
  /**
19
18
  * To export the file as image/svg format
@@ -25,25 +24,24 @@ var PdfExport = /** @class */ (function () {
25
24
  * @returns {Promise<string>} - Returns the promise string
26
25
  * @private
27
26
  */
28
- PdfExport.prototype.export = function (type, fileName, allowDownload, orientation) {
29
- var _this = this;
27
+ PdfExport.prototype.export = function (maps, type, fileName, allowDownload, orientation) {
30
28
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
29
  var promise = new Promise(function (resolve, reject) {
32
30
  var canvasElement = createElement('canvas', {
33
31
  id: 'ej2-canvas',
34
32
  attrs: {
35
- 'width': _this.control.availableSize.width.toString(),
36
- 'height': _this.control.availableSize.height.toString()
33
+ 'width': maps.availableSize.width.toString(),
34
+ 'height': maps.availableSize.height.toString()
37
35
  }
38
36
  });
39
37
  orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;
40
- var svgParent = document.getElementById(_this.control.element.id + '_Tile_SVG_Parent');
38
+ var svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
41
39
  var svgData;
42
- var exportElement = _this.control.svgObject.cloneNode(true);
40
+ var exportElement = maps.svgObject.cloneNode(true);
43
41
  var backgroundElement = exportElement.childNodes[0];
44
42
  var backgroundColor = backgroundElement.getAttribute('fill');
45
- if ((_this.control.theme === 'Tailwind' || _this.control.theme === 'TailwindDark' || _this.control.theme === 'Bootstrap5' || _this.control.theme === 'Bootstrap5Dark'
46
- || _this.control.theme === 'Fluent' || _this.control.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
43
+ if ((maps.theme === 'Tailwind' || maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5' || maps.theme === 'Bootstrap5Dark'
44
+ || maps.theme === 'Fluent' || maps.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
47
45
  exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
48
46
  }
49
47
  var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
@@ -51,7 +49,7 @@ var PdfExport = /** @class */ (function () {
51
49
  var pdfDocument = new PdfDocument();
52
50
  var image = new Image();
53
51
  var ctx = canvasElement.getContext('2d');
54
- if (!_this.control.isTileMap) {
52
+ if (!maps.isTileMap) {
55
53
  image.onload = (function () {
56
54
  ctx.drawImage(image, 0, 0);
57
55
  window.URL.revokeObjectURL(url);
@@ -59,7 +57,7 @@ var PdfExport = /** @class */ (function () {
59
57
  var imageString = canvasElement.toDataURL('image/jpeg').replace('image/jpeg', 'image/octet-stream');
60
58
  pdfDocument.pageSettings.orientation = orientation;
61
59
  imageString = imageString.slice(imageString.indexOf(',') + 1);
62
- pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (_this.control.availableSize.width - 60), _this.control.availableSize.height);
60
+ pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
63
61
  if (allowDownload) {
64
62
  pdfDocument.save(fileName + '.pdf');
65
63
  pdfDocument.destroy();
@@ -72,22 +70,22 @@ var PdfExport = /** @class */ (function () {
72
70
  image.src = url;
73
71
  }
74
72
  else {
75
- var svgParentElement = document.getElementById(_this.control.element.id + '_MapAreaBorder');
73
+ var svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
76
74
  var top_1 = parseFloat(svgParentElement.getAttribute('y'));
77
75
  var left_1 = parseFloat(svgParentElement.getAttribute('x'));
78
76
  var xHttp = new XMLHttpRequest();
79
- var tileLength_1 = _this.control.mapLayerPanel.tiles.length;
77
+ var tileLength_1 = maps.mapLayerPanel.tiles.length;
80
78
  var _loop_1 = function (i) {
81
- var tile = document.getElementById(_this.control.element.id + '_tile_' + (i - 1));
79
+ var tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
82
80
  var tileImg = new Image();
83
81
  tileImg.crossOrigin = 'Anonymous';
84
- ctx.fillStyle = _this.control.background ? _this.control.background : '#FFFFFF';
85
- ctx.fillRect(0, 0, _this.control.availableSize.width, _this.control.availableSize.height);
86
- ctx.font = _this.control.titleSettings.textStyle.size + ' Arial';
87
- var titleElement = document.getElementById(_this.control.element.id + '_Map_title');
82
+ ctx.fillStyle = maps.background ? maps.background : '#FFFFFF';
83
+ ctx.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
84
+ ctx.font = maps.titleSettings.textStyle.size + ' Arial';
85
+ var titleElement = document.getElementById(maps.element.id + '_Map_title');
88
86
  if (!isNullOrUndefined(titleElement)) {
89
87
  ctx.fillStyle = titleElement.getAttribute('fill');
90
- ctx.fillText(_this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
88
+ ctx.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
91
89
  }
92
90
  tileImg.onload = (function () {
93
91
  if (i === 0 || i === tileLength_1 + 1) {
@@ -101,7 +99,6 @@ var PdfExport = /** @class */ (function () {
101
99
  }
102
100
  }
103
101
  else {
104
- var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
105
102
  ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left_1, parseFloat(tile.style.top) + top_1);
106
103
  }
107
104
  ctx.drawImage(tileImg, 0, 0);
@@ -111,7 +108,7 @@ var PdfExport = /** @class */ (function () {
111
108
  var x = localStorage.getItem('saved-image-example');
112
109
  pdfDocument.pageSettings.orientation = orientation;
113
110
  x = x.slice(x.indexOf(',') + 1);
114
- pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (_this.control.availableSize.width - 60), _this.control.availableSize.height);
111
+ pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
115
112
  if (allowDownload) {
116
113
  pdfDocument.save(fileName + '.pdf');
117
114
  pdfDocument.destroy();
@@ -128,7 +125,7 @@ var PdfExport = /** @class */ (function () {
128
125
  }
129
126
  else {
130
127
  setTimeout(function () {
131
- var tileSvg = document.getElementById(_this.control.element.id + '_Tile_SVG');
128
+ var tileSvg = document.getElementById(maps.element.id + '_Tile_SVG');
132
129
  tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
133
130
  }, 300);
134
131
  }
@@ -155,17 +152,12 @@ var PdfExport = /** @class */ (function () {
155
152
  return 'PdfExport';
156
153
  };
157
154
  /**
158
- * To destroy the PdfExports.
155
+ * To destroy the PdfExport.
159
156
  *
160
- * @param {Maps} maps - Specifies the instance of the maps.
161
157
  * @returns {void}
162
158
  * @private
163
159
  */
164
- PdfExport.prototype.destroy = function (maps) {
165
- /**
166
- * Destroy method performed here
167
- */
168
- };
160
+ PdfExport.prototype.destroy = function () { };
169
161
  return PdfExport;
170
162
  }());
171
163
  export { PdfExport };
@@ -503,6 +503,14 @@ export interface ILabelRenderingEventArgs extends IMapsEventArgs {
503
503
  * Defines the text for the data-label in event argument.
504
504
  */
505
505
  text: string;
506
+ /**
507
+ * Defines the right and left position of text for the data-label in event argument.
508
+ */
509
+ offsetX: number;
510
+ /**
511
+ * Defines the top and bottom position of text for the data-label in event argument.
512
+ */
513
+ offsetY: number;
506
514
  /**
507
515
  * Defines the color and width of the border for the data-label in event argument.
508
516
  */
@@ -5,8 +5,6 @@ import { Maps } from '../../index';
5
5
  * @hidden
6
6
  */
7
7
  export declare class Print {
8
- private control;
9
- private printWindow;
10
8
  /**
11
9
  * Constructor for Maps
12
10
  *
@@ -20,7 +18,7 @@ export declare class Print {
20
18
  * @returns {void}
21
19
  * @private
22
20
  */
23
- print(elements?: string[] | string | Element): void;
21
+ print(maps: Maps, elements?: string[] | string | Element): void;
24
22
  /**
25
23
  * To get the html string of the Maps
26
24
  *
@@ -38,9 +36,8 @@ export declare class Print {
38
36
  /**
39
37
  * To destroy the print.
40
38
  *
41
- * @param {Maps} maps - Specifies the instance of the maps
42
39
  * @returns {void}
43
40
  * @private
44
41
  */
45
- destroy(maps: Maps): void;
42
+ destroy(): void;
46
43
  }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
- import { print as printWindow, createElement } from '@syncfusion/ej2-base';
3
- import { getElement, getClientElement } from '../utils/helper';
2
+ import { print as printFunction, createElement } from '@syncfusion/ej2-base';
3
+ import { getElement } from '../utils/helper';
4
4
  import { beforePrint } from '../model/constants';
5
5
  /**
6
6
  * This module enables the print functionality in maps.
@@ -14,7 +14,6 @@ var Print = /** @class */ (function () {
14
14
  * @param {Maps} control - Specifies the instance of the map
15
15
  */
16
16
  function Print(control) {
17
- this.control = control;
18
17
  }
19
18
  /**
20
19
  * To print the Maps
@@ -23,17 +22,16 @@ var Print = /** @class */ (function () {
23
22
  * @returns {void}
24
23
  * @private
25
24
  */
26
- Print.prototype.print = function (elements) {
27
- var _this = this;
28
- this.printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
29
- this.printWindow.moveTo(0, 0);
30
- this.printWindow.resizeTo(screen.availWidth, screen.availHeight);
25
+ Print.prototype.print = function (maps, elements) {
26
+ var printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
27
+ printWindow.moveTo(0, 0);
28
+ printWindow.resizeTo(screen.availWidth, screen.availHeight);
31
29
  var argsData = {
32
- cancel: false, htmlContent: this.getHTMLContent(elements), name: beforePrint
30
+ cancel: false, htmlContent: this.getHTMLContent(maps, elements), name: beforePrint
33
31
  };
34
- this.control.trigger('beforePrint', argsData, function (beforePrintArgs) {
32
+ maps.trigger('beforePrint', argsData, function (beforePrintArgs) {
35
33
  if (!argsData.cancel) {
36
- printWindow(argsData.htmlContent, _this.printWindow);
34
+ printFunction(argsData.htmlContent, printWindow);
37
35
  }
38
36
  });
39
37
  };
@@ -44,20 +42,19 @@ var Print = /** @class */ (function () {
44
42
  * @returns {Element} - Returns the div element
45
43
  * @private
46
44
  */
47
- Print.prototype.getHTMLContent = function (elements) {
48
- var elementRect = getClientElement(this.control.element.id);
45
+ Print.prototype.getHTMLContent = function (maps, elements) {
49
46
  var div = createElement('div');
50
- var divElement = this.control.element.cloneNode(true);
51
- if (this.control.isTileMap) {
47
+ var divElement = maps.element.cloneNode(true);
48
+ if (maps.isTileMap) {
52
49
  for (var i = 0; i < divElement.childElementCount; i++) {
53
- if (divElement.children[i].id === this.control.element.id + '_tile_parent') {
50
+ if (divElement.children[i].id === maps.element.id + '_tile_parent') {
54
51
  divElement.children[i].style.removeProperty('height');
55
52
  divElement.children[i].style.removeProperty('width');
56
53
  divElement.children[i].style.removeProperty('top');
57
54
  divElement.children[i].style.removeProperty('left');
58
55
  divElement.children[i].style.removeProperty('right');
59
56
  divElement.children[i].style.removeProperty('overflow');
60
- var svgElement = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
57
+ var svgElement = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
61
58
  divElement.children[i].children[0].style.overflow = 'hidden';
62
59
  divElement.children[i].children[0].style.position = 'absolute';
63
60
  divElement.children[i].children[0].style.height = svgElement.style.height;
@@ -97,15 +94,10 @@ var Print = /** @class */ (function () {
97
94
  /**
98
95
  * To destroy the print.
99
96
  *
100
- * @param {Maps} maps - Specifies the instance of the maps
101
97
  * @returns {void}
102
98
  * @private
103
99
  */
104
- Print.prototype.destroy = function (maps) {
105
- /**
106
- * Destroy method performed here
107
- */
108
- };
100
+ Print.prototype.destroy = function () { };
109
101
  return Print;
110
102
  }());
111
103
  export { Print };
@@ -14,9 +14,8 @@ export declare class Annotations {
14
14
  /**
15
15
  * To destroy the annotation.
16
16
  *
17
- * @param {Maps} map - Specifies the instance of the maps
18
17
  * @returns {void}
19
18
  * @private
20
19
  */
21
- destroy(map: Maps): void;
20
+ destroy(): void;
22
21
  }
@@ -113,12 +113,11 @@ var Annotations = /** @class */ (function () {
113
113
  /**
114
114
  * To destroy the annotation.
115
115
  *
116
- * @param {Maps} map - Specifies the instance of the maps
117
116
  * @returns {void}
118
117
  * @private
119
118
  */
120
- Annotations.prototype.destroy = function (map) {
121
- // Destroy method performed here
119
+ Annotations.prototype.destroy = function () {
120
+ this.map = null;
122
121
  };
123
122
  return Annotations;
124
123
  }());
@@ -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
  }