@syncfusion/ej2-maps 25.2.4 → 25.2.5

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 (52) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/ej2-maps.min.js +2 -2
  3. package/dist/ej2-maps.umd.min.js +2 -2
  4. package/dist/ej2-maps.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-maps.es2015.js +322 -202
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +331 -205
  8. package/dist/es6/ej2-maps.es5.js.map +1 -1
  9. package/dist/global/ej2-maps.min.js +2 -2
  10. package/dist/global/ej2-maps.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +7 -7
  13. package/src/maps/layers/bubble.d.ts +3 -4
  14. package/src/maps/layers/bubble.js +3 -4
  15. package/src/maps/layers/color-mapping.d.ts +2 -2
  16. package/src/maps/layers/color-mapping.js +2 -2
  17. package/src/maps/layers/data-label.d.ts +1 -1
  18. package/src/maps/layers/data-label.js +1 -1
  19. package/src/maps/layers/layer-panel.d.ts +7 -7
  20. package/src/maps/layers/layer-panel.js +11 -20
  21. package/src/maps/layers/legend.d.ts +9 -0
  22. package/src/maps/layers/legend.js +96 -19
  23. package/src/maps/layers/marker.d.ts +8 -8
  24. package/src/maps/layers/marker.js +8 -8
  25. package/src/maps/layers/navigation-selected-line.d.ts +1 -1
  26. package/src/maps/layers/navigation-selected-line.js +1 -1
  27. package/src/maps/layers/polygon.d.ts +1 -1
  28. package/src/maps/layers/polygon.js +1 -1
  29. package/src/maps/maps.d.ts +24 -26
  30. package/src/maps/maps.js +32 -30
  31. package/src/maps/model/base-model.d.ts +18 -2
  32. package/src/maps/model/base.d.ts +16 -2
  33. package/src/maps/model/base.js +7 -1
  34. package/src/maps/model/constants.d.ts +0 -4
  35. package/src/maps/model/constants.js +0 -4
  36. package/src/maps/model/interface.d.ts +2 -1
  37. package/src/maps/model/print.d.ts +3 -3
  38. package/src/maps/model/print.js +3 -3
  39. package/src/maps/model/theme.d.ts +1 -1
  40. package/src/maps/model/theme.js +1 -1
  41. package/src/maps/user-interaction/annotation.d.ts +1 -2
  42. package/src/maps/user-interaction/annotation.js +1 -2
  43. package/src/maps/user-interaction/highlight.d.ts +4 -4
  44. package/src/maps/user-interaction/highlight.js +4 -4
  45. package/src/maps/user-interaction/selection.d.ts +5 -5
  46. package/src/maps/user-interaction/selection.js +5 -5
  47. package/src/maps/user-interaction/tooltip.d.ts +6 -6
  48. package/src/maps/user-interaction/tooltip.js +18 -11
  49. package/src/maps/user-interaction/zoom.d.ts +6 -4
  50. package/src/maps/user-interaction/zoom.js +23 -10
  51. package/src/maps/utils/helper.d.ts +87 -72
  52. package/src/maps/utils/helper.js +114 -78
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.2.4
3
+ * version : 25.2.5
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-maps@*",
3
- "_id": "@syncfusion/ej2-maps@25.1.41",
3
+ "_id": "@syncfusion/ej2-maps@25.2.4",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-f3i1agwk554peX5JwF25nYx4Spy6FhCaRvPuvbQq0PIslntofQeqvtJCh8uiodToSusmNixIvo5dr/+bmtUwjQ==",
5
+ "_integrity": "sha512-ou/s4tco99cxQJFBGlZthR96dOnuc+4td4nf+N4JO+WjxIWVvW0gCWi1ZjY6UEICS+9/lCcoRMDKMBQmBQ3r1Q==",
6
6
  "_location": "/@syncfusion/ej2-maps",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-maps",
24
24
  "/@syncfusion/ej2-vue-maps"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-25.1.41.tgz",
27
- "_shasum": "f7a46097b695e5576502c1e4508edfc587b91aa4",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-25.2.4.tgz",
27
+ "_shasum": "86b6edff8a231ab6d079e6d9a9e486faa4dbd315",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
30
30
  "author": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~25.2.3",
38
+ "@syncfusion/ej2-base": "~25.2.5",
39
39
  "@syncfusion/ej2-buttons": "~25.2.4",
40
40
  "@syncfusion/ej2-compression": "~25.2.3",
41
41
  "@syncfusion/ej2-data": "~25.2.3",
