@syncfusion/ej2-maps 19.4.42 → 19.4.53

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.
@@ -5502,7 +5502,8 @@ class LayerPanel {
5502
5502
  else {
5503
5503
  this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
5504
5504
  x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
5505
- width: areaRect.width, height: (areaRect.height < 0) ? 0 : areaRect.height
5505
+ width: areaRect.width, height: (areaRect.height < 0) ? 0 : !isNullOrUndefined(this.mapObject.legendModule) &&
5506
+ this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
5506
5507
  }));
5507
5508
  }
5508
5509
  this.layerGroup.appendChild(this.clipRectElement);
@@ -5968,7 +5969,7 @@ class LayerPanel {
5968
5969
  }
5969
5970
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
5970
5971
  (currentShapeData['property'][properties]) : ''));
5971
- pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i + 2).toString());
5972
+ pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i + 3).toString());
5972
5973
  if (drawingType === 'LineString') {
5973
5974
  pathEle.setAttribute('style', 'outline:none');
5974
5975
  }
@@ -7593,7 +7594,6 @@ let Maps = class Maps extends Component {
7593
7594
  const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
7594
7595
  const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
7595
7596
  element.setAttribute('aria-label', this.description || title.text);
7596
- element.setAttribute('tabindex', (this.tabIndex + (type === 'title' ? 1 : 2)).toString());
7597
7597
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
7598
7598
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
7599
7599
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -7652,6 +7652,8 @@ let Maps = class Maps extends Component {
7652
7652
  EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap, this);
7653
7653
  EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEndOnMap, this);
7654
7654
  EventHandler.add(this.element, 'pointerleave mouseleave', this.mouseLeaveOnMap, this);
7655
+ EventHandler.add(this.element, 'keydown', this.keyDownHandler, this);
7656
+ EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);
7655
7657
  // EventHandler.add(this.element, cancelEvent, this.mouseLeaveOnMap, this);
7656
7658
  window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize.bind(this));
7657
7659
  }
@@ -7669,6 +7671,8 @@ let Maps = class Maps extends Component {
7669
7671
  EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap);
7670
7672
  EventHandler.remove(this.element, Browser.touchEndEvent, this.mouseEndOnMap);
7671
7673
  EventHandler.remove(this.element, 'pointerleave mouseleave', this.mouseLeaveOnMap);
7674
+ EventHandler.remove(this.element, 'keydown', this.keyDownHandler);
7675
+ EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
7672
7676
  //EventHandler.remove(this.element, cancelEvent, this.mouseLeaveOnMap);
7673
7677
  window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize);
7674
7678
  }
@@ -7684,6 +7688,96 @@ let Maps = class Maps extends Component {
7684
7688
  removeClass(document.getElementsByClassName('highlightMapStyle')[0]);
7685
7689
  }
7686
7690
  }
