@syncfusion/ej2-maps 30.2.4 → 31.2.2

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 (61) hide show
  1. package/.eslintrc.json +263 -0
  2. package/dist/ej2-maps.min.js +2 -2
  3. package/dist/ej2-maps.umd.min.js +2 -2
  4. package/dist/global/ej2-maps.min.js +2 -2
  5. package/dist/global/index.d.ts +2 -2
  6. package/dist/ts/index.d.ts +4 -0
  7. package/dist/ts/index.ts +4 -0
  8. package/dist/ts/maps/index.d.ts +28 -0
  9. package/dist/ts/maps/index.ts +28 -0
  10. package/dist/ts/maps/layers/bing-map.d.ts +21 -0
  11. package/dist/ts/maps/layers/bing-map.ts +51 -0
  12. package/dist/ts/maps/layers/bubble.d.ts +77 -0
  13. package/dist/ts/maps/layers/bubble.ts +304 -0
  14. package/dist/ts/maps/layers/color-mapping.d.ts +36 -0
  15. package/dist/ts/maps/layers/color-mapping.ts +230 -0
  16. package/dist/ts/maps/layers/data-label.d.ts +45 -0
  17. package/dist/ts/maps/layers/data-label.ts +457 -0
  18. package/dist/ts/maps/layers/layer-panel.d.ts +144 -0
  19. package/dist/ts/maps/layers/layer-panel.ts +1455 -0
  20. package/dist/ts/maps/layers/legend.d.ts +173 -0
  21. package/dist/ts/maps/layers/legend.ts +2465 -0
  22. package/dist/ts/maps/layers/marker.d.ts +105 -0
  23. package/dist/ts/maps/layers/marker.ts +632 -0
  24. package/dist/ts/maps/layers/navigation-selected-line.d.ts +33 -0
  25. package/dist/ts/maps/layers/navigation-selected-line.ts +171 -0
  26. package/dist/ts/maps/layers/polygon.d.ts +30 -0
  27. package/dist/ts/maps/layers/polygon.ts +68 -0
  28. package/dist/ts/maps/maps-model.d.ts +409 -0
  29. package/dist/ts/maps/maps.d.ts +1247 -0
  30. package/dist/ts/maps/maps.ts +3416 -0
  31. package/dist/ts/maps/model/base-model.d.ts +2107 -0
  32. package/dist/ts/maps/model/base.d.ts +1840 -0
  33. package/dist/ts/maps/model/base.ts +2257 -0
  34. package/dist/ts/maps/model/constants.d.ts +225 -0
  35. package/dist/ts/maps/model/constants.ts +226 -0
  36. package/dist/ts/maps/model/export-image.d.ts +39 -0
  37. package/dist/ts/maps/model/export-image.ts +194 -0
  38. package/dist/ts/maps/model/export-pdf.d.ts +40 -0
  39. package/dist/ts/maps/model/export-pdf.ts +183 -0
  40. package/dist/ts/maps/model/interface.d.ts +892 -0
  41. package/dist/ts/maps/model/interface.ts +929 -0
  42. package/dist/ts/maps/model/print.d.ts +45 -0
  43. package/dist/ts/maps/model/print.ts +125 -0
  44. package/dist/ts/maps/model/theme.d.ts +98 -0
  45. package/dist/ts/maps/model/theme.ts +919 -0
  46. package/dist/ts/maps/user-interaction/annotation.d.ts +27 -0
  47. package/dist/ts/maps/user-interaction/annotation.ts +133 -0
  48. package/dist/ts/maps/user-interaction/highlight.d.ts +63 -0
  49. package/dist/ts/maps/user-interaction/highlight.ts +272 -0
  50. package/dist/ts/maps/user-interaction/selection.d.ts +85 -0
  51. package/dist/ts/maps/user-interaction/selection.ts +342 -0
  52. package/dist/ts/maps/user-interaction/tooltip.d.ts +78 -0
  53. package/dist/ts/maps/user-interaction/tooltip.ts +500 -0
  54. package/dist/ts/maps/user-interaction/zoom.d.ts +334 -0
  55. package/dist/ts/maps/user-interaction/zoom.ts +2523 -0
  56. package/dist/ts/maps/utils/enum.d.ts +328 -0
  57. package/dist/ts/maps/utils/enum.ts +343 -0
  58. package/dist/ts/maps/utils/helper.d.ts +1318 -0
  59. package/dist/ts/maps/utils/helper.ts +3811 -0
  60. package/package.json +53 -18
  61. package/tslint.json +111 -0
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Maps constants doc
3
+ */
4
+ /**
5
+ * Specifies the maps load event name.
6
+ *
7
+ * @private
8
+ */
9
+ export declare const load: string;
10
+ /**
11
+ * Specifies the maps loaded event name.
12
+ *
13
+ * @private
14
+ */
15
+ export declare const loaded: string;
16
+ /**
17
+ * Specifies the maps click event name.
18
+ *
19
+ * @private
20
+ */
21
+ export declare const click: string;
22
+ /**
23
+ * Specifies the maps onclick event name.
24
+ *
25
+ * @private
26
+ */
27
+ export declare const onclick: string;
28
+ /**
29
+ * Specifies the maps right click event name.
30
+ *
31
+ * @private
32
+ */
33
+ export declare const rightClick: string;
34
+ /**
35
+ * Specifies the maps double click event name.
36
+ *
37
+ * @private
38
+ */
39
+ export declare const doubleClick: string;
40
+ /**
41
+ * Specifies the maps resize event name.
42
+ *
43
+ * @private
44
+ */
45
+ export declare const resize: string;
46
+ /**
47
+ * Specifies the maps tooltip event name.
48
+ *
49
+ */
50
+ export declare const tooltipRender: string;
51
+ /**
52
+ * Specifies the map shape selected event.
53
+ *
54
+ */
55
+ export declare const shapeSelected: string;
56
+ /**
57
+ * Specifies the maps shape highlight event.
58
+ *
59
+ */
60
+ export declare const shapeHighlight: string;
61
+ /**
62
+ * Specifies the maps mouse move event name.
63
+ *
64
+ * @private
65
+ */
66
+ export declare const mousemove: string;
67
+ /**
68
+ * Specifies the maps mouse up event name.
69
+ *
70
+ * @private
71
+ */
72
+ export declare const mouseup: string;
73
+ /**
74
+ * Specifies the maps mouse down event name.
75
+ *
76
+ * @private
77
+ */
78
+ export declare const mousedown: string;
79
+ /**
80
+ * Specifies the maps layer rendering event name.
81
+ *
82
+ * @private
83
+ */
84
+ export declare const layerRendering: string;
85
+ /**
86
+ * Specifies the maps shape rendering event name.
87
+ *
88
+ * @private
89
+ */
90
+ export declare const shapeRendering: string;
91
+ /**
92
+ * Specifies the maps marker rendering event name.
93
+ *
94
+ * @private
95
+ */
96
+ export declare const markerRendering: string;
97
+ /**
98
+ * Specifies the maps cluster rendering event name.
99
+ *
100
+ * @private
101
+ */
102
+ export declare const markerClusterRendering: string;
103
+ /**
104
+ * Specifies the maps marker click event name.
105
+ *
106
+ * @private
107
+ */
108
+ export declare const markerClick: string;
109
+ /**
110
+ * Specifies the maps marker drag start event name.
111
+ *
112
+ * @private
113
+ */
114
+ export declare const markerDragStart: string;
115
+ /**
116
+ * Specifies the maps marker drag end event name.
117
+ *
118
+ * @private
119
+ */
120
+ export declare const markerDragEnd: string;
121
+ /**
122
+ * Specifies the maps cluster click event name.
123
+ *
124
+ * @private
125
+ */
126
+ export declare const markerClusterClick: string;
127
+ /**
128
+ * Specifies the maps marker mouse move event name.
129
+ *
130
+ * @private
131
+ */
132
+ export declare const markerMouseMove: string;
133
+ /**
134
+ * Specifies the maps mouse move event name.
135
+ *
136
+ * @private
137
+ */
138
+ export declare const mouseMove: string;
139
+ /**
140
+ * Specifies the maps cluster mouse move event name.
141
+ *
142
+ * @private
143
+ */
144
+ export declare const markerClusterMouseMove: string;
145
+ /**
146
+ * Specifies the maps data label rendering event name.
147
+ *
148
+ * @private
149
+ */
150
+ export declare const dataLabelRendering: string;
151
+ /**
152
+ * Specifies the maps bubbleRendering event name.
153
+ *
154
+ * @private
155
+ */
156
+ export declare const bubbleRendering: string;
157
+ /**
158
+ * Specifies the maps bubble click event name.
159
+ *
160
+ * @private
161
+ */
162
+ export declare const bubbleClick: string;
163
+ /**
164
+ * Specifies the maps bubble mouse move event name.
165
+ *
166
+ * @private
167
+ */
168
+ export declare const bubbleMouseMove: string;
169
+ /**
170
+ * Specifies the maps animation complete event name.
171
+ *
172
+ * @private
173
+ */
174
+ export declare const animationComplete: string;
175
+ /**
176
+ * Specifies the maps legend rendering event name.
177
+ *
178
+ * @private
179
+ */
180
+ export declare const legendRendering: string;
181
+ /**
182
+ * Specifies the maps annotation rendering event name.
183
+ *
184
+ * @private
185
+ */
186
+ export declare const annotationRendering: string;
187
+ /**
188
+ * Specifies the maps item selection event name.
189
+ *
190
+ * @private
191
+ */
192
+ export declare const itemSelection: string;
193
+ /**
194
+ * Specifies the maps pan complete event name.
195
+ *
196
+ * @private
197
+ */
198
+ export declare const panComplete: string;
199
+ /**
200
+ * Specifies the maps zoom complete event name.
201
+ *
202
+ * @private
203
+ */
204
+ export declare const zoomComplete: string;
205
+ /**
206
+ * Specifies the maps item highlight event name.
207
+ *
208
+ */
209
+ export declare const itemHighlight: string;
210
+ /**
211
+ * Specifies the maps before print event name.
212
+ */
213
+ export declare const beforePrint: string;
214
+ /**
215
+ * Specifies the maps zoom in event name.
216
+ */
217
+ export declare const zoomIn: string;
218
+ /**
219
+ * Specifies the maps zoom out event name.
220
+ */
221
+ export declare const zoomOut: string;
222
+ /**
223
+ * Specifies the maps pan event name.
224
+ */
225
+ export declare const pan: string;
@@ -0,0 +1,226 @@
1
+ /**
2
+ * Maps constants doc
3
+ */
4
+
5
+ /**
6
+ * Specifies the maps load event name.
7
+ *
8
+ * @private
9
+ */
10
+ export const load: string = 'load';
11
+ /**
12
+ * Specifies the maps loaded event name.
13
+ *
14
+ * @private
15
+ */
16
+ export const loaded: string = 'loaded';
17
+ /**
18
+ * Specifies the maps click event name.
19
+ *
20
+ * @private
21
+ */
22
+ export const click: string = 'click';
23
+ /**
24
+ * Specifies the maps onclick event name.
25
+ *
26
+ * @private
27
+ */
28
+ export const onclick: string = 'onclick';
29
+ /**
30
+ * Specifies the maps right click event name.
31
+ *
32
+ * @private
33
+ */
34
+ export const rightClick: string = 'rightClick';
35
+ /**
36
+ * Specifies the maps double click event name.
37
+ *
38
+ * @private
39
+ */
40
+ export const doubleClick: string = 'doubleClick';
41
+ /**
42
+ * Specifies the maps resize event name.
43
+ *
44
+ * @private
45
+ */
46
+ export const resize: string = 'resize';
47
+ /**
48
+ * Specifies the maps tooltip event name.
49
+ *
50
+ */
51
+ export const tooltipRender: string = 'tooltipRender';
52
+ /**
53
+ * Specifies the map shape selected event.
54
+ *
55
+ */
56
+ export const shapeSelected: string = 'shapeSelected';
57
+ /**
58
+ * Specifies the maps shape highlight event.
59
+ *
60
+ */
61
+ export const shapeHighlight: string = 'shapeHighlight';
62
+ /**
63
+ * Specifies the maps mouse move event name.
64
+ *
65
+ * @private
66
+ */
67
+ export const mousemove: string = 'mousemove';
68
+ /**
69
+ * Specifies the maps mouse up event name.
70
+ *
71
+ * @private
72
+ */
73
+ export const mouseup: string = 'mouseup';
74
+ /**
75
+ * Specifies the maps mouse down event name.
76
+ *
77
+ * @private
78
+ */
79
+ export const mousedown: string = 'mousedown';
80
+ /**
81
+ * Specifies the maps layer rendering event name.
82
+ *
83
+ * @private
84
+ */
85
+ export const layerRendering: string = 'layerRendering';
86
+ /**
87
+ * Specifies the maps shape rendering event name.
88
+ *
89
+ * @private
90
+ */
91
+ export const shapeRendering: string = 'shapeRendering';
92
+ /**
93
+ * Specifies the maps marker rendering event name.
94
+ *
95
+ * @private
96
+ */
97
+ export const markerRendering: string = 'markerRendering';
98
+ /**
99
+ * Specifies the maps cluster rendering event name.
100
+ *
101
+ * @private
102
+ */
103
+ export const markerClusterRendering: string = 'markerClusterRendering';
104
+ /**
105
+ * Specifies the maps marker click event name.
106
+ *
107
+ * @private
108
+ */
109
+ export const markerClick: string = 'markerClick';
110
+ /**
111
+ * Specifies the maps marker drag start event name.
112
+ *
113
+ * @private
114
+ */
115
+ export const markerDragStart: string = 'markerDragStart';
116
+ /**
117
+ * Specifies the maps marker drag end event name.
118
+ *
119
+ * @private
120
+ */
121
+ export const markerDragEnd: string = 'markerDragEnd';
122
+ /**
123
+ * Specifies the maps cluster click event name.
124
+ *
125
+ * @private
126
+ */
127
+ export const markerClusterClick: string = 'markerClusterClick';
128
+ /**
129
+ * Specifies the maps marker mouse move event name.
130
+ *
131
+ * @private
132
+ */
133
+ export const markerMouseMove: string = 'markerMouseMove';
134
+ /**
135
+ * Specifies the maps mouse move event name.
136
+ *
137
+ * @private
138
+ */
139
+ export const mouseMove: string = 'mouseMove';
140
+ /**
141
+ * Specifies the maps cluster mouse move event name.
142
+ *
143
+ * @private
144
+ */
145
+ export const markerClusterMouseMove: string = 'markerClusterMouseMove';
146
+ /**
147
+ * Specifies the maps data label rendering event name.
148
+ *
149
+ * @private
150
+ */
151
+ export const dataLabelRendering: string = 'dataLabelRendering';
152
+ /**
153
+ * Specifies the maps bubbleRendering event name.
154
+ *
155
+ * @private
156
+ */
157
+ export const bubbleRendering: string = 'bubbleRendering';
158
+ /**
159
+ * Specifies the maps bubble click event name.
160
+ *
161
+ * @private
162
+ */
163
+ export const bubbleClick: string = 'bubbleClick';
164
+ /**
165
+ * Specifies the maps bubble mouse move event name.
166
+ *
167
+ * @private
168
+ */
169
+ export const bubbleMouseMove: string = 'bubbleMouseMove';
170
+ /**
171
+ * Specifies the maps animation complete event name.
172
+ *
173
+ * @private
174
+ */
175
+ export const animationComplete: string = 'animationComplete';
176
+ /**
177
+ * Specifies the maps legend rendering event name.
178
+ *
179
+ * @private
180
+ */
181
+ export const legendRendering: string = 'legendRendering';
182
+ /**
183
+ * Specifies the maps annotation rendering event name.
184
+ *
185
+ * @private
186
+ */
187
+ export const annotationRendering: string = 'annotationRendering';
188
+ /**
189
+ * Specifies the maps item selection event name.
190
+ *
191
+ * @private
192
+ */
193
+ export const itemSelection: string = 'itemSelection';
194
+ /**
195
+ * Specifies the maps pan complete event name.
196
+ *
197
+ * @private
198
+ */
199
+ export const panComplete: string = 'panComplete';
200
+ /**
201
+ * Specifies the maps zoom complete event name.
202
+ *
203
+ * @private
204
+ */
205
+ export const zoomComplete: string = 'zoomComplete';
206
+ /**
207
+ * Specifies the maps item highlight event name.
208
+ *
209
+ */
210
+ export const itemHighlight: string = 'itemHighlight';
211
+ /**
212
+ * Specifies the maps before print event name.
213
+ */
214
+ export const beforePrint: string = 'beforePrint';
215
+ /**
216
+ * Specifies the maps zoom in event name.
217
+ */
218
+ export const zoomIn: string = 'zoomIn';
219
+ /**
220
+ * Specifies the maps zoom out event name.
221
+ */
222
+ export const zoomOut: string = 'zoomOut';
223
+ /**
224
+ * Specifies the maps pan event name.
225
+ */
226
+ export const pan: string = 'pan';
@@ -0,0 +1,39 @@
1
+ import { Maps } from '../../index';
2
+ import { ExportType } from '../utils/enum';
3
+ /**
4
+ * This module enables the export to Image functionality in maps.
5
+ *
6
+ * @hidden
7
+ */
8
+ export declare class ImageExport {
9
+ /**
10
+ * Constructor for Maps
11
+ *
12
+ * @param {Maps} control - Specifies the instance of the map
13
+ */
14
+ constructor(control: Maps);
15
+ /**
16
+ * To export the file as image/svg format
17
+ *
18
+ * @param {Maps} maps - Specifies the Maps instance.
19
+ * @param {ExportType} type - Specifies the type of the image file for exporting.
20
+ * @param {string} fileName - Specifies the file name of the image file for exporting.
21
+ * @param {boolean} allowDownload - Specifies whether to download image as a file or not.
22
+ * @returns {Promise<string>} - Specifies the base64 string of the exported image which is returned when the allowDownload is set to false.
23
+ * @private
24
+ */
25
+ export(maps: Maps, type: ExportType, fileName: string, allowDownload?: boolean): Promise<string>;
26
+ /**
27
+ * Get module name.
28
+ *
29
+ * @returns {string} - Returns the module name
30
+ */
31
+ protected getModuleName(): string;
32
+ /**
33
+ * To destroy the ImageExport.
34
+ *
35
+ * @returns {void}
36
+ * @private
37
+ */
38
+ destroy(): void;
39
+ }
@@ -0,0 +1,194 @@
1
+ import { createElement, Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
2
+ import { Maps } from '../../index';
3
+ import { triggerDownload, getElementByID } from '../utils/helper';
4
+ import { ExportType } from '../utils/enum';
5
+
6
+ /**
7
+ * This module enables the export to Image functionality in maps.
8
+ *
9
+ * @hidden
10
+ */
11
+ export class ImageExport {
12
+
13
+ /**
14
+ * Constructor for Maps
15
+ *
16
+ * @param {Maps} control - Specifies the instance of the map
17
+ */
18
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
19
+ constructor(control: Maps) {
20
+ }
21
+ /**
22
+ * To export the file as image/svg format
23
+ *
24
+ * @param {Maps} maps - Specifies the Maps instance.
25
+ * @param {ExportType} type - Specifies the type of the image file for exporting.
26
+ * @param {string} fileName - Specifies the file name of the image file for exporting.
27
+ * @param {boolean} allowDownload - Specifies whether to download image as a file or not.
28
+ * @returns {Promise<string>} - Specifies the base64 string of the exported image which is returned when the allowDownload is set to false.
29
+ * @private
30
+ */
31
+ public export(maps: Maps, type: ExportType, fileName: string, allowDownload?: boolean): Promise<string> {
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
33
+ const promise: Promise<string> = new Promise((resolve: any, reject: any) => {
34
+ const imageCanvasElement: HTMLCanvasElement = <HTMLCanvasElement>createElement('canvas', {
35
+ id: 'ej2-canvas',
36
+ attrs: {
37
+ 'width': maps.availableSize.width.toString(),
38
+ 'height': maps.availableSize.height.toString()
39
+ }
40
+ });
41
+ const isDownload: boolean = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
42
+ const svgParent: HTMLElement = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
43
+ let svgDataElement: string;
44
+ let tileSvg: Element;
45
+ const svgObject: Element = getElementByID(maps.element.id + '_svg').cloneNode(true) as Element;
46
+ const backgroundElement: HTMLElement = svgObject.childNodes[0] as HTMLElement;
47
+ const backgroundColor: string = backgroundElement.getAttribute('fill');
48
+ if ((maps.theme === 'Tailwind' || maps.theme === 'Tailwind3' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' || maps.theme === 'Fluent2')
49
+ && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
50
+ (svgObject.childNodes[0] as HTMLElement).setAttribute('fill', 'rgba(255,255,255, 1)');
51
+ } else if ((maps.theme === 'TailwindDark' || maps.theme === 'Tailwind3Dark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark' ||
52
+ maps.theme === 'Fluent2Dark' || maps.theme === 'Fluent2HighContrast')
53
+ && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
54
+ (svgObject.childNodes[0] as HTMLElement).setAttribute('fill', 'rgba(0, 0, 0, 1)');
55
+ }
56
+ if (!maps.isTileMap) {
57
+ svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
58
+ svgObject.outerHTML + '</svg>';
59
+ } else {
60
+ tileSvg = getElementByID(maps.element.id + '_Tile_SVG').cloneNode(true) as Element;
61
+ svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
62
+ svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
63
+ }
64
+ const url: string = window.URL.createObjectURL(
65
+ new Blob(
66
+ type === 'SVG' ? [svgDataElement] :
67
+ [(new XMLSerializer()).serializeToString(svgObject)],
68
+ { type: 'image/svg+xml' }
69
+ )
70
+ );
71
+ if (type === 'SVG') {
72
+ if (allowDownload) {
73
+ triggerDownload(
74
+ fileName, type,
75
+ url, isDownload
76
+ );
77
+ } else {
78
+ resolve(null);
79
+ }
80
+ } else {
81
+ const image: HTMLImageElement = new Image();
82
+ const ctxt: CanvasRenderingContext2D = imageCanvasElement.getContext('2d');
83
+ if (!maps.isTileMap) {
84
+ image.onload = (() => {
85
+ ctxt.drawImage(image, 0, 0);
86
+ window.URL.revokeObjectURL(url);
87
+ if (allowDownload) {
88
+ triggerDownload(
89
+ fileName, type, imageCanvasElement.toDataURL('image/png').replace('image/png', 'image/octet-stream'),
90
+ isDownload
91
+ );
92
+ } else {
93
+ if (type === 'PNG') {
94
+ resolve(imageCanvasElement.toDataURL('image/png'));
95
+ } else if (type === 'JPEG') {
96
+ resolve(imageCanvasElement.toDataURL('image/jpeg'));
97
+ }
98
+ }
99
+ });
100
+ image.src = url;
101
+ } else {
102
+ maps.isExportInitialTileMap = true;
103
+ const svgParentElement: HTMLElement = document.getElementById(maps.element.id + '_MapAreaBorder');
104
+ const top: number = parseFloat(svgParentElement.getAttribute('y'));
105
+ const left: number = parseFloat(svgParentElement.getAttribute('x'));
106
+ const imgxHttp: XMLHttpRequest = new XMLHttpRequest();
107
+ const imgTileLength: number = maps.mapLayerPanel.tiles.length;
108
+ for (let i: number = 0; i <= imgTileLength + 1; i++) {
109
+ const tile: HTMLElement = document.getElementById(maps.element.id + '_tile_' + (i - 1));
110
+ const exportTileImg: HTMLImageElement = new Image();
111
+ exportTileImg.crossOrigin = 'Anonymous';
112
+ const background: string = maps.background ? maps.background : ((maps.theme === 'Tailwind' || maps.theme === 'Tailwind3' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) ? '#ffffff' :
113
+ (maps.theme === 'TailwindDark' || maps.theme === 'Tailwind3Dark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent') ? '#000000' : '#ffffff';
114
+ ctxt.fillStyle = background;
115
+ ctxt.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
116
+ ctxt.font = maps.titleSettings.textStyle.size + ' Arial';
117
+ const titleElement: HTMLElement = document.getElementById(maps.element.id + '_Map_title');
118
+ if (!isNullOrUndefined(titleElement)) {
119
+ ctxt.fillStyle = titleElement.getAttribute('fill');
120
+ ctxt.fillText(
121
+ maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')),
122
+ parseFloat(titleElement.getAttribute('y'))
123
+ );
124
+ }
125
+ exportTileImg.onload = (() => {
126
+ if (i === 0 || i === imgTileLength + 1) {
127
+ if (i === 0) {
128
+ ctxt.setTransform(1, 0, 0, 1, 0, 0);
129
+ ctxt.rect(0, top, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
130
+ ctxt.clip();
131
+ } else {
132
+ ctxt.setTransform(1, 0, 0, 1, left, top);
133
+ }
134
+ } else {
135
+ ctxt.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left, parseFloat(tile.style.top) +
136
+ top);
137
+ }
138
+ ctxt.drawImage(exportTileImg, 0, 0);
139
+ if (i === imgTileLength + 1) {
140
+ localStorage.setItem('local-canvasImage', imageCanvasElement.toDataURL('image/png'));
141
+ const localBase64: string = localStorage.getItem('local-canvasImage');
142
+ if (allowDownload) {
143
+ triggerDownload(fileName, type, localBase64, isDownload);
144
+ localStorage.removeItem('local-canvasImage');
145
+ maps.isExportInitialTileMap = false;
146
+ } else {
147
+ maps.isExportInitialTileMap = false;
148
+ if (type === 'PNG') {
149
+ resolve(localBase64);
150
+ } else if (type === 'JPEG') {
151
+ resolve(imageCanvasElement.toDataURL('image/jpeg'));
152
+ }
153
+ }
154
+ }
155
+ });
156
+ if (i === 0 || i === imgTileLength + 1) {
157
+ if (i === 0) {
158
+ exportTileImg.src = url;
159
+ } else {
160
+ setTimeout(() => {
161
+ exportTileImg.src = window.URL.createObjectURL(new Blob(
162
+ [(new XMLSerializer()).serializeToString(tileSvg)],
163
+ { type: 'image/svg+xml' }));
164
+ }, 300);
165
+ }
166
+ } else {
167
+ imgxHttp.open('GET', tile.children[0].getAttribute('src'), true);
168
+ imgxHttp.send();
169
+ exportTileImg.src = tile.children[0].getAttribute('src');
170
+ }
171
+ }
172
+ }
173
+ }
174
+ });
175
+ return promise;
176
+ }
177
+ /**
178
+ * Get module name.
179
+ *
180
+ * @returns {string} - Returns the module name
181
+ */
182
+ protected getModuleName(): string {
183
+ return 'ImageExport';
184
+ }
185
+
186
+ /**
187
+ * To destroy the ImageExport.
188
+ *
189
+ * @returns {void}
190
+ * @private
191
+ */
192
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
193
+ public destroy(): void { }
194
+ }