@syncfusion/ej2-maps 25.2.4 → 26.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/.eslintrc.json +3 -2
- 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 +1328 -1138
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1375 -1180
- 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/bing-map.d.ts +2 -2
- package/src/maps/layers/bubble.d.ts +3 -4
- package/src/maps/layers/bubble.js +3 -4
- package/src/maps/layers/color-mapping.d.ts +2 -2
- package/src/maps/layers/color-mapping.js +2 -2
- package/src/maps/layers/data-label.d.ts +1 -1
- package/src/maps/layers/data-label.js +6 -6
- package/src/maps/layers/layer-panel.d.ts +7 -7
- package/src/maps/layers/layer-panel.js +129 -193
- package/src/maps/layers/legend.d.ts +9 -0
- package/src/maps/layers/legend.js +147 -55
- package/src/maps/layers/marker.d.ts +8 -8
- package/src/maps/layers/marker.js +109 -105
- package/src/maps/layers/navigation-selected-line.d.ts +1 -1
- package/src/maps/layers/navigation-selected-line.js +2 -2
- package/src/maps/layers/polygon.d.ts +1 -1
- package/src/maps/layers/polygon.js +10 -7
- package/src/maps/maps.d.ts +24 -26
- package/src/maps/maps.js +39 -46
- package/src/maps/model/base-model.d.ts +20 -93
- package/src/maps/model/base.d.ts +19 -83
- package/src/maps/model/base.js +13 -40
- package/src/maps/model/constants.d.ts +0 -4
- package/src/maps/model/constants.js +0 -4
- package/src/maps/model/export-image.js +5 -2
- package/src/maps/model/export-pdf.js +5 -2
- package/src/maps/model/interface.d.ts +14 -1
- package/src/maps/model/interface.js +0 -1
- package/src/maps/model/print.d.ts +3 -3
- package/src/maps/model/print.js +8 -5
- package/src/maps/model/theme.d.ts +1 -1
- package/src/maps/model/theme.js +190 -15
- package/src/maps/user-interaction/annotation.d.ts +1 -2
- package/src/maps/user-interaction/annotation.js +1 -2
- package/src/maps/user-interaction/highlight.d.ts +4 -4
- package/src/maps/user-interaction/highlight.js +4 -4
- package/src/maps/user-interaction/selection.d.ts +5 -5
- package/src/maps/user-interaction/selection.js +5 -5
- package/src/maps/user-interaction/tooltip.d.ts +6 -6
- package/src/maps/user-interaction/tooltip.js +30 -13
- package/src/maps/user-interaction/zoom.d.ts +6 -4
- package/src/maps/user-interaction/zoom.js +50 -50
- package/src/maps/utils/enum.d.ts +7 -53
- package/src/maps/utils/helper.d.ts +87 -72
- package/src/maps/utils/helper.js +130 -102
- package/CHANGELOG.md +0 -632
|
@@ -7,13 +7,12 @@ export declare class Annotations {
|
|
|
7
7
|
constructor(map: Maps);
|
|
8
8
|
renderAnnotationElements(): void;
|
|
9
9
|
/**
|
|
10
|
-
* To create annotation elements
|
|
10
|
+
* To create annotation elements.
|
|
11
11
|
*
|
|
12
12
|
* @param {HTMLElement} parentElement - Specifies the parent element in the map.
|
|
13
13
|
* @param {Annotation} annotation - Specifies the options for customizing the annotation element in maps.
|
|
14
14
|
* @param {number} annotationIndex - Specifies the index of the annotation.
|
|
15
15
|
* @returns {void}
|
|
16
|
-
*
|
|
17
16
|
* @private
|
|
18
17
|
*/
|
|
19
18
|
createAnnotationTemplate(parentElement: HTMLElement, annotation: Annotation, annotationIndex: number): void;
|
|
@@ -27,13 +27,12 @@ var Annotations = /** @class */ (function () {
|
|
|
27
27
|
this.map.renderReactTemplates();
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
|
-
* To create annotation elements
|
|
30
|
+
* To create annotation elements.
|
|
31
31
|
*
|
|
32
32
|
* @param {HTMLElement} parentElement - Specifies the parent element in the map.
|
|
33
33
|
* @param {Annotation} annotation - Specifies the options for customizing the annotation element in maps.
|
|
34
34
|
* @param {number} annotationIndex - Specifies the index of the annotation.
|
|
35
35
|
* @returns {void}
|
|
36
|
-
*
|
|
37
36
|
* @private
|
|
38
37
|
*/
|
|
39
38
|
Annotations.prototype.createAnnotationTemplate = function (parentElement, annotation, annotationIndex) {
|
|
@@ -11,19 +11,19 @@ export declare class Highlight {
|
|
|
11
11
|
highlightSettings: HighlightSettingsModel;
|
|
12
12
|
constructor(maps: Maps);
|
|
13
13
|
/**
|
|
14
|
-
* To bind events for highlight module
|
|
14
|
+
* To bind events for highlight module.
|
|
15
15
|
*
|
|
16
16
|
* @returns {void}
|
|
17
17
|
*/
|
|
18
18
|
private addEventListener;
|
|
19
19
|
/**
|
|
20
|
-
* To unbind events for highlight module
|
|
20
|
+
* To unbind events for highlight module.
|
|
21
21
|
*
|
|
22
22
|
* @returns {void}
|
|
23
23
|
*/
|
|
24
24
|
private removeEventListener;
|
|
25
25
|
/**
|
|
26
|
-
* Public method for highlight module
|
|
26
|
+
* Public method for highlight module.
|
|
27
27
|
*
|
|
28
28
|
* @param {number} layerIndex - Specifies the index of the layer.
|
|
29
29
|
* @param {string} name - Specifies the name.
|
|
@@ -34,7 +34,7 @@ export declare class Highlight {
|
|
|
34
34
|
addHighlight(layerIndex: number, name: string, enable: boolean): void;
|
|
35
35
|
private mouseMove;
|
|
36
36
|
/**
|
|
37
|
-
* Handles the highlighting events in map
|
|
37
|
+
* Handles the highlighting events in map.
|
|
38
38
|
*
|
|
39
39
|
* @param {Element} targetElement - Specifies the target element.
|
|
40
40
|
* @param {number} layerIndex - Specifies the index of the layer.
|
|
@@ -10,7 +10,7 @@ var Highlight = /** @class */ (function () {
|
|
|
10
10
|
this.addEventListener();
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* To bind events for highlight module
|
|
13
|
+
* To bind events for highlight module.
|
|
14
14
|
*
|
|
15
15
|
* @returns {void}
|
|
16
16
|
*/
|
|
@@ -22,7 +22,7 @@ var Highlight = /** @class */ (function () {
|
|
|
22
22
|
this.maps.on(Browser.touchStartEvent, this.mouseMove, this);
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* To unbind events for highlight module
|
|
25
|
+
* To unbind events for highlight module.
|
|
26
26
|
*
|
|
27
27
|
* @returns {void}
|
|
28
28
|
*/
|
|
@@ -34,7 +34,7 @@ var Highlight = /** @class */ (function () {
|
|
|
34
34
|
this.maps.off(Browser.touchStartEvent, this.mouseMove);
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* Public method for highlight module
|
|
37
|
+
* Public method for highlight module.
|
|
38
38
|
*
|
|
39
39
|
* @param {number} layerIndex - Specifies the index of the layer.
|
|
40
40
|
* @param {string} name - Specifies the name.
|
|
@@ -146,7 +146,7 @@ var Highlight = /** @class */ (function () {
|
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
/**
|
|
149
|
-
* Handles the highlighting events in map
|
|
149
|
+
* Handles the highlighting events in map.
|
|
150
150
|
*
|
|
151
151
|
* @param {Element} targetElement - Specifies the target element.
|
|
152
152
|
* @param {number} layerIndex - Specifies the index of the layer.
|
|
@@ -15,20 +15,20 @@ export declare class Selection {
|
|
|
15
15
|
selectionType: string;
|
|
16
16
|
constructor(maps: Maps);
|
|
17
17
|
/**
|
|
18
|
-
* For binding events to selection module
|
|
18
|
+
* For binding events to selection module.
|
|
19
19
|
*
|
|
20
20
|
* @returns {void}
|
|
21
21
|
*/
|
|
22
22
|
private addEventListener;
|
|
23
23
|
/**
|
|
24
|
-
* For removing events from selection
|
|
24
|
+
* For removing events from selection module.
|
|
25
25
|
*
|
|
26
26
|
* @returns {void}
|
|
27
27
|
*/
|
|
28
28
|
private removeEventListener;
|
|
29
29
|
private mouseClick;
|
|
30
30
|
/**
|
|
31
|
-
* Selects the element in the map
|
|
31
|
+
* Selects the element in the map.
|
|
32
32
|
*
|
|
33
33
|
* @param {Element} targetElement - Specifies the target element.
|
|
34
34
|
* @param {number} layerIndex - Specifies the index of the layer.
|
|
@@ -39,7 +39,7 @@ export declare class Selection {
|
|
|
39
39
|
*/
|
|
40
40
|
selectElement(targetElement: Element, layerIndex: number, data: object, shapeData: object): void;
|
|
41
41
|
/**
|
|
42
|
-
* Public method for selection
|
|
42
|
+
* Public method for selection.
|
|
43
43
|
*
|
|
44
44
|
* @param {number} layerIndex - Specifies the index of the layer.
|
|
45
45
|
* @param {string} name - Specifies the name.
|
|
@@ -49,7 +49,7 @@ export declare class Selection {
|
|
|
49
49
|
*/
|
|
50
50
|
addSelection(layerIndex: number, name: string, enable: boolean): void;
|
|
51
51
|
/**
|
|
52
|
-
* Method for selection
|
|
52
|
+
* Method for selection.
|
|
53
53
|
*
|
|
54
54
|
* @param {Element} targetElement - Specifies the target element
|
|
55
55
|
* @param {any} shapeData - Specifies the shape data
|
|
@@ -10,7 +10,7 @@ var Selection = /** @class */ (function () {
|
|
|
10
10
|
this.addEventListener();
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* For binding events to selection module
|
|
13
|
+
* For binding events to selection module.
|
|
14
14
|
*
|
|
15
15
|
* @returns {void}
|
|
16
16
|
*/
|
|
@@ -20,7 +20,7 @@ var Selection = /** @class */ (function () {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* For removing events from selection
|
|
23
|
+
* For removing events from selection module.
|
|
24
24
|
*
|
|
25
25
|
* @returns {void}
|
|
26
26
|
*/
|
|
@@ -99,7 +99,7 @@ var Selection = /** @class */ (function () {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
|
-
* Selects the element in the map
|
|
102
|
+
* Selects the element in the map.
|
|
103
103
|
*
|
|
104
104
|
* @param {Element} targetElement - Specifies the target element.
|
|
105
105
|
* @param {number} layerIndex - Specifies the index of the layer.
|
|
@@ -120,7 +120,7 @@ var Selection = /** @class */ (function () {
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
/**
|
|
123
|
-
* Public method for selection
|
|
123
|
+
* Public method for selection.
|
|
124
124
|
*
|
|
125
125
|
* @param {number} layerIndex - Specifies the index of the layer.
|
|
126
126
|
* @param {string} name - Specifies the name.
|
|
@@ -138,7 +138,7 @@ var Selection = /** @class */ (function () {
|
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
/**
|
|
141
|
-
* Method for selection
|
|
141
|
+
* Method for selection.
|
|
142
142
|
*
|
|
143
143
|
* @param {Element} targetElement - Specifies the target element
|
|
144
144
|
* @param {any} shapeData - Specifies the shape data
|
|
@@ -11,7 +11,7 @@ export declare class MapsTooltip {
|
|
|
11
11
|
svgTooltip: Tooltip;
|
|
12
12
|
private isTouch;
|
|
13
13
|
private tooltipId;
|
|
14
|
-
private
|
|
14
|
+
private tooltipTimer;
|
|
15
15
|
/**
|
|
16
16
|
* @private
|
|
17
17
|
*/
|
|
@@ -24,7 +24,7 @@ export declare class MapsTooltip {
|
|
|
24
24
|
*/
|
|
25
25
|
renderTooltip(e: PointerEvent): void;
|
|
26
26
|
/**
|
|
27
|
-
* To get content for the current toolitp
|
|
27
|
+
* To get content for the current toolitp.
|
|
28
28
|
*
|
|
29
29
|
* @param {TooltipSettingsModel} options - Specifies the options for rendering tooltip
|
|
30
30
|
* @param {any} templateData - Specifies the template data
|
|
@@ -33,7 +33,7 @@ export declare class MapsTooltip {
|
|
|
33
33
|
private setTooltipContent;
|
|
34
34
|
private formatter;
|
|
35
35
|
/**
|
|
36
|
-
* Handles the mouse up
|
|
36
|
+
* Handles the mouse up.
|
|
37
37
|
*
|
|
38
38
|
* @param {PointerEvent} e - Specifies the event
|
|
39
39
|
* @returns {void}
|
|
@@ -41,7 +41,7 @@ export declare class MapsTooltip {
|
|
|
41
41
|
*/
|
|
42
42
|
mouseUpHandler(e: PointerEvent): void;
|
|
43
43
|
/**
|
|
44
|
-
* Removes the tooltip
|
|
44
|
+
* Removes the tooltip.
|
|
45
45
|
*
|
|
46
46
|
* @returns {boolean} - Returns the boolean whether tooltip is removed or not.
|
|
47
47
|
* @private
|
|
@@ -49,14 +49,14 @@ export declare class MapsTooltip {
|
|
|
49
49
|
removeTooltip(): boolean;
|
|
50
50
|
private clearTooltip;
|
|
51
51
|
/**
|
|
52
|
-
* To bind events for tooltip module
|
|
52
|
+
* To bind events for tooltip module.
|
|
53
53
|
*
|
|
54
54
|
* @returns {void}
|
|
55
55
|
* @private
|
|
56
56
|
*/
|
|
57
57
|
addEventListener(): void;
|
|
58
58
|
/**
|
|
59
|
-
* Removes the event listeners
|
|
59
|
+
* Removes the event listeners.
|
|
60
60
|
*
|
|
61
61
|
* @returns {void}
|
|
62
62
|
* @private
|
|
@@ -36,10 +36,6 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
36
36
|
pageY = e.pageY;
|
|
37
37
|
target = e.target;
|
|
38
38
|
}
|
|
39
|
-
if (this.maps.isDevice) {
|
|
40
|
-
clearTimeout(this.clearTimeout);
|
|
41
|
-
this.clearTimeout = setTimeout(this.removeTooltip.bind(this), 2000);
|
|
42
|
-
}
|
|
43
39
|
if (target.id.indexOf(this.maps.element.id) === -1) {
|
|
44
40
|
var ancestor = target.closest('.' + this.maps.element.id + '_marker_template_element');
|
|
45
41
|
if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
|
|
@@ -206,9 +202,11 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
206
202
|
// eslint-disable-next-line no-constant-condition
|
|
207
203
|
if (typeof (isPolygon ? polygon.tooltipTemplate !== 'function' : option.template !== 'function') && (isPolygon ? polygon.tooltipTemplate !== null : option.template !== null) && Object.keys(typeof (isPolygon ? polygon.tooltipTemplate === 'object' : option.template === 'object') ? (isPolygon ? polygon.tooltipTemplate : option.template) : {}).length === 1) {
|
|
208
204
|
if (isPolygon) {
|
|
205
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
209
206
|
polygon.tooltipTemplate = polygon.tooltipTemplate[Object.keys(polygon.tooltipTemplate)[0]];
|
|
210
207
|
}
|
|
211
208
|
else {
|
|
209
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
212
210
|
option.template = option.template[Object.keys(option.template)[0]];
|
|
213
211
|
}
|
|
214
212
|
}
|
|
@@ -247,8 +245,17 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
247
245
|
|| _this.maps.themeStyle.fontWeight;
|
|
248
246
|
tooltipArgs.options['textStyle']['opacity'] = tooltipArgs.options['textStyle']['opacity']
|
|
249
247
|
|| _this.maps.themeStyle.tooltipTextOpacity;
|
|
248
|
+
var borderObject = isPolygon ? {
|
|
249
|
+
color: polygonTooltipOption.border.color ||
|
|
250
|
+
_this.maps.themeStyle.tooltipBorderColor, width: polygonTooltipOption.border.width,
|
|
251
|
+
opacity: polygonTooltipOption.border.opacity
|
|
252
|
+
} : {
|
|
253
|
+
color: option.border.color ||
|
|
254
|
+
_this.maps.themeStyle.tooltipBorderColor, width: option.border.width, opacity: option.border.opacity
|
|
255
|
+
};
|
|
250
256
|
if (tooltipArgs.cancel) {
|
|
251
257
|
_this.svgTooltip = new Tooltip({
|
|
258
|
+
theme: _this.maps.theme,
|
|
252
259
|
enable: true,
|
|
253
260
|
header: '',
|
|
254
261
|
data: option['data'],
|
|
@@ -263,11 +270,12 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
263
270
|
availableSize: _this.maps.availableSize,
|
|
264
271
|
fill: option.fill || _this.maps.themeStyle.tooltipFillColor,
|
|
265
272
|
enableShadow: true,
|
|
266
|
-
border:
|
|
273
|
+
border: borderObject
|
|
267
274
|
});
|
|
268
275
|
}
|
|
269
276
|
else {
|
|
270
277
|
_this.svgTooltip = new Tooltip({
|
|
278
|
+
theme: _this.maps.theme,
|
|
271
279
|
enable: true,
|
|
272
280
|
header: '',
|
|
273
281
|
data: tooltipArgs.options['data'],
|
|
@@ -282,7 +290,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
282
290
|
availableSize: _this.maps.availableSize,
|
|
283
291
|
fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor,
|
|
284
292
|
enableShadow: true,
|
|
285
|
-
border:
|
|
293
|
+
border: borderObject
|
|
286
294
|
});
|
|
287
295
|
}
|
|
288
296
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -293,6 +301,15 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
293
301
|
_this.svgTooltip.appendTo(tooltipEle);
|
|
294
302
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
295
303
|
_this.maps.renderReactTemplates();
|
|
304
|
+
if (_this.maps.isDevice) {
|
|
305
|
+
var timer = targetId.indexOf('_MarkerIndex_') > -1 || targetId.indexOf('_BubbleIndex_') > -1
|
|
306
|
+
|| targetId.indexOf('_shapeIndex_') > -1 ? option.duration : polygonTooltipOption.duration;
|
|
307
|
+
timer = (!isNullOrUndefined(timer) && timer > 0) ? timer : (timer < 0) ? 2000 : null;
|
|
308
|
+
if (timer !== null) {
|
|
309
|
+
clearTimeout(_this.tooltipTimer);
|
|
310
|
+
_this.tooltipTimer = setTimeout(_this.removeTooltip.bind(_this), timer);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
296
313
|
}
|
|
297
314
|
else {
|
|
298
315
|
_this.clearTooltip(e.target);
|
|
@@ -329,7 +346,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
329
346
|
}
|
|
330
347
|
};
|
|
331
348
|
/**
|
|
332
|
-
* To get content for the current toolitp
|
|
349
|
+
* To get content for the current toolitp.
|
|
333
350
|
*
|
|
334
351
|
* @param {TooltipSettingsModel} options - Specifies the options for rendering tooltip
|
|
335
352
|
* @param {any} templateData - Specifies the template data
|
|
@@ -363,7 +380,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
363
380
|
return format;
|
|
364
381
|
};
|
|
365
382
|
/**
|
|
366
|
-
* Handles the mouse up
|
|
383
|
+
* Handles the mouse up.
|
|
367
384
|
*
|
|
368
385
|
* @param {PointerEvent} e - Specifies the event
|
|
369
386
|
* @returns {void}
|
|
@@ -373,13 +390,13 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
373
390
|
if (!isNullOrUndefined(this.maps)) {
|
|
374
391
|
this.renderTooltip(e);
|
|
375
392
|
if (this.maps.tooltipDisplayMode === 'MouseMove') {
|
|
376
|
-
clearTimeout(this.
|
|
377
|
-
this.
|
|
393
|
+
clearTimeout(this.tooltipTimer);
|
|
394
|
+
this.tooltipTimer = setTimeout(this.removeTooltip.bind(this), 2000);
|
|
378
395
|
}
|
|
379
396
|
}
|
|
380
397
|
};
|
|
381
398
|
/**
|
|
382
|
-
* Removes the tooltip
|
|
399
|
+
* Removes the tooltip.
|
|
383
400
|
*
|
|
384
401
|
* @returns {boolean} - Returns the boolean whether tooltip is removed or not.
|
|
385
402
|
* @private
|
|
@@ -404,7 +421,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
404
421
|
}
|
|
405
422
|
};
|
|
406
423
|
/**
|
|
407
|
-
* To bind events for tooltip module
|
|
424
|
+
* To bind events for tooltip module.
|
|
408
425
|
*
|
|
409
426
|
* @returns {void}
|
|
410
427
|
* @private
|
|
@@ -426,7 +443,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
426
443
|
this.maps.element.addEventListener('contextmenu', this.removeTooltip);
|
|
427
444
|
};
|
|
428
445
|
/**
|
|
429
|
-
* Removes the event listeners
|
|
446
|
+
* Removes the event listeners.
|
|
430
447
|
*
|
|
431
448
|
* @returns {void}
|
|
432
449
|
* @private
|
|
@@ -57,6 +57,8 @@ export declare class Zoom {
|
|
|
57
57
|
private fingers;
|
|
58
58
|
/** @private */
|
|
59
59
|
firstMove: boolean;
|
|
60
|
+
/** @private */
|
|
61
|
+
isPanningInProgress: boolean;
|
|
60
62
|
private isPan;
|
|
61
63
|
private isZoomFinal;
|
|
62
64
|
private isZoomSelection;
|
|
@@ -77,7 +79,7 @@ export declare class Zoom {
|
|
|
77
79
|
layerCollectionEle: Element;
|
|
78
80
|
constructor(maps: Maps);
|
|
79
81
|
/**
|
|
80
|
-
* To perform zooming for maps
|
|
82
|
+
* To perform zooming for maps.
|
|
81
83
|
*
|
|
82
84
|
* @param {Point} position - Specifies the position.
|
|
83
85
|
* @param {number} newZoomFactor - Specifies the zoom factor.
|
|
@@ -110,7 +112,7 @@ export declare class Zoom {
|
|
|
110
112
|
*/
|
|
111
113
|
drawZoomRectangle(): void;
|
|
112
114
|
/**
|
|
113
|
-
* To animate the zooming process
|
|
115
|
+
* To animate the zooming process.
|
|
114
116
|
*
|
|
115
117
|
* @param {Element} element - Specifies the element
|
|
116
118
|
* @param {boolean} animate - Specifies the boolean value
|
|
@@ -130,7 +132,7 @@ export declare class Zoom {
|
|
|
130
132
|
applyTransform(maps: Maps, animate?: boolean, isPanning?: boolean): void;
|
|
131
133
|
private markerTranslates;
|
|
132
134
|
/**
|
|
133
|
-
* To translate the layer template elements
|
|
135
|
+
* To translate the layer template elements.
|
|
134
136
|
*
|
|
135
137
|
* @param {number} x - Specifies the x value
|
|
136
138
|
* @param {number} y - Specifies the y value
|
|
@@ -269,7 +271,7 @@ export declare class Zoom {
|
|
|
269
271
|
*/
|
|
270
272
|
click(e: PointerEvent): void;
|
|
271
273
|
/**
|
|
272
|
-
* Gets the Mouse Position
|
|
274
|
+
* Gets the Mouse Position.
|
|
273
275
|
*
|
|
274
276
|
* @param {number} pageX - Specifies the Page x in map
|
|
275
277
|
* @param {number} pageY - Specifies the Page y in map
|
|
@@ -25,6 +25,8 @@ var Zoom = /** @class */ (function () {
|
|
|
25
25
|
/** @private */
|
|
26
26
|
this.isPointer = Browser.isPointer;
|
|
27
27
|
this.handled = false;
|
|
28
|
+
/** @private */
|
|
29
|
+
this.isPanningInProgress = false;
|
|
28
30
|
this.isPan = false;
|
|
29
31
|
this.isZoomFinal = false;
|
|
30
32
|
this.isZoomSelection = false;
|
|
@@ -40,14 +42,12 @@ var Zoom = /** @class */ (function () {
|
|
|
40
42
|
this.maps = maps;
|
|
41
43
|
this.wheelEvent = this.browserName === 'mozilla' ? (this.isPointer ? 'mousewheel' : 'DOMMouseScroll') : 'mousewheel';
|
|
42
44
|
this.cancelEvent = this.isPointer ? 'pointerleave' : 'mouseleave';
|
|
43
|
-
this.selectionColor = this.maps.zoomSettings.toolbarSettings.buttonSettings.selectionColor
|
|
44
|
-
|
|
45
|
-
this.fillColor = this.maps.zoomSettings.toolbarSettings.buttonSettings.color == null ? this.maps.zoomSettings.color :
|
|
46
|
-
this.maps.zoomSettings.toolbarSettings.buttonSettings.color;
|
|
45
|
+
this.selectionColor = this.maps.zoomSettings.toolbarSettings.buttonSettings.selectionColor;
|
|
46
|
+
this.fillColor = this.maps.zoomSettings.toolbarSettings.buttonSettings.color;
|
|
47
47
|
this.addEventListener();
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* To perform zooming for maps
|
|
50
|
+
* To perform zooming for maps.
|
|
51
51
|
*
|
|
52
52
|
* @param {Point} position - Specifies the position.
|
|
53
53
|
* @param {number} newZoomFactor - Specifies the zoom factor.
|
|
@@ -475,7 +475,7 @@ var Zoom = /** @class */ (function () {
|
|
|
475
475
|
}
|
|
476
476
|
};
|
|
477
477
|
/**
|
|
478
|
-
* To animate the zooming process
|
|
478
|
+
* To animate the zooming process.
|
|
479
479
|
*
|
|
480
480
|
* @param {Element} element - Specifies the element
|
|
481
481
|
* @param {boolean} animate - Specifies the boolean value
|
|
@@ -513,6 +513,7 @@ var Zoom = /** @class */ (function () {
|
|
|
513
513
|
var y = maps.translatePoint.y;
|
|
514
514
|
var currentLabelIndex = 0;
|
|
515
515
|
maps.zoomShapeCollection = [];
|
|
516
|
+
this.isPanningInProgress = isPanning || false;
|
|
516
517
|
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
517
518
|
removeElement(maps.element.id + '_mapsTooltip');
|
|
518
519
|
}
|
|
@@ -544,7 +545,9 @@ var Zoom = /** @class */ (function () {
|
|
|
544
545
|
var markerData = polygonSettings.points;
|
|
545
546
|
var path = calculatePolygonPath(maps, maps.tileZoomLevel, _this.currentLayer, markerData);
|
|
546
547
|
var element = document.getElementById(maps.element.id + '_LayerIndex_' + _this.index + '_PolygonIndex_' + polygonIndex);
|
|
547
|
-
element
|
|
548
|
+
if (!isNullOrUndefined(element)) {
|
|
549
|
+
element.setAttribute('d', path);
|
|
550
|
+
}
|
|
548
551
|
});
|
|
549
552
|
document.getElementById(maps.element.id + '_LayerIndex_' + this_1.index + '_Polygons_Group').style.visibility = '';
|
|
550
553
|
}
|
|
@@ -556,7 +559,7 @@ var Zoom = /** @class */ (function () {
|
|
|
556
559
|
}
|
|
557
560
|
}
|
|
558
561
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
559
|
-
if ((!this_1.isPanModeEnabled) && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
562
|
+
if ((!this_1.isPanModeEnabled || !isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
560
563
|
this_1.markerTranslates(currentEle.childNodes[0], factor_1, x, y, scale, 'Marker', layerElement);
|
|
561
564
|
}
|
|
562
565
|
currentEle = layerElement.childNodes[j];
|
|
@@ -823,7 +826,7 @@ var Zoom = /** @class */ (function () {
|
|
|
823
826
|
});
|
|
824
827
|
};
|
|
825
828
|
/**
|
|
826
|
-
* To translate the layer template elements
|
|
829
|
+
* To translate the layer template elements.
|
|
827
830
|
*
|
|
828
831
|
* @param {number} x - Specifies the x value
|
|
829
832
|
* @param {number} y - Specifies the y value
|
|
@@ -1038,19 +1041,6 @@ var Zoom = /** @class */ (function () {
|
|
|
1038
1041
|
var templateOffset = element.getBoundingClientRect();
|
|
1039
1042
|
element.style.left = ((location_2.x - (templateOffset.width / 2)) + marker.offset.x) + 'px';
|
|
1040
1043
|
element.style.top = ((location_2.y - (templateOffset.height / 2)) + marker.offset.y) + 'px';
|
|
1041
|
-
if (this.maps.layers[this.maps.baseLayerIndex].layerType === 'GoogleStaticMap') {
|
|
1042
|
-
var staticMapOffset = getElementByID(this.maps.element.id + '_StaticGoogleMap').getBoundingClientRect();
|
|
1043
|
-
var staticMapOffsetWidth = 640;
|
|
1044
|
-
if (element['style']['display'] !== 'none') {
|
|
1045
|
-
if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])
|
|
1046
|
-
&& (staticMapOffset['y'] > templateOffset['y'] || staticMapOffset['y'] + staticMapOffset['height'] < templateOffset['y'] + templateOffset['height'])) {
|
|
1047
|
-
element.style.display = 'none';
|
|
1048
|
-
}
|
|
1049
|
-
else if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])) {
|
|
1050
|
-
element.style.display = 'none';
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
1044
|
}
|
|
1055
1045
|
else {
|
|
1056
1046
|
location_2.x += marker.offset.x;
|
|
@@ -1333,44 +1323,44 @@ var Zoom = /** @class */ (function () {
|
|
|
1333
1323
|
var toolbar = map.zoomSettings.toolbarSettings;
|
|
1334
1324
|
var button = map.zoomSettings.toolbarSettings.buttonSettings;
|
|
1335
1325
|
this.maps.toolbarProperties = {
|
|
1336
|
-
toolBarOrientation: toolbar.orientation
|
|
1337
|
-
highlightColor: button.highlightColor
|
|
1338
|
-
selectionColor: button.selectionColor
|
|
1339
|
-
horizontalAlignment: toolbar.horizontalAlignment
|
|
1340
|
-
verticalAlignment: toolbar.verticalAlignment
|
|
1341
|
-
color: button.color
|
|
1342
|
-
shapeOpacity: button.opacity
|
|
1343
|
-
borderOpacity: button.borderOpacity
|
|
1326
|
+
toolBarOrientation: toolbar.orientation,
|
|
1327
|
+
highlightColor: button.highlightColor,
|
|
1328
|
+
selectionColor: button.selectionColor,
|
|
1329
|
+
horizontalAlignment: toolbar.horizontalAlignment,
|
|
1330
|
+
verticalAlignment: toolbar.verticalAlignment,
|
|
1331
|
+
color: button.color,
|
|
1332
|
+
shapeOpacity: button.opacity,
|
|
1333
|
+
borderOpacity: button.borderOpacity
|
|
1344
1334
|
};
|
|
1345
|
-
var
|
|
1346
|
-
var
|
|
1347
|
-
var
|
|
1335
|
+
var buttonRadius = button.radius || map.themeStyle.zoomButtonRadius;
|
|
1336
|
+
var cx = buttonRadius / 4;
|
|
1337
|
+
var cy = buttonRadius / 4;
|
|
1338
|
+
var radius = buttonRadius / 2;
|
|
1348
1339
|
var padding = button.padding;
|
|
1349
1340
|
var orientation = this.maps.toolbarProperties.toolBarOrientation;
|
|
1350
1341
|
var toolbarCollection = map.zoomSettings.toolbarSettings.buttonSettings.toolbarItems.map(function (value) { return value; });
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
ySpacing = (button.radius / 4) + (button.borderWidth / 2) + padding;
|
|
1342
|
+
xSpacing = (buttonRadius / 4) + (button.borderWidth / 2) + padding;
|
|
1343
|
+
ySpacing = (buttonRadius / 4) + (button.borderWidth / 2) + padding;
|
|
1354
1344
|
var shadowElement = '<filter id="chart_shadow" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="5"/>';
|
|
1355
1345
|
shadowElement += '<feOffset dx="-3" dy="4" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="1"/>';
|
|
1356
1346
|
shadowElement += '</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>';
|
|
1357
1347
|
var toolBarLength = toolbarCollection.length;
|
|
1358
|
-
var toolWidth = (orientation === 'Horizontal') ? ((toolBarLength *
|
|
1359
|
-
var toolHeight = (orientation === 'Horizontal') ? (
|
|
1348
|
+
var toolWidth = (orientation === 'Horizontal') ? ((toolBarLength * buttonRadius) + (toolBarLength * padding) + padding + (toolBarLength * button.borderWidth)) : (buttonRadius + button.borderWidth + (2 * padding));
|
|
1349
|
+
var toolHeight = (orientation === 'Horizontal') ? (buttonRadius + button.borderWidth + (2 * padding)) : ((toolBarLength * buttonRadius) + (toolBarLength * padding) + padding + (toolBarLength * button.borderWidth));
|
|
1360
1350
|
var defElement = map.renderer.createDefs();
|
|
1361
1351
|
defElement.innerHTML = shadowElement;
|
|
1362
1352
|
this.toolBarGroup.appendChild(defElement);
|
|
1363
1353
|
var outerElement = map.renderer.drawRectangle(new RectOption(map.element.id + '_Zooming_Rect', toolbar.backgroundColor, { color: toolbar.borderColor, width: toolbar.borderWidth, opacity: toolbar.borderOpacity }, toolbar.borderOpacity, new Rect((toolbar.borderWidth / 2), (toolbar.borderWidth / 2), (toolWidth - toolbar.borderWidth), (toolHeight - toolbar.borderWidth)), 0, 0));
|
|
1364
1354
|
this.toolBarGroup.appendChild(outerElement);
|
|
1365
|
-
var scaleX = (
|
|
1366
|
-
for (var i = 0; i <
|
|
1355
|
+
var scaleX = (buttonRadius - (button.borderWidth / 2)) / 30;
|
|
1356
|
+
for (var i = 0; i < toolbarCollection.length; i++) {
|
|
1367
1357
|
if (i !== 0) {
|
|
1368
|
-
xSpacing = (map.toolbarProperties.toolBarOrientation === 'Horizontal') ? (xSpacing + (
|
|
1369
|
-
ySpacing = (map.toolbarProperties.toolBarOrientation === 'Horizontal') ? ySpacing : (ySpacing + (
|
|
1358
|
+
xSpacing = (map.toolbarProperties.toolBarOrientation === 'Horizontal') ? (xSpacing + (buttonRadius + padding) + button.borderWidth) : xSpacing;
|
|
1359
|
+
ySpacing = (map.toolbarProperties.toolBarOrientation === 'Horizontal') ? ySpacing : (ySpacing + (buttonRadius + padding) + button.borderWidth);
|
|
1370
1360
|
}
|
|
1371
|
-
var toolbar_1 =
|
|
1361
|
+
var toolbar_1 = toolbarCollection[i];
|
|
1372
1362
|
var pathStroke = !isNullOrUndefined(this.maps.toolbarProperties.color) ? this.maps.toolbarProperties.color : this.maps.themeStyle.zoomFillColor;
|
|
1373
|
-
var borderColor = button.borderColor || this.maps.themeStyle.zoomFillColor;
|
|
1363
|
+
var borderColor = button.borderColor || (this.maps.themeStyle.zoomBorderColor || this.maps.themeStyle.zoomFillColor);
|
|
1374
1364
|
this.currentToolbarEle = map.renderer.createGroup({
|
|
1375
1365
|
id: map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Group',
|
|
1376
1366
|
transform: 'translate( ' + xSpacing + ' ' + ySpacing + ' ) '
|
|
@@ -1546,10 +1536,15 @@ var Zoom = /** @class */ (function () {
|
|
|
1546
1536
|
break;
|
|
1547
1537
|
case 'zoomin':
|
|
1548
1538
|
map.staticMapZoom = map.tileZoomLevel;
|
|
1549
|
-
if (map.staticMapZoom > 0 && map.staticMapZoom <
|
|
1539
|
+
if (map.staticMapZoom > 0 && map.staticMapZoom < map.zoomSettings.maxZoom) {
|
|
1550
1540
|
map.staticMapZoom += 1;
|
|
1551
1541
|
}
|
|
1552
|
-
|
|
1542
|
+
if (map.isTileMap && map.tileZoomLevel >= map.zoomSettings.minZoom && map.tileZoomLevel < map.zoomSettings.maxZoom) {
|
|
1543
|
+
this.toolBarZooming(map.tileZoomLevel + 1, 'ZoomIn');
|
|
1544
|
+
}
|
|
1545
|
+
else if (!map.isTileMap) {
|
|
1546
|
+
this.toolBarZooming(map.scale + 1, 'ZoomIn');
|
|
1547
|
+
}
|
|
1553
1548
|
scale = this.maps.isTileMap ? Math.round(this.maps.tileZoomLevel) : Math.round(this.maps.mapScaleValue);
|
|
1554
1549
|
if (!this.isZoomSelection) {
|
|
1555
1550
|
if (scale === map.zoomSettings.maxZoom || scale > 1 || (scale === 1 && this.maps.isTileMap)) {
|
|
@@ -1909,9 +1904,14 @@ var Zoom = /** @class */ (function () {
|
|
|
1909
1904
|
-(e.detail) / 3 > 0 ? 'ZoomIn' : 'ZoomOut' : (e.wheelDelta / 120) > 0 ? 'ZoomIn' : 'ZoomOut';
|
|
1910
1905
|
if (direction === 'ZoomIn') {
|
|
1911
1906
|
map.mapScaleValue = value + delta;
|
|
1912
|
-
map.
|
|
1913
|
-
|
|
1914
|
-
map.staticMapZoom
|
|
1907
|
+
if (map.isTileMap) {
|
|
1908
|
+
map.staticMapZoom = map.tileZoomLevel;
|
|
1909
|
+
if (map.staticMapZoom > 0 && map.staticMapZoom < staticMaxZoomLevel) {
|
|
1910
|
+
map.staticMapZoom += 1;
|
|
1911
|
+
this.performZooming(position, (value + delta), direction);
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
else {
|
|
1915
1915
|
this.performZooming(position, (value + delta), direction);
|
|
1916
1916
|
}
|
|
1917
1917
|
}
|
|
@@ -2195,7 +2195,7 @@ var Zoom = /** @class */ (function () {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
};
|
|
2197
2197
|
/**
|
|
2198
|
-
* Gets the Mouse Position
|
|
2198
|
+
* Gets the Mouse Position.
|
|
2199
2199
|
*
|
|
2200
2200
|
* @param {number} pageX - Specifies the Page x in map
|
|
2201
2201
|
* @param {number} pageY - Specifies the Page y in map
|