@syncfusion/ej2-maps 25.2.4 → 26.1.35
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.
- package/.eslintrc.json +3 -2
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +1328 -1138
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1375 -1180
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/maps/layers/bing-map.d.ts +2 -2
- package/src/maps/layers/bubble.d.ts +3 -4
- package/src/maps/layers/bubble.js +3 -4
- package/src/maps/layers/color-mapping.d.ts +2 -2
- package/src/maps/layers/color-mapping.js +2 -2
- package/src/maps/layers/data-label.d.ts +1 -1
- package/src/maps/layers/data-label.js +6 -6
- package/src/maps/layers/layer-panel.d.ts +7 -7
- package/src/maps/layers/layer-panel.js +129 -193
- package/src/maps/layers/legend.d.ts +9 -0
- package/src/maps/layers/legend.js +147 -55
- package/src/maps/layers/marker.d.ts +8 -8
- package/src/maps/layers/marker.js +109 -105
- package/src/maps/layers/navigation-selected-line.d.ts +1 -1
- package/src/maps/layers/navigation-selected-line.js +2 -2
- package/src/maps/layers/polygon.d.ts +1 -1
- package/src/maps/layers/polygon.js +10 -7
- package/src/maps/maps.d.ts +24 -26
- package/src/maps/maps.js +39 -46
- package/src/maps/model/base-model.d.ts +20 -93
- package/src/maps/model/base.d.ts +19 -83
- package/src/maps/model/base.js +13 -40
- package/src/maps/model/constants.d.ts +0 -4
- package/src/maps/model/constants.js +0 -4
- package/src/maps/model/export-image.js +5 -2
- package/src/maps/model/export-pdf.js +5 -2
- package/src/maps/model/interface.d.ts +14 -1
- package/src/maps/model/interface.js +0 -1
- package/src/maps/model/print.d.ts +3 -3
- package/src/maps/model/print.js +8 -5
- package/src/maps/model/theme.d.ts +1 -1
- package/src/maps/model/theme.js +190 -15
- package/src/maps/user-interaction/annotation.d.ts +1 -2
- package/src/maps/user-interaction/annotation.js +1 -2
- package/src/maps/user-interaction/highlight.d.ts +4 -4
- package/src/maps/user-interaction/highlight.js +4 -4
- package/src/maps/user-interaction/selection.d.ts +5 -5
- package/src/maps/user-interaction/selection.js +5 -5
- package/src/maps/user-interaction/tooltip.d.ts +6 -6
- package/src/maps/user-interaction/tooltip.js +30 -13
- package/src/maps/user-interaction/zoom.d.ts +6 -4
- package/src/maps/user-interaction/zoom.js +50 -50
- package/src/maps/utils/enum.d.ts +7 -53
- package/src/maps/utils/helper.d.ts +87 -72
- package/src/maps/utils/helper.js +130 -102
- package/CHANGELOG.md +0 -632
|
@@ -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
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
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
|
|
521
|
-
|
|
522
|
-
|
|
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,36 @@ 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,
|
|
637
|
+
/* eslint-disable-next-line max-len */
|
|
638
|
+
this.maps.layers[layerIndex].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor, isNullOrUndefined(this.maps.layers[layerIndex].shapeSettings.border.width)
|
|
639
|
+
? 0 : this.maps.layers[layerIndex].shapeSettings.border.width, isNullOrUndefined(this.maps.layers[layerIndex].shapeSettings.border.opacity)
|
|
640
|
+
? this.maps.layers[layerIndex].shapeSettings.opacity
|
|
641
|
+
: this.maps.layers[layerIndex].shapeSettings.border.opacity, this.maps.layers[layerIndex].shapeSettings.fill);
|
|
642
|
+
}
|
|
643
|
+
currentItem['_isVisible'] = false;
|
|
644
|
+
}
|
|
645
|
+
};
|
|
608
646
|
Legend.prototype.legendHighLightAndSelection = function (targetElement, value) {
|
|
609
647
|
var shapeIndex;
|
|
610
648
|
var layerIndex;
|
|
@@ -796,7 +834,7 @@ var Legend = /** @class */ (function () {
|
|
|
796
834
|
collection.push({
|
|
797
835
|
legendElement: targetElement, legendOldFill: oldElement['fill'], legendOldOpacity: oldElement['opacity'],
|
|
798
836
|
legendOldBorderColor: oldElement['borderColor'], legendOldBorderWidth: oldElement['borderWidth'],
|
|
799
|
-
shapeOpacity: shapeSettings.opacity, shapeOldBorderColor: shapeSettings.border.color,
|
|
837
|
+
shapeOpacity: shapeSettings.opacity, shapeOldBorderColor: shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor,
|
|
800
838
|
shapeOldBorderWidth: shapeSettings.border.width
|
|
801
839
|
});
|
|
802
840
|
var length = collection.length;
|
|
@@ -1273,7 +1311,8 @@ var Legend = /** @class */ (function () {
|
|
|
1273
1311
|
this.legendBorderRect = new Rect((this.legendItemRect.x - spacing), (this.legendItemRect.y - spacing - textSize.height), (this.legendItemRect.width) + (spacing * 2), (this.legendItemRect.height) + (spacing * 2) + textSize.height +
|
|
1274
1312
|
(legend.mode === 'Interactive' ? 0 : (this.page !== 0) ? spacing : 0));
|
|
1275
1313
|
var legendBorder = {
|
|
1276
|
-
color: legend.border.color
|
|
1314
|
+
color: legend.border.color || this.maps.themeStyle.legendBorderColor, opacity: legend.border.opacity,
|
|
1315
|
+
width: legend.border.width || this.maps.themeStyle.legendBorderWidth
|
|
1277
1316
|
};
|
|
1278
1317
|
legendBorder.opacity = isNullOrUndefined(legendBorder.opacity) ? 1 : legendBorder.opacity;
|
|
1279
1318
|
var renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
|
|
@@ -1438,7 +1477,7 @@ var Legend = /** @class */ (function () {
|
|
|
1438
1477
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1439
1478
|
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
1440
1479
|
var marker = _this.maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1441
|
-
if ((text === data[marker.legendText] || text === '') && legendFill === data[marker.colorValuePath]) {
|
|
1480
|
+
if ((text === data[marker.legendText] || text === '') && legendFill === (data[marker.colorValuePath] || marker.fill)) {
|
|
1442
1481
|
legendData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
|
|
1443
1482
|
shape: !isNullOrUndefined(marker.shapeValuePath) ? data[marker.shapeValuePath] : marker.shape });
|
|
1444
1483
|
}
|
|
@@ -1460,15 +1499,17 @@ var Legend = /** @class */ (function () {
|
|
|
1460
1499
|
legendText = !isNullOrUndefined(colorMap.label) ? colorMap.label : colorMap.from + ' - ' + colorMap.to;
|
|
1461
1500
|
rangeData = [];
|
|
1462
1501
|
var colorMapProcess_1 = false;
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1502
|
+
if (!isNullOrUndefined(dataSource) && dataSource.length > 0) {
|
|
1503
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1504
|
+
Array.prototype.forEach.call(dataSource, function (data, dataIndex) {
|
|
1505
|
+
var colorValue = (colorValuePath.indexOf('.') > -1) ? Number(getValueFromObject(data, colorValuePath)) :
|
|
1506
|
+
parseFloat(data[colorValuePath]);
|
|
1507
|
+
if (colorValue >= colorMap.from && colorValue <= colorMap.to) {
|
|
1508
|
+
colorMapProcess_1 = true;
|
|
1509
|
+
rangeData.push(_this.getLegendData(layerIndex, dataIndex, data, dataPath, layerData, propertyPath, colorValue));
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
}
|
|
1472
1513
|
if (!colorMapProcess_1) {
|
|
1473
1514
|
rangeData.push({
|
|
1474
1515
|
layerIndex: layerIndex, shapeIndex: null, dataIndex: null,
|
|
@@ -1556,23 +1597,25 @@ var Legend = /** @class */ (function () {
|
|
|
1556
1597
|
legendText = !isNullOrUndefined(colorMap.label) ? colorMap.label : colorMap.value;
|
|
1557
1598
|
equalData = [];
|
|
1558
1599
|
var eqaulColorProcess_1 = false;
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
(data
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
equalValues.
|
|
1600
|
+
if (!isNullOrUndefined(dataSource) && dataSource.length > 0) {
|
|
1601
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1602
|
+
Array.prototype.forEach.call(dataSource, function (data, dataIndex) {
|
|
1603
|
+
var equalValue = ((colorValuePath.indexOf('.') > -1) ? (getValueFromObject(data, colorValuePath)) :
|
|
1604
|
+
(data[colorValuePath]));
|
|
1605
|
+
if (equalValue === colorMap.value) {
|
|
1606
|
+
eqaulColorProcess_1 = true;
|
|
1607
|
+
if (equalValues.indexOf(equalValue) === -1) {
|
|
1608
|
+
equalValues.push(equalValue);
|
|
1609
|
+
}
|
|
1610
|
+
equalData.push(_this.getLegendData(layerIndex, dataIndex, data, dataPath, layerData, propertyPath, equalValue));
|
|
1567
1611
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
outOfRangeValues.push(equalValue);
|
|
1612
|
+
else {
|
|
1613
|
+
if (outOfRangeValues.indexOf(equalValue) === -1) {
|
|
1614
|
+
outOfRangeValues.push(equalValue);
|
|
1615
|
+
}
|
|
1573
1616
|
}
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1576
1619
|
for (var x = 0; x < equalValues.length; x++) {
|
|
1577
1620
|
for (var y = 0; y < outOfRangeValues.length; y++) {
|
|
1578
1621
|
if (equalValues[x] === outOfRangeValues[y]) {
|
|
@@ -1699,11 +1742,22 @@ var Legend = /** @class */ (function () {
|
|
|
1699
1742
|
if (!isNullOrUndefined(currentData['data'])) {
|
|
1700
1743
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1701
1744
|
var data = currentData['data'];
|
|
1702
|
-
|
|
1745
|
+
var _loop_3 = function (j) {
|
|
1703
1746
|
if (dataIndex === data[j]['dataIndex'] && layerIndex === data[j]['layerIndex']) {
|
|
1704
|
-
|
|
1705
|
-
|
|
1747
|
+
this_3.renderInteractivePointer(legend, fill, stroke, id, strokeWidth, rect);
|
|
1748
|
+
var arrowElement_1 = querySelector(id, this_3.maps.element.id);
|
|
1749
|
+
if (this_3.maps.isDevice && !(isNullOrUndefined(arrowElement_1))) {
|
|
1750
|
+
clearTimeout(this_3.arrowTimer);
|
|
1751
|
+
this_3.arrowTimer = setTimeout(function () { remove(arrowElement_1); }, 2000);
|
|
1752
|
+
}
|
|
1753
|
+
return "break";
|
|
1706
1754
|
}
|
|
1755
|
+
};
|
|
1756
|
+
var this_3 = this;
|
|
1757
|
+
for (var j = 0; j < data.length; j++) {
|
|
1758
|
+
var state_1 = _loop_3(j);
|
|
1759
|
+
if (state_1 === "break")
|
|
1760
|
+
break;
|
|
1707
1761
|
}
|
|
1708
1762
|
}
|
|
1709
1763
|
}
|
|
@@ -1779,6 +1833,10 @@ var Legend = /** @class */ (function () {
|
|
|
1779
1833
|
mapElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[layerIndex].markerSettings[markerIndex].border.opacity) ?
|
|
1780
1834
|
this.maps.layers[layerIndex].markerSettings[markerIndex].opacity :
|
|
1781
1835
|
this.maps.layers[layerIndex].markerSettings[markerIndex].border.opacity).toString());
|
|
1836
|
+
var indexToRemoveSelectedElement = this.maps.toggledElementId.indexOf(mapElement.id);
|
|
1837
|
+
if (indexToRemoveSelectedElement !== -1) {
|
|
1838
|
+
this.maps.toggledElementId.splice(indexToRemoveSelectedElement, 1);
|
|
1839
|
+
}
|
|
1782
1840
|
};
|
|
1783
1841
|
Legend.prototype.bubbleToggleSelection = function (mapElement, layerIndex, bubbleIndex, legendIndex) {
|
|
1784
1842
|
mapElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
|
|
@@ -1820,10 +1878,11 @@ var Legend = /** @class */ (function () {
|
|
|
1820
1878
|
'_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id);
|
|
1821
1879
|
mapElement = mapElement.children[0];
|
|
1822
1880
|
}
|
|
1881
|
+
var toggledLegendIdIndex = this.maps.toggledLegendId.indexOf(legendIndex);
|
|
1823
1882
|
if (isVisible && mapElement !== null) {
|
|
1824
1883
|
if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
|
|
1825
1884
|
mapElement.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
|
|
1826
|
-
mapElement.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
|
|
1885
|
+
mapElement.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor);
|
|
1827
1886
|
mapElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
|
|
1828
1887
|
mapElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1829
1888
|
mapElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
@@ -1837,6 +1896,15 @@ var Legend = /** @class */ (function () {
|
|
|
1837
1896
|
mapElement.setAttribute('stroke-width', (legendToggleBorderWidth).toString());
|
|
1838
1897
|
mapElement.setAttribute('stroke-opacity', (legendToggleBorderOpacity).toString());
|
|
1839
1898
|
}
|
|
1899
|
+
if (this.maps.legendSettings.type === 'Markers') {
|
|
1900
|
+
if (toggledLegendIdIndex === -1) {
|
|
1901
|
+
this.maps.toggledLegendId.push(legendIndex);
|
|
1902
|
+
}
|
|
1903
|
+
var index = this.maps.toggledElementId.indexOf(mapElement.id);
|
|
1904
|
+
if (index === -1) {
|
|
1905
|
+
this.maps.toggledElementId.push(mapElement.id);
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1840
1908
|
if (targetEle !== null) {
|
|
1841
1909
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
1842
1910
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
|
|
@@ -1844,7 +1912,9 @@ var Legend = /** @class */ (function () {
|
|
|
1844
1912
|
this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
|
|
1845
1913
|
}
|
|
1846
1914
|
else {
|
|
1847
|
-
this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[k].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity,
|
|
1915
|
+
this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[k].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity,
|
|
1916
|
+
/* eslint-disable-next-line max-len */
|
|
1917
|
+
this.maps.layers[k].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor, isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width)
|
|
1848
1918
|
? 0 : this.maps.layers[k].shapeSettings.border.width,
|
|
1849
1919
|
/* eslint-disable-next-line max-len */
|
|
1850
1920
|
isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity)
|
|
@@ -1855,6 +1925,9 @@ var Legend = /** @class */ (function () {
|
|
|
1855
1925
|
}
|
|
1856
1926
|
else {
|
|
1857
1927
|
if (this.maps.legendSettings.type === 'Markers') {
|
|
1928
|
+
if (toggledLegendIdIndex !== -1 && i === 0) {
|
|
1929
|
+
this.maps.toggledLegendId.splice(toggledLegendIdIndex, 1);
|
|
1930
|
+
}
|
|
1858
1931
|
this.markerToggleSelection(mapElement, k, j, legendIndex);
|
|
1859
1932
|
}
|
|
1860
1933
|
else {
|
|
@@ -1863,7 +1936,7 @@ var Legend = /** @class */ (function () {
|
|
|
1863
1936
|
if (targetEle !== null) {
|
|
1864
1937
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
1865
1938
|
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'],
|
|
1939
|
+
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
1940
|
if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
|
|
1868
1941
|
legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
|
|
1869
1942
|
}
|
|
@@ -1887,18 +1960,18 @@ var Legend = /** @class */ (function () {
|
|
|
1887
1960
|
layerElement = querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
1888
1961
|
'_shapeIndex_' + shape['shapeIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
|
|
1889
1962
|
if (layerElement !== null) {
|
|
1890
|
-
var toggledShapeIdIndex = this.maps.
|
|
1963
|
+
var toggledShapeIdIndex = this.maps.toggledElementId.indexOf(layerElement.id);
|
|
1891
1964
|
if (isVisible) {
|
|
1892
1965
|
if (i === 0) {
|
|
1893
1966
|
this.maps.toggledLegendId.push(legendIndex);
|
|
1894
1967
|
}
|
|
1895
1968
|
if (toggledShapeIdIndex === -1) {
|
|
1896
|
-
this.maps.
|
|
1969
|
+
this.maps.toggledElementId.push(layerElement.id);
|
|
1897
1970
|
}
|
|
1898
1971
|
if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
|
|
1899
1972
|
layerElement.setAttribute('fill', this.maps.layers[j].shapeSettings.fill);
|
|
1900
1973
|
layerElement.setAttribute('fill-opacity', (this.maps.layers[j].shapeSettings.opacity).toString());
|
|
1901
|
-
layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
|
|
1974
|
+
layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor);
|
|
1902
1975
|
layerElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.width) ? 0 : this.maps.layers[j].shapeSettings.border.width).toString());
|
|
1903
1976
|
layerElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity) ?
|
|
1904
1977
|
this.maps.layers[j].shapeSettings.opacity :
|
|
@@ -1918,7 +1991,9 @@ var Legend = /** @class */ (function () {
|
|
|
1918
1991
|
this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
|
|
1919
1992
|
}
|
|
1920
1993
|
else {
|
|
1921
|
-
this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[j].shapeSettings.fill, this.maps.layers[j].shapeSettings.opacity,
|
|
1994
|
+
this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[j].shapeSettings.fill, this.maps.layers[j].shapeSettings.opacity,
|
|
1995
|
+
/* eslint-disable-next-line max-len */
|
|
1996
|
+
this.maps.layers[j].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor, isNullOrUndefined(this.maps.layers[j].shapeSettings.border.width)
|
|
1922
1997
|
? 0 : this.maps.layers[j].shapeSettings.border.width,
|
|
1923
1998
|
/* eslint-disable-next-line max-len */
|
|
1924
1999
|
isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity)
|
|
@@ -1932,7 +2007,7 @@ var Legend = /** @class */ (function () {
|
|
|
1932
2007
|
this.maps.toggledLegendId.splice(toggledLegendIdIndex, 1);
|
|
1933
2008
|
}
|
|
1934
2009
|
if (toggledShapeIdIndex !== -1) {
|
|
1935
|
-
this.maps.
|
|
2010
|
+
this.maps.toggledElementId.splice(toggledShapeIdIndex, 1);
|
|
1936
2011
|
}
|
|
1937
2012
|
layerElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
|
|
1938
2013
|
layerElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity) ?
|
|
@@ -1940,7 +2015,7 @@ var Legend = /** @class */ (function () {
|
|
|
1940
2015
|
this.maps.layers[j].shapeSettings.border.opacity).toString());
|
|
1941
2016
|
layerElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.width) ? 0 : this.maps.layers[j].shapeSettings.border.width).toString());
|
|
1942
2017
|
layerElement.setAttribute('fill-opacity', (this.maps.layers[j].shapeSettings.opacity).toString());
|
|
1943
|
-
layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
|
|
2018
|
+
layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor);
|
|
1944
2019
|
if (targetEle !== null) {
|
|
1945
2020
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
|
|
1946
2021
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
@@ -1964,6 +2039,7 @@ var Legend = /** @class */ (function () {
|
|
|
1964
2039
|
var selectedItem = this.legendCollection[legendIndex]['data'];
|
|
1965
2040
|
var isVisible = selectedItem['_isVisible'];
|
|
1966
2041
|
if ((this.maps.legendSettings.type === 'Bubbles' || this.maps.legendSettings.type === 'Markers') && this.maps.legendSettings.toggleLegendSettings.enable) {
|
|
2042
|
+
var toggledLegendIdIndex = this.maps.toggledLegendId.indexOf(legendIndex);
|
|
1967
2043
|
for (var k = 0; k < this.maps.layers.length; k++) {
|
|
1968
2044
|
for (var j = 0; j < (this.maps.legendSettings.type === 'Bubbles' ? this.maps.layers[k].bubbleSettings.length : this.maps.layers[k].markerSettings.length); j++) {
|
|
1969
2045
|
for (var i = 0; i < selectedItem.length; i++) {
|
|
@@ -1978,9 +2054,18 @@ var Legend = /** @class */ (function () {
|
|
|
1978
2054
|
LegendInteractive = LegendInteractive.children[0];
|
|
1979
2055
|
}
|
|
1980
2056
|
if (isVisible && LegendInteractive !== null) {
|
|
2057
|
+
if (this.maps.legendSettings.type === 'Markers') {
|
|
2058
|
+
if (toggledLegendIdIndex === -1) {
|
|
2059
|
+
this.maps.toggledLegendId.push(legendIndex);
|
|
2060
|
+
}
|
|
2061
|
+
var index = this.maps.toggledElementId.indexOf(LegendInteractive.id);
|
|
2062
|
+
if (index === -1) {
|
|
2063
|
+
this.maps.toggledElementId.push(LegendInteractive.id);
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
1981
2066
|
if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
|
|
1982
2067
|
LegendInteractive.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
|
|
1983
|
-
LegendInteractive.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
|
|
2068
|
+
LegendInteractive.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor);
|
|
1984
2069
|
LegendInteractive.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1985
2070
|
LegendInteractive.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
1986
2071
|
this.maps.layers[k].shapeSettings.opacity :
|
|
@@ -2001,7 +2086,9 @@ var Legend = /** @class */ (function () {
|
|
|
2001
2086
|
this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
|
|
2002
2087
|
}
|
|
2003
2088
|
else {
|
|
2004
|
-
this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[k].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity,
|
|
2089
|
+
this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[k].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity,
|
|
2090
|
+
/* eslint-disable-next-line max-len */
|
|
2091
|
+
this.maps.layers[k].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor,
|
|
2005
2092
|
/* eslint-disable-next-line max-len */
|
|
2006
2093
|
(isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width)
|
|
2007
2094
|
? 0
|
|
@@ -2015,6 +2102,9 @@ var Legend = /** @class */ (function () {
|
|
|
2015
2102
|
}
|
|
2016
2103
|
else {
|
|
2017
2104
|
if (this.maps.legendSettings.type === 'Markers') {
|
|
2105
|
+
if (toggledLegendIdIndex !== -1 && i === 0) {
|
|
2106
|
+
this.maps.toggledLegendId.splice(toggledLegendIdIndex, 1);
|
|
2107
|
+
}
|
|
2018
2108
|
this.markerToggleSelection(LegendInteractive, k, j, legendIndex);
|
|
2019
2109
|
}
|
|
2020
2110
|
else {
|
|
@@ -2028,7 +2118,7 @@ var Legend = /** @class */ (function () {
|
|
|
2028
2118
|
legendShapeId.setAttribute('stroke-width', this.legendCollection[legendIndex]['shapeBorder']['width']);
|
|
2029
2119
|
legendShapeId.setAttribute('stroke-opacity', this.legendCollection[legendIndex]['shapeBorder']['opacity']);
|
|
2030
2120
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
|
|
2031
|
-
legendTextId.setAttribute('fill',
|
|
2121
|
+
legendTextId.setAttribute('fill', this.maps.legendSettings.textStyle.color);
|
|
2032
2122
|
}
|
|
2033
2123
|
}
|
|
2034
2124
|
}
|
|
@@ -2049,17 +2139,17 @@ var Legend = /** @class */ (function () {
|
|
|
2049
2139
|
mapLegendElement = querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
|
|
2050
2140
|
'_shapeIndex_' + mapdata['shapeIndex'] + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id);
|
|
2051
2141
|
if (mapLegendElement !== null) {
|
|
2052
|
-
var toggledShapeIdIndex = this.maps.
|
|
2142
|
+
var toggledShapeIdIndex = this.maps.toggledElementId.indexOf(mapLegendElement.id);
|
|
2053
2143
|
if (isVisible) {
|
|
2054
2144
|
if (i === 0) {
|
|
2055
2145
|
this.maps.toggledLegendId.push(legendIndex);
|
|
2056
2146
|
}
|
|
2057
2147
|
if (toggledShapeIdIndex === -1) {
|
|
2058
|
-
this.maps.
|
|
2148
|
+
this.maps.toggledElementId.push(mapLegendElement.id);
|
|
2059
2149
|
}
|
|
2060
2150
|
if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
|
|
2061
2151
|
mapLegendElement.setAttribute('fill', this.maps.layers[0].shapeSettings.fill);
|
|
2062
|
-
mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color);
|
|
2152
|
+
mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor);
|
|
2063
2153
|
mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
|
|
2064
2154
|
mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
|
|
2065
2155
|
mapLegendElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
@@ -2080,7 +2170,9 @@ var Legend = /** @class */ (function () {
|
|
|
2080
2170
|
this.setToggleAttributes(legendTextId, legendShapeId, legendToggleFill, legendToggleOpacity, legendToggleBorderColor, legendToggleBorderWidth, legendToggleBorderOpacity, legendToggleFill);
|
|
2081
2171
|
}
|
|
2082
2172
|
else {
|
|
2083
|
-
this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[0].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity,
|
|
2173
|
+
this.setToggleAttributes(legendTextId, legendShapeId, this.maps.layers[0].shapeSettings.fill, this.maps.layers[k].shapeSettings.opacity,
|
|
2174
|
+
/* eslint-disable-next-line max-len */
|
|
2175
|
+
this.maps.layers[0].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor, isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width)
|
|
2084
2176
|
? 0
|
|
2085
2177
|
: this.maps.layers[k].shapeSettings.border.width,
|
|
2086
2178
|
/* eslint-disable-next-line max-len */
|
|
@@ -2095,12 +2187,12 @@ var Legend = /** @class */ (function () {
|
|
|
2095
2187
|
this.maps.toggledLegendId.splice(toggleLegendIdIndex, 1);
|
|
2096
2188
|
}
|
|
2097
2189
|
if (toggledShapeIdIndex !== -1) {
|
|
2098
|
-
this.maps.
|
|
2190
|
+
this.maps.toggledElementId.splice(toggledShapeIdIndex, 1);
|
|
2099
2191
|
}
|
|
2100
2192
|
mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
|
|
2101
2193
|
mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 :
|
|
2102
2194
|
this.maps.layers[k].shapeSettings.border.width).toString());
|
|
2103
|
-
mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color);
|
|
2195
|
+
mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color || this.maps.themeStyle.shapeBorderColor);
|
|
2104
2196
|
mapLegendElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
2105
2197
|
this.maps.layers[k].shapeSettings.opacity :
|
|
2106
2198
|
this.maps.layers[k].shapeSettings.border.opacity).toString());
|
|
@@ -31,7 +31,7 @@ export declare class Marker {
|
|
|
31
31
|
*/
|
|
32
32
|
private calculateIndividualLayerMarkerZoomLevel;
|
|
33
33
|
/**
|
|
34
|
-
* To calculate center position and factor value dynamically
|
|
34
|
+
* To calculate center position and factor value dynamically.
|
|
35
35
|
*
|
|
36
36
|
* @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
|
|
37
37
|
* @returns {void}
|
|
@@ -39,7 +39,7 @@ export declare class Marker {
|
|
|
39
39
|
*/
|
|
40
40
|
calculateZoomCenterPositionAndFactor(layersCollection: LayerSettings[]): void;
|
|
41
41
|
/**
|
|
42
|
-
* To check and trigger marker click event
|
|
42
|
+
* To check and trigger marker click event.
|
|
43
43
|
*
|
|
44
44
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
45
45
|
* @returns {void}
|
|
@@ -47,7 +47,7 @@ export declare class Marker {
|
|
|
47
47
|
*/
|
|
48
48
|
markerClick(e: PointerEvent): void;
|
|
49
49
|
/**
|
|
50
|
-
* To check and trigger Cluster click event
|
|
50
|
+
* To check and trigger Cluster click event.
|
|
51
51
|
*
|
|
52
52
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
53
53
|
* @returns {void}
|
|
@@ -55,14 +55,14 @@ export declare class Marker {
|
|
|
55
55
|
*/
|
|
56
56
|
markerClusterClick(e: PointerEvent): void;
|
|
57
57
|
/**
|
|
58
|
-
* To get marker from target id
|
|
58
|
+
* To get marker from target id.
|
|
59
59
|
*
|
|
60
60
|
* @param {string} target - Specifies the target
|
|
61
61
|
* @returns {object} - Returns the marker, data, clusterCollection, markCollection
|
|
62
62
|
*/
|
|
63
63
|
private getMarker;
|
|
64
64
|
/**
|
|
65
|
-
* To check and trigger marker move event
|
|
65
|
+
* To check and trigger marker move event.
|
|
66
66
|
*
|
|
67
67
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
68
68
|
* @returns {void}
|
|
@@ -70,15 +70,15 @@ export declare class Marker {
|
|
|
70
70
|
*/
|
|
71
71
|
markerMove(e: PointerEvent): void;
|
|
72
72
|
/**
|
|
73
|
-
* To check and trigger cluster move event
|
|
73
|
+
* To check and trigger cluster move event.
|
|
74
74
|
*
|
|
75
75
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
76
76
|
* @returns {void}
|
|
77
77
|
* @private
|
|
78
78
|
*/
|
|
79
79
|
markerClusterMouseMove(e: PointerEvent): void;
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
80
|
+
/**
|
|
81
|
+
* @private
|
|
82
82
|
* @returns {void}
|
|
83
83
|
*/
|
|
84
84
|
initializeMarkerClusterList(): void;
|