@syncfusion/ej2-maps 19.4.47 → 19.4.48

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 19.4.47
3
+ * version : 19.4.48
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@19.4.42",
3
+ "_id": "@syncfusion/ej2-maps@19.4.47",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-6IogYAgkvC+yY7H06Uxil3SdTZuWzu2boQhnZA/djQSae2/fAdgMqnJqOMUYLodljc+O6wddpuilkmx2zAkLWg==",
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-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-19.4.42.tgz",
27
- "_shasum": "9aaa735f0d4d3574c0da6101157be9c1a6208652",
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.42",
39
- "@syncfusion/ej2-buttons": "~19.4.42",
40
- "@syncfusion/ej2-compression": "~19.4.38",
41
- "@syncfusion/ej2-data": "~19.4.47",
42
- "@syncfusion/ej2-file-utils": "~19.4.38",
43
- "@syncfusion/ej2-pdf-export": "~19.4.43",
44
- "@syncfusion/ej2-svg-base": "~19.4.42"
38
+ "@syncfusion/ej2-base": "~19.4.48",
39
+ "@syncfusion/ej2-buttons": "~19.4.48",
40
+ "@syncfusion/ej2-compression": "~19.4.48",
41
+ "@syncfusion/ej2-data": "~19.4.48",
42
+ "@syncfusion/ej2-file-utils": "~19.4.48",
43
+ "@syncfusion/ej2-pdf-export": "~19.4.48",
44
+ "@syncfusion/ej2-svg-base": "~19.4.48"
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.47",
83
+ "version": "19.4.48",
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 : areaRect.height
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 + 2).toString());
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
- private legendGroup;
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
- private drawLegendItem;
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;
@@ -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;
@@ -434,6 +461,7 @@ var Legend = /** @class */ (function () {
434
461
  var shapeBorder = collection['shapeBorder'];
435
462
  var legendElement = render.createGroup({ id: map.element.id + '_Legend_Index_' + collection['idIndex'] });
436
463
  var legendText = collection['DisplayText'];
464
+ var pagingArrowPadding = 4;
437
465
  var shape = ((legend.type === 'Markers') ? ((isNullOrUndefined(collection['ImageSrc'])) ?
438
466
  legend.shape : 'Image') : collection['legendShape']);
439
467
  var strokeColor = (legend.shape === 'HorizontalLine' || legend.shape === 'VerticalLine'
@@ -443,8 +471,8 @@ var Legend = /** @class */ (function () {
443
471
  1 : shapeBorder.width : shapeBorder.width;
444
472
  var shapeId = map.element.id + '_Legend_Shape_Index_' + collection['idIndex'];
445
473
  var textId = map.element.id + '_Legend_Text_Index_' + collection['idIndex'];
446
- var shapeLocation = collection['Shape'];
447
- 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));
448
476
  var imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
449
477
  var renderOptions_1 = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
450
478
  var legendTextStyle = {
@@ -487,10 +515,10 @@ var Legend = /** @class */ (function () {
487
515
  var pagingFont = legend.textStyle;
488
516
  var pagingTextSize = measureText(pagingText, pagingFont);
489
517
  var leftPageX = (this.legendItemRect.x + this.legendItemRect.width) - pagingTextSize.width -
490
- (width * 2) - spacing;
518
+ (width * 2) - (spacing * 2) + (pagingArrowPadding / 2);
491
519
  var rightPageX = (this.legendItemRect.x + this.legendItemRect.width);
520
+ var pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2) - pagingArrowPadding;
492
521
  var locY = (this.legendItemRect.y + this.legendItemRect.height) + (height / 2) + spacing;
493
- var pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2);
494
522
  pagingGroup = render.createGroup({ id: map.element.id + '_Legend_Paging_Group' });
495
523
  var leftPageElement = render.createGroup({ id: map.element.id + '_Legend_Left_Paging_Group' });
496
524
  var rightPageElement = render.createGroup({ id: map.element.id + '_Legend_Right_Paging_Group' });
@@ -498,15 +526,19 @@ var Legend = /** @class */ (function () {
498
526
  ' L ' + (rightPageX - width) + ' ' + (locY + height) + ' z ';
499
527
  var leftPath = ' M ' + leftPageX + ' ' + locY + ' L ' + (leftPageX + width) + ' ' + (locY - height) +
500
528
  ' L ' + (leftPageX + width) + ' ' + (locY + height) + ' z ';
501
- 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);
502
530
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
503
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, '', '');
504
- leftPageElement.appendChild(render.drawRectangle(leftRectPageOptions));
532
+ var pathEle = render.drawRectangle(leftRectPageOptions);
533
+ pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
534
+ leftPageElement.appendChild(pathEle);
505
535
  this.wireEvents(leftPageElement);
506
- 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);
507
537
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
508
- var rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect((rightPageX - width), (locY - height), width, spacing), null, null, '', '');
509
- rightPageElement.appendChild(render.drawRectangle(rightRectPageOptions));
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);
510
542
  this.wireEvents(rightPageElement);
511
543
  pagingGroup.appendChild(leftPageElement);
512
544
  pagingGroup.appendChild(rightPageElement);
@@ -1244,13 +1276,13 @@ var Legend = /** @class */ (function () {
1244
1276
  break;
1245
1277
  }
1246
1278
  if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
1247
- map.totalRect = totalRect;
1279
+ this.legendTotalRect = map.totalRect = totalRect;
1248
1280
  }
1249
1281
  else {
1250
1282
  if ((legend.height || legend.width) && legend.mode === 'Interactive') {
1251
1283
  map.totalRect = totalRect;
1252
1284
  }
1253
- map.mapAreaRect = totalRect;
1285
+ this.legendTotalRect = map.mapAreaRect = totalRect;
1254
1286
  }
1255
1287
  this.translate = new Point(x, y);
1256
1288
  }
