@syncfusion/ej2-maps 19.4.53 → 19.4.56-105067

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.
Files changed (84) hide show
  1. package/.eslintrc.json +18 -3
  2. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
  3. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
  4. package/CHANGELOG.md +441 -422
  5. package/README.md +73 -73
  6. package/dist/ej2-maps.umd.min.js +1 -10
  7. package/dist/ej2-maps.umd.min.js.map +1 -1
  8. package/dist/es6/ej2-maps.es2015.js +1220 -653
  9. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  10. package/dist/es6/ej2-maps.es5.js +1258 -692
  11. package/dist/es6/ej2-maps.es5.js.map +1 -1
  12. package/dist/global/ej2-maps.min.js +1 -10
  13. package/dist/global/ej2-maps.min.js.map +1 -1
  14. package/dist/global/index.d.ts +0 -9
  15. package/dist/ts/maps/layers/bing-map.ts +50 -0
  16. package/dist/ts/maps/layers/bubble.ts +290 -0
  17. package/dist/ts/maps/layers/color-mapping.ts +226 -0
  18. package/dist/ts/maps/layers/data-label.ts +418 -0
  19. package/dist/ts/maps/layers/layer-panel.ts +1480 -0
  20. package/dist/ts/maps/layers/legend.ts +2236 -0
  21. package/dist/ts/maps/layers/marker.ts +453 -0
  22. package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
  23. package/dist/ts/maps/maps.ts +2886 -0
  24. package/dist/ts/maps/model/base.ts +1843 -0
  25. package/dist/ts/maps/model/constants.ts +200 -0
  26. package/dist/ts/maps/model/export-image.ts +178 -0
  27. package/dist/ts/maps/model/export-pdf.ts +170 -0
  28. package/dist/ts/maps/model/interface.ts +823 -0
  29. package/dist/ts/maps/model/print.ts +104 -0
  30. package/dist/ts/maps/model/theme.ts +554 -0
  31. package/dist/ts/maps/user-interaction/annotation.ts +127 -0
  32. package/dist/ts/maps/user-interaction/highlight.ts +233 -0
  33. package/dist/ts/maps/user-interaction/selection.ts +321 -0
  34. package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
  35. package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
  36. package/dist/ts/maps/utils/enum.ts +368 -0
  37. package/dist/ts/maps/utils/helper.ts +3421 -0
  38. package/helper/e2e/index.js +3 -3
  39. package/helper/e2e/maps-helper.js +13 -13
  40. package/license +9 -9
  41. package/package.json +85 -85
  42. package/src/maps/layers/bing-map.d.ts +4 -0
  43. package/src/maps/layers/bing-map.js +16 -3
  44. package/src/maps/layers/bubble.d.ts +1 -2
  45. package/src/maps/layers/bubble.js +7 -12
  46. package/src/maps/layers/data-label.d.ts +1 -4
  47. package/src/maps/layers/data-label.js +32 -35
  48. package/src/maps/layers/layer-panel.d.ts +18 -1
  49. package/src/maps/layers/layer-panel.js +226 -72
  50. package/src/maps/layers/legend.d.ts +5 -2
  51. package/src/maps/layers/legend.js +170 -61
  52. package/src/maps/layers/marker.d.ts +2 -4
  53. package/src/maps/layers/marker.js +49 -48
  54. package/src/maps/layers/navigation-selected-line.d.ts +1 -2
  55. package/src/maps/layers/navigation-selected-line.js +7 -13
  56. package/src/maps/maps-model.d.ts +259 -251
  57. package/src/maps/maps.d.ts +25 -3
  58. package/src/maps/maps.js +179 -106
  59. package/src/maps/model/base-model.d.ts +1025 -1021
  60. package/src/maps/model/base.d.ts +5 -1
  61. package/src/maps/model/base.js +24 -24
  62. package/src/maps/model/constants.d.ts +6 -0
  63. package/src/maps/model/constants.js +6 -0
  64. package/src/maps/model/export-image.d.ts +2 -4
  65. package/src/maps/model/export-image.js +34 -33
  66. package/src/maps/model/export-pdf.d.ts +4 -6
  67. package/src/maps/model/export-pdf.js +31 -32
  68. package/src/maps/model/interface.d.ts +34 -26
  69. package/src/maps/model/print.d.ts +2 -5
  70. package/src/maps/model/print.js +32 -18
  71. package/src/maps/model/theme.js +7 -4
  72. package/src/maps/user-interaction/annotation.d.ts +1 -2
  73. package/src/maps/user-interaction/annotation.js +3 -4
  74. package/src/maps/user-interaction/highlight.d.ts +1 -2
  75. package/src/maps/user-interaction/highlight.js +11 -10
  76. package/src/maps/user-interaction/selection.d.ts +1 -2
  77. package/src/maps/user-interaction/selection.js +42 -19
  78. package/src/maps/user-interaction/tooltip.d.ts +3 -5
  79. package/src/maps/user-interaction/tooltip.js +27 -14
  80. package/src/maps/user-interaction/zoom.d.ts +3 -8
  81. package/src/maps/user-interaction/zoom.js +282 -162
  82. package/src/maps/utils/enum.d.ts +5 -1
  83. package/src/maps/utils/helper.d.ts +9 -1
  84. package/src/maps/utils/helper.js +82 -33