42
42
  "@syncfusion/ej2-file-utils": "~25.2.3",
43
43
  "@syncfusion/ej2-pdf-export": "~25.2.3",
44
- "@syncfusion/ej2-svg-base": "~25.2.3"
44
+ "@syncfusion/ej2-svg-base": "~25.2.5"
45
45
  },
46
46
  "deprecated": false,
47
47
  "description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
@@ -93,6 +93,6 @@
93
93
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
94
94
  },
95
95
  "typings": "index.d.ts",
96
- "version": "25.2.4",
96
+ "version": "25.2.5",
97
97
  "sideEffects": false
98
98
  }
@@ -31,7 +31,6 @@ export declare class Bubble {
31
31
  * @param {Element} group - Specifies the element group
32
32
  * @param {string} bubbleID - Specifies the ID of the bubble
33
33
  * @returns {void}
34
- *
35
34
  * @private
36
35
  */
37
36
  renderBubble(bubbleSettings: BubbleSettingsModel, shapeData: object, color: string, range: {
@@ -40,7 +39,7 @@ export declare class Bubble {
40
39
  }, bubbleIndex: number, dataIndex: number, layerIndex: number, layer: LayerSettings, group: Element, bubbleID?: string): void;
41
40
  private getPoints;
42
41
  /**
43
- * To check and trigger bubble click event
42
+ * To check and trigger bubble click event.
44
43
  *
45
44
  * @param {PointerEvent} e - Specifies the pointer event argument.
46
45
  * @returns {void}
@@ -48,14 +47,14 @@ export declare class Bubble {
48
47
  */
49
48
  bubbleClick(e: PointerEvent): void;
50
49
  /**
51
- * To get bubble from target id
50
+ * To get bubble from target id.
52
51
  *
53
52
  * @param {string} target - Specifies the target
54
53
  * @returns {object} - Returns the object
55
54
  */
56
55
  private getbubble;
57
56
  /**
58
- * To check and trigger bubble move event
57
+ * To check and trigger bubble move event.
59
58
  *
60
59
  * @param {PointerEvent} e - Specifies the pointer event argument.
61
60
  * @retruns {void}
@@ -33,7 +33,6 @@ var Bubble = /** @class */ (function () {
33
33
  * @param {Element} group - Specifies the element group
34
34
  * @param {string} bubbleID - Specifies the ID of the bubble
35
35
  * @returns {void}
36
- *
37
36
  * @private
38
37
  */
39
38
  Bubble.prototype.renderBubble = function (bubbleSettings, shapeData, color, range, bubbleIndex, dataIndex, layerIndex, layer, group, bubbleID) {
@@ -207,7 +206,7 @@ var Bubble = /** @class */ (function () {
207
206
  return points;
208
207
  };
209
208
  /**
210
- * To check and trigger bubble click event
209
+ * To check and trigger bubble click event.
211
210
  *
212
211
  * @param {PointerEvent} e - Specifies the pointer event argument.
213
212
  * @returns {void}
@@ -230,7 +229,7 @@ var Bubble = /** @class */ (function () {
230
229
  this.maps.trigger(bubbleClick, eventArgs);
231
230
  };
232
231
  /**
233
- * To get bubble from target id
232
+ * To get bubble from target id.
234
233
  *
235
234
  * @param {string} target - Specifies the target
236
235
  * @returns {object} - Returns the object
@@ -254,7 +253,7 @@ var Bubble = /** @class */ (function () {
254
253
  };
255
254
  // eslint-disable-next-line valid-jsdoc
256
255
  /**
257
- * To check and trigger bubble move event
256
+ * To check and trigger bubble move event.
258
257
  *
259
258
  * @param {PointerEvent} e - Specifies the pointer event argument.
260
259
  * @retruns {void}
@@ -11,12 +11,12 @@ export declare class ColorMapping {
11
11
  * @param { ShapeSettingsModel } shapeSettings - Specifies the shape settings.
12
12
  * @param { object } layerData - Specifies the layer data.
13
13
  * @param { string } color - Specifies the color.
14
- * @returns {Object} - Returns the object.
14
+ * @returns {object} - Returns the object.
15
15
  * @private
16
16
  */
17
17
  getShapeColorMapping(shapeSettings: ShapeSettingsModel, layerData: object, color: string): any;
18
18
  /**
19
- * To color by value and color mapping
19
+ * To color by value and color mapping.
20
20
  *
21
21
  * @param {ColorMappingSettingsModel[]} colorMapping - Specifies the color mapping instance.
22
22
  * @param {number} colorValue - Specifies the color value
@@ -17,7 +17,7 @@ var ColorMapping = /** @class */ (function () {
17
17
  * @param { ShapeSettingsModel } shapeSettings - Specifies the shape settings.
18
18
  * @param { object } layerData - Specifies the layer data.
19
19
  * @param { string } color - Specifies the color.
20
- * @returns {Object} - Returns the object.
20
+ * @returns {object} - Returns the object.
21
21
  * @private
22
22
  */
23
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -31,7 +31,7 @@ var ColorMapping = /** @class */ (function () {
31
31
  return !isNullOrUndefined(shapeColor) ? shapeColor : color;
32
32
  };
33
33
  /**
34
- * To color by value and color mapping
34
+ * To color by value and color mapping.
35
35
  *
36
36
  * @param {ColorMappingSettingsModel[]} colorMapping - Specifies the color mapping instance.
37
37
  * @param {number} colorValue - Specifies the color value
@@ -15,7 +15,7 @@ export declare class DataLabel {
15
15
  constructor(maps: Maps);
16
16
  private getDataLabel;
17
17
  /**
18
- * To render label for maps
18
+ * To render label for maps.
19
19
  *
20
20
  * @param {LayerSettings} layer - Specifies the layer settings
21
21
  * @param {number} layerIndex - Specifies the layer index.
@@ -32,7 +32,7 @@ var DataLabel = /** @class */ (function () {
32
32
  return text;
33
33
  };
34
34
  /**
35
- * To render label for maps
35
+ * To render label for maps.
36
36
  *
37
37
  * @param {LayerSettings} layer - Specifies the layer settings
38
38
  * @param {number} layerIndex - Specifies the layer index.
@@ -63,7 +63,7 @@ export declare class LayerPanel {
63
63
  */
64
64
  private layerFeatures;
65
65
  /**
66
- * render datalabel
66
+ * render datalabel.
67
67
  *
68
68
  * @param {LayerSettings} layer - Specifies the layer
69
69
  * @param {number} layerIndex - Specifies the layer index
@@ -76,14 +76,14 @@ export declare class LayerPanel {
76
76
  */
77
77
  private renderLabel;
78
78
  /**
79
- * To render path for multipolygon
79
+ * To render path for multipolygon.
80
80
  *
81
81
  * @param {any[]} currentShapeData Specifies the current shape data
82
82
  * @returns {string} Returns the path
83
83
  */
84
84
  private generateMultiPolygonPath;
85
85
  /**
86
- * To render bubble
86
+ * To render bubble.
87
87
  *
88
88
  * @param {LayerSettings} layer - Specifies the layer
89
89
  * @param {object} bubbleData - Specifies the bubble data
@@ -100,7 +100,7 @@ export declare class LayerPanel {
100
100
  */
101
101
  private renderBubble;
102
102
  /**
103
- * To get the shape color from color mapping module
103
+ * To get the shape color from color mapping module.
104
104
  *
105
105
  * @param {LayerSettingsModel} layer - Specifies the layer
106
106
  * @param {any} shape - Specifies the shape
@@ -118,7 +118,7 @@ export declare class LayerPanel {
118
118
  generateTiles(zoomLevel: number, tileTranslatePoint: Point, zoomType?: string, bing?: BingMap, position?: Point): void;
119
119
  arrangeTiles(type: string, x: number, y: number): void;
120
120
  /**
121
- * Animation for tile layers and hide the group element until the tile layer rendering
121
+ * Animation for tile layers and hide the group element until the tile layer rendering.
122
122
  *
123
123
  * @param {string} zoomType - Specifies the zoom type
124
124
  * @param {number} translateX - Specifies the x translate point
@@ -127,7 +127,7 @@ export declare class LayerPanel {
127
127
  */
128
128
  private tileAnimation;
129
129
  /**
130
- * Static map rendering
130
+ * Static map rendering.
131
131
  *
132
132
  * @param {string} apikey - Specifies the api key
133
133
  * @param {number} zoom - Specifies the zoom value
@@ -136,7 +136,7 @@ export declare class LayerPanel {
136
136
  */
137
137
  renderGoogleMap(apikey: string, zoom: number): void;
138
138
  /**
139
- * To find the tile translate point
139
+ * To find the tile translate point.
140
140
  *
141
141
  * @param {number} factorX - Specifies the x factor
142
142
  * @param {number} factorY - Specifies the x factor
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-case-declarations */
2
2
  import { isNullOrUndefined, extend, createElement, Fetch, animationMode } from '@syncfusion/ej2-base';
3
3
  import { getShapeColor } from '../model/theme';
4
- import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size, removeElement } from '../utils/helper';
4
+ import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size, removeElement, maintainToggleSelection } from '../utils/helper';
5
5
  import { getElementByID, maintainSelection, getValueFromObject } from '../utils/helper';
6
6
  import { RectOption, getTranslate, convertTileLatLongToPoint, checkShapeDataFields, CircleOption } from '../utils/helper';
7
7
  import { getZoomTranslate, fixInitialScaleForTile } from '../utils/helper';
@@ -643,18 +643,9 @@ var LayerPanel = /** @class */ (function () {
643
643
  pathEle.style.cssText = 'outline:none';
644
644
  }
645
645
  maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
646
- if (this.mapObject.toggledShapeElementId) {
647
- for (var j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
648
- var styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
649
- this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
650
- if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
651
- pathEle.setAttribute('fill', styleProperty.fill);
652
- pathEle.setAttribute('stroke', styleProperty.border.color);
653
- pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
654
- pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
655
- pathEle.setAttribute('stroke-width', (isNullOrUndefined(styleProperty.border.width) ? 0 : styleProperty.border.width).toString());
656
- }
657
- }
646
+ if (this.mapObject.legendSettings.toggleLegendSettings.enable && this.mapObject.legendSettings.type === 'Layers') {
647
+ maintainToggleSelection(this.mapObject.toggledElementId, pathEle, this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ? this.currentLayer.shapeSettings
648
+ : this.mapObject.legendSettings.toggleLegendSettings);
658
649
  }
659
650
  groupElement.appendChild(pathEle);
660
651
  };
@@ -729,7 +720,7 @@ var LayerPanel = /** @class */ (function () {
729
720
  this.layerGroup.appendChild(this.layerObject);
730
721
  };
731
722
  /**
732
- * render datalabel
723
+ * render datalabel.
733
724
  *
734
725
  * @param {LayerSettings} layer - Specifies the layer
735
726
  * @param {number} layerIndex - Specifies the layer index
@@ -746,7 +737,7 @@ var LayerPanel = /** @class */ (function () {
746
737
  this.mapObject.dataLabelModule.renderLabel(layer, layerIndex, shape, layer.layerData, group, labelTemplateEle, shapeIndex, intersect);
747
738
  };
748
739
  /**
749
- * To render path for multipolygon
740
+ * To render path for multipolygon.
750
741
  *
751
742
  * @param {any[]} currentShapeData Specifies the current shape data
752
743
  * @returns {string} Returns the path
@@ -768,7 +759,7 @@ var LayerPanel = /** @class */ (function () {
768
759
  return path;
769
760
  };
770
761
  /**
771
- * To render bubble
762
+ * To render bubble.
772
763
  *
773
764
  * @param {LayerSettings} layer - Specifies the layer
774
765
  * @param {object} bubbleData - Specifies the bubble data
@@ -795,7 +786,7 @@ var LayerPanel = /** @class */ (function () {
795
786
  this.mapObject.bubbleModule.renderBubble(bubbleSettings, bubbleData, color, range, bubbleIndex, dataIndex, layerIndex, layer, group, this.mapObject.bubbleModule.id);
796
787
  };
797
788
  /**
798
- * To get the shape color from color mapping module
789
+ * To get the shape color from color mapping module.
799
790
  *
800
791
  * @param {LayerSettingsModel} layer - Specifies the layer
801
792
  * @param {any} shape - Specifies the shape
@@ -1363,7 +1354,7 @@ var LayerPanel = /** @class */ (function () {
1363
1354
  }
1364
1355
  };
1365
1356
  /**
1366
- * Animation for tile layers and hide the group element until the tile layer rendering
1357
+ * Animation for tile layers and hide the group element until the tile layer rendering.
1367
1358
  *
1368
1359
  * @param {string} zoomType - Specifies the zoom type
1369
1360
  * @param {number} translateX - Specifies the x translate point
@@ -1392,7 +1383,7 @@ var LayerPanel = /** @class */ (function () {
1392
1383
  }
1393
1384
  };
1394
1385
  /**
1395
- * Static map rendering
1386
+ * Static map rendering.
1396
1387
  *
1397
1388
  * @param {string} apikey - Specifies the api key
1398
1389
  * @param {number} zoom - Specifies the zoom value
@@ -1449,7 +1440,7 @@ var LayerPanel = /** @class */ (function () {
1449
1440
  + eleHeight + 'px"><img src="' + staticMapString + '"' + 'alt="' + this.mapObject.getLocalizedLabel('ImageNotFound') + '"></div>';
1450
1441
  };
1451
1442
  /**
1452
- * To find the tile translate point
1443
+ * To find the tile translate point.
1453
1444
  *
1454
1445
  * @param {number} factorX - Specifies the x factor
1455
1446
  * @param {number} factorY - Specifies the x factor
@@ -42,6 +42,7 @@ export declare class Legend {
42
42
  private heightIncrement;
43
43
  private widthIncrement;
44
44
  private textMaxWidth;
45
+ private arrowTimer;
45
46
  /**
46
47
  * @private
47
48
  */
@@ -110,6 +111,14 @@ export declare class Legend {
110
111
  * @private
111
112
  */
112
113
  drawLegendItem(page: number): void;
114
+ /**
115
+ * @param {number} legendIndex - Specifies the legend index.
116
+ * @param {Element} legendShapeElement - Specifies the legend shape element.
117
+ * @param {Element} legendTextElement - Specifies the legend text element.
118
+ * @returns {void}
119
+ * @private
120
+ */
121
+ maintainLegendToggle(legendIndex: number, legendShapeElement: Element, legendTextElement: Element): void;
113
122
  legendHighLightAndSelection(targetElement: Element, value: string): void;
114
123
  private setColor;
115
124
  pushCollection(targetElement: Element, collection: any[], oldElement: object, shapeSettings: ShapeSettings): void;
@@ -440,10 +440,14 @@ var Legend = /** @class */ (function () {
440
440
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
441
441
  textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
442
442
  textFont.size = map.themeStyle.legendFontSize || textFont.size;
443
- var element = renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
444
- element.setAttribute('aria-label', item['text']);
445
- element.setAttribute('role', 'region');
446
- this.legendGroup.appendChild(render.drawRectangle(rectOptions));
443
+ var textElement = renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
444
+ textElement.setAttribute('aria-label', item['text']);
445
+ textElement.setAttribute('role', 'region');
446
+ var rectElement = render.drawRectangle(rectOptions);
447
+ this.legendGroup.appendChild(rectElement);
448
+ if (map.legendSettings.toggleLegendSettings.enable && (legend.type === 'Layers' || legend.type === 'Markers')) {
449
+ this.maintainLegendToggle(i, rectElement, textElement);
450
+ }
447
451
  this.legendToggle();
448
452
  }
449
453
  }
@@ -517,10 +521,14 @@ var Legend = /** @class */ (function () {
517
521
  legendText = trimmedText;
518
522
  }
519
523
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
520
- var element = renderTextElement(textOptions, legendTextStyle, legendTextStyle.color, legendElement);
521
- element.setAttribute('aria-label', legendText);
522
- element.setAttribute('role', 'region');
524
+ var textElement = renderTextElement(textOptions, legendTextStyle, legendTextStyle.color, legendElement);
525
+ textElement.setAttribute('aria-label', legendText);
526
+ textElement.setAttribute('role', 'region');
523
527
  this.legendGroup.appendChild(legendElement);
528
+ if (map.legendSettings.toggleLegendSettings.enable && (legend.type === 'Layers' || legend.type === 'Markers')) {
529
+ var legendShapeElement = legendElement.childNodes[0];
530
+ this.maintainLegendToggle(collection['idIndex'], legendShapeElement, textElement);
531
+ }
524
532
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
525
533
  if (i === (this.totalPages[page]['Collection'].length - 1)) {
526
534
  var pagingGroup = void 0;
@@ -605,6 +613,34 @@ var Legend = /** @class */ (function () {
605
613
  }
606
614
  }
607
615
  };
616
+ /**
617
+ * @param {number} legendIndex - Specifies the legend index.
618
+ * @param {Element} legendShapeElement - Specifies the legend shape element.
619
+ * @param {Element} legendTextElement - Specifies the legend text element.
620
+ * @returns {void}
621
+ * @private
622
+ */
623
+ Legend.prototype.maintainLegendToggle = function (legendIndex, legendShapeElement, legendTextElement) {
624
+ if (this.maps.legendSettings.toggleLegendSettings.enable &&
625
+ !isNullOrUndefined(this.maps.toggledLegendId) && this.maps.toggledLegendId.indexOf(legendIndex) > -1 &&
626
+ !isNullOrUndefined(this.maps.toggledElementId) && this.maps.toggledElementId.length > 0) {
627
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
628
+ var currentItem = this.legendCollection[legendIndex]['data'];
629
+ if (!this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
630
+ this.setToggleAttributes(legendTextElement, legendShapeElement, this.maps.legendSettings.toggleLegendSettings.fill, this.maps.legendSettings.toggleLegendSettings.opacity, this.maps.legendSettings.toggleLegendSettings.border.color, this.maps.legendSettings.toggleLegendSettings.border.width, isNullOrUndefined(this.maps.legendSettings.toggleLegendSettings.border.opacity) ?
631
+ this.maps.legendSettings.toggleLegendSettings.opacity :
632
+ this.maps.legendSettings.toggleLegendSettings.border.opacity, this.maps.legendSettings.toggleLegendSettings.fill);
633
+ }
634
+ else {
635
+ var layerIndex = currentItem[currentItem.length - 1].layerIndex;
636
+ this.setToggleAttributes(legendTextElement, legendShapeElement, this.maps.layers[layerIndex].shapeSettings.fill, this.maps.layers[layerIndex].shapeSettings.opacity, this.maps.layers[layerIndex].shapeSettings.border.color, isNullOrUndefined(this.maps.layers[layerIndex].shapeSettings.border.width)
637
+ ? 0 : this.maps.layers[layerIndex].shapeSettings.border.width, isNullOrUndefined(this.maps.layers[layerIndex].shapeSettings.border.opacity)
638
+ ? this.maps.layers[layerIndex].shapeSettings.opacity
639
+ : this.maps.layers[layerIndex].shapeSettings.border.opacity, this.maps.layers[layerIndex].shapeSettings.fill);
640
+ }
641
+ currentItem['_isVisible'] = false;
642
+ }
643
+ };
608
644
  Legend.prototype.legendHighLightAndSelection = function (targetElement, value) {
609
645
  var shapeIndex;
610
646
  var layerIndex;
@@ -1438,7 +1474,7 @@ var Legend = /** @class */ (function () {
1438
1474
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1439
1475
  Array.prototype.forEach.call(markerData, function (data, dataIndex) {
1440
1476
  var marker = _this.maps.layers[layerIndex].markerSettings[markerIndex];
1441
- if ((text === data[marker.legendText] || text === '') && legendFill === data[marker.colorValuePath]) {
1477
+ if ((text === data[marker.legendText] || text === '') && legendFill === (data[marker.colorValuePath] || marker.fill)) {
1442
1478
  legendData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
1443
1479
  shape: !isNullOrUndefined(marker.shapeValuePath) ? data[marker.shapeValuePath] : marker.shape });
1444
1480
  }
@@ -1699,11 +1735,22 @@ var Legend = /** @class */ (function () {
1699
1735
  if (!isNullOrUndefined(currentData['data'])) {
1700
1736
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1701
1737
  var data = currentData['data'];
1702
- for (var j = 0; j < data.length; j++) {
1738
+ var _loop_3 = function (j) {
1703
1739
  if (dataIndex === data[j]['dataIndex'] && layerIndex === data[j]['layerIndex']) {
1704
- this.renderInteractivePointer(legend, fill, stroke, id, strokeWidth, rect);
1705
- break;
1740
+ this_3.renderInteractivePointer(legend, fill, stroke, id, strokeWidth, rect);
1741
+ var arrowElement_1 = querySelector(id, this_3.maps.element.id);
1742
+ if (this_3.maps.isDevice && !(isNullOrUndefined(arrowElement_1))) {
1743
+ clearTimeout(this_3.arrowTimer);
1744
+ this_3.arrowTimer = setTimeout(function () { remove(arrowElement_1); }, 2000);
1745
+ }
1746
+ return "break";
1706
1747
  }
1748
+ };
1749
+ var this_3 = this;
1750
+ for (var j = 0; j < data.length; j++) {
1751
+ var state_1 = _loop_3(j);
1752
+ if (state_1 === "break")
1753
+ break;
1707
1754
  }
1708
1755
  }
1709
1756
  }
@@ -1779,6 +1826,10 @@ var Legend = /** @class */ (function () {
1779
1826
  mapElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[layerIndex].markerSettings[markerIndex].border.opacity) ?
1780
1827
  this.maps.layers[layerIndex].markerSettings[markerIndex].opacity :
1781
1828
  this.maps.layers[layerIndex].markerSettings[markerIndex].border.opacity).toString());
1829
+ var indexToRemoveSelectedElement = this.maps.toggledElementId.indexOf(mapElement.id);
1830
+ if (indexToRemoveSelectedElement !== -1) {
1831
+ this.maps.toggledElementId.splice(indexToRemoveSelectedElement, 1);
1832
+ }
1782
1833
  };
1783
1834
  Legend.prototype.bubbleToggleSelection = function (mapElement, layerIndex, bubbleIndex, legendIndex) {
1784
1835
  mapElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
@@ -1820,6 +1871,7 @@ var Legend = /** @class */ (function () {
1820
1871
  '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id);
1821
1872
  mapElement = mapElement.children[0];
1822
1873
  }
1874
+ var toggledLegendIdIndex = this.maps.toggledLegendId.indexOf(legendIndex);
1823
1875
  if (isVisible && mapElement !== null) {
1824
1876
  if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
1825
1877
  mapElement.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
@@ -1837,6 +1889,15 @@ var Legend = /** @class */ (function () {
1837
1889
  mapElement.setAttribute('stroke-width', (legendToggleBorderWidth).toString());
1838
1890
  mapElement.setAttribute('stroke-opacity', (legendToggleBorderOpacity).toString());
1839
1891
  }
1892
+ if (this.maps.legendSettings.type === 'Markers') {
1893
+ if (toggledLegendIdIndex === -1) {
1894
+ this.maps.toggledLegendId.push(legendIndex);
1895
+ }
1896
+ var index = this.maps.toggledElementId.indexOf(mapElement.id);
1897
+ if (index === -1) {
1898
+ this.maps.toggledElementId.push(mapElement.id);
1899
+ }
1900
+ }
1840
1901
  if (targetEle !== null) {
1841
1902
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1842
1903
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
@@ -1855,6 +1916,9 @@ var Legend = /** @class */ (function () {
1855
1916
  }
1856
1917
  else {
1857
1918
  if (this.maps.legendSettings.type === 'Markers') {
1919
+ if (toggledLegendIdIndex !== -1 && i === 0) {
1920
+ this.maps.toggledLegendId.splice(toggledLegendIdIndex, 1);
1921
+ }
1858
1922
  this.markerToggleSelection(mapElement, k, j, legendIndex);
1859
1923
  }
1860
1924
  else {
@@ -1863,7 +1927,7 @@ var Legend = /** @class */ (function () {
1863
1927
  if (targetEle !== null) {
1864
1928
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1865
1929
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1866
- this.setToggleAttributes(legendTextId, legendShapeId, this.legendCollection[legendIndex]['fill'], this.legendCollection[legendIndex]['opacity'], this.legendCollection[legendIndex]['shapeBorder']['color'], this.legendCollection[legendIndex]['shapeBorder']['width'], this.legendCollection[legendIndex]['shapeBorder']['opacity'], '#757575');
1930
+ this.setToggleAttributes(legendTextId, legendShapeId, this.legendCollection[legendIndex]['fill'], this.legendCollection[legendIndex]['opacity'], this.legendCollection[legendIndex]['shapeBorder']['color'], this.legendCollection[legendIndex]['shapeBorder']['width'], this.legendCollection[legendIndex]['shapeBorder']['opacity'], this.maps.legendSettings.textStyle.color);
1867
1931
  if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
1868
1932
  legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
1869
1933
  }
@@ -1887,13 +1951,13 @@ var Legend = /** @class */ (function () {
1887
1951
  layerElement = querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
1888
1952
  '_shapeIndex_' + shape['shapeIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
1889
1953
  if (layerElement !== null) {
1890
- var toggledShapeIdIndex = this.maps.toggledShapeElementId.indexOf(layerElement.id);
1954
+ var toggledShapeIdIndex = this.maps.toggledElementId.indexOf(layerElement.id);
1891
1955
  if (isVisible) {
1892
1956
  if (i === 0) {
1893
1957
  this.maps.toggledLegendId.push(legendIndex);
1894
1958
  }
1895
1959
  if (toggledShapeIdIndex === -1) {
1896
- this.maps.toggledShapeElementId.push(layerElement.id);
1960
+ this.maps.toggledElementId.push(layerElement.id);
1897
1961
  }
1898
1962
  if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
1899
1963
  layerElement.setAttribute('fill', this.maps.layers[j].shapeSettings.fill);
@@ -1932,7 +1996,7 @@ var Legend = /** @class */ (function () {
1932
1996
  this.maps.toggledLegendId.splice(toggledLegendIdIndex, 1);
1933
1997
  }
1934
1998
  if (toggledShapeIdIndex !== -1) {
1935
- this.maps.toggledShapeElementId.splice(toggledShapeIdIndex, 1);
1999
+ this.maps.toggledElementId.splice(toggledShapeIdIndex, 1);
1936
2000
  }
1937
2001
  layerElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
1938
2002
  layerElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity) ?
@@ -1964,6 +2028,7 @@ var Legend = /** @class */ (function () {
1964
2028
  var selectedItem = this.legendCollection[legendIndex]['data'];
1965
2029
  var isVisible = selectedItem['_isVisible'];
1966
2030
  if ((this.maps.legendSettings.type === 'Bubbles' || this.maps.legendSettings.type === 'Markers') && this.maps.legendSettings.toggleLegendSettings.enable) {
2031
+ var toggledLegendIdIndex = this.maps.toggledLegendId.indexOf(legendIndex);
1967
2032
  for (var k = 0; k < this.maps.layers.length; k++) {
1968
2033
  for (var j = 0; j < (this.maps.legendSettings.type === 'Bubbles' ? this.maps.layers[k].bubbleSettings.length : this.maps.layers[k].markerSettings.length); j++) {
1969
2034
  for (var i = 0; i < selectedItem.length; i++) {
@@ -1978,6 +2043,15 @@ var Legend = /** @class */ (function () {
1978
2043
  LegendInteractive = LegendInteractive.children[0];
1979
2044
  }
1980
2045
  if (isVisible && LegendInteractive !== null) {
2046
+ if (this.maps.legendSettings.type === 'Markers') {
2047
+ if (toggledLegendIdIndex === -1) {
2048
+ this.maps.toggledLegendId.push(legendIndex);
2049
+ }
2050
+ var index = this.maps.toggledElementId.indexOf(LegendInteractive.id);
2051
+ if (index === -1) {
2052
+ this.maps.toggledElementId.push(LegendInteractive.id);
2053
+ }
2054
+ }
1981
2055
  if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
1982
2056
  LegendInteractive.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
1983
2057
  LegendInteractive.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
@@ -2015,6 +2089,9 @@ var Legend = /** @class */ (function () {
2015
2089
  }
2016
2090
  else {
2017
2091
  if (this.maps.legendSettings.type === 'Markers') {
2092
+ if (toggledLegendIdIndex !== -1 && i === 0) {
2093
+ this.maps.toggledLegendId.splice(toggledLegendIdIndex, 1);
2094
+ }
2018
2095
  this.markerToggleSelection(LegendInteractive, k, j, legendIndex);
2019
2096
  }
2020
2097
  else {
@@ -2028,7 +2105,7 @@ var Legend = /** @class */ (function () {
2028
2105
  legendShapeId.setAttribute('stroke-width', this.legendCollection[legendIndex]['shapeBorder']['width']);
2029
2106
  legendShapeId.setAttribute('stroke-opacity', this.legendCollection[legendIndex]['shapeBorder']['opacity']);
2030
2107
  legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
2031
- legendTextId.setAttribute('fill', '#757575');
2108
+ legendTextId.setAttribute('fill', this.maps.legendSettings.textStyle.color);
2032
2109
  }
2033
2110
  }
2034
2111
  }
@@ -2049,13 +2126,13 @@ var Legend = /** @class */ (function () {
2049
2126
  mapLegendElement = querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
2050
2127
  '_shapeIndex_' + mapdata['shapeIndex'] + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id);
2051
2128
  if (mapLegendElement !== null) {
2052
- var toggledShapeIdIndex = this.maps.toggledShapeElementId.indexOf(mapLegendElement.id);
2129
+ var toggledShapeIdIndex = this.maps.toggledElementId.indexOf(mapLegendElement.id);
2053
2130
  if (isVisible) {
2054
2131
  if (i === 0) {
2055
2132
  this.maps.toggledLegendId.push(legendIndex);
2056
2133
  }
2057
2134
  if (toggledShapeIdIndex === -1) {
2058
- this.maps.toggledShapeElementId.push(mapLegendElement.id);
2135
+ this.maps.toggledElementId.push(mapLegendElement.id);
2059
2136
  }
2060
2137
  if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
2061
2138
  mapLegendElement.setAttribute('fill', this.maps.layers[0].shapeSettings.fill);
@@ -2095,7 +2172,7 @@ var Legend = /** @class */ (function () {
2095
2172
  this.maps.toggledLegendId.splice(toggleLegendIdIndex, 1);
2096
2173
  }
2097
2174
  if (toggledShapeIdIndex !== -1) {
2098
- this.maps.toggledShapeElementId.splice(toggledShapeIdIndex, 1);
2175
+ this.maps.toggledElementId.splice(toggledShapeIdIndex, 1);
2099
2176
  }
2100
2177
  mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
2101
2178
  mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 :