@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.
@@ -59,13 +59,15 @@ function calculateSize(maps) {
59
59
  var containerHeight = maps.element.clientHeight;
60
60
  var containerElementWidth = stringToNumber(maps.element.style.width, containerWidth);
61
61
  var containerElementHeight = stringToNumber(maps.element.style.height, containerHeight);
62
+ var availableSize = new Size(0, 0);
62
63
  if (maps.width === '0px' || maps.width === '0%' || maps.height === '0%' || maps.height === '0px') {
63
- maps.availableSize = new Size(0, 0);
64
+ availableSize = new Size(0, 0);
64
65
  }
65
66
  else {
66
- maps.availableSize = new Size(stringToNumber(maps.width, containerWidth) || containerWidth || containerElementWidth || 600, stringToNumber(maps.height, containerHeight) || containerHeight || containerElementHeight || (maps.isDevice ?
67
+ availableSize = new Size(stringToNumber(maps.width, containerWidth) || containerWidth || containerElementWidth || 600, stringToNumber(maps.height, containerHeight) || containerHeight || containerElementHeight || (maps.isDevice ?
67
68
  Math.min(window.innerWidth, window.innerHeight) : 450));
68
69
  }
70
+ return availableSize;
69
71
  }
70
72
  /**
71
73
  * Method to create svg for maps.
@@ -75,7 +77,7 @@ function calculateSize(maps) {
75
77
  */
76
78
  function createSvg(maps) {
77
79
  maps.renderer = new SvgRenderer(maps.element.id);
78
- calculateSize(maps);
80
+ maps.availableSize = calculateSize(maps);
79
81
  maps.svgObject = maps.renderer.createSvg({
80
82
  id: maps.element.id + '_svg',
81
83
  width: maps.availableSize.width,
@@ -857,7 +859,7 @@ function markerShapeChoose(eventArgs, data) {
857
859
  var shape = ((eventArgs.shapeValuePath.indexOf('.') > -1) ?
858
860
  (getValueFromObject(data, eventArgs.shapeValuePath).toString()) :
859
861
  data[eventArgs.shapeValuePath]);
860
- eventArgs.shape = shape;
862
+ eventArgs.shape = (shape.toString() !== "") ? shape : eventArgs.shape;
861
863
  if (data[eventArgs.shapeValuePath] === 'Image') {
862
864
  eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
863
865
  ((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
@@ -866,7 +868,7 @@ function markerShapeChoose(eventArgs, data) {
866
868
  }
867
869
  else {
868
870
  var shapes = (!isNullOrUndefined(eventArgs.shapeValuePath)) ? ((eventArgs.shapeValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.shapeValuePath).toString() : eventArgs.shape) : eventArgs.shape;
869
- eventArgs.shape = shapes;
871
+ eventArgs.shape = (shapes.toString() !== "") ? shapes : eventArgs.shape;
870
872
  var shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
871
873
  ((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
872
874
  data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
@@ -1429,7 +1431,7 @@ function calculateShapes(maps, shape, options, size, location, markerEle) {
1429
1431
  var tempGroup;
1430
1432
  switch (shape) {
1431
1433
  case 'Balloon':
1432
- tempGroup = drawBalloon(maps, options, size, location, markerEle);
1434
+ tempGroup = drawBalloon(maps, options, size, location, 'Marker', markerEle);
1433
1435
  break;
1434
1436
  case 'Cross':
1435
1437
  options.d = 'M ' + location.x + ' ' + (location.y - size.height / 2) + ' L ' + location.x + ' ' + (location.y + size.height
@@ -1587,9 +1589,10 @@ function drawStar(maps, options, size, location, element) {
1587
1589
  * @returns {Element} - Returns the element
1588
1590
  * @private
1589
1591
  */
1590
- function drawBalloon(maps, options, size, location, element) {
1592
+ function drawBalloon(maps, options, size, location, type, element) {
1591
1593
  var width = size.width;
1592
1594
  var height = size.height;
1595
+ var pathElement;
1593
1596
  location.x -= width / 2;
1594
1597
  location.y -= height;
1595
1598
  options.d = 'M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16' +
@@ -1598,9 +1601,15 @@ function drawBalloon(maps, options, size, location, element) {
1598
1601
  var x = size.width / 30;
1599
1602
  var y = size.height / 30;
1600
1603
  balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
1601
- var g = maps.renderer.createGroup({ id: options.id });
1602
- appendShape(balloon, g);
1603
- return appendShape(g, element);
1604
+ if (type === 'Marker') {
1605
+ var g = maps.renderer.createGroup({ id: options.id });
1606
+ appendShape(balloon, g);
1607
+ pathElement = appendShape(g, element);
1608
+ }
1609
+ else {
1610
+ pathElement = balloon;
1611
+ }
1612
+ return pathElement;
1604
1613
  }
1605
1614
  /**
1606
1615
  * Internal rendering of Pattern
@@ -2721,6 +2730,8 @@ function renderLegendShape(location, size, shape, options, url) {
2721
2730
  var shapeY = location.y;
2722
2731
  var x = location.x + (-shapeWidth / 2);
2723
2732
  var y = location.y + (-shapeHeight / 2);
2733
+ options['stroke'] = (shape === 'HorizontalLine' || shape === 'VerticalLine' || shape === 'Cross') ? options['fill'] : options['stroke'];
2734
+ options['stroke-width'] = (options['stroke-width'] === 0 && (shape === 'HorizontalLine' || shape === 'VerticalLine' || shape === 'Cross')) ? 1 : options['stroke-width'];
2724
2735
  switch (shape) {
2725
2736
  case 'Circle':
2726
2737
  case 'Bubble':
@@ -2732,6 +2743,11 @@ function renderLegendShape(location, size, shape, options, url) {
2732
2743
  + (shapeY + (-shapeHeight / 2));
2733
2744
  merge(options, { 'd': renderPath });
2734
2745
  break;
2746
+ case 'HorizontalLine':
2747
+ renderPath = 'M' + ' ' + shapeX + ' ' + shapeY + ' ' + 'L' + ' ' + (shapeX + (shapeWidth / 2)) + ' '
2748
+ + shapeY;
2749
+ merge(options, { 'd': renderPath });
2750
+ break;
2735
2751
  case 'Diamond':
2736
2752
  renderPath = 'M' + ' ' + x + ' ' + shapeY + ' ' +
2737
2753
  'L' + ' ' + shapeX + ' ' + (shapeY + (-shapeHeight / 2)) + ' ' +
@@ -4391,6 +4407,9 @@ var LegendSettings = /** @__PURE__ @class */ (function (_super) {
4391
4407
  function LegendSettings() {
4392
4408
  return _super !== null && _super.apply(this, arguments) || this;
4393
4409
  }
4410
+ __decorate$1([
4411
+ Property(false)
4412
+ ], LegendSettings.prototype, "useMarkerShape", void 0);
4394
4413
  __decorate$1([
4395
4414
  Property(false)
4396
4415
  ], LegendSettings.prototype, "toggleVisibility", void 0);
@@ -5708,7 +5727,8 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
5708
5727
  else {
5709
5728
  this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
5710
5729
  x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
5711
- width: areaRect.width, height: (areaRect.height < 0) ? 0 : areaRect.height
5730
+ width: areaRect.width, height: (areaRect.height < 0) ? 0 : !isNullOrUndefined(this.mapObject.legendModule) &&
5731
+ this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
5712
5732
  }));
5713
5733
  }
5714
5734
  this.layerGroup.appendChild(this.clipRectElement);
@@ -6176,7 +6196,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
6176
6196
  }
6177
6197
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
6178
6198
  (currentShapeData['property'][properties]) : ''));
6179
- pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 2).toString());
6199
+ pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 3).toString());
6180
6200
  if (drawingType === 'LineString') {
6181
6201
  pathEle.setAttribute('style', 'outline:none');
6182
6202
  }
@@ -7446,7 +7466,15 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
7446
7466
  }
7447
7467
  this.mapLayerPanel.measureLayerPanel();
7448
7468
  this.element.appendChild(this.svgObject);
7469
+ var position = this.getExtraPosition();
7449
7470
  for (var i = 0; i < this.layers.length; i++) {
7471
+ if (position.x !== 0 || position.y !== 0) {
7472
+ var markerTemplate$$1 = document.getElementById(this.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
7473
+ if (!isNullOrUndefined(markerTemplate$$1)) {
7474
+ markerTemplate$$1.style.top = this.mapAreaRect.y + position.y + 'px';
7475
+ markerTemplate$$1.style.left = this.mapAreaRect.x + position.x + 'px';
7476
+ }
7477
+ }
7450
7478
  if (this.layers[i].selectionSettings && this.layers[i].selectionSettings.enable &&
7451
7479
  this.layers[i].initialShapeSelection.length > 0 && this.checkInitialRender) {
7452
7480
  var checkSelection = this.layers[i].selectionSettings.enableMultiSelect;
@@ -7846,7 +7874,6 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
7846
7874
  var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
7847
7875
  var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
7848
7876
  element.setAttribute('aria-label', this.description || title.text);
7849
- element.setAttribute('tabindex', (this.tabIndex + (type === 'title' ? 1 : 2)).toString());
7850
7877
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
7851
7878
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
7852
7879
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -7905,6 +7932,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
7905
7932
  EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap, this);
7906
7933
  EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEndOnMap, this);
7907
7934
  EventHandler.add(this.element, 'pointerleave mouseleave', this.mouseLeaveOnMap, this);
7935
+ EventHandler.add(this.element, 'keydown', this.keyDownHandler, this);
7936
+ EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);
7908
7937
  // EventHandler.add(this.element, cancelEvent, this.mouseLeaveOnMap, this);
7909
7938
  window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize.bind(this));
7910
7939
  };
@@ -7922,6 +7951,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
7922
7951
  EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap);
7923
7952
  EventHandler.remove(this.element, Browser.touchEndEvent, this.mouseEndOnMap);
7924
7953
  EventHandler.remove(this.element, 'pointerleave mouseleave', this.mouseLeaveOnMap);
7954
+ EventHandler.remove(this.element, 'keydown', this.keyDownHandler);
7955
+ EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
7925
7956
  //EventHandler.remove(this.element, cancelEvent, this.mouseLeaveOnMap);
7926
7957
  window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize);
7927
7958
  };
@@ -7937,6 +7968,96 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
7937
7968
  removeClass(document.getElementsByClassName('highlightMapStyle')[0]);
7938
7969
  }
7939
7970
  };
7971
+ Maps.prototype.keyUpHandler = function (event) {
7972
+ var id = event.target['id'];
7973
+ if (event.code === 'Tab' && id.indexOf('_LayerIndex_') > -1 && id.indexOf('shapeIndex') > -1) {
7974
+ this.keyboardHighlightSelection(id, event.type);
7975
+ }
7976
+ else if (id.indexOf('_LayerIndex_') === -1 && id.indexOf('shapeIndex') === -1 &&
7977
+ getElementsByClassName('highlightMapStyle').length > 0) {
7978
+ removeClass(getElementsByClassName('highlightMapStyle')[0]);
7979
+ if (this.legendSettings.visible && this.legendModule) {
7980
+ this.legendModule.removeShapeHighlightCollection();
7981
+ }
7982
+ }
7983
+ };
7984
+ Maps.prototype.keyboardHighlightSelection = function (id, key) {
7985
+ var layerIndex = parseInt(id.split('_LayerIndex_')[1].split('_')[0], 10);
7986
+ var shapeIndex = parseInt(id.split('_shapeIndex_')[1].split('_')[0], 10);
7987
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7988
+ var shapeData = this.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
7989
+ this.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
7990
+ var dataIndex = parseInt(id.split('_dataIndex_')[1].split('_')[0], 10);
7991
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7992
+ var data = isNullOrUndefined(dataIndex) ? null : this.layers[layerIndex].dataSource[dataIndex];
7993
+ if (this.layers[layerIndex].selectionSettings.enable && key === 'keydown' && this.selectionModule) {
7994
+ this.selectionModule.selectionsettings = this.layers[layerIndex].selectionSettings;
7995
+ this.selectionModule.selectionType = 'Shape';
7996
+ this.selectionModule.selectElement(event.target, layerIndex, data, shapeData);
7997
+ }
7998
+ else if (this.highlightModule && (this.layers[layerIndex].highlightSettings.enable && key === 'keyup' &&
7999
+ !event.target.classList.contains('ShapeselectionMapStyle'))) {
8000
+ this.highlightModule.highlightSettings = this.layers[layerIndex].highlightSettings;
8001
+ this.highlightModule.handleHighlight(event.target, layerIndex, data, shapeData);
8002
+ }
8003
+ };
8004
+ Maps.prototype.keyDownHandler = function (event) {
8005
+ var zoom = this.zoomModule;
8006
+ if ((event.key === '+' || event.code === 'Equal') && zoom) {
8007
+ zoom.performZoomingByToolBar('zoomin');
8008
+ }
8009
+ else if ((event.key === '-' || event.code === 'Minus') && zoom) {
8010
+ zoom.performZoomingByToolBar('zoomout');
8011
+ }
8012
+ else if (event['keyCode'] === 82 && zoom) {
8013
+ zoom.performZoomingByToolBar('reset');
8014
+ }
8015
+ else if ((event.code === 'ArrowUp' || event.code === 'ArrowDown') && zoom) {
8016
+ event.preventDefault();
8017
+ zoom.mouseDownLatLong['x'] = 0;
8018
+ zoom.mouseMoveLatLong['y'] = this.mapAreaRect.height / 7;
8019
+ zoom.panning('None', zoom.mouseDownLatLong['x'], event.code === 'ArrowUp' ? -(zoom.mouseMoveLatLong['y']) :
8020
+ zoom.mouseMoveLatLong['y'], event);
8021
+ zoom.mouseDownLatLong['y'] = zoom.mouseMoveLatLong['y'];
8022
+ }
8023
+ else if ((event.code === 'ArrowLeft' || event.code === 'ArrowRight') && zoom) {
8024
+ event.preventDefault();
8025
+ zoom.mouseDownLatLong['y'] = 0;
8026
+ zoom.mouseMoveLatLong['x'] = this.mapAreaRect.width / 7;
8027
+ zoom.panning('None', event.code === 'ArrowLeft' ? -(zoom.mouseMoveLatLong['x']) : zoom.mouseMoveLatLong['x'], zoom.mouseDownLatLong['y'], event);
8028
+ zoom.mouseDownLatLong['x'] = zoom.mouseMoveLatLong['x'];
8029
+ }
8030
+ else if (event.code === 'Enter') {
8031
+ var id = event.target['id'];
8032
+ event.preventDefault();
8033
+ if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
8034
+ this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
8035
+ (this.legendModule.currentPage + 1);
8036
+ this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
8037
+ this.legendModule.drawLegendItem(this.legendModule.currentPage);
8038
+ var textContent = (document.getElementById(this.element.id + '_Paging_Text')).textContent;
8039
+ var text = textContent.split('/').map(Number);
8040
+ if (id.indexOf('_Left_Page_Rect') > -1) {
8041
+ if (text[0] !== 1) {
8042
+ event.target.focus();
8043
+ }
8044
+ event.target.style.outlineColor = text[0] - 1 !== text[1] ? '' : 'transparent';
8045
+ }
8046
+ else if (id.indexOf('_Right_Page_Rect') > -1) {
8047
+ if (text[0] !== text[1]) {
8048
+ event.target.focus();
8049
+ }
8050
+ event.target.style.outlineColor = text[0] !== text[1] + 1 ? '' : 'transparent';
8051
+ }
8052
+ if (querySelector(this.element.id + '_Legend_Border', this.element.id)) {
8053
+ querySelector(this.element.id + '_Legend_Border', this.element.id).style.pointerEvents = 'none';
8054
+ }
8055
+ }
8056
+ if (id.indexOf('shapeIndex') > -1) {
8057
+ this.keyboardHighlightSelection(id, event.type);
8058
+ }
8059
+ }
8060
+ };
7940
8061
  /**
7941
8062
  * Gets the selected element to be maintained or not.
7942
8063
  *
@@ -8274,24 +8395,26 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8274
8395
  var _this = this;
8275
8396
  this.isResize = this.isReset = true;
8276
8397
  var args = {
8398
+ cancel: false,
8277
8399
  name: resize,
8278
8400
  previousSize: this.availableSize,
8279
- currentSize: new Size(0, 0),
8401
+ currentSize: calculateSize(this),
8280
8402
  maps: this
8281
8403
  };
8282
- if (this.resizeTo) {
8283
- clearTimeout(this.resizeTo);
8284
- }
8285
- if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-maps')) {
8286
- this.resizeTo = setTimeout(function () {
8287
- _this.unWireEVents();
8288
- _this.createSVG();
8289
- _this.refreshing = true;
8290
- _this.wireEVents();
8291
- args.currentSize = _this.availableSize;
8292
- _this.trigger(resize, args);
8293
- _this.render();
8294
- }, 500);
8404
+ this.trigger(resize, args);
8405
+ if (!args.cancel) {
8406
+ if (this.resizeTo) {
8407
+ clearTimeout(this.resizeTo);
8408
+ }
8409
+ if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-maps')) {
8410
+ this.resizeTo = setTimeout(function () {
8411
+ _this.unWireEVents();
8412
+ _this.createSVG();
8413
+ _this.refreshing = true;
8414
+ _this.wireEVents();
8415
+ _this.render();
8416
+ }, 500);
8417
+ }
8295
8418
  }
8296
8419
  return false;
8297
8420
  };
@@ -8879,6 +9002,26 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8879
9002
  });
8880
9003
  return isVisible;
8881
9004
  };
9005
+ /**
9006
+ * To find space between the secondary element and svg element.
9007
+ * @private
9008
+ */
9009
+ Maps.prototype.getExtraPosition = function () {
9010
+ var top = 0;
9011
+ var left = 0;
9012
+ var svgElement = getElement(this.element.id + '_svg');
9013
+ if (!isNullOrUndefined(svgElement)) {
9014
+ var svgClientRects = svgElement.getClientRects();
9015
+ var mapsClientRects = (getElement(this.element.id + '_Secondary_Element')).getClientRects();
9016
+ if (svgClientRects.length !== 0 && mapsClientRects.length !== 0) {
9017
+ var svgClientRect = svgClientRects[0];
9018
+ var mapsClientRect = mapsClientRects[0];
9019
+ top = svgClientRect.top - mapsClientRect.top;
9020
+ left = svgClientRect.left - mapsClientRect.left;
9021
+ }
9022
+ }
9023
+ return new Point(left, top);
9024
+ };
8882
9025
  /**
8883
9026
  * To find marker visibility
8884
9027
  */
@@ -10093,7 +10236,14 @@ var NavigationLine = /** @__PURE__ @class */ (function () {
10093
10236
  */
10094
10237
  var Legend = /** @__PURE__ @class */ (function () {
10095
10238
  function Legend(maps) {
10239
+ /**
10240
+ * @private
10241
+ */
10096
10242
  this.legendBorderRect = new Rect(0, 0, 0, 0);
10243
+ /**
10244
+ * @private
10245
+ */
10246
+ this.legendTotalRect = new Rect(0, 0, 0, 0);
10097
10247
  /**
10098
10248
  * @private
10099
10249
  */
@@ -10110,12 +10260,27 @@ var Legend = /** @__PURE__ @class */ (function () {
10110
10260
  this.textMaxWidth = 0;
10111
10261
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10112
10262
  this.shapeHighlightCollection = [];
10263
+ /**
10264
+ * @private
10265
+ */
10113
10266
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10114
10267
  this.legendHighlightCollection = [];
10268
+ /**
10269
+ * @private
10270
+ */
10115
10271
  this.shapePreviousColor = [];
10272
+ /**
10273
+ * @private
10274
+ */
10116
10275
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10117
10276
  this.selectedNonLegendShapes = [];
10277
+ /**
10278
+ * @private
10279
+ */
10118
10280
  this.shapeToggled = true;
10281
+ /**
10282
+ * @private
10283
+ */
10119
10284
  this.legendElement = null;
10120
10285
  this.maps = maps;
10121
10286
  this.addEventListener();
@@ -10496,6 +10661,11 @@ var Legend = /** @__PURE__ @class */ (function () {
10496
10661
  this.drawLegendItem(this.currentPage);
10497
10662
  }
10498
10663
  };
10664
+ /**
10665
+ * @param {string} page - Specifies the legend page.
10666
+ * @returns {void}
10667
+ * @private
10668
+ */
10499
10669
  Legend.prototype.drawLegendItem = function (page) {
10500
10670
  var map = this.maps;
10501
10671
  var legend = map.legendSettings;
@@ -10503,6 +10673,7 @@ var Legend = /** @__PURE__ @class */ (function () {
10503
10673
  var shapeSize = new Size(legend.shapeWidth, legend.shapeHeight);
10504
10674
  var textOptions;
10505
10675
  var render = map.renderer;
10676
+ var legendShape = legend.shape;
10506
10677
  if (page >= 0 && page < this.totalPages.length) {
10507
10678
  if (querySelector(this.legendGroup.id, this.maps.element.id)) {
10508
10679
  remove(querySelector(this.legendGroup.id, this.maps.element.id));
@@ -10514,6 +10685,7 @@ var Legend = /** @__PURE__ @class */ (function () {
10514
10685
  var shapeBorder = collection['shapeBorder'];
10515
10686
  var legendElement = render.createGroup({ id: map.element.id + '_Legend_Index_' + collection['idIndex'] });
10516
10687
  var legendText = collection['DisplayText'];
10688
+ var pagingArrowPadding = 4;
10517
10689
  var shape = ((legend.type === 'Markers') ? ((isNullOrUndefined(collection['ImageSrc'])) ?
10518
10690
  legend.shape : 'Image') : collection['legendShape']);
10519
10691
  var strokeColor = (legend.shape === 'HorizontalLine' || legend.shape === 'VerticalLine'
@@ -10523,8 +10695,8 @@ var Legend = /** @__PURE__ @class */ (function () {
10523
10695
  1 : shapeBorder.width : shapeBorder.width;
10524
10696
  var shapeId = map.element.id + '_Legend_Shape_Index_' + collection['idIndex'];
10525
10697
  var textId = map.element.id + '_Legend_Text_Index_' + collection['idIndex'];
10526
- var shapeLocation = collection['Shape'];
10527
- var textLocation = collection['Text'];
10698
+ var shapeLocation = new Point(collection['Shape']['x'], (collection['Shape']['y'] - pagingArrowPadding));
10699
+ var textLocation = new Point(collection['Text']['x'], (collection['Text']['y'] - pagingArrowPadding));
10528
10700
  var imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
10529
10701
  var renderOptions_1 = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
10530
10702
  var legendTextStyle = {
@@ -10538,7 +10710,17 @@ var Legend = /** @__PURE__ @class */ (function () {
10538
10710
  if (i === 0) {
10539
10711
  this.renderLegendBorder();
10540
10712
  }
10541
- legendElement.appendChild(drawSymbol(shapeLocation, shape, shapeSize, collection['ImageSrc'], renderOptions_1));
10713
+ if (legend.type === 'Markers' && legend.useMarkerShape) {
10714
+ var legendShapeData = this.legendCollection[collection['idIndex']].data[0];
10715
+ var marker$$1 = map.layers[legendShapeData['layerIndex']].markerSettings[legendShapeData['markerIndex']];
10716
+ legendShape = !isNullOrUndefined(marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']]) && marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']] !== '' ? marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']] : marker$$1.shape;
10717
+ }
10718
+ if (legendShape === "Balloon") {
10719
+ legendElement.appendChild(drawBalloon(map, renderOptions_1, shapeSize, { x: shapeLocation.x, y: (shapeLocation.y + 5) }, 'Legend'));
10720
+ }
10721
+ else {
10722
+ legendElement.appendChild(drawSymbol(shapeLocation, legendShape, shapeSize, collection['ImageSrc'], renderOptions_1));
10723
+ }
10542
10724
  var legendRectSize = collection['Rect']['x'] + collection['Rect']['width'];
10543
10725
  if (legendRectSize > this.legendBorderRect.width) {
10544
10726
  var trimmedText = this.legendTextTrim(this.legendBorderRect.width, legendText, legendTextStyle, legendRectSize);
@@ -10557,10 +10739,10 @@ var Legend = /** @__PURE__ @class */ (function () {
10557
10739
  var pagingFont = legend.textStyle;
10558
10740
  var pagingTextSize = measureText(pagingText, pagingFont);
10559
10741
  var leftPageX = (this.legendItemRect.x + this.legendItemRect.width) - pagingTextSize.width -
10560
- (width * 2) - spacing;
10742
+ (width * 2) - (spacing * 2) + (pagingArrowPadding / 2);
10561
10743
  var rightPageX = (this.legendItemRect.x + this.legendItemRect.width);
10744
+ var pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2) - pagingArrowPadding;
10562
10745
  var locY = (this.legendItemRect.y + this.legendItemRect.height) + (height / 2) + spacing;
10563
- var pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2);
10564
10746
  pagingGroup = render.createGroup({ id: map.element.id + '_Legend_Paging_Group' });
10565
10747
  var leftPageElement = render.createGroup({ id: map.element.id + '_Legend_Left_Paging_Group' });
10566
10748
  var rightPageElement = render.createGroup({ id: map.element.id + '_Legend_Right_Paging_Group' });
@@ -10568,15 +10750,19 @@ var Legend = /** @__PURE__ @class */ (function () {
10568
10750
  ' L ' + (rightPageX - width) + ' ' + (locY + height) + ' z ';
10569
10751
  var leftPath = ' M ' + leftPageX + ' ' + locY + ' L ' + (leftPageX + width) + ' ' + (locY - height) +
10570
10752
  ' L ' + (leftPageX + width) + ' ' + (locY + height) + ' z ';
10571
- var leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', 1, 1, '', leftPath);
10753
+ var leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === 1 ? 0.5 : 1), 1, '', leftPath);
10572
10754
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
10573
10755
  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, '', '');
10574
- leftPageElement.appendChild(render.drawRectangle(leftRectPageOptions));
10756
+ var pathEle = render.drawRectangle(leftRectPageOptions);
10757
+ pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
10758
+ leftPageElement.appendChild(pathEle);
10575
10759
  this.wireEvents(leftPageElement);
10576
- var rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', 1, 1, '', rightPath);
10760
+ var rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
10577
10761
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
10578
- var rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect((rightPageX - width), (locY - height), width, spacing), null, null, '', '');
10579
- rightPageElement.appendChild(render.drawRectangle(rightRectPageOptions));
10762
+ 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, '', '');
10763
+ pathEle = render.drawRectangle(rightRectPageOptions);
10764
+ pathEle.setAttribute('tabindex', ((page + 1) === this.totalPages.length ? -1 : map.tabIndex + 2).toString());
10765
+ rightPageElement.appendChild(pathEle);
10580
10766
  this.wireEvents(rightPageElement);
10581
10767
  pagingGroup.appendChild(leftPageElement);
10582
10768
  pagingGroup.appendChild(rightPageElement);
@@ -11314,13 +11500,13 @@ var Legend = /** @__PURE__ @class */ (function () {
11314
11500
  break;
11315
11501
  }
11316
11502
  if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
11317
- map.totalRect = totalRect;
11503
+ this.legendTotalRect = map.totalRect = totalRect;
11318
11504
  }
11319
11505
  else {
11320
11506
  if ((legend.height || legend.width) && legend.mode === 'Interactive') {
11321
11507
  map.totalRect = totalRect;
11322
11508
  }
11323
- map.mapAreaRect = totalRect;
11509
+ this.legendTotalRect = map.mapAreaRect = totalRect;
11324
11510
  }
11325
11511
  this.translate = new Point(x, y);
11326
11512
  }
@@ -11355,7 +11541,7 @@ var Legend = /** @__PURE__ @class */ (function () {
11355
11541
  }
11356
11542
  else {
11357
11543
  newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
11358
- shape: !isNullOrUndefined(marker$$1.shapeValuePath) ? data[marker$$1.shapeValuePath] : marker$$1.shape });
11544
+ shape: (!isNullOrUndefined(marker$$1.shapeValuePath) && !isNullOrUndefined(data[marker$$1.shapeValuePath]) && data[marker$$1.shapeValuePath] !== '') ? data[marker$$1.shapeValuePath] : (_this.maps.legendSettings.useMarkerShape ? marker$$1.shape : _this.maps.legendSettings.shape) });
11359
11545
  _this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
11360
11546
  }
11361
11547
  }
@@ -11735,7 +11921,7 @@ var Legend = /** @__PURE__ @class */ (function () {
11735
11921
  shape = this.legendCollection[legendIndex]['data'][i];
11736
11922
  mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
11737
11923
  '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
11738
- '_MarkerIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
11924
+ '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
11739
11925
  if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
11740
11926
  mapElement = mapElement.children[0];
11741
11927
  }
@@ -11759,6 +11945,9 @@ var Legend = /** @__PURE__ @class */ (function () {
11759
11945
  if (targetEle !== null) {
11760
11946
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
11761
11947
  legendShapeId.setAttribute('fill', '#E5E5E5');
11948
+ if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
11949
+ legendShapeId.setAttribute('stroke', '#E5E5E5');
11950
+ }
11762
11951
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
11763
11952
  legendTextId.setAttribute('fill', '#E5E5E5');
11764
11953
  }
@@ -11773,6 +11962,9 @@ var Legend = /** @__PURE__ @class */ (function () {
11773
11962
  if (targetEle !== null) {
11774
11963
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
11775
11964
  legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
11965
+ if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
11966
+ legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
11967
+ }
11776
11968
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
11777
11969
  legendTextId.setAttribute('fill', '#757575');
11778
11970
  }
@@ -11857,7 +12049,7 @@ var Legend = /** @__PURE__ @class */ (function () {
11857
12049
  targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendSettings.visible &&
11858
12050
  targetEle.id.indexOf('_Text') === -1) {
11859
12051
  var LegendInteractive = void 0;
11860
- var legendIndex = parseFloat(targetEle.id.substr((this.maps.element.id + '_Legend_Index_').length));
12052
+ var legendIndex = parseFloat(targetEle.id.split(this.maps.element.id + '_Legend_Index_')[1]);
11861
12053
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11862
12054
  var mapdata = void 0;
11863
12055
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -12189,14 +12381,7 @@ var Highlight = /** @__PURE__ @class */ (function () {
12189
12381
  this.highlightSettings = this.maps.layers[layerIndex].navigationLineSettings[index].highlightSettings;
12190
12382
  }
12191
12383
  if (this.highlightSettings.enable) {
12192
- if (this.maps.legendSettings.visible && targetEle.id.indexOf('_MarkerIndex_') === -1) {
12193
- this.maps.legendModule.shapeHighLightAndSelection(targetEle, data, this.highlightSettings, 'highlight', layerIndex);
12194
- }
12195
- var selectHighLight = targetEle.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible ?
12196
- this.maps.legendModule.shapeToggled : true;
12197
- if (selectHighLight) {
12198
- this.mapHighlight(targetEle, shapeData, data);
12199
- }
12384
+ this.handleHighlight(targetEle, layerIndex, data, shapeData);
12200
12385
  }
12201
12386
  else {
12202
12387
  var element = document.getElementsByClassName('highlightMapStyle')[0];
@@ -12220,21 +12405,35 @@ var Highlight = /** @__PURE__ @class */ (function () {
12220
12405
  targetEle.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
12221
12406
  }
12222
12407
  removeClass(targetEle);
12223
- if (this.maps.legendSettings.visible) {
12408
+ if (this.maps.legendSettings.visible && this.maps.legendModule) {
12224
12409
  this.maps.legendModule.removeShapeHighlightCollection();
12225
12410
  }
12226
12411
  }
12227
12412
  else if ((targetEle.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') !== -1 ||
12228
- targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) &&
12413
+ targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendModule &&
12229
12414
  this.maps.legendSettings.visible && targetEle.id.indexOf('_Text') === -1) {
12230
12415
  this.maps.legendModule.legendHighLightAndSelection(targetEle, 'highlight');
12231
12416
  }
12232
12417
  else {
12233
- if (this.maps.legendSettings.visible) {
12418
+ if (this.maps.legendSettings.visible && this.maps.legendModule) {
12234
12419
  this.maps.legendModule.removeLegendHighlightCollection();
12235
12420
  }
12236
12421
  }
12237
12422
  };
12423
+ /**
12424
+ * @private
12425
+ */
12426
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12427
+ Highlight.prototype.handleHighlight = function (targetElement, layerIndex, data, shapeData) {
12428
+ if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule) {
12429
+ this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
12430
+ }
12431
+ var selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
12432
+ this.maps.legendModule.shapeToggled : true;
12433
+ if (selectHighLight) {
12434
+ this.mapHighlight(targetElement, shapeData, data);
12435
+ }
12436
+ };
12238
12437
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12239
12438
  Highlight.prototype.mapHighlight = function (targetEle, shapeData, data) {
12240
12439
  var _this = this;
@@ -12393,24 +12592,31 @@ var Selection = /** @__PURE__ @class */ (function () {
12393
12592
  this.selectionType = 'navigationline';
12394
12593
  }
12395
12594
  if (this.selectionsettings.enable) {
12396
- this.maps.mapSelect = targetElement ? true : false;
12397
- if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
12398
- this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
12399
- }
12400
- var shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible) ?
12401
- this.maps.legendModule.shapeToggled : true;
12402
- if (shapeToggled) {
12403
- this.selectMap(targetElement, shapeData, data);
12404
- }
12595
+ this.selectElement(targetElement, layerIndex, data, shapeData);
12405
12596
  }
12406
12597
  }
12407
- else if (this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable &&
12598
+ else if ((this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable && this.maps.legendModule) &&
12408
12599
  !isNullOrUndefined(targetElement.id) && targetElement.id.indexOf('_Text') === -1 &&
12409
12600
  (targetElement.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') > -1 ||
12410
12601
  targetElement.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1)) {
12411
12602
  this.maps.legendModule.legendHighLightAndSelection(targetElement, 'selection');
12412
12603
  }
12413
12604
  };
12605
+ /**
12606
+ * @private
12607
+ */
12608
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12609
+ Selection.prototype.selectElement = function (targetElement, layerIndex, data, shapeData) {
12610
+ this.maps.mapSelect = targetElement ? true : false;
12611
+ if (this.maps.legendModule && this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
12612
+ this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
12613
+ }
12614
+ var shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible && this.maps.legendModule) ?
12615
+ this.maps.legendModule.shapeToggled : true;
12616
+ if (shapeToggled) {
12617
+ this.selectMap(targetElement, shapeData, data);
12618
+ }
12619
+ };
12414
12620
  // eslint-disable-next-line valid-jsdoc
12415
12621
  /**
12416
12622
  * Public method for selection
@@ -13796,6 +14002,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
13796
14002
  }
13797
14003
  }
13798
14004
  };
14005
+ /**
14006
+ * @private
14007
+ */
13799
14008
  Zoom.prototype.panning = function (direction, xDifference, yDifference, mouseLocation) {
13800
14009
  var map = this.maps;
13801
14010
  var panArgs;
@@ -13814,6 +14023,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
13814
14023
  yDifference = !isNullOrUndefined(yDifference) ? yDifference : (down.y - move.y);
13815
14024
  this.maps.mergeCluster();
13816
14025
  if (!map.isTileMap) {
14026
+ var legendElement = document.getElementById(map.element.id + '_Legend_Group');
14027
+ var legendHeight = !isNullOrUndefined(legendElement) ? legendElement.getClientRects()[0].height : 0;
13817
14028
  x = translatePoint.x - xDifference / scale;
13818
14029
  y = translatePoint.y - yDifference / scale;
13819
14030
  var layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
@@ -13821,7 +14032,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
13821
14032
  var panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
13822
14033
  ((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
13823
14034
  var panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
13824
- ((layerRect.top + layerRect.height + map.margin.top) >= (elementRect.top + elementRect.height))));
14035
+ ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
13825
14036
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13826
14037
  var location_3 = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
13827
14038
  panArgs = {
@@ -14224,8 +14435,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
14224
14435
  x = (size.width - toolBarSize.width) - padding;
14225
14436
  break;
14226
14437
  }
14227
- element.style.left = x + 'px';
14228
- element.style.top = y + 'px';
14438
+ var extraPosition = map.getExtraPosition();
14439
+ element.style.left = x + extraPosition.x + 'px';
14440
+ element.style.top = y + extraPosition.y + 'px';
14229
14441
  var color = this.maps.zoomSettings.highlightColor || this.maps.themeStyle.zoomSelectionColor;
14230
14442
  var css = ' .e-maps-toolbar:hover > circle { stroke:' + color + '; } .e-maps-toolbar:hover > path { fill: ' + color + ' ; stroke: ' + color + '; }' +
14231
14443
  '.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } ' +