@syncfusion/ej2-maps 19.4.38 → 19.4.52
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 +29 -1
- package/README.md +1 -1
- 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 +279 -67
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +278 -66
- 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 +12 -12
- package/src/maps/layers/layer-panel.js +3 -2
- package/src/maps/layers/legend.d.ts +41 -2
- package/src/maps/layers/legend.js +65 -16
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +8 -0
- package/src/maps/maps.js +141 -18
- package/src/maps/model/base-model.d.ts +7 -0
- package/src/maps/model/base.d.ts +6 -0
- package/src/maps/model/base.js +3 -0
- package/src/maps/model/interface.d.ts +1 -3
- package/src/maps/user-interaction/highlight.d.ts +9 -1
- package/src/maps/user-interaction/highlight.js +18 -11
- package/src/maps/user-interaction/selection.d.ts +9 -1
- package/src/maps/user-interaction/selection.js +17 -10
- package/src/maps/user-interaction/zoom.d.ts +4 -1
- package/src/maps/user-interaction/zoom.js +9 -3
- package/src/maps/utils/enum.d.ts +3 -1
- package/src/maps/utils/helper.d.ts +2 -2
- package/src/maps/utils/helper.js +26 -10
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.4.
|
|
3
|
+
* version : 19.4.52
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-maps@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-maps@
|
|
3
|
+
"_id": "@syncfusion/ej2-maps@19.4.47",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-gFY2cYlS0ul2u+VnTBMpp7y3/9IXBZUOaCFTosfzKgBc0twsoKiTyqkVR6kPqdlzE3WnEjjv8PlTlGZtICjesg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-maps",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-maps",
|
|
24
24
|
"/@syncfusion/ej2-vue-maps"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-19.4.47.tgz",
|
|
27
|
+
"_shasum": "53a776c701d92b8a6699ce476823e6f8a2474cc0",
|
|
28
28
|
"_spec": "@syncfusion/ej2-maps@*",
|
|
29
29
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~19.4.
|
|
39
|
-
"@syncfusion/ej2-buttons": "~19.4.
|
|
40
|
-
"@syncfusion/ej2-compression": "~19.4.
|
|
41
|
-
"@syncfusion/ej2-data": "~19.4.
|
|
42
|
-
"@syncfusion/ej2-file-utils": "~19.4.
|
|
43
|
-
"@syncfusion/ej2-pdf-export": "~19.4.
|
|
44
|
-
"@syncfusion/ej2-svg-base": "~19.4.
|
|
38
|
+
"@syncfusion/ej2-base": "~19.4.52",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~19.4.52",
|
|
40
|
+
"@syncfusion/ej2-compression": "~19.4.52",
|
|
41
|
+
"@syncfusion/ej2-data": "~19.4.52",
|
|
42
|
+
"@syncfusion/ej2-file-utils": "~19.4.52",
|
|
43
|
+
"@syncfusion/ej2-pdf-export": "~19.4.52",
|
|
44
|
+
"@syncfusion/ej2-svg-base": "~19.4.52"
|
|
45
45
|
},
|
|
46
46
|
"deprecated": false,
|
|
47
47
|
"description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
81
81
|
},
|
|
82
82
|
"typings": "index.d.ts",
|
|
83
|
-
"version": "19.4.
|
|
83
|
+
"version": "19.4.52",
|
|
84
84
|
"sideEffects": false
|
|
85
85
|
}
|
|
@@ -56,7 +56,8 @@ var LayerPanel = /** @class */ (function () {
|
|
|
56
56
|
else {
|
|
57
57
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
58
58
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
59
|
-
width: areaRect.width, height: (areaRect.height < 0) ? 0 :
|
|
59
|
+
width: areaRect.width, height: (areaRect.height < 0) ? 0 : !isNullOrUndefined(this.mapObject.legendModule) &&
|
|
60
|
+
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
60
61
|
}));
|
|
61
62
|
}
|
|
62
63
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -527,7 +528,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
527
528
|
}
|
|
528
529
|
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
529
530
|
(currentShapeData['property'][properties]) : ''));
|
|
530
|
-
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i +
|
|
531
|
+
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 3).toString());
|
|
531
532
|
if (drawingType === 'LineString') {
|
|
532
533
|
pathEle.setAttribute('style', 'outline:none');
|
|
533
534
|
}
|
|
@@ -7,10 +7,23 @@ import { ShapeSettings } from '../model/base';
|
|
|
7
7
|
* Legend module is used to render legend for the maps
|
|
8
8
|
*/
|
|
9
9
|
export declare class Legend {
|
|
10
|
+
/**
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
10
13
|
legendCollection: any[];
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
11
17
|
legendRenderingCollections: any[];
|
|
12
18
|
private translate;
|
|
19
|
+
/**
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
13
22
|
legendBorderRect: Rect;
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
legendTotalRect: Rect;
|
|
14
27
|
private maps;
|
|
15
28
|
/**
|
|
16
29
|
* @private
|
|
@@ -25,16 +38,37 @@ export declare class Legend {
|
|
|
25
38
|
private heightIncrement;
|
|
26
39
|
private widthIncrement;
|
|
27
40
|
private textMaxWidth;
|
|
28
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
legendGroup: Element;
|
|
29
45
|
private shapeHighlightCollection;
|
|
46
|
+
/**
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
30
49
|
legendHighlightCollection: any[];
|
|
50
|
+
/**
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
31
53
|
shapePreviousColor: string[];
|
|
54
|
+
/**
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
32
57
|
selectedNonLegendShapes: any[];
|
|
58
|
+
/**
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
33
61
|
shapeToggled: boolean;
|
|
34
62
|
private legendLinearGradient;
|
|
35
63
|
private currentLayer;
|
|
36
64
|
private defsElement;
|
|
65
|
+
/**
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
37
68
|
legendElement: Element[];
|
|
69
|
+
/**
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
38
72
|
oldShapeElement: Element;
|
|
39
73
|
constructor(maps: Maps);
|
|
40
74
|
/**
|
|
@@ -63,7 +97,12 @@ export declare class Legend {
|
|
|
63
97
|
* To draw the legend shape and text.
|
|
64
98
|
*/
|
|
65
99
|
drawLegend(): void;
|
|
66
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @param {string} page - Specifies the legend page.
|
|
102
|
+
* @returns {void}
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
drawLegendItem(page: number): void;
|
|
67
106
|
legendHighLightAndSelection(targetElement: Element, value: string): void;
|
|
68
107
|
private setColor;
|
|
69
108
|
pushCollection(targetElement: Element, collection: any[], oldElement: any, shapeSettings: ShapeSettings): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { click, legendRendering } from '../index';
|
|
2
|
-
import { Rect, measureText, PathOption, textTrim, removeClass, querySelector, getTemplateFunction, maintainStyleClass, getValueFromObject } from '../utils/helper';
|
|
2
|
+
import { Rect, measureText, PathOption, textTrim, drawBalloon, removeClass, querySelector, getTemplateFunction, maintainStyleClass, getValueFromObject } from '../utils/helper';
|
|
3
3
|
import { RectOption, Size, TextOption, Point, renderTextElement, drawSymbol, checkPropertyPath, getElement } from '../utils/helper';
|
|
4
4
|
import { isNullOrUndefined, Browser, EventHandler, remove, extend } from '@syncfusion/ej2-base';
|
|
5
5
|
/**
|
|
@@ -7,7 +7,14 @@ import { isNullOrUndefined, Browser, EventHandler, remove, extend } from '@syncf
|
|
|
7
7
|
*/
|
|
8
8
|
var Legend = /** @class */ (function () {
|
|
9
9
|
function Legend(maps) {
|
|
10
|
+
/**
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
10
13
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
this.legendTotalRect = new Rect(0, 0, 0, 0);
|
|
11
18
|
/**
|
|
12
19
|
* @private
|
|
13
20
|
*/
|
|
@@ -24,12 +31,27 @@ var Legend = /** @class */ (function () {
|
|
|
24
31
|
this.textMaxWidth = 0;
|
|
25
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
33
|
this.shapeHighlightCollection = [];
|
|
34
|
+
/**
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
27
37
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
38
|
this.legendHighlightCollection = [];
|
|
39
|
+
/**
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
29
42
|
this.shapePreviousColor = [];
|
|
43
|
+
/**
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
30
46
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
47
|
this.selectedNonLegendShapes = [];
|
|
48
|
+
/**
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
32
51
|
this.shapeToggled = true;
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
33
55
|
this.legendElement = null;
|
|
34
56
|
this.maps = maps;
|
|
35
57
|
this.addEventListener();
|
|
@@ -414,6 +436,11 @@ var Legend = /** @class */ (function () {
|
|
|
414
436
|
this.drawLegendItem(this.currentPage);
|
|
415
437
|
}
|
|
416
438
|
};
|
|
439
|
+
/**
|
|
440
|
+
* @param {string} page - Specifies the legend page.
|
|
441
|
+
* @returns {void}
|
|
442
|
+
* @private
|
|
443
|
+
*/
|
|
417
444
|
Legend.prototype.drawLegendItem = function (page) {
|
|
418
445
|
var map = this.maps;
|
|
419
446
|
var legend = map.legendSettings;
|
|
@@ -422,6 +449,7 @@ var Legend = /** @class */ (function () {
|
|
|
422
449
|
var textOptions;
|
|
423
450
|
var renderOptions;
|
|
424
451
|
var render = map.renderer;
|
|
452
|
+
var legendShape = legend.shape;
|
|
425
453
|
if (page >= 0 && page < this.totalPages.length) {
|
|
426
454
|
if (querySelector(this.legendGroup.id, this.maps.element.id)) {
|
|
427
455
|
remove(querySelector(this.legendGroup.id, this.maps.element.id));
|
|
@@ -433,6 +461,7 @@ var Legend = /** @class */ (function () {
|
|
|
433
461
|
var shapeBorder = collection['shapeBorder'];
|
|
434
462
|
var legendElement = render.createGroup({ id: map.element.id + '_Legend_Index_' + collection['idIndex'] });
|
|
435
463
|
var legendText = collection['DisplayText'];
|
|
464
|
+
var pagingArrowPadding = 4;
|
|
436
465
|
var shape = ((legend.type === 'Markers') ? ((isNullOrUndefined(collection['ImageSrc'])) ?
|
|
437
466
|
legend.shape : 'Image') : collection['legendShape']);
|
|
438
467
|
var strokeColor = (legend.shape === 'HorizontalLine' || legend.shape === 'VerticalLine'
|
|
@@ -442,8 +471,8 @@ var Legend = /** @class */ (function () {
|
|
|
442
471
|
1 : shapeBorder.width : shapeBorder.width;
|
|
443
472
|
var shapeId = map.element.id + '_Legend_Shape_Index_' + collection['idIndex'];
|
|
444
473
|
var textId = map.element.id + '_Legend_Text_Index_' + collection['idIndex'];
|
|
445
|
-
var shapeLocation = collection['Shape'];
|
|
446
|
-
var textLocation = collection['Text'];
|
|
474
|
+
var shapeLocation = new Point(collection['Shape']['x'], (collection['Shape']['y'] - pagingArrowPadding));
|
|
475
|
+
var textLocation = new Point(collection['Text']['x'], (collection['Text']['y'] - pagingArrowPadding));
|
|
447
476
|
var imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
|
|
448
477
|
var renderOptions_1 = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
|
|
449
478
|
var legendTextStyle = {
|
|
@@ -457,7 +486,17 @@ var Legend = /** @class */ (function () {
|
|
|
457
486
|
if (i === 0) {
|
|
458
487
|
this.renderLegendBorder();
|
|
459
488
|
}
|
|
460
|
-
|
|
489
|
+
if (legend.type === 'Markers' && legend.useMarkerShape) {
|
|
490
|
+
var legendShapeData = this.legendCollection[collection['idIndex']].data[0];
|
|
491
|
+
var marker = map.layers[legendShapeData['layerIndex']].markerSettings[legendShapeData['markerIndex']];
|
|
492
|
+
legendShape = !isNullOrUndefined(marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']]) && marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']] !== '' ? marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']] : marker.shape;
|
|
493
|
+
}
|
|
494
|
+
if (legendShape === "Balloon") {
|
|
495
|
+
legendElement.appendChild(drawBalloon(map, renderOptions_1, shapeSize, { x: shapeLocation.x, y: (shapeLocation.y + 5) }, 'Legend'));
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
legendElement.appendChild(drawSymbol(shapeLocation, legendShape, shapeSize, collection['ImageSrc'], renderOptions_1));
|
|
499
|
+
}
|
|
461
500
|
var legendRectSize = collection['Rect']['x'] + collection['Rect']['width'];
|
|
462
501
|
if (legendRectSize > this.legendBorderRect.width) {
|
|
463
502
|
var trimmedText = this.legendTextTrim(this.legendBorderRect.width, legendText, legendTextStyle, legendRectSize);
|
|
@@ -476,10 +515,10 @@ var Legend = /** @class */ (function () {
|
|
|
476
515
|
var pagingFont = legend.textStyle;
|
|
477
516
|
var pagingTextSize = measureText(pagingText, pagingFont);
|
|
478
517
|
var leftPageX = (this.legendItemRect.x + this.legendItemRect.width) - pagingTextSize.width -
|
|
479
|
-
(width * 2) - spacing;
|
|
518
|
+
(width * 2) - (spacing * 2) + (pagingArrowPadding / 2);
|
|
480
519
|
var rightPageX = (this.legendItemRect.x + this.legendItemRect.width);
|
|
520
|
+
var pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2) - pagingArrowPadding;
|
|
481
521
|
var locY = (this.legendItemRect.y + this.legendItemRect.height) + (height / 2) + spacing;
|
|
482
|
-
var pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2);
|
|
483
522
|
pagingGroup = render.createGroup({ id: map.element.id + '_Legend_Paging_Group' });
|
|
484
523
|
var leftPageElement = render.createGroup({ id: map.element.id + '_Legend_Left_Paging_Group' });
|
|
485
524
|
var rightPageElement = render.createGroup({ id: map.element.id + '_Legend_Right_Paging_Group' });
|
|
@@ -487,15 +526,19 @@ var Legend = /** @class */ (function () {
|
|
|
487
526
|
' L ' + (rightPageX - width) + ' ' + (locY + height) + ' z ';
|
|
488
527
|
var leftPath = ' M ' + leftPageX + ' ' + locY + ' L ' + (leftPageX + width) + ' ' + (locY - height) +
|
|
489
528
|
' L ' + (leftPageX + width) + ' ' + (locY + height) + ' z ';
|
|
490
|
-
var leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', 1, 1, '', leftPath);
|
|
529
|
+
var leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === 1 ? 0.5 : 1), 1, '', leftPath);
|
|
491
530
|
leftPageElement.appendChild(render.drawPath(leftPageOptions));
|
|
492
531
|
var leftRectPageOptions = new RectOption(map.element.id + '_Left_Page_Rect', 'transparent', {}, 1, new Rect(leftPageX - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
|
|
493
|
-
|
|
532
|
+
var pathEle = render.drawRectangle(leftRectPageOptions);
|
|
533
|
+
pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
|
|
534
|
+
leftPageElement.appendChild(pathEle);
|
|
494
535
|
this.wireEvents(leftPageElement);
|
|
495
|
-
var rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', 1, 1, '', rightPath);
|
|
536
|
+
var rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
|
|
496
537
|
rightPageElement.appendChild(render.drawPath(rightPageOptions));
|
|
497
|
-
var rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(
|
|
498
|
-
|
|
538
|
+
var rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(rightPageX - spacing - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
|
|
539
|
+
pathEle = render.drawRectangle(rightRectPageOptions);
|
|
540
|
+
pathEle.setAttribute('tabindex', ((page + 1) === this.totalPages.length ? -1 : map.tabIndex + 2).toString());
|
|
541
|
+
rightPageElement.appendChild(pathEle);
|
|
499
542
|
this.wireEvents(rightPageElement);
|
|
500
543
|
pagingGroup.appendChild(leftPageElement);
|
|
501
544
|
pagingGroup.appendChild(rightPageElement);
|
|
@@ -1233,13 +1276,13 @@ var Legend = /** @class */ (function () {
|
|
|
1233
1276
|
break;
|
|
1234
1277
|
}
|
|
1235
1278
|
if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
|
|
1236
|
-
map.totalRect = totalRect;
|
|
1279
|
+
this.legendTotalRect = map.totalRect = totalRect;
|
|
1237
1280
|
}
|
|
1238
1281
|
else {
|
|
1239
1282
|
if ((legend.height || legend.width) && legend.mode === 'Interactive') {
|
|
1240
1283
|
map.totalRect = totalRect;
|
|
1241
1284
|
}
|
|
1242
|
-
map.mapAreaRect = totalRect;
|
|
1285
|
+
this.legendTotalRect = map.mapAreaRect = totalRect;
|
|
1243
1286
|
}
|
|
1244
1287
|
this.translate = new Point(x, y);
|
|
1245
1288
|
}
|
|
@@ -1276,7 +1319,7 @@ var Legend = /** @class */ (function () {
|
|
|
1276
1319
|
}
|
|
1277
1320
|
else {
|
|
1278
1321
|
newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
|
|
1279
|
-
shape: !isNullOrUndefined(marker.shapeValuePath) ? data[marker.shapeValuePath] : marker.shape });
|
|
1322
|
+
shape: (!isNullOrUndefined(marker.shapeValuePath) && !isNullOrUndefined(data[marker.shapeValuePath]) && data[marker.shapeValuePath] !== '') ? data[marker.shapeValuePath] : (_this.maps.legendSettings.useMarkerShape ? marker.shape : _this.maps.legendSettings.shape) });
|
|
1280
1323
|
_this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
|
|
1281
1324
|
}
|
|
1282
1325
|
}
|
|
@@ -1662,7 +1705,7 @@ var Legend = /** @class */ (function () {
|
|
|
1662
1705
|
shape = this.legendCollection[legendIndex]['data'][i];
|
|
1663
1706
|
mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
1664
1707
|
'_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
1665
|
-
'_MarkerIndex_' +
|
|
1708
|
+
'_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
|
|
1666
1709
|
if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
|
|
1667
1710
|
mapElement = mapElement.children[0];
|
|
1668
1711
|
}
|
|
@@ -1686,6 +1729,9 @@ var Legend = /** @class */ (function () {
|
|
|
1686
1729
|
if (targetEle !== null) {
|
|
1687
1730
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
1688
1731
|
legendShapeId.setAttribute('fill', '#E5E5E5');
|
|
1732
|
+
if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
|
|
1733
|
+
legendShapeId.setAttribute('stroke', '#E5E5E5');
|
|
1734
|
+
}
|
|
1689
1735
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
|
|
1690
1736
|
legendTextId.setAttribute('fill', '#E5E5E5');
|
|
1691
1737
|
}
|
|
@@ -1700,6 +1746,9 @@ var Legend = /** @class */ (function () {
|
|
|
1700
1746
|
if (targetEle !== null) {
|
|
1701
1747
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
1702
1748
|
legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
|
|
1749
|
+
if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
|
|
1750
|
+
legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
|
|
1751
|
+
}
|
|
1703
1752
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
|
|
1704
1753
|
legendTextId.setAttribute('fill', '#757575');
|
|
1705
1754
|
}
|
|
@@ -1784,7 +1833,7 @@ var Legend = /** @class */ (function () {
|
|
|
1784
1833
|
targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendSettings.visible &&
|
|
1785
1834
|
targetEle.id.indexOf('_Text') === -1) {
|
|
1786
1835
|
var LegendInteractive = void 0;
|
|
1787
|
-
var legendIndex = parseFloat(targetEle.id.
|
|
1836
|
+
var legendIndex = parseFloat(targetEle.id.split(this.maps.element.id + '_Legend_Index_')[1]);
|
|
1788
1837
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1789
1838
|
var mapdata = void 0;
|
|
1790
1839
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/src/maps/maps-model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Ajax } from '@syncfusion/ej2-base';import { EventHandler, Browser, EmitType, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';import { ModuleDeclaration } from '@syncfusion/ej2-base';import { SvgRenderer } from '@syncfusion/ej2-svg-base';import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition } from './utils/helper';import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle } from './utils/helper';import { createStyle } from './utils/helper';import { ZoomSettings, LegendSettings, Tile } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel } from './model/base-model';import { MarkerSettingsModel, SelectionSettingsModel , InitialMarkerSelectionSettingsModel} from './model/base-model';import { TitleSettingsModel, BorderModel, MarginModel, CenterPositionModel, InitialShapeSelectionSettingsModel } from './model/base-model';import { MapsAreaSettingsModel, AnnotationModel } from './model/base-model';import { Bubble } from './layers/bubble';import { Legend } from './layers/legend';import { Marker } from './layers/marker';import { Highlight } from './user-interaction/highlight';import { Selection } from './user-interaction/selection';import { MapsTooltip } from './user-interaction/tooltip';import { Zoom } from './user-interaction/zoom';import { load, click, rightClick, loaded, doubleClick, resize, shapeSelected, itemSelection, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle } from './model/theme';import { BingMap } from './layers/bing-map';import { ILoadEventArgs, ILoadedEventArgs, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';import { GeoPosition, ITooltipRenderCompleteEventArgs, ILegendRenderingEventArgs } from './model/interface';import { ILayerRenderingEventArgs, IShapeRenderingEventArgs, IMarkerRenderingEventArgs, IMarkerClickEventArgs } from './model/interface';import { IMarkerMoveEventArgs, ILabelRenderingEventArgs, IBubbleMoveEventArgs, IBubbleClickEventArgs } from './model/interface';import { IMarkerClusterClickEventArgs, IMarkerClusterMoveEventArgs, IMarkerClusterRenderingEventArgs } from './model/interface';import { ISelectionEventArgs, IShapeSelectedEventArgs, IMapPanEventArgs, IMapZoomEventArgs } from './model/interface';import { IBubbleRenderingEventArgs, IAnimationCompleteEventArgs, IPrintEventArgs, IThemeStyle } from './model/interface';import { LayerPanel } from './layers/layer-panel';import { GeoLocation, Rect, RectOption, measureText, getElementByID, MapAjax, processResult } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, convertGeoToPoint, calculateZoomLevel } from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';import { DataManager, Query } from '@syncfusion/ej2-data';import { ExportType } from '../maps/utils/enum';import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';import { Print } from './model/print';import { PdfExport } from './model/export-pdf';import { ImageExport } from './model/export-image';
|
|
1
|
+
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Ajax } from '@syncfusion/ej2-base';import { EventHandler, Browser, EmitType, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';import { ModuleDeclaration } from '@syncfusion/ej2-base';import { SvgRenderer } from '@syncfusion/ej2-svg-base';import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition, calculateSize } from './utils/helper';import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle, querySelector } from './utils/helper';import { createStyle } from './utils/helper';import { ZoomSettings, LegendSettings, Tile } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel } from './model/base-model';import { MarkerSettingsModel, SelectionSettingsModel , InitialMarkerSelectionSettingsModel} from './model/base-model';import { TitleSettingsModel, BorderModel, MarginModel, CenterPositionModel, InitialShapeSelectionSettingsModel } from './model/base-model';import { MapsAreaSettingsModel, AnnotationModel } from './model/base-model';import { Bubble } from './layers/bubble';import { Legend } from './layers/legend';import { Marker } from './layers/marker';import { Highlight } from './user-interaction/highlight';import { Selection } from './user-interaction/selection';import { MapsTooltip } from './user-interaction/tooltip';import { Zoom } from './user-interaction/zoom';import { load, click, rightClick, loaded, doubleClick, resize, shapeSelected, itemSelection, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle } from './model/theme';import { BingMap } from './layers/bing-map';import { ILoadEventArgs, ILoadedEventArgs, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';import { GeoPosition, ITooltipRenderCompleteEventArgs, ILegendRenderingEventArgs } from './model/interface';import { ILayerRenderingEventArgs, IShapeRenderingEventArgs, IMarkerRenderingEventArgs, IMarkerClickEventArgs } from './model/interface';import { IMarkerMoveEventArgs, ILabelRenderingEventArgs, IBubbleMoveEventArgs, IBubbleClickEventArgs } from './model/interface';import { IMarkerClusterClickEventArgs, IMarkerClusterMoveEventArgs, IMarkerClusterRenderingEventArgs } from './model/interface';import { ISelectionEventArgs, IShapeSelectedEventArgs, IMapPanEventArgs, IMapZoomEventArgs } from './model/interface';import { IBubbleRenderingEventArgs, IAnimationCompleteEventArgs, IPrintEventArgs, IThemeStyle } from './model/interface';import { LayerPanel } from './layers/layer-panel';import { GeoLocation, Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, convertGeoToPoint, calculateZoomLevel } from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';import { DataManager, Query } from '@syncfusion/ej2-data';import { ExportType } from '../maps/utils/enum';import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';import { Print } from './model/print';import { PdfExport } from './model/export-pdf';import { ImageExport } from './model/export-image';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
package/src/maps/maps.d.ts
CHANGED
|
@@ -801,6 +801,9 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
801
801
|
* @returns {void}
|
|
802
802
|
*/
|
|
803
803
|
mouseLeaveOnMap(e: PointerEvent): void;
|
|
804
|
+
private keyUpHandler;
|
|
805
|
+
private keyboardHighlightSelection;
|
|
806
|
+
private keyDownHandler;
|
|
804
807
|
/**
|
|
805
808
|
* Gets the selected element to be maintained or not.
|
|
806
809
|
*
|
|
@@ -986,6 +989,11 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
986
989
|
* To find navigation line visibility
|
|
987
990
|
*/
|
|
988
991
|
private isNavigationVisible;
|
|
992
|
+
/**
|
|
993
|
+
* To find space between the secondary element and svg element.
|
|
994
|
+
* @private
|
|
995
|
+
*/
|
|
996
|
+
getExtraPosition(): Point;
|
|
989
997
|
/**
|
|
990
998
|
* To find marker visibility
|
|
991
999
|
*/
|
package/src/maps/maps.js
CHANGED
|
@@ -29,8 +29,8 @@ import { Component, NotifyPropertyChanges, Property, Ajax } from '@syncfusion/ej
|
|
|
29
29
|
import { EventHandler, Browser, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';
|
|
30
30
|
import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';
|
|
31
31
|
import { SvgRenderer } from '@syncfusion/ej2-svg-base';
|
|
32
|
-
import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, getMousePosition } from './utils/helper';
|
|
33
|
-
import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle } from './utils/helper';
|
|
32
|
+
import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, getMousePosition, calculateSize } from './utils/helper';
|
|
33
|
+
import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle, querySelector } from './utils/helper';
|
|
34
34
|
import { createStyle } from './utils/helper';
|
|
35
35
|
import { ZoomSettings, LegendSettings } from './model/base';
|
|
36
36
|
import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';
|
|
@@ -39,7 +39,7 @@ import { load, click, loaded, doubleClick, resize, shapeSelected, zoomIn } from
|
|
|
39
39
|
import { getThemeStyle } from './model/theme';
|
|
40
40
|
import { BingMap } from './layers/bing-map';
|
|
41
41
|
import { LayerPanel } from './layers/layer-panel';
|
|
42
|
-
import { Rect, RectOption, measureText, getElementByID, MapAjax, processResult } from '../maps/utils/helper';
|
|
42
|
+
import { Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';
|
|
43
43
|
import { findPosition, textTrim, TextOption, renderTextElement, convertGeoToPoint, calculateZoomLevel } from '../maps/utils/helper';
|
|
44
44
|
import { Annotations } from '../maps/user-interaction/annotation';
|
|
45
45
|
import { MarkerSettings } from './index';
|
|
@@ -395,7 +395,15 @@ var Maps = /** @class */ (function (_super) {
|
|
|
395
395
|
}
|
|
396
396
|
this.mapLayerPanel.measureLayerPanel();
|
|
397
397
|
this.element.appendChild(this.svgObject);
|
|
398
|
+
var position = this.getExtraPosition();
|
|
398
399
|
for (var i = 0; i < this.layers.length; i++) {
|
|
400
|
+
if (position.x !== 0 || position.y !== 0) {
|
|
401
|
+
var markerTemplate = document.getElementById(this.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
|
|
402
|
+
if (!isNullOrUndefined(markerTemplate)) {
|
|
403
|
+
markerTemplate.style.top = this.mapAreaRect.y + position.y + 'px';
|
|
404
|
+
markerTemplate.style.left = this.mapAreaRect.x + position.x + 'px';
|
|
405
|
+
}
|
|
406
|
+
}
|
|
399
407
|
if (this.layers[i].selectionSettings && this.layers[i].selectionSettings.enable &&
|
|
400
408
|
this.layers[i].initialShapeSelection.length > 0 && this.checkInitialRender) {
|
|
401
409
|
var checkSelection = this.layers[i].selectionSettings.enableMultiSelect;
|
|
@@ -795,7 +803,6 @@ var Maps = /** @class */ (function (_super) {
|
|
|
795
803
|
var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
|
|
796
804
|
var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
797
805
|
element.setAttribute('aria-label', this.description || title.text);
|
|
798
|
-
element.setAttribute('tabindex', (this.tabIndex + (type === 'title' ? 1 : 2)).toString());
|
|
799
806
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
800
807
|
height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
|
|
801
808
|
this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
|
|
@@ -854,6 +861,8 @@ var Maps = /** @class */ (function (_super) {
|
|
|
854
861
|
EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap, this);
|
|
855
862
|
EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEndOnMap, this);
|
|
856
863
|
EventHandler.add(this.element, 'pointerleave mouseleave', this.mouseLeaveOnMap, this);
|
|
864
|
+
EventHandler.add(this.element, 'keydown', this.keyDownHandler, this);
|
|
865
|
+
EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);
|
|
857
866
|
// EventHandler.add(this.element, cancelEvent, this.mouseLeaveOnMap, this);
|
|
858
867
|
window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize.bind(this));
|
|
859
868
|
};
|
|
@@ -871,6 +880,8 @@ var Maps = /** @class */ (function (_super) {
|
|
|
871
880
|
EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap);
|
|
872
881
|
EventHandler.remove(this.element, Browser.touchEndEvent, this.mouseEndOnMap);
|
|
873
882
|
EventHandler.remove(this.element, 'pointerleave mouseleave', this.mouseLeaveOnMap);
|
|
883
|
+
EventHandler.remove(this.element, 'keydown', this.keyDownHandler);
|
|
884
|
+
EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
|
|
874
885
|
//EventHandler.remove(this.element, cancelEvent, this.mouseLeaveOnMap);
|
|
875
886
|
window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize);
|
|
876
887
|
};
|
|
@@ -886,6 +897,96 @@ var Maps = /** @class */ (function (_super) {
|
|
|
886
897
|
removeClass(document.getElementsByClassName('highlightMapStyle')[0]);
|
|
887
898
|
}
|
|
888
899
|
};
|
|
900
|
+
Maps.prototype.keyUpHandler = function (event) {
|
|
901
|
+
var id = event.target['id'];
|
|
902
|
+
if (event.code === 'Tab' && id.indexOf('_LayerIndex_') > -1 && id.indexOf('shapeIndex') > -1) {
|
|
903
|
+
this.keyboardHighlightSelection(id, event.type);
|
|
904
|
+
}
|
|
905
|
+
else if (id.indexOf('_LayerIndex_') === -1 && id.indexOf('shapeIndex') === -1 &&
|
|
906
|
+
getElementsByClassName('highlightMapStyle').length > 0) {
|
|
907
|
+
removeClass(getElementsByClassName('highlightMapStyle')[0]);
|
|
908
|
+
if (this.legendSettings.visible && this.legendModule) {
|
|
909
|
+
this.legendModule.removeShapeHighlightCollection();
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
Maps.prototype.keyboardHighlightSelection = function (id, key) {
|
|
914
|
+
var layerIndex = parseInt(id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
915
|
+
var shapeIndex = parseInt(id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
916
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
917
|
+
var shapeData = this.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
|
|
918
|
+
this.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
|
|
919
|
+
var dataIndex = parseInt(id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
920
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
921
|
+
var data = isNullOrUndefined(dataIndex) ? null : this.layers[layerIndex].dataSource[dataIndex];
|
|
922
|
+
if (this.layers[layerIndex].selectionSettings.enable && key === 'keydown' && this.selectionModule) {
|
|
923
|
+
this.selectionModule.selectionsettings = this.layers[layerIndex].selectionSettings;
|
|
924
|
+
this.selectionModule.selectionType = 'Shape';
|
|
925
|
+
this.selectionModule.selectElement(event.target, layerIndex, data, shapeData);
|
|
926
|
+
}
|
|
927
|
+
else if (this.highlightModule && (this.layers[layerIndex].highlightSettings.enable && key === 'keyup' &&
|
|
928
|
+
!event.target.classList.contains('ShapeselectionMapStyle'))) {
|
|
929
|
+
this.highlightModule.highlightSettings = this.layers[layerIndex].highlightSettings;
|
|
930
|
+
this.highlightModule.handleHighlight(event.target, layerIndex, data, shapeData);
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
Maps.prototype.keyDownHandler = function (event) {
|
|
934
|
+
var zoom = this.zoomModule;
|
|
935
|
+
if ((event.key === '+' || event.code === 'Equal') && zoom) {
|
|
936
|
+
zoom.performZoomingByToolBar('zoomin');
|
|
937
|
+
}
|
|
938
|
+
else if ((event.key === '-' || event.code === 'Minus') && zoom) {
|
|
939
|
+
zoom.performZoomingByToolBar('zoomout');
|
|
940
|
+
}
|
|
941
|
+
else if (event['keyCode'] === 82 && zoom) {
|
|
942
|
+
zoom.performZoomingByToolBar('reset');
|
|
943
|
+
}
|
|
944
|
+
else if ((event.code === 'ArrowUp' || event.code === 'ArrowDown') && zoom) {
|
|
945
|
+
event.preventDefault();
|
|
946
|
+
zoom.mouseDownLatLong['x'] = 0;
|
|
947
|
+
zoom.mouseMoveLatLong['y'] = this.mapAreaRect.height / 7;
|
|
948
|
+
zoom.panning('None', zoom.mouseDownLatLong['x'], event.code === 'ArrowUp' ? -(zoom.mouseMoveLatLong['y']) :
|
|
949
|
+
zoom.mouseMoveLatLong['y'], event);
|
|
950
|
+
zoom.mouseDownLatLong['y'] = zoom.mouseMoveLatLong['y'];
|
|
951
|
+
}
|
|
952
|
+
else if ((event.code === 'ArrowLeft' || event.code === 'ArrowRight') && zoom) {
|
|
953
|
+
event.preventDefault();
|
|
954
|
+
zoom.mouseDownLatLong['y'] = 0;
|
|
955
|
+
zoom.mouseMoveLatLong['x'] = this.mapAreaRect.width / 7;
|
|
956
|
+
zoom.panning('None', event.code === 'ArrowLeft' ? -(zoom.mouseMoveLatLong['x']) : zoom.mouseMoveLatLong['x'], zoom.mouseDownLatLong['y'], event);
|
|
957
|
+
zoom.mouseDownLatLong['x'] = zoom.mouseMoveLatLong['x'];
|
|
958
|
+
}
|
|
959
|
+
else if (event.code === 'Enter') {
|
|
960
|
+
var id = event.target['id'];
|
|
961
|
+
event.preventDefault();
|
|
962
|
+
if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
|
|
963
|
+
this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
|
|
964
|
+
(this.legendModule.currentPage + 1);
|
|
965
|
+
this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
|
|
966
|
+
this.legendModule.drawLegendItem(this.legendModule.currentPage);
|
|
967
|
+
var textContent = (document.getElementById(this.element.id + '_Paging_Text')).textContent;
|
|
968
|
+
var text = textContent.split('/').map(Number);
|
|
969
|
+
if (id.indexOf('_Left_Page_Rect') > -1) {
|
|
970
|
+
if (text[0] !== 1) {
|
|
971
|
+
event.target.focus();
|
|
972
|
+
}
|
|
973
|
+
event.target.style.outlineColor = text[0] - 1 !== text[1] ? '' : 'transparent';
|
|
974
|
+
}
|
|
975
|
+
else if (id.indexOf('_Right_Page_Rect') > -1) {
|
|
976
|
+
if (text[0] !== text[1]) {
|
|
977
|
+
event.target.focus();
|
|
978
|
+
}
|
|
979
|
+
event.target.style.outlineColor = text[0] !== text[1] + 1 ? '' : 'transparent';
|
|
980
|
+
}
|
|
981
|
+
if (querySelector(this.element.id + '_Legend_Border', this.element.id)) {
|
|
982
|
+
querySelector(this.element.id + '_Legend_Border', this.element.id).style.pointerEvents = 'none';
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
if (id.indexOf('shapeIndex') > -1) {
|
|
986
|
+
this.keyboardHighlightSelection(id, event.type);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
};
|
|
889
990
|
/**
|
|
890
991
|
* Gets the selected element to be maintained or not.
|
|
891
992
|
*
|
|
@@ -1235,24 +1336,26 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1235
1336
|
var _this = this;
|
|
1236
1337
|
this.isResize = this.isReset = true;
|
|
1237
1338
|
var args = {
|
|
1339
|
+
cancel: false,
|
|
1238
1340
|
name: resize,
|
|
1239
1341
|
previousSize: this.availableSize,
|
|
1240
|
-
currentSize:
|
|
1342
|
+
currentSize: calculateSize(this),
|
|
1241
1343
|
maps: this
|
|
1242
1344
|
};
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1345
|
+
this.trigger(resize, args);
|
|
1346
|
+
if (!args.cancel) {
|
|
1347
|
+
if (this.resizeTo) {
|
|
1348
|
+
clearTimeout(this.resizeTo);
|
|
1349
|
+
}
|
|
1350
|
+
if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-maps')) {
|
|
1351
|
+
this.resizeTo = setTimeout(function () {
|
|
1352
|
+
_this.unWireEVents();
|
|
1353
|
+
_this.createSVG();
|
|
1354
|
+
_this.refreshing = true;
|
|
1355
|
+
_this.wireEVents();
|
|
1356
|
+
_this.render();
|
|
1357
|
+
}, 500);
|
|
1358
|
+
}
|
|
1256
1359
|
}
|
|
1257
1360
|
return false;
|
|
1258
1361
|
};
|
|
@@ -1840,6 +1943,26 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1840
1943
|
});
|
|
1841
1944
|
return isVisible;
|
|
1842
1945
|
};
|
|
1946
|
+
/**
|
|
1947
|
+
* To find space between the secondary element and svg element.
|
|
1948
|
+
* @private
|
|
1949
|
+
*/
|
|
1950
|
+
Maps.prototype.getExtraPosition = function () {
|
|
1951
|
+
var top = 0;
|
|
1952
|
+
var left = 0;
|
|
1953
|
+
var svgElement = getElement(this.element.id + '_svg');
|
|
1954
|
+
if (!isNullOrUndefined(svgElement)) {
|
|
1955
|
+
var svgClientRects = svgElement.getClientRects();
|
|
1956
|
+
var mapsClientRects = (getElement(this.element.id + '_Secondary_Element')).getClientRects();
|
|
1957
|
+
if (svgClientRects.length !== 0 && mapsClientRects.length !== 0) {
|
|
1958
|
+
var svgClientRect = svgClientRects[0];
|
|
1959
|
+
var mapsClientRect = mapsClientRects[0];
|
|
1960
|
+
top = svgClientRect.top - mapsClientRect.top;
|
|
1961
|
+
left = svgClientRect.left - mapsClientRect.left;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
return new Point(left, top);
|
|
1965
|
+
};
|
|
1843
1966
|
/**
|
|
1844
1967
|
* To find marker visibility
|
|
1845
1968
|
*/
|