7691
+ keyUpHandler(event) {
7692
+ const id = event.target['id'];
7693
+ if (event.code === 'Tab' && id.indexOf('_LayerIndex_') > -1 && id.indexOf('shapeIndex') > -1) {
7694
+ this.keyboardHighlightSelection(id, event.type);
7695
+ }
7696
+ else if (id.indexOf('_LayerIndex_') === -1 && id.indexOf('shapeIndex') === -1 &&
7697
+ getElementsByClassName('highlightMapStyle').length > 0) {
7698
+ removeClass(getElementsByClassName('highlightMapStyle')[0]);
7699
+ if (this.legendSettings.visible && this.legendModule) {
7700
+ this.legendModule.removeShapeHighlightCollection();
7701
+ }
7702
+ }
7703
+ }
7704
+ keyboardHighlightSelection(id, key) {
7705
+ const layerIndex = parseInt(id.split('_LayerIndex_')[1].split('_')[0], 10);
7706
+ const shapeIndex = parseInt(id.split('_shapeIndex_')[1].split('_')[0], 10);
7707
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7708
+ const shapeData = this.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
7709
+ this.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
7710
+ const dataIndex = parseInt(id.split('_dataIndex_')[1].split('_')[0], 10);
7711
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7712
+ const data = isNullOrUndefined(dataIndex) ? null : this.layers[layerIndex].dataSource[dataIndex];
7713
+ if (this.layers[layerIndex].selectionSettings.enable && key === 'keydown' && this.selectionModule) {
7714
+ this.selectionModule.selectionsettings = this.layers[layerIndex].selectionSettings;
7715
+ this.selectionModule.selectionType = 'Shape';
7716
+ this.selectionModule.selectElement(event.target, layerIndex, data, shapeData);
7717
+ }
7718
+ else if (this.highlightModule && (this.layers[layerIndex].highlightSettings.enable && key === 'keyup' &&
7719
+ !event.target.classList.contains('ShapeselectionMapStyle'))) {
7720
+ this.highlightModule.highlightSettings = this.layers[layerIndex].highlightSettings;
7721
+ this.highlightModule.handleHighlight(event.target, layerIndex, data, shapeData);
7722
+ }
7723
+ }
7724
+ keyDownHandler(event) {
7725
+ const zoom = this.zoomModule;
7726
+ if ((event.key === '+' || event.code === 'Equal') && zoom) {
7727
+ zoom.performZoomingByToolBar('zoomin');
7728
+ }
7729
+ else if ((event.key === '-' || event.code === 'Minus') && zoom) {
7730
+ zoom.performZoomingByToolBar('zoomout');
7731
+ }
7732
+ else if (event['keyCode'] === 82 && zoom) {
7733
+ zoom.performZoomingByToolBar('reset');
7734
+ }
7735
+ else if ((event.code === 'ArrowUp' || event.code === 'ArrowDown') && zoom) {
7736
+ event.preventDefault();
7737
+ zoom.mouseDownLatLong['x'] = 0;
7738
+ zoom.mouseMoveLatLong['y'] = this.mapAreaRect.height / 7;
7739
+ zoom.panning('None', zoom.mouseDownLatLong['x'], event.code === 'ArrowUp' ? -(zoom.mouseMoveLatLong['y']) :
7740
+ zoom.mouseMoveLatLong['y'], event);
7741
+ zoom.mouseDownLatLong['y'] = zoom.mouseMoveLatLong['y'];
7742
+ }
7743
+ else if ((event.code === 'ArrowLeft' || event.code === 'ArrowRight') && zoom) {
7744
+ event.preventDefault();
7745
+ zoom.mouseDownLatLong['y'] = 0;
7746
+ zoom.mouseMoveLatLong['x'] = this.mapAreaRect.width / 7;
7747
+ zoom.panning('None', event.code === 'ArrowLeft' ? -(zoom.mouseMoveLatLong['x']) : zoom.mouseMoveLatLong['x'], zoom.mouseDownLatLong['y'], event);
7748
+ zoom.mouseDownLatLong['x'] = zoom.mouseMoveLatLong['x'];
7749
+ }
7750
+ else if (event.code === 'Enter') {
7751
+ const id = event.target['id'];
7752
+ event.preventDefault();
7753
+ if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
7754
+ this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
7755
+ (this.legendModule.currentPage + 1);
7756
+ this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
7757
+ this.legendModule.drawLegendItem(this.legendModule.currentPage);
7758
+ const textContent = (document.getElementById(this.element.id + '_Paging_Text')).textContent;
7759
+ const text = textContent.split('/').map(Number);
7760
+ if (id.indexOf('_Left_Page_Rect') > -1) {
7761
+ if (text[0] !== 1) {
7762
+ event.target.focus();
7763
+ }
7764
+ event.target.style.outlineColor = text[0] - 1 !== text[1] ? '' : 'transparent';
7765
+ }
7766
+ else if (id.indexOf('_Right_Page_Rect') > -1) {
7767
+ if (text[0] !== text[1]) {
7768
+ event.target.focus();
7769
+ }
7770
+ event.target.style.outlineColor = text[0] !== text[1] + 1 ? '' : 'transparent';
7771
+ }
7772
+ if (querySelector(this.element.id + '_Legend_Border', this.element.id)) {
7773
+ querySelector(this.element.id + '_Legend_Border', this.element.id).style.pointerEvents = 'none';
7774
+ }
7775
+ }
7776
+ if (id.indexOf('shapeIndex') > -1) {
7777
+ this.keyboardHighlightSelection(id, event.type);
7778
+ }
7779
+ }
7780
+ }
7687
7781
  /**
7688
7782
  * Gets the selected element to be maintained or not.
7689
7783
  *
@@ -7729,12 +7823,8 @@ let Maps = class Maps extends Component {
7729
7823
  }
7730
7824
  }
7731
7825
  if (this.markerModule) {
7732
- this.markerModule.markerClick(e);
7733
7826
  this.markerModule.markerClusterClick(e);
7734
7827
  }
7735
- if (this.bubbleModule) {
7736
- this.bubbleModule.bubbleClick(e);
7737
- }
7738
7828
  if (!eventArgs.cancel) {
7739
7829
  this.notify(click, targetEle);
7740
7830
  }
@@ -8624,16 +8714,21 @@ let Maps = class Maps extends Component {
8624
8714
  }
8625
8715
  /**
8626
8716
  * To find space between the secondary element and svg element.
8717
+ * @private
8627
8718
  */