@@ -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, calculateSize } 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
  /**
@@ -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
  *
package/src/maps/maps.js CHANGED
@@ -30,7 +30,7 @@ import { EventHandler, Browser, isNullOrUndefined, createElement, setValue, exte
30
30
  import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';
31
31
  import { SvgRenderer } from '@syncfusion/ej2-svg-base';
32
32
  import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, getMousePosition, calculateSize } from './utils/helper';
33
- import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle } 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';
@@ -803,7 +803,6 @@ var Maps = /** @class */ (function (_super) {
803
803
  var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
804
804
  var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
805
805
  element.setAttribute('aria-label', this.description || title.text);
806
- element.setAttribute('tabindex', (this.tabIndex + (type === 'title' ? 1 : 2)).toString());
807
806
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
808
807
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
809
808
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -862,6 +861,8 @@ var Maps = /** @class */ (function (_super) {
862
861
  EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap, this);
863
862
  EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEndOnMap, this);
864
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);
865
866
  // EventHandler.add(this.element, cancelEvent, this.mouseLeaveOnMap, this);
866
867
  window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize.bind(this));
867
868
  };
@@ -879,6 +880,8 @@ var Maps = /** @class */ (function (_super) {
879
880
  EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap);
880
881
  EventHandler.remove(this.element, Browser.touchEndEvent, this.mouseEndOnMap);
881
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);
882
885
  //EventHandler.remove(this.element, cancelEvent, this.mouseLeaveOnMap);
883
886
  window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize);
884
887
  };