@@ -11,6 +11,10 @@ var Legend = /** @class */ (function () {
11
11
  * @private
12
12
  */
13
13
  this.legendBorderRect = new Rect(0, 0, 0, 0);
14
+ /**
15
+ * @private
16
+ */
17
+ this.initialMapAreaRect = new Rect(0, 0, 0, 0);
14
18
  /**
15
19
  * @private
16
20
  */
@@ -69,6 +73,7 @@ var Legend = /** @class */ (function () {
69
73
  this.heightIncrement = 0;
70
74
  this.defsElement = this.maps.renderer.createDefs();
71
75
  this.maps.svgObject.appendChild(this.defsElement);
76
+ this.initialMapAreaRect = this.maps.mapAreaRect;
72
77
  this.calculateLegendBounds();
73
78
  this.drawLegend();
74
79
  };
@@ -108,9 +113,9 @@ var Legend = /** @class */ (function () {
108
113
  }
109
114
  }
110
115
  }
111
- else {
112
- _this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
113
- }
116
+ }
117
+ if (legend.type === 'Markers') {
118
+ _this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
114
119
  }
115
120
  });
116
121
  if (this.legendCollection.length > 0) {
@@ -305,8 +310,9 @@ var Legend = /** @class */ (function () {
305
310
  }
306
311
  }
307
312
  else {
313
+ var padding = 10;
308
314
  shapeX = shapeLocation[j - 1].x;
309
- shapeY = prevPositionY + topPadding + (shapeHeight / 2);
315
+ shapeY = prevPositionY + padding + (shapeHeight / 2);
310
316
  }
311
317
  }
312
318
  }
