@syncfusion/ej2-maps 30.2.4 → 31.1.17
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.
- package/.eslintrc.json +263 -0
- package/dist/ej2-maps.min.js +1 -1
- package/dist/ej2-maps.umd.min.js +1 -1
- package/dist/global/ej2-maps.min.js +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/index.d.ts +4 -0
- package/dist/ts/index.ts +4 -0
- package/dist/ts/maps/index.d.ts +28 -0
- package/dist/ts/maps/index.ts +28 -0
- package/dist/ts/maps/layers/bing-map.d.ts +21 -0
- package/dist/ts/maps/layers/bing-map.ts +51 -0
- package/dist/ts/maps/layers/bubble.d.ts +77 -0
- package/dist/ts/maps/layers/bubble.ts +304 -0
- package/dist/ts/maps/layers/color-mapping.d.ts +36 -0
- package/dist/ts/maps/layers/color-mapping.ts +230 -0
- package/dist/ts/maps/layers/data-label.d.ts +45 -0
- package/dist/ts/maps/layers/data-label.ts +457 -0
- package/dist/ts/maps/layers/layer-panel.d.ts +144 -0
- package/dist/ts/maps/layers/layer-panel.ts +1455 -0
- package/dist/ts/maps/layers/legend.d.ts +173 -0
- package/dist/ts/maps/layers/legend.ts +2465 -0
- package/dist/ts/maps/layers/marker.d.ts +105 -0
- package/dist/ts/maps/layers/marker.ts +632 -0
- package/dist/ts/maps/layers/navigation-selected-line.d.ts +33 -0
- package/dist/ts/maps/layers/navigation-selected-line.ts +171 -0
- package/dist/ts/maps/layers/polygon.d.ts +30 -0
- package/dist/ts/maps/layers/polygon.ts +68 -0
- package/dist/ts/maps/maps-model.d.ts +409 -0
- package/dist/ts/maps/maps.d.ts +1247 -0
- package/dist/ts/maps/maps.ts +3416 -0
- package/dist/ts/maps/model/base-model.d.ts +2107 -0
- package/dist/ts/maps/model/base.d.ts +1840 -0
- package/dist/ts/maps/model/base.ts +2257 -0
- package/dist/ts/maps/model/constants.d.ts +225 -0
- package/dist/ts/maps/model/constants.ts +226 -0
- package/dist/ts/maps/model/export-image.d.ts +39 -0
- package/dist/ts/maps/model/export-image.ts +194 -0
- package/dist/ts/maps/model/export-pdf.d.ts +40 -0
- package/dist/ts/maps/model/export-pdf.ts +183 -0
- package/dist/ts/maps/model/interface.d.ts +892 -0
- package/dist/ts/maps/model/interface.ts +929 -0
- package/dist/ts/maps/model/print.d.ts +45 -0
- package/dist/ts/maps/model/print.ts +125 -0
- package/dist/ts/maps/model/theme.d.ts +98 -0
- package/dist/ts/maps/model/theme.ts +919 -0
- package/dist/ts/maps/user-interaction/annotation.d.ts +27 -0
- package/dist/ts/maps/user-interaction/annotation.ts +133 -0
- package/dist/ts/maps/user-interaction/highlight.d.ts +63 -0
- package/dist/ts/maps/user-interaction/highlight.ts +272 -0
- package/dist/ts/maps/user-interaction/selection.d.ts +85 -0
- package/dist/ts/maps/user-interaction/selection.ts +342 -0
- package/dist/ts/maps/user-interaction/tooltip.d.ts +78 -0
- package/dist/ts/maps/user-interaction/tooltip.ts +500 -0
- package/dist/ts/maps/user-interaction/zoom.d.ts +334 -0
- package/dist/ts/maps/user-interaction/zoom.ts +2523 -0
- package/dist/ts/maps/utils/enum.d.ts +328 -0
- package/dist/ts/maps/utils/enum.ts +343 -0
- package/dist/ts/maps/utils/helper.d.ts +1318 -0
- package/dist/ts/maps/utils/helper.ts +3811 -0
- package/package.json +53 -18
- package/tslint.json +111 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Maps } from '../../index';
|
|
2
|
+
/**
|
|
3
|
+
* This module enables the print functionality in maps.
|
|
4
|
+
*
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare class Print {
|
|
8
|
+
/**
|
|
9
|
+
* Constructor for Maps.
|
|
10
|
+
*
|
|
11
|
+
* @param {Maps} control - Specifies the instance of the Maps
|
|
12
|
+
*/
|
|
13
|
+
constructor(control: Maps);
|
|
14
|
+
/**
|
|
15
|
+
* To print the Maps.
|
|
16
|
+
*
|
|
17
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
18
|
+
* @param {string[] | string | Element} elements - Specifies the element of the Maps
|
|
19
|
+
* @returns {void}
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
print(maps: Maps, elements?: string[] | string | Element): void;
|
|
23
|
+
/**
|
|
24
|
+
* To get the html string of the Maps.
|
|
25
|
+
*
|
|
26
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
27
|
+
* @param {string[] | string | Element} elements - Specifies the html element
|
|
28
|
+
* @returns {Element} - Returns the div element
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
private getHTMLContent;
|
|
32
|
+
/**
|
|
33
|
+
* Get module name.
|
|
34
|
+
*
|
|
35
|
+
* @returns {string} Returns the module name
|
|
36
|
+
*/
|
|
37
|
+
protected getModuleName(): string;
|
|
38
|
+
/**
|
|
39
|
+
* To destroy the print.
|
|
40
|
+
*
|
|
41
|
+
* @returns {void}
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
destroy(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { print as printFunction, createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
|
+
import { Maps } from '../../index';
|
|
3
|
+
import { getElement } from '../utils/helper';
|
|
4
|
+
import { IPrintEventArgs } from '../model/interface';
|
|
5
|
+
import { beforePrint } from '../model/constants';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This module enables the print functionality in maps.
|
|
9
|
+
*
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export class Print {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Constructor for Maps.
|
|
16
|
+
*
|
|
17
|
+
* @param {Maps} control - Specifies the instance of the Maps
|
|
18
|
+
*/
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
20
|
+
constructor(control: Maps) { }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* To print the Maps.
|
|
24
|
+
*
|
|
25
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
26
|
+
* @param {string[] | string | Element} elements - Specifies the element of the Maps
|
|
27
|
+
* @returns {void}
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
public print(maps: Maps, elements?: string[] | string | Element): void {
|
|
31
|
+
const printWindow: Window = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
|
|
32
|
+
printWindow.moveTo(0, 0);
|
|
33
|
+
printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
34
|
+
const argsData: IPrintEventArgs = {
|
|
35
|
+
cancel: false, htmlContent: this.getHTMLContent(maps, elements), name: beforePrint
|
|
36
|
+
};
|
|
37
|
+
//eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
|
+
maps.trigger('beforePrint', argsData, (beforePrintArgs: IPrintEventArgs) => {
|
|
39
|
+
if (!argsData.cancel) {
|
|
40
|
+
printFunction(argsData.htmlContent, printWindow);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* To get the html string of the Maps.
|
|
47
|
+
*
|
|
48
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
49
|
+
* @param {string[] | string | Element} elements - Specifies the html element
|
|
50
|
+
* @returns {Element} - Returns the div element
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
53
|
+
private getHTMLContent(maps: Maps, elements?: string[] | string | Element): Element {
|
|
54
|
+
const div: Element = createElement('div');
|
|
55
|
+
const divElement: Element = maps.element.cloneNode(true) as Element;
|
|
56
|
+
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
let backgroundElement: HTMLElement = (!maps.isTileMap ? divElement.getElementsByTagName('svg')[0] as any : divElement.getElementsByTagName('svg')[1] as any) as HTMLElement;
|
|
58
|
+
if (!isNullOrUndefined(backgroundElement)) {
|
|
59
|
+
backgroundElement = backgroundElement.childNodes[0] as HTMLElement;
|
|
60
|
+
if (!isNullOrUndefined(backgroundElement)) {
|
|
61
|
+
const backgroundColor: string = backgroundElement.getAttribute('fill');
|
|
62
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Tailwind3' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
63
|
+
maps.theme === 'Fluent2')
|
|
64
|
+
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
65
|
+
(backgroundElement as HTMLElement).setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
66
|
+
} else if ((maps.theme === 'TailwindDark' || maps.theme === 'Tailwind3Dark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark' ||
|
|
67
|
+
maps.theme === 'Fluent2Dark' || maps.theme === 'Fluent2HighContrast')
|
|
68
|
+
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
69
|
+
(backgroundElement as HTMLElement).setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (maps.isTileMap) {
|
|
74
|
+
for (let i: number = 0; i < divElement.childElementCount; i++) {
|
|
75
|
+
if (divElement.children[i as number].id === maps.element.id + '_tile_parent') {
|
|
76
|
+
(divElement.children[i as number] as HTMLElement).style.removeProperty('height');
|
|
77
|
+
(divElement.children[i as number] as HTMLElement).style.removeProperty('width');
|
|
78
|
+
(divElement.children[i as number] as HTMLElement).style.removeProperty('top');
|
|
79
|
+
(divElement.children[i as number] as HTMLElement).style.removeProperty('left');
|
|
80
|
+
(divElement.children[i as number] as HTMLElement).style.removeProperty('right');
|
|
81
|
+
(divElement.children[i as number] as HTMLElement).style.removeProperty('overflow');
|
|
82
|
+
const svgElement: HTMLElement = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
83
|
+
(divElement.children[i as number].children[0] as HTMLElement).style.overflow = 'hidden';
|
|
84
|
+
(divElement.children[i as number].children[0] as HTMLElement).style.position = 'absolute';
|
|
85
|
+
(divElement.children[i as number].children[0] as HTMLElement).style.height = svgElement.style.height;
|
|
86
|
+
(divElement.children[i as number].children[0] as HTMLElement).style.width = svgElement.style.width;
|
|
87
|
+
(divElement.children[i as number].children[0] as HTMLElement).style.left = svgElement.style.left;
|
|
88
|
+
(divElement.children[i as number].children[0] as HTMLElement).style.top = svgElement.style.top;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (elements) {
|
|
94
|
+
if (elements instanceof Array) {
|
|
95
|
+
Array.prototype.forEach.call(elements, (value: string) => {
|
|
96
|
+
div.appendChild(getElement(value).cloneNode(true) as Element);
|
|
97
|
+
});
|
|
98
|
+
} else if (elements instanceof Element) {
|
|
99
|
+
div.appendChild(elements.cloneNode(true) as Element);
|
|
100
|
+
} else {
|
|
101
|
+
div.appendChild(getElement(elements).cloneNode(true) as Element);
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
div.appendChild(divElement);
|
|
105
|
+
}
|
|
106
|
+
return div;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get module name.
|
|
110
|
+
*
|
|
111
|
+
* @returns {string} Returns the module name
|
|
112
|
+
*/
|
|
113
|
+
protected getModuleName(): string {
|
|
114
|
+
return 'Print';
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* To destroy the print.
|
|
119
|
+
*
|
|
120
|
+
* @returns {void}
|
|
121
|
+
* @private
|
|
122
|
+
*/
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
124
|
+
public destroy(): void { }
|
|
125
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps Themes doc
|
|
3
|
+
*/
|
|
4
|
+
import { IFontMapping, MapsTheme } from '../index';
|
|
5
|
+
import { IThemeStyle } from './interface';
|
|
6
|
+
/**
|
|
7
|
+
* Specifies Maps Themes
|
|
8
|
+
*/
|
|
9
|
+
export declare namespace Theme {
|
|
10
|
+
/** @private */
|
|
11
|
+
const mapsTitleFont: IFontMapping;
|
|
12
|
+
/** @private */
|
|
13
|
+
const mapsSubTitleFont: IFontMapping;
|
|
14
|
+
/** @private */
|
|
15
|
+
const tooltipLabelFont: IFontMapping;
|
|
16
|
+
/** @private */
|
|
17
|
+
const legendTitleFont: IFontMapping;
|
|
18
|
+
/** @private */
|
|
19
|
+
const legendLabelFont: IFontMapping;
|
|
20
|
+
/** @private */
|
|
21
|
+
const dataLabelFont: IFontMapping;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace FabricTheme {
|
|
24
|
+
/** @private */
|
|
25
|
+
const mapsTitleFont: IFontMapping;
|
|
26
|
+
/** @private */
|
|
27
|
+
const mapsSubTitleFont: IFontMapping;
|
|
28
|
+
/** @private */
|
|
29
|
+
const tooltipLabelFont: IFontMapping;
|
|
30
|
+
/** @private */
|
|
31
|
+
const legendTitleFont: IFontMapping;
|
|
32
|
+
/** @private */
|
|
33
|
+
const legendLabelFont: IFontMapping;
|
|
34
|
+
/** @private */
|
|
35
|
+
const dataLabelFont: IFontMapping;
|
|
36
|
+
}
|
|
37
|
+
export declare namespace BootstrapTheme {
|
|
38
|
+
/** @private */
|
|
39
|
+
const mapsTitleFont: IFontMapping;
|
|
40
|
+
/** @private */
|
|
41
|
+
const mapsSubTitleFont: IFontMapping;
|
|
42
|
+
/** @private */
|
|
43
|
+
const tooltipLabelFont: IFontMapping;
|
|
44
|
+
/** @private */
|
|
45
|
+
const legendTitleFont: IFontMapping;
|
|
46
|
+
/** @private */
|
|
47
|
+
const legendLabelFont: IFontMapping;
|
|
48
|
+
/** @private */
|
|
49
|
+
const dataLabelFont: IFontMapping;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Internal use of Method to getting colors based on themes.
|
|
53
|
+
*
|
|
54
|
+
* @private
|
|
55
|
+
* @param {MapsTheme} theme Specifies the theme of the maps
|
|
56
|
+
* @returns {string[]} Returns the shape color
|
|
57
|
+
*/
|
|
58
|
+
export declare function getShapeColor(theme: MapsTheme): string[];
|
|
59
|
+
/**
|
|
60
|
+
* HighContrast Theme configuration
|
|
61
|
+
*/
|
|
62
|
+
export declare namespace HighContrastTheme {
|
|
63
|
+
/** @private */
|
|
64
|
+
const mapsTitleFont: IFontMapping;
|
|
65
|
+
/** @private */
|
|
66
|
+
const mapsSubTitleFont: IFontMapping;
|
|
67
|
+
/** @private */
|
|
68
|
+
const tooltipLabelFont: IFontMapping;
|
|
69
|
+
/** @private */
|
|
70
|
+
const legendTitleFont: IFontMapping;
|
|
71
|
+
/** @private */
|
|
72
|
+
const legendLabelFont: IFontMapping;
|
|
73
|
+
/** @private */
|
|
74
|
+
const dataLabelFont: IFontMapping;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Dark Theme configuration
|
|
78
|
+
*/
|
|
79
|
+
export declare namespace DarkTheme {
|
|
80
|
+
/** @private */
|
|
81
|
+
const mapsTitleFont: IFontMapping;
|
|
82
|
+
/** @private */
|
|
83
|
+
const mapsSubTitleFont: IFontMapping;
|
|
84
|
+
/** @private */
|
|
85
|
+
const tooltipLabelFont: IFontMapping;
|
|
86
|
+
/** @private */
|
|
87
|
+
const legendTitleFont: IFontMapping;
|
|
88
|
+
/** @private */
|
|
89
|
+
const legendLabelFont: IFontMapping;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Method to get the theme style.
|
|
93
|
+
*
|
|
94
|
+
* @param {MapsTheme} theme - Specifies the theme.
|
|
95
|
+
* @returns {IThemeStyle} - Returns the theme style.
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
export declare function getThemeStyle(theme: MapsTheme): IThemeStyle;
|