8628
8719
  getExtraPosition() {
8629
- let top;
8630
- let left;
8720
+ let top = 0;
8721
+ let left = 0;
8631
8722
  const svgElement = getElement(this.element.id + '_svg');
8632
8723
  if (!isNullOrUndefined(svgElement)) {
8633
- const svgClientRect = svgElement.getClientRects()[0];
8634
- const mapsClientRect = (getElement(this.element.id + '_Secondary_Element')).getClientRects()[0];
8635
- top = svgClientRect.top - mapsClientRect.top;
8636
- left = svgClientRect.left - mapsClientRect.left;
8724
+ const svgClientRects = svgElement.getClientRects();
8725
+ const mapsClientRects = (getElement(this.element.id + '_Secondary_Element')).getClientRects();
8726
+ if (svgClientRects.length !== 0 && mapsClientRects.length !== 0) {
8727
+ const svgClientRect = svgClientRects[0];
8728
+ const mapsClientRect = mapsClientRects[0];
8729
+ top = svgClientRect.top - mapsClientRect.top;
8730
+ left = svgClientRect.left - mapsClientRect.left;
8731
+ }
8637
8732
  }
8638
8733
  return new Point(left, top);
8639
8734
  }
@@ -9833,7 +9928,14 @@ class NavigationLine {
9833
9928
  */
9834
9929
  class Legend {
9835
9930
  constructor(maps) {
9931
+ /**
9932
+ * @private
9933
+ */
9836
9934
  this.legendBorderRect = new Rect(0, 0, 0, 0);
9935
+ /**
9936
+ * @private
9937
+ */
9938
+ this.legendTotalRect = new Rect(0, 0, 0, 0);
9837
9939
  /**
9838
9940
  * @private
9839
9941
  */
@@ -9850,12 +9952,27 @@ class Legend {
9850
9952
  this.textMaxWidth = 0;
9851
9953
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9852
9954
  this.shapeHighlightCollection = [];
9955
+ /**
9956
+ * @private
9957
+ */
9853
9958
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9854
9959
  this.legendHighlightCollection = [];
9960
+ /**
9961
+ * @private
9962
+ */
9855
9963
  this.shapePreviousColor = [];
9964
+ /**
9965
+ * @private
9966
+ */
9856
9967
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9857
9968
  this.selectedNonLegendShapes = [];
9969
+ /**
9970
+ * @private
9971
+ */
9858
9972
  this.shapeToggled = true;
9973
+ /**
9974
+ * @private
9975
+ */
9859
9976
  this.legendElement = null;
9860
9977
  this.maps = maps;
9861
9978
  this.addEventListener();
@@ -10234,6 +10351,11 @@ class Legend {
10234
10351
  this.drawLegendItem(this.currentPage);
10235
10352
  }
10236
10353
  }
10354
+ /**
10355
+ * @param {string} page - Specifies the legend page.
10356
+ * @returns {void}
10357
+ * @private
10358
+ */
10237
10359
  drawLegendItem(page) {
10238
10360
  const map = this.maps;
10239
10361
  const legend = map.legendSettings;
@@ -10253,6 +10375,7 @@ class Legend {
10253
10375
  const shapeBorder = collection['shapeBorder'];
10254
10376
  let legendElement = render.createGroup({ id: map.element.id + '_Legend_Index_' + collection['idIndex'] });
10255
10377
  let legendText = collection['DisplayText'];
10378
+ const pagingArrowPadding = 4;
10256
10379
  const shape = ((legend.type === 'Markers') ? ((isNullOrUndefined(collection['ImageSrc'])) ?
10257
10380
  legend.shape : 'Image') : collection['legendShape']);
10258
10381
  const strokeColor = (legend.shape === 'HorizontalLine' || legend.shape === 'VerticalLine'
@@ -10262,8 +10385,8 @@ class Legend {
10262
10385
  1 : shapeBorder.width : shapeBorder.width;
10263
10386
  const shapeId = map.element.id + '_Legend_Shape_Index_' + collection['idIndex'];
10264
10387
  const textId = map.element.id + '_Legend_Text_Index_' + collection['idIndex'];
10265
- const shapeLocation = collection['Shape'];
10266
- const textLocation = collection['Text'];
10388
+ const shapeLocation = new Point(collection['Shape']['x'], (collection['Shape']['y'] - pagingArrowPadding));
10389
+ const textLocation = new Point(collection['Text']['x'], (collection['Text']['y'] - pagingArrowPadding));
10267
10390
  const imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
10268
10391
  const renderOptions = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
10269
10392
  const legendTextStyle = {
@@ -10306,10 +10429,10 @@ class Legend {
10306
10429
  const pagingFont = legend.textStyle;
10307
10430
  const pagingTextSize = measureText(pagingText, pagingFont);
10308
10431
  const leftPageX = (this.legendItemRect.x + this.legendItemRect.width) - pagingTextSize.width -
10309
- (width * 2) - spacing;
10432
+ (width * 2) - (spacing * 2) + (pagingArrowPadding / 2);
10310
10433
  const rightPageX = (this.legendItemRect.x + this.legendItemRect.width);
10434
+ const pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2) - pagingArrowPadding;
10311
10435
  const locY = (this.legendItemRect.y + this.legendItemRect.height) + (height / 2) + spacing;
10312
- const pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2);
10313
10436
  pagingGroup = render.createGroup({ id: map.element.id + '_Legend_Paging_Group' });
10314
10437
  const leftPageElement = render.createGroup({ id: map.element.id + '_Legend_Left_Paging_Group' });
10315
10438
  const rightPageElement = render.createGroup({ id: map.element.id + '_Legend_Right_Paging_Group' });
@@ -10317,15 +10440,19 @@ class Legend {
10317
10440
  ' L ' + (rightPageX - width) + ' ' + (locY + height) + ' z ';
10318
10441
  const leftPath = ' M ' + leftPageX + ' ' + locY + ' L ' + (leftPageX + width) + ' ' + (locY - height) +
10319
10442
  ' L ' + (leftPageX + width) + ' ' + (locY + height) + ' z ';
10320
- const leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', 1, 1, '', leftPath);
10443
+ const leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === 1 ? 0.5 : 1), 1, '', leftPath);
10321
10444
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
10322
10445
  const 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, '', '');
10323
- leftPageElement.appendChild(render.drawRectangle(leftRectPageOptions));
10446
+ let pathEle = render.drawRectangle(leftRectPageOptions);
10447
+ pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
10448
+ leftPageElement.appendChild(pathEle);
10324
10449
  this.wireEvents(leftPageElement);
10325
- const rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', 1, 1, '', rightPath);
10450
+ const rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
10326
10451
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
10327
- const rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect((rightPageX - width), (locY - height), width, spacing), null, null, '', '');
10328
- rightPageElement.appendChild(render.drawRectangle(rightRectPageOptions));
10452
+ const 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, '', '');
10453
+ pathEle = render.drawRectangle(rightRectPageOptions);
10454
+ pathEle.setAttribute('tabindex', ((page + 1) === this.totalPages.length ? -1 : map.tabIndex + 2).toString());
10455
+ rightPageElement.appendChild(pathEle);
10329
10456
  this.wireEvents(rightPageElement);
10330
10457
  pagingGroup.appendChild(leftPageElement);
10331
10458
  pagingGroup.appendChild(rightPageElement);
@@ -11063,13 +11190,13 @@ class Legend {
11063
11190
  break;
11064
11191
  }
11065
11192
  if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
11066
- map.totalRect = totalRect;
11193
+ this.legendTotalRect = map.totalRect = totalRect;
11067
11194
  }
11068
11195
  else {
11069
11196
  if ((legend.height || legend.width) && legend.mode === 'Interactive') {
11070
11197
  map.totalRect = totalRect;
11071
11198
  }
11072
- map.mapAreaRect = totalRect;
11199
+ this.legendTotalRect = map.mapAreaRect = totalRect;
11073
11200
  }
11074
11201
  this.translate = new Point(x, y);
11075
11202
  }
@@ -11928,14 +12055,7 @@ class Highlight {
11928
12055
  this.highlightSettings = this.maps.layers[layerIndex].navigationLineSettings[index].highlightSettings;
11929
12056
  }
11930
12057
  if (this.highlightSettings.enable) {
11931
- if (this.maps.legendSettings.visible && targetEle.id.indexOf('_MarkerIndex_') === -1) {
11932
- this.maps.legendModule.shapeHighLightAndSelection(targetEle, data, this.highlightSettings, 'highlight', layerIndex);
11933
- }
11934
- const selectHighLight = targetEle.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible ?
11935
- this.maps.legendModule.shapeToggled : true;
11936
- if (selectHighLight) {
11937
- this.mapHighlight(targetEle, shapeData, data);
11938
- }
12058
+ this.handleHighlight(targetEle, layerIndex, data, shapeData);
11939
12059
  }
11940
12060
  else {
11941
12061
  const element = document.getElementsByClassName('highlightMapStyle')[0];
@@ -11959,21 +12079,35 @@ class Highlight {
11959
12079
  targetEle.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
11960
12080
  }
11961
12081
  removeClass(targetEle);
11962
- if (this.maps.legendSettings.visible) {
12082
+ if (this.maps.legendSettings.visible && this.maps.legendModule) {
11963
12083
  this.maps.legendModule.removeShapeHighlightCollection();
11964
12084
  }
11965
12085
  }
11966
12086
  else if ((targetEle.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') !== -1 ||
11967
- targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) &&
12087
+ targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendModule &&
11968
12088
  this.maps.legendSettings.visible && targetEle.id.indexOf('_Text') === -1) {
11969
12089
  this.maps.legendModule.legendHighLightAndSelection(targetEle, 'highlight');
11970
12090
  }
11971
12091
  else {
11972
- if (this.maps.legendSettings.visible) {
12092
+ if (this.maps.legendSettings.visible && this.maps.legendModule) {
11973
12093
  this.maps.legendModule.removeLegendHighlightCollection();
11974
12094
  }
11975
12095
  }
11976
12096
  }
12097
+ /**
12098
+ * @private
12099
+ */
12100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12101
+ handleHighlight(targetElement, layerIndex, data, shapeData) {
12102
+ if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule) {
12103
+ this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
12104
+ }
12105
+ const selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
12106
+ this.maps.legendModule.shapeToggled : true;
12107
+ if (selectHighLight) {
12108
+ this.mapHighlight(targetElement, shapeData, data);
12109
+ }
12110
+ }
11977
12111
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11978
12112
  mapHighlight(targetEle, shapeData, data) {
11979
12113
  const layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
@@ -12130,24 +12264,31 @@ class Selection {
12130
12264
  this.selectionType = 'navigationline';
12131
12265
  }
12132
12266
  if (this.selectionsettings.enable) {
12133
- this.maps.mapSelect = targetElement ? true : false;
12134
- if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
12135
- this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
12136
- }
12137
- const shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible) ?
12138
- this.maps.legendModule.shapeToggled : true;
12139
- if (shapeToggled) {
12140
- this.selectMap(targetElement, shapeData, data);
12141
- }
12267
+ this.selectElement(targetElement, layerIndex, data, shapeData);
12142
12268
  }