@@ -894,6 +897,96 @@ var Maps = /** @class */ (function (_super) {
894
897
  removeClass(document.getElementsByClassName('highlightMapStyle')[0]);
895
898
  }
896
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
+ };
897
990
  /**
898
991
  * Gets the selected element to be maintained or not.
899
992
  *
@@ -1855,14 +1948,18 @@ var Maps = /** @class */ (function (_super) {
1855
1948
  * @private
1856
1949
  */
1857
1950
  Maps.prototype.getExtraPosition = function () {
1858
- var top;
1859
- var left;
1951
+ var top = 0;
1952
+ var left = 0;
1860
1953
  var svgElement = getElement(this.element.id + '_svg');
1861
1954
  if (!isNullOrUndefined(svgElement)) {
1862
- var svgClientRect = svgElement.getClientRects()[0];
1863
- var mapsClientRect = (getElement(this.element.id + '_Secondary_Element')).getClientRects()[0];
1864
- top = svgClientRect.top - mapsClientRect.top;
1865
- left = svgClientRect.left - mapsClientRect.left;
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
+ }
1866
1963
  }
1867
1964
  return new Point(left, top);
1868
1965
  };
@@ -1,10 +1,14 @@
1
1
  import { Maps } from '../../index';
2
+ import { HighlightSettingsModel } from '../index';
2
3
  /**
3
4
  * Highlight module class
4
5
  */
5
6
  export declare class Highlight {
6
7
  private maps;
7
- private highlightSettings;
8
+ /**
9
+ * @private
10
+ */
11
+ highlightSettings: HighlightSettingsModel;
8
12
  constructor(maps: Maps);
9
13
  /**
10
14
  * To bind events for highlight module
@@ -23,6 +27,10 @@ export declare class Highlight {
23
27
  */
24
28
  addHighlight(layerIndex: number, name: string, enable: boolean): void;
25
29
  private mouseMove;
30
+ /**
31
+ * @private
32
+ */
33
+ handleHighlight(targetElement: Element, layerIndex: number, data: any, shapeData: any): void;
26
34
  private mapHighlight;
27
35
  private highlightMap;
28
36
  /**
@@ -93,14 +93,7 @@ var Highlight = /** @class */ (function () {
93
93
  this.highlightSettings = this.maps.layers[layerIndex].navigationLineSettings[index].highlightSettings;
94
94
  }
95
95
  if (this.highlightSettings.enable) {
96
- if (this.maps.legendSettings.visible && targetEle.id.indexOf('_MarkerIndex_') === -1) {
97
- this.maps.legendModule.shapeHighLightAndSelection(targetEle, data, this.highlightSettings, 'highlight', layerIndex);
98
- }
99
- var selectHighLight = targetEle.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible ?
100
- this.maps.legendModule.shapeToggled : true;
101
- if (selectHighLight) {
102
- this.mapHighlight(targetEle, shapeData, data);
103
- }
96
+ this.handleHighlight(targetEle, layerIndex, data, shapeData);
104
97
  }
105
98
  else {
106
99
  var element = document.getElementsByClassName('highlightMapStyle')[0];
@@ -124,21 +117,35 @@ var Highlight = /** @class */ (function () {
124
117
  targetEle.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
125
118
  }
126
119
  removeClass(targetEle);
127
- if (this.maps.legendSettings.visible) {
120
+ if (this.maps.legendSettings.visible && this.maps.legendModule) {
128
121
  this.maps.legendModule.removeShapeHighlightCollection();
129
122
  }
130
123
  }
131
124
  else if ((targetEle.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') !== -1 ||
132
- targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) &&
125
+ targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendModule &&
133
126
  this.maps.legendSettings.visible && targetEle.id.indexOf('_Text') === -1) {
134
127
  this.maps.legendModule.legendHighLightAndSelection(targetEle, 'highlight');
135
128
  }
136
129
  else {
137
- if (this.maps.legendSettings.visible) {
130
+ if (this.maps.legendSettings.visible && this.maps.legendModule) {
138
131
  this.maps.legendModule.removeLegendHighlightCollection();
139
132
  }
140
133
  }
141
134
  };
135
+ /**
136
+ * @private
137
+ */
138
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
139
+ Highlight.prototype.handleHighlight = function (targetElement, layerIndex, data, shapeData) {
140
+ if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule) {
141
+ this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
142
+ }
143
+ var selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
144
+ this.maps.legendModule.shapeToggled : true;
145
+ if (selectHighLight) {
146
+ this.mapHighlight(targetElement, shapeData, data);
147
+ }
148
+ };
142
149
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
143
150
  Highlight.prototype.mapHighlight = function (targetEle, shapeData, data) {
144
151
  var _this = this;
@@ -1,10 +1,14 @@
1
1
  import { Maps } from '../../index';
2
+ import { SelectionSettingsModel } from '../index';
2
3
  /**
3
4
  * Selection module class
4
5
  */
5
6
  export declare class Selection {
6
7
  private maps;
7
- private selectionsettings;
8
+ /**
9
+ * @private
10
+ */
11
+ selectionsettings: SelectionSettingsModel;
8
12
  /**
9
13
  * @private
10
14
  */
@@ -23,6 +27,10 @@ export declare class Selection {
23
27
  */
24
28
  private removeEventListener;
25
29
  private mouseClick;
30
+ /**
31
+ * @private
32
+ */
33
+ selectElement(targetElement: Element, layerIndex: number, data: any, shapeData: any): void;
26
34
  /**
27
35
  * Public method for selection
28
36
  */
@@ -80,24 +80,31 @@ var Selection = /** @class */ (function () {
80
80
  this.selectionType = 'navigationline';
81
81
  }
82
82
  if (this.selectionsettings.enable) {
83
- this.maps.mapSelect = targetElement ? true : false;
84
- if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
85
- this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
86
- }
87
- var shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible) ?
88
- this.maps.legendModule.shapeToggled : true;
89
- if (shapeToggled) {
90
- this.selectMap(targetElement, shapeData, data);
91
- }
83
+ this.selectElement(targetElement, layerIndex, data, shapeData);
92
84
  }
93
85
  }
94
- else if (this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable &&
86
+ else if ((this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable && this.maps.legendModule) &&
95
87
  !isNullOrUndefined(targetElement.id) && targetElement.id.indexOf('_Text') === -1 &&
96
88
  (targetElement.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') > -1 ||
97
89
  targetElement.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1)) {
98
90
  this.maps.legendModule.legendHighLightAndSelection(targetElement, 'selection');
99
91
  }
100
92
  };
93
+ /**
94
+ * @private
95
+ */
96
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
97
+ Selection.prototype.selectElement = function (targetElement, layerIndex, data, shapeData) {
98
+ this.maps.mapSelect = targetElement ? true : false;
99
+ if (this.maps.legendModule && this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
100
+ this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
101
+ }
102
+ var shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible && this.maps.legendModule) ?
103
+ this.maps.legendModule.shapeToggled : true;
104
+ if (shapeToggled) {
105
+ this.selectMap(targetElement, shapeData, data);
106
+ }
107
+ };
101
108
  // eslint-disable-next-line valid-jsdoc
102
109
  /**
103
110
  * Public method for selection