@@ -409,7 +415,14 @@ var Legend = /** @class */ (function () {
409
415
  var legend = map.legendSettings;
410
416
  var render = map.renderer;
411
417
  var textOptions;
412
- var textFont = legend.textStyle;
418
+ var textFont = {
419
+ size: legend.textStyle.size,
420
+ color: legend.textStyle.color,
421
+ fontFamily: legend.textStyle.fontFamily,
422
+ fontWeight: legend.textStyle.fontWeight,
423
+ fontStyle: legend.textStyle.fontStyle,
424
+ opacity: legend.textStyle.opacity
425
+ };
413
426
  this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
414
427
  if (legend.mode === 'Interactive') {
415
428
  for (var i = 0; i < this.legendRenderingCollections.length; i++) {
@@ -425,7 +438,7 @@ var Legend = /** @class */ (function () {
425
438
  textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
426
439
  var rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
427
440
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
428
- textFont.fontFamily = map.themeStyle.fontFamily || textFont.fontFamily;
441
+ textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
429
442
  textFont.size = map.themeStyle.legendFontSize || textFont.size;
430
443
  renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
431
444
  this.legendGroup.appendChild(render.drawRectangle(rectOptions));
@@ -481,7 +494,7 @@ var Legend = /** @class */ (function () {
481
494
  };
482
495
  legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
483
496
  this.maps.themeStyle.legendTextColor;
484
- legendTextStyle.fontFamily = map.themeStyle.fontFamily || legendTextStyle.fontFamily;
497
+ legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
485
498
  legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
486
499
  if (i === 0) {
487
500
  this.renderLegendBorder();
@@ -557,7 +570,9 @@ var Legend = /** @class */ (function () {
557
570
  'opacity': 1,
558
571
  'dominant-baseline': ''
559
572
  };
560
- pagingGroup.appendChild(render.createText(pageTextOptions, pagingText));
573
+ var pagingTextElement = render.createText(pageTextOptions, pagingText);
574
+ pagingTextElement.setAttribute('style', 'user-select: none;');
575
+ pagingGroup.appendChild(pagingTextElement);
561
576
  this.legendGroup.appendChild(pagingGroup);
562
577
  }
563
578
  this.legendToggle();
@@ -569,6 +584,7 @@ var Legend = /** @class */ (function () {
569
584
  var shapeIndex;
570
585
  var layerIndex;
571
586
  var dataIndex;
587
+ var pointIndex;
572
588
  var legend = this.maps.legendSettings;
573
589
  var textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
574
590
  document.getElementById(targetElement.id + '_Text');
@@ -656,12 +672,20 @@ var Legend = /** @class */ (function () {
656
672
  }
657
673
  if (enable) {
658
674
  for (var j = 0; j < data.length; j++) {
675
+ var shapeElement = void 0;
659
676
  shapeIndex = data[j]['shapeIndex'];
660
677
  layerIndex = data[j]['layerIndex'];
661
678
  dataIndex = data[j]['dataIndex'];
662
- var shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
663
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
664
- if (shapeEle !== null) {
679
+ pointIndex = data[j]['pointIndex'];
680
+ if (pointIndex === -1) {
681
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
682
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
683
+ }
684
+ else {
685
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
686
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
687
+ }
688
+ if (shapeElement !== null) {
665
689
  var shapeMatch = true;
666
690
  if (this.maps.legendSelectionCollection !== null) {
667
691
  for (var i_1 = 0; i_1 < this.maps.legendSelectionCollection.length; i_1++) {
@@ -678,13 +702,13 @@ var Legend = /** @class */ (function () {
678
702
  }
679
703
  length = this.legendHighlightCollection.length;
680
704
  var legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
681
- this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeEle);
705
+ this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
682
706
  var shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
683
- var shapeOldFillColor = shapeEle.getAttribute('fill');
707
+ var shapeOldFillColor = shapeElement.getAttribute('fill');
684
708
  this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
685
709
  var shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
686
710
  this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
687
- this.setColor(shapeEle, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
711
+ this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
688
712
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
689
713
  }
690
714
  else if (value === 'selection') {
@@ -707,12 +731,12 @@ var Legend = /** @class */ (function () {
707
731
  }
708
732
  selectLength = this.maps.legendSelectionCollection.length;
709
733
  var legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
710
- this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeEle);
734
+ this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
711
735
  this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
712
736
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
713
- this.setColor(shapeEle, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
714
- if (this.maps.selectedElementId.indexOf(shapeEle.getAttribute('id')) === -1) {
715
- this.maps.selectedElementId.push(shapeEle.getAttribute('id'));
737
+ this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
738
+ if (this.maps.selectedElementId.indexOf(shapeElement.getAttribute('id')) === -1) {
739
+ this.maps.selectedElementId.push(shapeElement.getAttribute('id'));
716
740
  }
717
741
  if (j === data.length - 1) {
718
742
  this.maps.legendSelection = false;
@@ -727,14 +751,15 @@ var Legend = /** @class */ (function () {
727
751
  }
728
752
  };
729
753
  Legend.prototype.setColor = function (element, fill, opacity, borderColor, borderWidth, type) {
754
+ var isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
730
755
  if (type === 'selection') {
731
- maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
732
- element.setAttribute('class', 'ShapeselectionMapStyle');
756
+ maintainStyleClass((isLineStringShape ? 'LineselectionMap' : 'ShapeselectionMap'), (isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle'), (isLineStringShape ? 'transparent' : fill), opacity, (isLineStringShape ? fill : borderColor), borderWidth, this.maps);
757
+ element.setAttribute('class', isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle');
733
758
  }
734
759
  else {
735
- element.setAttribute('fill', fill);
760
+ element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
736
761
  element.setAttribute('fill-opacity', opacity);
737
- element.setAttribute('stroke', borderColor);
762
+ element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
738
763
  element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
739
764
  }
740
765
  };
@@ -777,7 +802,8 @@ var Legend = /** @class */ (function () {
777
802
  var dataCount = shapeElements.length;
778
803
  for (var j = 0; j < dataCount; j++) {
779
804
  var shapeElement = getElement(shapeElements[j]);
780
- if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle') {
805
+ if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
806
+ shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
781
807
  removeClass(shapeElement);
782
808
  var selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
783
809
  if (selectedElementIdIndex !== -1) {
@@ -855,12 +881,14 @@ var Legend = /** @class */ (function () {
855
881
  this.maps.legendSelectionClass = module;
856
882
  }
857
883
  else {
858
- if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
884
+ if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
885
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
859
886
  if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
860
887
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
861
888
  }
862
889
  else {
863
- if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
890
+ if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
891
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
864
892
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
865
893
  }
866
894
  }
@@ -947,7 +975,8 @@ var Legend = /** @class */ (function () {
947
975
  }
948
976
  }
949
977
  }
950
- if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle')) {
978
+ if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
979
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
951
980
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
952
981
  var element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
953
982
  var multiSelection = 0;
@@ -1038,7 +1067,7 @@ var Legend = /** @class */ (function () {
1038
1067
  }
1039
1068
  for (var j = 0; j < this.maps.selectedLegendElementId.length; j++) {
1040
1069
  var idIndex = this.maps.legendSettings.mode === 'Interactive' ?
1041
- 'container_Legend_Index_' : 'container_Legend_Shape_Index_';
1070
+ this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
1042
1071
  var selectedElement = idIndex + this.maps.selectedLegendElementId[j];
1043
1072
  var legendElement = document.getElementById(selectedElement);
1044
1073
  if (!isNullOrUndefined(legendElement)) {
@@ -1090,6 +1119,7 @@ var Legend = /** @class */ (function () {
1090
1119
  var shapeIndex;
1091
1120
  var layerIndex;
1092
1121
  var dataIndex;
1122
+ var pointIndex;
1093
1123
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1094
1124
  var collection = this.maps.legendModule.legendCollection;
1095
1125
  var legend = this.maps.legendSettings;
@@ -1102,15 +1132,23 @@ var Legend = /** @class */ (function () {
1102
1132
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1103
1133
  var currentElement = { Elements: [] };
1104
1134
  for (var j = 0; j < data.length; j++) {
1135
+ var shapeElement = void 0;
1105
1136
  shapeIndex = data[j]['shapeIndex'];
1106
1137
  layerIndex = data[j]['layerIndex'];
1107
1138
  dataIndex = data[j]['dataIndex'];
1108
- var shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
1109
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
1110
- if (targetElement === shapeEle) {
1139
+ pointIndex = data[j]['pointIndex'];
1140
+ if (pointIndex === -1) {
1141
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
1142
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
1143
+ }
1144
+ else {
1145
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
1146
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
1147
+ }
1148
+ if (targetElement === shapeElement) {
1111
1149
  process = true;
1112
1150
  }
1113
- elements.push(shapeEle);
1151
+ elements.push(shapeElement);
1114
1152
  }
1115
1153
  if (process) {
1116
1154
  if (isNullOrUndefined(currentElement['LegendEle'])) {
@@ -1128,16 +1166,25 @@ var Legend = /** @class */ (function () {
1128
1166
  var shapeIndex;
1129
1167
  var layerIndex;
1130
1168
  var dataIndex;
1169
+ var pointIndex;
1131
1170
  var idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
1132
1171
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1133
1172
  var data = this.maps.legendModule.legendCollection[idIndex]['data'];
1134
1173
  var legendShapeElements = [];
1135
1174
  for (var i = 0; i < data.length; i++) {
1175
+ var shapeElement = void 0;
1136
1176
  shapeIndex = data[i]['shapeIndex'];
1137
1177
  layerIndex = data[i]['layerIndex'];
1138
1178
  dataIndex = data[i]['dataIndex'];
1139
- var shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
1140
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
1179
+ pointIndex = data[i]['pointIndex'];
1180
+ if (pointIndex === -1) {
1181
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
1182
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
1183
+ }
1184
+ else {
1185
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
1186
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
1187
+ }
1141
1188
  if (!isNullOrUndefined(shapeElement)) {
1142
1189
  legendShapeElements.push(shapeElement.id);
1143
1190
  }
@@ -1205,9 +1252,11 @@ var Legend = /** @class */ (function () {
1205
1252
  var renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
1206
1253
  this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
1207
1254
  this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
1208
- this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-(this.legendBorderRect.x))) + ' ' +
1255
+ this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
1209
1256
  (this.translate.y + (-(this.legendBorderRect.y))) + ' )');
1210
- map.svgObject.appendChild(this.legendGroup);
1257
+ if (legend.position !== 'Float') {
1258
+ map.svgObject.appendChild(this.legendGroup);
1259
+ }
1211
1260
  if (legendTitle) {
1212
1261
  textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
1213
1262
  textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
@@ -1219,7 +1268,16 @@ var Legend = /** @class */ (function () {
1219
1268
  this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
1220
1269
  (this.currentPage + 1);
1221
1270
  this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
1271
+ this.maps.mapAreaRect = this.initialMapAreaRect;
1222
1272
  this.drawLegendItem(this.currentPage);
1273
+ if (!isNullOrUndefined(this.maps.legendModule) && this.maps.legendSettings.position === 'Float') {
1274
+ if (this.maps.isTileMap) {
1275
+ this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.legendModule.legendGroup);
1276
+ }
1277
+ else {
1278
+ this.maps.svgObject.appendChild(this.maps.legendModule.legendGroup);
1279
+ }
1280
+ }
1223
1281
  if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
1224
1282
  querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
1225
1283
  }
@@ -1237,53 +1295,60 @@ var Legend = /** @class */ (function () {
1237
1295
  var areaWidth = totalRect.width;
1238
1296
  var totalWidth = map.availableSize.width;
1239
1297
  var totalHeight = map.availableSize.height;
1298
+ var locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
1299
+ var locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
1240
1300
  if (legend.position === 'Float') {
1241
- this.translate = legend.location;
1301
+ this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) : new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
1302
+ this.legendTotalRect = map.mapAreaRect;
1242
1303
  }
1243
1304
  else {
1244
1305
  switch (legend.position) {
1245
1306
  case 'Top':
1246
1307
  case 'Bottom':
1247
- totalRect.height = (areaHeight - height);
1308
+ totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
1248
1309
  x = (totalWidth / 2) - (width / 2);
1249
1310
  y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
1250
- totalRect.y = (legend.position === 'Top') ? areaY + height + spacing : areaY;
1311
+ totalRect.y = (legend.position === 'Top') ? areaY + height + (map.isTileMap ? (spacing / 2) : spacing) : areaY - (spacing / 2);
1251
1312
  break;
1252
1313
  case 'Left':
1253
1314
  case 'Right':
1254
- totalRect.width = (areaWidth - width);
1255
- x = (legend.position === 'Left') ? areaX : (areaX + totalRect.width) - spacing;
1315
+ totalRect.width = (areaWidth - width - map.mapAreaRect.x);
1316
+ x = (legend.position === 'Left') ? areaX + (spacing / 2) : (areaX + totalRect.width + spacing);
1256
1317
  y = (totalHeight / 2) - (height / 2);
1257
- totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
1318
+ totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
1258
1319
  break;
1259
1320
  }
1260
1321
  switch (legend.alignment) {
1261
1322
  case 'Near':
1262
1323
  if (legend.position === 'Top' || legend.position === 'Bottom') {
1263
- x = totalRect.x;
1324
+ x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
1264
1325
  }
1265
1326
  else {
1266
- y = totalRect.y;
1327
+ y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
1267
1328
  }
1268
1329
  break;
1269
1330
  case 'Far':
1270
1331
  if (legend.position === 'Top' || legend.position === 'Bottom') {
1271
- x = (totalWidth - width) - spacing;
1332
+ x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
1272
1333
  }
1273
1334
  else {
1274
- y = totalHeight - height;
1335
+ y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
1275
1336
  }
1276
1337
  break;
1277
1338
  }
1278
1339
  if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
1279
- this.legendTotalRect = map.totalRect = totalRect;
1340
+ this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
1280
1341
  }
1281
1342
  else {
1343
+ map.totalRect = null;
1282
1344
  if ((legend.height || legend.width) && legend.mode === 'Interactive') {
1283
1345
  map.totalRect = totalRect;
1284
1346
  }
1285
1347
  this.legendTotalRect = map.mapAreaRect = totalRect;
1286
1348
  }
1349
+ if (legend.position === 'Left') {
1350
+ map.mapAreaRect.width = totalRect.width;
1351
+ }
1287
1352
  this.translate = new Point(x, y);
1288
1353
  }
1289
1354
  };
@@ -1303,7 +1368,7 @@ var Legend = /** @class */ (function () {
1303
1368
  data[_this.maps.legendSettings.showLegendPath];
1304
1369
  if (marker.visible && showLegend && (!isNullOrUndefined(data['latitude'])) && (!isNullOrUndefined(data['longitude']))) {
1305
1370
  if (marker.template) {
1306
- templateFn = getTemplateFunction(marker.template);
1371
+ templateFn = getTemplateFunction(marker.template, _this.maps);
1307
1372
  var templateElement = templateFn(_this.maps);
1308
1373
  var markerEle = isNullOrUndefined(templateElement.childElementCount) ? templateElement[0] :
1309
1374
  templateElement;
@@ -1414,6 +1479,13 @@ var Legend = /** @class */ (function () {
1414
1479
  borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
1415
1480
  });
1416
1481
  }
1482
+ else {
1483
+ for (var i = 0; i < this.legendCollection.length; i++) {
1484
+ if (this.legendCollection[i]['text'] === legendText && this.legendCollection[i]['fill'] === legendFill) {
1485
+ this.legendCollection[i].data.push(newColllection[0]);
1486
+ }
1487
+ }
1488
+ }
1417
1489
  }
1418
1490
  };
1419
1491
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1620,15 +1692,16 @@ var Legend = /** @class */ (function () {
1620
1692
  var width = 10;
1621
1693
  var direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
1622
1694
  ? 'Horizontal' : 'Vertical' : legend.orientation;
1695
+ rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
1623
1696
  if (direction === 'Horizontal') {
1624
1697
  if (!legend.invertedPointer) {
1625
- locX = rect.x + (rect.width / 2);
1698
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
1626
1699
  locY = rect.y;
1627
1700
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
1628
1701
  ' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
1629
1702
  }
1630
1703
  else {
1631
- locX = rect.x + (rect.width / 2);
1704
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
1632
1705
  locY = rect.y + (rect.height);
1633
1706
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
1634
1707
  ' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
@@ -1636,20 +1709,25 @@ var Legend = /** @class */ (function () {
1636
1709
  }
1637
1710
  else {
1638
1711
  if (!legend.invertedPointer) {
1639
- locX = rect.x + (rect.width);
1712
+ locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
1640
1713
  locY = rect.y + (rect.height / 2);
1641
1714
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
1642
1715
  ' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
1643
1716
  }
1644
1717
  else {
1645
- locX = rect.x;
1718
+ locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
1646
1719
  locY = rect.y + (rect.height / 2);
1647
1720
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
1648
1721
  ' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
1649
1722
  }
1650
1723
  }
1651
1724
  var pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
1652
- this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
1725
+ if (legend.position === 'Float' && this.maps.isTileMap) {
1726
+ this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.renderer.drawPath(pathOptions));
1727
+ }
1728
+ else {
1729
+ this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
1730
+ }
1653
1731
  };
1654
1732
  Legend.prototype.wireEvents = function (element) {
1655
1733
  EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
@@ -1707,6 +1785,9 @@ var Legend = /** @class */ (function () {
1707
1785
  '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
1708
1786
  '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
1709
1787
  if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
1788
+ mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
1789
+ '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
1790
+ '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id);
1710
1791
  mapElement = mapElement.children[0];
1711
1792
  }
1712
1793
  if (isVisible && mapElement !== null) {
@@ -1848,6 +1929,9 @@ var Legend = /** @class */ (function () {
1848
1929
  '_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
1849
1930
  '_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id);
1850
1931
  if (!isNullOrUndefined(mapdata['shape']) && mapdata['shape'] === 'Balloon') {
1932
+ LegendInteractive = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
1933
+ '_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'] + '_Group', this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
1934
+ '_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'] + '_Group', this.maps.element.id);
1851
1935
  LegendInteractive = LegendInteractive.children[0];
1852
1936
  }
1853
1937
  if (isVisible && LegendInteractive !== null) {
@@ -2011,10 +2095,20 @@ var Legend = /** @class */ (function () {
2011
2095
  var shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
2012
2096
  && isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
2013
2097
  if (shapeDataValueCase === dataPathValueCase) {
2014
- legendData.push({
2015
- layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
2016
- name: data[dataPath], value: value
2017
- });
2098
+ if (shapeData['geometry']['type'] != 'MultiPoint') {
2099
+ legendData.push({
2100
+ layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
2101
+ name: data[dataPath], value: value, pointIndex: -1
2102
+ });
2103
+ }
2104
+ else {
2105
+ for (var j = 0; j < shapeData['geometry'].coordinates.length; j++) {
2106
+ legendData.push({
2107
+ layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
2108
+ name: data[dataPath], value: value, pointIndex: j
2109
+ });
2110
+ }
2111
+ }
2018
2112
  }
2019
2113
  }
2020
2114
  }
@@ -2060,15 +2154,30 @@ var Legend = /** @class */ (function () {
2060
2154
  /**
2061
2155
  * To destroy the legend.
2062
2156
  *
2063
- * @param {Maps} maps - Specifies the instance of the maps
2064
2157
  * @returns {void}
2065
2158
  * @private
2066
2159
  */
2067
- Legend.prototype.destroy = function (maps) {
2068
- /**
2069
- * Destroy method performed here
2070
- */
2160
+ Legend.prototype.destroy = function () {
2161
+ this.legendCollection = [];
2162
+ this.legendRenderingCollections = [];
2163
+ this.translate = null;
2164
+ this.legendBorderRect = null;
2165
+ this.initialMapAreaRect = null;
2166
+ this.legendTotalRect = null;
2167
+ this.totalPages = [];
2168
+ this.legendItemRect = null;
2169
+ this.legendGroup = null;
2170
+ this.shapeHighlightCollection = [];
2171
+ this.legendHighlightCollection = [];
2172
+ this.shapePreviousColor = [];
2173
+ this.selectedNonLegendShapes = [];
2174
+ this.legendLinearGradient = null;
2175
+ this.currentLayer = null;
2176
+ this.defsElement = null;
2177
+ this.legendElement = [];
2178
+ this.oldShapeElement = null;
2071
2179
  this.removeEventListener();
2180
+ this.maps = null;
2072
2181
  };
2073
2182
  return Legend;
2074
2183
  }());
@@ -8,13 +8,12 @@ export declare class Marker {
8
8
  private isMarkerExplode;
9
9
  private trackElements;
10
10
  private markerSVGObject;
11
- private previousExplodeId;
12
11
  /**
13
12
  * @private
14
13
  */
15
14
  sameMarkerData: MarkerClusterData[];
16
15
  constructor(maps: Maps);
17
- markerRender(layerElement: Element, layerIndex: number, factor: number, type: string): void;
16
+ markerRender(maps: Maps, layerElement: Element, layerIndex: number, factor: number, type: string): void;
18
17
  /**
19
18
  * To find zoom level for individual layers like India, USA.
20
19
  *
@@ -60,9 +59,8 @@ export declare class Marker {
60
59
  /**
61
60
  * To destroy the layers.
62
61
  *
63
- * @param {Maps} maps - Specifies the instance of the map
64
62
  * @returns {void}
65
63
  * @private
66
64
  */
67
- destroy(maps: Maps): void;
65
+ destroy(): void;
68
66
  }