12143
12269
  }
12144
- else if (this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable &&
12270
+ else if ((this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable && this.maps.legendModule) &&
12145
12271
  !isNullOrUndefined(targetElement.id) && targetElement.id.indexOf('_Text') === -1 &&
12146
12272
  (targetElement.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') > -1 ||
12147
12273
  targetElement.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1)) {
12148
12274
  this.maps.legendModule.legendHighLightAndSelection(targetElement, 'selection');
12149
12275
  }
12150
12276
  }
12277
+ /**
12278
+ * @private
12279
+ */
12280
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12281
+ selectElement(targetElement, layerIndex, data, shapeData) {
12282
+ this.maps.mapSelect = targetElement ? true : false;
12283
+ if (this.maps.legendModule && this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
12284
+ this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
12285
+ }
12286
+ const shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible && this.maps.legendModule) ?
12287
+ this.maps.legendModule.shapeToggled : true;
12288
+ if (shapeToggled) {
12289
+ this.selectMap(targetElement, shapeData, data);
12290
+ }
12291
+ }
12151
12292
  // eslint-disable-next-line valid-jsdoc
12152
12293
  /**
12153
12294
  * Public method for selection
@@ -13522,6 +13663,9 @@ class Zoom {
13522
13663
  }
13523
13664
  }
13524
13665
  }
13666
+ /**
13667
+ * @private
13668
+ */
13525
13669
  panning(direction, xDifference, yDifference, mouseLocation) {
13526
13670
  const map = this.maps;
13527
13671
  let panArgs;
@@ -13540,6 +13684,8 @@ class Zoom {
13540
13684
  yDifference = !isNullOrUndefined(yDifference) ? yDifference : (down.y - move.y);
13541
13685
  this.maps.mergeCluster();
13542
13686
  if (!map.isTileMap) {
13687
+ const legendElement = document.getElementById(map.element.id + '_Legend_Group');
13688
+ const legendHeight = !isNullOrUndefined(legendElement) ? legendElement.getClientRects()[0].height : 0;
13543
13689
  x = translatePoint.x - xDifference / scale;
13544
13690
  y = translatePoint.y - yDifference / scale;
13545
13691
  const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
@@ -13547,7 +13693,7 @@ class Zoom {
13547
13693
  const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
13548
13694
  ((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
13549
13695
  const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
13550
- ((layerRect.top + layerRect.height + map.margin.top) >= (elementRect.top + elementRect.height))));
13696
+ ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
13551
13697
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13552
13698
  const location = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
13553
13699
  panArgs = {
@@ -13949,8 +14095,9 @@ class Zoom {
13949
14095
  x = (size.width - toolBarSize.width) - padding;
13950
14096
  break;
13951
14097
  }
13952
- element.style.left = x + 'px';
13953
- element.style.top = y + 'px';
14098
+ let extraPosition = map.getExtraPosition();
14099
+ element.style.left = x + extraPosition.x + 'px';
14100
+ element.style.top = y + extraPosition.y + 'px';
13954
14101
  const color = this.maps.zoomSettings.highlightColor || this.maps.themeStyle.zoomSelectionColor;
13955
14102
  const css = ' .e-maps-toolbar:hover > circle { stroke:' + color + '; } .e-maps-toolbar:hover > path { fill: ' + color + ' ; stroke: ' + color + '; }' +
13956
14103
  '.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } ' +