@syncfusion/ej2-maps 20.4.49 → 21.1.35
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/CHANGELOG.md +4 -20
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +993 -236
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1008 -236
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/maps/layers/bubble.d.ts +2 -0
- package/src/maps/layers/bubble.js +2 -1
- package/src/maps/layers/color-mapping.d.ts +1 -0
- package/src/maps/layers/color-mapping.js +1 -0
- package/src/maps/layers/data-label.d.ts +1 -0
- package/src/maps/layers/data-label.js +9 -4
- package/src/maps/layers/layer-panel.js +1 -0
- package/src/maps/layers/legend.d.ts +2 -0
- package/src/maps/layers/legend.js +2 -0
- package/src/maps/layers/marker.d.ts +5 -0
- package/src/maps/layers/marker.js +42 -3
- package/src/maps/layers/navigation-selected-line.d.ts +1 -0
- package/src/maps/layers/navigation-selected-line.js +1 -0
- package/src/maps/maps-model.d.ts +47 -33
- package/src/maps/maps.d.ts +144 -88
- package/src/maps/maps.js +217 -61
- package/src/maps/model/base-model.d.ts +535 -230
- package/src/maps/model/base.d.ts +540 -263
- package/src/maps/model/base.js +168 -28
- package/src/maps/model/constants.d.ts +12 -0
- package/src/maps/model/constants.js +12 -0
- package/src/maps/model/export-image.d.ts +1 -1
- package/src/maps/model/export-image.js +1 -1
- package/src/maps/model/export-pdf.d.ts +2 -2
- package/src/maps/model/export-pdf.js +2 -2
- package/src/maps/model/interface.d.ts +137 -108
- package/src/maps/model/theme.d.ts +1 -0
- package/src/maps/model/theme.js +1 -0
- package/src/maps/user-interaction/annotation.d.ts +2 -0
- package/src/maps/user-interaction/annotation.js +2 -0
- package/src/maps/user-interaction/highlight.d.ts +1 -0
- package/src/maps/user-interaction/highlight.js +1 -0
- package/src/maps/user-interaction/selection.d.ts +1 -0
- package/src/maps/user-interaction/selection.js +1 -0
- package/src/maps/user-interaction/tooltip.d.ts +16 -0
- package/src/maps/user-interaction/tooltip.js +23 -6
- package/src/maps/user-interaction/zoom.d.ts +99 -3
- package/src/maps/user-interaction/zoom.js +405 -100
- package/src/maps/utils/enum.d.ts +105 -91
- package/src/maps/utils/helper.d.ts +76 -16
- package/src/maps/utils/helper.js +122 -37
- package/.eslintrc.json +0 -259
- package/tslint.json +0 -111
package/src/maps/model/theme.js
CHANGED
|
@@ -8,6 +8,8 @@ export declare class Annotations {
|
|
|
8
8
|
renderAnnotationElements(): void;
|
|
9
9
|
/**
|
|
10
10
|
* To create annotation elements
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
11
13
|
*/
|
|
12
14
|
createAnnotationTemplate(parentElement: HTMLElement, annotation: Annotation, annotationIndex: number): void;
|
|
13
15
|
protected getModuleName(): string;
|
|
@@ -29,6 +29,8 @@ var Annotations = /** @class */ (function () {
|
|
|
29
29
|
// eslint-disable-next-line valid-jsdoc
|
|
30
30
|
/**
|
|
31
31
|
* To create annotation elements
|
|
32
|
+
*
|
|
33
|
+
* @private
|
|
32
34
|
*/
|
|
33
35
|
Annotations.prototype.createAnnotationTemplate = function (parentElement, annotation, annotationIndex) {
|
|
34
36
|
var _this = this;
|
|
@@ -36,6 +36,7 @@ var Highlight = /** @class */ (function () {
|
|
|
36
36
|
// eslint-disable-next-line valid-jsdoc
|
|
37
37
|
/**
|
|
38
38
|
* Public method for highlight module
|
|
39
|
+
* @private
|
|
39
40
|
*/
|
|
40
41
|
Highlight.prototype.addHighlight = function (layerIndex, name, enable) {
|
|
41
42
|
var targetEle = getTargetElement(layerIndex, name, enable, this.maps);
|
|
@@ -33,6 +33,7 @@ export declare class Selection {
|
|
|
33
33
|
selectElement(targetElement: Element, layerIndex: number, data: any, shapeData: any): void;
|
|
34
34
|
/**
|
|
35
35
|
* Public method for selection
|
|
36
|
+
* @private
|
|
36
37
|
*/
|
|
37
38
|
addSelection(layerIndex: number, name: string, enable: boolean): void;
|
|
38
39
|
/**
|
|
@@ -110,6 +110,7 @@ var Selection = /** @class */ (function () {
|
|
|
110
110
|
// eslint-disable-next-line valid-jsdoc
|
|
111
111
|
/**
|
|
112
112
|
* Public method for selection
|
|
113
|
+
* @private
|
|
113
114
|
*/
|
|
114
115
|
Selection.prototype.addSelection = function (layerIndex, name, enable) {
|
|
115
116
|
var targetElement = getTargetElement(layerIndex, name, enable, this.maps);
|
|
@@ -12,8 +12,14 @@ export declare class MapsTooltip {
|
|
|
12
12
|
private isTouch;
|
|
13
13
|
private tooltipId;
|
|
14
14
|
private clearTimeout;
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
15
18
|
tooltipTargetID: string;
|
|
16
19
|
constructor(maps: Maps);
|
|
20
|
+
/**
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
17
23
|
renderTooltip(e: PointerEvent): void;
|
|
18
24
|
/**
|
|
19
25
|
* To get content for the current toolitp
|
|
@@ -24,13 +30,23 @@ export declare class MapsTooltip {
|
|
|
24
30
|
*/
|
|
25
31
|
private setTooltipContent;
|
|
26
32
|
private formatter;
|
|
33
|
+
/**
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
27
36
|
mouseUpHandler(e: PointerEvent): void;
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
28
40
|
removeTooltip(): boolean;
|
|
29
41
|
private clearTooltip;
|
|
30
42
|
/**
|
|
31
43
|
* To bind events for tooltip module
|
|
44
|
+
* @private
|
|
32
45
|
*/
|
|
33
46
|
addEventListener(): void;
|
|
47
|
+
/**
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
34
50
|
removeEventListener(): void;
|
|
35
51
|
/**
|
|
36
52
|
* Get module name.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tooltipRender } from '../index';
|
|
2
2
|
import { Tooltip } from '@syncfusion/ej2-svg-base';
|
|
3
|
-
import { createElement, Browser, isNullOrUndefined, extend, remove } from '@syncfusion/ej2-base';
|
|
3
|
+
import { createElement, Browser, isNullOrUndefined, extend, remove, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
|
|
4
4
|
import { getMousePosition, Internalize, checkPropertyPath, getValueFromObject, formatValue, convertStringToValue } from '../utils/helper';
|
|
5
5
|
import { click } from '../model/constants';
|
|
6
6
|
/**
|
|
@@ -12,6 +12,9 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
12
12
|
this.tooltipId = this.maps.element.id + '_mapsTooltip';
|
|
13
13
|
this.addEventListener();
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
15
18
|
MapsTooltip.prototype.renderTooltip = function (e) {
|
|
16
19
|
var _this = this;
|
|
17
20
|
var pageX;
|
|
@@ -33,6 +36,10 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
33
36
|
pageY = e.pageY;
|
|
34
37
|
target = e.target;
|
|
35
38
|
}
|
|
39
|
+
if (this.maps.isDevice) {
|
|
40
|
+
clearTimeout(this.clearTimeout);
|
|
41
|
+
this.clearTimeout = setTimeout(this.removeTooltip.bind(this), 2000);
|
|
42
|
+
}
|
|
36
43
|
var option;
|
|
37
44
|
var currentData = '';
|
|
38
45
|
var targetId = target.id;
|
|
@@ -48,7 +55,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
48
55
|
this.tooltipTargetID = targetId;
|
|
49
56
|
var istooltipRender = (targetId.indexOf('_shapeIndex_') > -1)
|
|
50
57
|
|| (targetId.indexOf('_MarkerIndex_') > -1) || (targetId.indexOf('_BubbleIndex_') > -1);
|
|
51
|
-
if (istooltipRender) {
|
|
58
|
+
if (istooltipRender && this.maps.markerDragArgument === null) {
|
|
52
59
|
if (targetId.indexOf('_shapeIndex_') > -1) {
|
|
53
60
|
option = layer.tooltipSettings;
|
|
54
61
|
var shape = parseInt(targetId.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
@@ -200,8 +207,8 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
200
207
|
header: '',
|
|
201
208
|
data: option['data'],
|
|
202
209
|
template: option['template'],
|
|
203
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
204
|
-
[currentData.toString()],
|
|
210
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [SanitizeHtmlHelper.sanitize(tooltipArgs.content.toString())] :
|
|
211
|
+
[SanitizeHtmlHelper.sanitize(currentData.toString())],
|
|
205
212
|
shapes: [],
|
|
206
213
|
location: option['location'],
|
|
207
214
|
palette: [markerFill],
|
|
@@ -217,8 +224,8 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
217
224
|
header: '',
|
|
218
225
|
data: tooltipArgs.options['data'],
|
|
219
226
|
template: tooltipArgs.options['template'],
|
|
220
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
221
|
-
[currentData.toString()],
|
|
227
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [SanitizeHtmlHelper.sanitize(tooltipArgs.content.toString())] :
|
|
228
|
+
[SanitizeHtmlHelper.sanitize(currentData.toString())],
|
|
222
229
|
shapes: [],
|
|
223
230
|
location: tooltipArgs.options['location'],
|
|
224
231
|
palette: [markerFill],
|
|
@@ -308,6 +315,9 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
308
315
|
}
|
|
309
316
|
return format;
|
|
310
317
|
};
|
|
318
|
+
/**
|
|
319
|
+
* @private
|
|
320
|
+
*/
|
|
311
321
|
MapsTooltip.prototype.mouseUpHandler = function (e) {
|
|
312
322
|
this.renderTooltip(e);
|
|
313
323
|
if (this.maps.tooltipDisplayMode === 'MouseMove') {
|
|
@@ -315,6 +325,9 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
315
325
|
this.clearTimeout = setTimeout(this.removeTooltip.bind(this), 2000);
|
|
316
326
|
}
|
|
317
327
|
};
|
|
328
|
+
/**
|
|
329
|
+
* @private
|
|
330
|
+
*/
|
|
318
331
|
MapsTooltip.prototype.removeTooltip = function () {
|
|
319
332
|
var isTooltipRemoved = false;
|
|
320
333
|
if (document.getElementsByClassName('EJ2-maps-Tooltip').length > 0) {
|
|
@@ -333,6 +346,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
333
346
|
// eslint-disable-next-line valid-jsdoc
|
|
334
347
|
/**
|
|
335
348
|
* To bind events for tooltip module
|
|
349
|
+
* @private
|
|
336
350
|
*/
|
|
337
351
|
MapsTooltip.prototype.addEventListener = function () {
|
|
338
352
|
if (this.maps.isDestroyed) {
|
|
@@ -350,6 +364,9 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
350
364
|
this.maps.on(Browser.touchCancelEvent, this.removeTooltip, this);
|
|
351
365
|
this.maps.element.addEventListener('contextmenu', this.removeTooltip);
|
|
352
366
|
};
|
|
367
|
+
/**
|
|
368
|
+
* @private
|
|
369
|
+
*/
|
|
353
370
|
MapsTooltip.prototype.removeEventListener = function () {
|
|
354
371
|
if (this.maps) {
|
|
355
372
|
if (this.maps.isDestroyed) {
|
|
@@ -7,50 +7,75 @@ import { PanDirection } from '../utils/enum';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class Zoom {
|
|
9
9
|
private maps;
|
|
10
|
+
/** @private */
|
|
10
11
|
toolBarGroup: Element;
|
|
11
12
|
private currentToolbarEle;
|
|
13
|
+
/** @private */
|
|
12
14
|
zoomingRect: Rect;
|
|
15
|
+
/** @private */
|
|
13
16
|
selectionColor: string;
|
|
14
17
|
private fillColor;
|
|
15
18
|
private zoomElements;
|
|
16
19
|
private panElements;
|
|
20
|
+
/** @private */
|
|
17
21
|
isPanning: boolean;
|
|
22
|
+
/** @private */
|
|
18
23
|
mouseEnter: boolean;
|
|
24
|
+
/** @private */
|
|
19
25
|
baseTranslatePoint: Point;
|
|
20
26
|
private wheelEvent;
|
|
21
27
|
private cancelEvent;
|
|
28
|
+
/** @private */
|
|
22
29
|
currentScale: number;
|
|
30
|
+
/** @private */
|
|
23
31
|
isTouch: boolean;
|
|
32
|
+
/** @private */
|
|
24
33
|
rectZoomingStart: boolean;
|
|
34
|
+
/** @private */
|
|
25
35
|
touchStartList: ITouches[] | TouchList;
|
|
36
|
+
/** @private */
|
|
26
37
|
touchMoveList: ITouches[] | TouchList;
|
|
38
|
+
/** @private */
|
|
27
39
|
previousTouchMoveList: ITouches[] | TouchList;
|
|
40
|
+
/** @private */
|
|
28
41
|
mouseDownPoints: Point;
|
|
42
|
+
/** @private */
|
|
29
43
|
mouseMovePoints: Point;
|
|
44
|
+
/** @private */
|
|
30
45
|
isDragZoom: boolean;
|
|
46
|
+
/** @private */
|
|
31
47
|
currentLayer: LayerSettings;
|
|
32
48
|
private panColor;
|
|
49
|
+
private clearTimeout;
|
|
50
|
+
/** @private */
|
|
33
51
|
zoomColor: string;
|
|
52
|
+
/** @private */
|
|
34
53
|
browserName: string;
|
|
54
|
+
/** @private */
|
|
35
55
|
isPointer: Boolean;
|
|
36
56
|
private handled;
|
|
37
57
|
private fingers;
|
|
58
|
+
/** @private */
|
|
38
59
|
firstMove: boolean;
|
|
60
|
+
private isPan;
|
|
61
|
+
private isZoomFinal;
|
|
62
|
+
private isZoomSelection;
|
|
39
63
|
private interaction;
|
|
40
64
|
private lastScale;
|
|
41
65
|
private pinchFactor;
|
|
42
66
|
private startTouches;
|
|
43
67
|
private zoomshapewidth;
|
|
44
68
|
private index;
|
|
69
|
+
/** @private */
|
|
45
70
|
intersect: any[];
|
|
46
71
|
private templateCount;
|
|
47
72
|
private distanceX;
|
|
48
73
|
private distanceY;
|
|
74
|
+
/** @private */
|
|
49
75
|
mouseDownLatLong: any;
|
|
76
|
+
/** @private */
|
|
50
77
|
mouseMoveLatLong: any;
|
|
51
|
-
/**
|
|
52
|
-
* @private
|
|
53
|
-
*/
|
|
78
|
+
/** @private */
|
|
54
79
|
isSingleClick: boolean;
|
|
55
80
|
/** @private */
|
|
56
81
|
layerCollectionEle: Element;
|
|
@@ -62,15 +87,25 @@ export declare class Zoom {
|
|
|
62
87
|
* @param {number} newZoomFactor - Specifies the zoom factor.
|
|
63
88
|
* @param {string} type - Specifies the type.
|
|
64
89
|
* @returns {void}
|
|
90
|
+
* @private
|
|
65
91
|
*/
|
|
66
92
|
performZooming(position: Point, newZoomFactor: number, type: string): void;
|
|
67
93
|
private calculateInitalZoomTranslatePoint;
|
|
68
94
|
private triggerZoomEvent;
|
|
69
95
|
private getTileTranslatePosition;
|
|
96
|
+
/**
|
|
97
|
+
* @private
|
|
98
|
+
*/
|
|
70
99
|
performRectZooming(): void;
|
|
71
100
|
private setInteraction;
|
|
72
101
|
private updateInteraction;
|
|
102
|
+
/**
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
73
105
|
performPinchZooming(e: PointerEvent | TouchEvent): void;
|
|
106
|
+
/**
|
|
107
|
+
* @private
|
|
108
|
+
*/
|
|
74
109
|
drawZoomRectangle(): void;
|
|
75
110
|
/**
|
|
76
111
|
* To animate the zooming process
|
|
@@ -83,6 +118,9 @@ export declare class Zoom {
|
|
|
83
118
|
* @returns {void}
|
|
84
119
|
*/
|
|
85
120
|
private animateTransform;
|
|
121
|
+
/**
|
|
122
|
+
* @private
|
|
123
|
+
*/
|
|
86
124
|
applyTransform(maps: Maps, animate?: boolean): void;
|
|
87
125
|
private markerTranslates;
|
|
88
126
|
/**
|
|
@@ -109,8 +147,17 @@ export declare class Zoom {
|
|
|
109
147
|
*/
|
|
110
148
|
panning(direction: PanDirection, xDifference: number, yDifference: number, mouseLocation?: PointerEvent | TouchEvent | KeyboardEvent): void;
|
|
111
149
|
private toAlignSublayer;
|
|
150
|
+
/**
|
|
151
|
+
* @private
|
|
152
|
+
*/
|
|
112
153
|
toolBarZooming(zoomFactor: number, type: string): void;
|
|
154
|
+
/**
|
|
155
|
+
* @private
|
|
156
|
+
*/
|
|
113
157
|
createZoomingToolbars(): void;
|
|
158
|
+
/**
|
|
159
|
+
* @private
|
|
160
|
+
*/
|
|
114
161
|
performToolBarAction(e: PointerEvent): void;
|
|
115
162
|
/**
|
|
116
163
|
* @param {string} type - Specifies the type.
|
|
@@ -120,9 +167,30 @@ export declare class Zoom {
|
|
|
120
167
|
performZoomingByToolBar(type: string): void;
|
|
121
168
|
private panningStyle;
|
|
122
169
|
private applySelection;
|
|
170
|
+
/**
|
|
171
|
+
* @private
|
|
172
|
+
*/
|
|
123
173
|
showTooltip(e: PointerEvent): void;
|
|
174
|
+
/**
|
|
175
|
+
* @private
|
|
176
|
+
*/
|
|
124
177
|
removeTooltip(): void;
|
|
178
|
+
/**
|
|
179
|
+
* @private
|
|
180
|
+
*/
|
|
125
181
|
alignToolBar(): void;
|
|
182
|
+
/**
|
|
183
|
+
* @private
|
|
184
|
+
*/
|
|
185
|
+
removeToolbarOpacity(factor: number, id: string): void;
|
|
186
|
+
private setOpacity;
|
|
187
|
+
private removeZoomOpacity;
|
|
188
|
+
/**
|
|
189
|
+
* @private
|
|
190
|
+
*/
|
|
191
|
+
removeToolbarClass(zoomClassStyle: string, zoomInClassStyle: string, zoomOutClassStyle: string, panClassStyle: string, resetClassStyle: string): void;
|
|
192
|
+
private removePanColor;
|
|
193
|
+
private removeZoomColor;
|
|
126
194
|
/**
|
|
127
195
|
* To bind events.
|
|
128
196
|
*
|
|
@@ -132,21 +200,49 @@ export declare class Zoom {
|
|
|
132
200
|
* @private
|
|
133
201
|
*/
|
|
134
202
|
wireEvents(element: Element, process: any): void;
|
|
203
|
+
/**
|
|
204
|
+
* @private
|
|
205
|
+
*/
|
|
135
206
|
mapMouseWheel(e: WheelEvent): void;
|
|
207
|
+
/**
|
|
208
|
+
* @private
|
|
209
|
+
*/
|
|
136
210
|
doubleClick(e: PointerEvent): void;
|
|
211
|
+
/**
|
|
212
|
+
* @private
|
|
213
|
+
*/
|
|
137
214
|
mouseDownHandler(e: PointerEvent | TouchEvent): void;
|
|
215
|
+
/**
|
|
216
|
+
* @private
|
|
217
|
+
*/
|
|
138
218
|
mouseMoveHandler(e: PointerEvent | TouchEvent): void;
|
|
219
|
+
/**
|
|
220
|
+
* @private
|
|
221
|
+
*/
|
|
139
222
|
mouseUpHandler(e: PointerEvent | TouchEvent): void;
|
|
223
|
+
/**
|
|
224
|
+
* @private
|
|
225
|
+
*/
|
|
140
226
|
mouseCancelHandler(e: PointerEvent): void;
|
|
141
227
|
/**
|
|
142
228
|
* To handle the click event for maps.
|
|
143
229
|
*
|
|
144
230
|
* @param {PointerEvent} e - Specifies the pointer event.
|
|
145
231
|
* @returns {void}
|
|
232
|
+
* @private
|
|
146
233
|
*/
|
|
147
234
|
click(e: PointerEvent): void;
|
|
235
|
+
/**
|
|
236
|
+
* @private
|
|
237
|
+
*/
|
|
148
238
|
getMousePosition(pageX: number, pageY: number): Point;
|
|
239
|
+
/**
|
|
240
|
+
* @private
|
|
241
|
+
*/
|
|
149
242
|
addEventListener(): void;
|
|
243
|
+
/**
|
|
244
|
+
* @private
|
|
245
|
+
*/
|
|
150
246
|
removeEventListener(): void;
|
|
151
247
|
/**
|
|
152
248
|
* Get module name.
|