@syncfusion/ej2-maps 19.3.44 → 19.4.42
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 +1 -1
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -0
- package/CHANGELOG.md +36 -5
- package/README.md +4 -4
- 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 +655 -647
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +652 -645
- 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 +12 -12
- package/src/maps/layers/bubble.d.ts +6 -0
- package/src/maps/layers/bubble.js +10 -25
- package/src/maps/layers/data-label.js +6 -17
- package/src/maps/layers/layer-panel.d.ts +2 -1
- package/src/maps/layers/layer-panel.js +86 -72
- package/src/maps/layers/legend.js +48 -19
- package/src/maps/layers/marker.js +2 -24
- package/src/maps/maps-model.d.ts +1 -28
- package/src/maps/maps.d.ts +5 -38
- package/src/maps/maps.js +80 -102
- package/src/maps/model/base-model.d.ts +7 -5
- package/src/maps/model/base.d.ts +6 -5
- package/src/maps/model/base.js +5 -2
- package/src/maps/model/export-pdf.js +1 -1
- package/src/maps/model/interface.d.ts +1 -3
- package/src/maps/model/theme.js +116 -6
- package/src/maps/user-interaction/annotation.js +3 -7
- package/src/maps/user-interaction/highlight.js +4 -17
- package/src/maps/user-interaction/selection.js +10 -22
- package/src/maps/user-interaction/tooltip.js +61 -125
- package/src/maps/user-interaction/zoom.d.ts +1 -0
- package/src/maps/user-interaction/zoom.js +92 -110
- package/src/maps/utils/enum.d.ts +8 -2
- package/src/maps/utils/helper.d.ts +5 -3
- package/src/maps/utils/helper.js +136 -104
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { click, legendRendering } from '../index';
|
|
2
|
-
import { Rect, measureText, PathOption, textTrim, removeClass, querySelector, getTemplateFunction, maintainStyleClass, getValueFromObject } from '../utils/helper';
|
|
2
|
+
import { Rect, measureText, PathOption, textTrim, drawBalloon, removeClass, querySelector, getTemplateFunction, maintainStyleClass, getValueFromObject } from '../utils/helper';
|
|
3
3
|
import { RectOption, Size, TextOption, Point, renderTextElement, drawSymbol, checkPropertyPath, getElement } from '../utils/helper';
|
|
4
4
|
import { isNullOrUndefined, Browser, EventHandler, remove, extend } from '@syncfusion/ej2-base';
|
|
5
5
|
/**
|
|
@@ -422,6 +422,7 @@ var Legend = /** @class */ (function () {
|
|
|
422
422
|
var textOptions;
|
|
423
423
|
var renderOptions;
|
|
424
424
|
var render = map.renderer;
|
|
425
|
+
var legendShape = legend.shape;
|
|
425
426
|
if (page >= 0 && page < this.totalPages.length) {
|
|
426
427
|
if (querySelector(this.legendGroup.id, this.maps.element.id)) {
|
|
427
428
|
remove(querySelector(this.legendGroup.id, this.maps.element.id));
|
|
@@ -446,21 +447,35 @@ var Legend = /** @class */ (function () {
|
|
|
446
447
|
var textLocation = collection['Text'];
|
|
447
448
|
var imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
|
|
448
449
|
var renderOptions_1 = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
|
|
449
|
-
|
|
450
|
+
var legendTextStyle = {
|
|
451
|
+
fontFamily: legend.textStyle.fontFamily, fontStyle: legend.textStyle.fontStyle,
|
|
452
|
+
fontWeight: legend.textStyle.fontWeight, size: legend.textStyle.size, color: legend.textStyle.color, opacity: legend.textStyle.opacity
|
|
453
|
+
};
|
|
454
|
+
legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
|
|
450
455
|
this.maps.themeStyle.legendTextColor;
|
|
451
|
-
|
|
452
|
-
|
|
456
|
+
legendTextStyle.fontFamily = map.themeStyle.fontFamily || legendTextStyle.fontFamily;
|
|
457
|
+
legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
|
|
453
458
|
if (i === 0) {
|
|
454
459
|
this.renderLegendBorder();
|
|
455
460
|
}
|
|
456
|
-
|
|
461
|
+
if (legend.type === 'Markers' && legend.useMarkerShape) {
|
|
462
|
+
var legendShapeData = this.legendCollection[collection['idIndex']].data[0];
|
|
463
|
+
var marker = map.layers[legendShapeData['layerIndex']].markerSettings[legendShapeData['markerIndex']];
|
|
464
|
+
legendShape = !isNullOrUndefined(marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']]) && marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']] !== '' ? marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']] : marker.shape;
|
|
465
|
+
}
|
|
466
|
+
if (legendShape === "Balloon") {
|
|
467
|
+
legendElement.appendChild(drawBalloon(map, renderOptions_1, shapeSize, { x: shapeLocation.x, y: (shapeLocation.y + 5) }, 'Legend'));
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
legendElement.appendChild(drawSymbol(shapeLocation, legendShape, shapeSize, collection['ImageSrc'], renderOptions_1));
|
|
471
|
+
}
|
|
457
472
|
var legendRectSize = collection['Rect']['x'] + collection['Rect']['width'];
|
|
458
473
|
if (legendRectSize > this.legendBorderRect.width) {
|
|
459
|
-
var trimmedText = this.legendTextTrim(this.legendBorderRect.width, legendText,
|
|
474
|
+
var trimmedText = this.legendTextTrim(this.legendBorderRect.width, legendText, legendTextStyle, legendRectSize);
|
|
460
475
|
legendText = trimmedText;
|
|
461
476
|
}
|
|
462
477
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
|
|
463
|
-
renderTextElement(textOptions,
|
|
478
|
+
renderTextElement(textOptions, legendTextStyle, legendTextStyle.color, legendElement);
|
|
464
479
|
this.legendGroup.appendChild(legendElement);
|
|
465
480
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
466
481
|
if (i === (this.totalPages[page]['Collection'].length - 1)) {
|
|
@@ -528,7 +543,7 @@ var Legend = /** @class */ (function () {
|
|
|
528
543
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
529
544
|
var collection = this.maps.legendModule.legendCollection;
|
|
530
545
|
var length;
|
|
531
|
-
var multiSelectEnable = this.maps.layers[collection[0]['data'][0]['layerIndex']].selectionSettings.enableMultiSelect;
|
|
546
|
+
var multiSelectEnable = !isNullOrUndefined(collection[0]['data'][0]['layerIndex']) ? this.maps.layers[collection[0]['data'][0]['layerIndex']].selectionSettings.enableMultiSelect : false;
|
|
532
547
|
var selectLength = 0;
|
|
533
548
|
var interactProcess = true;
|
|
534
549
|
var idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
|
|
@@ -1141,7 +1156,10 @@ var Legend = /** @class */ (function () {
|
|
|
1141
1156
|
var map = this.maps;
|
|
1142
1157
|
var legend = map.legendSettings;
|
|
1143
1158
|
var legendTitle = legend.title.text;
|
|
1144
|
-
var textStyle =
|
|
1159
|
+
var textStyle = {
|
|
1160
|
+
fontFamily: legend.titleStyle.fontFamily, fontStyle: legend.titleStyle.fontStyle,
|
|
1161
|
+
fontWeight: legend.titleStyle.fontWeight, size: legend.titleStyle.size, color: legend.titleStyle.color, opacity: legend.titleStyle.opacity
|
|
1162
|
+
};
|
|
1145
1163
|
var textOptions;
|
|
1146
1164
|
var spacing = 10;
|
|
1147
1165
|
var trimTitle = textTrim((this.legendItemRect.width + (spacing * 2)), legendTitle, textStyle);
|
|
@@ -1160,6 +1178,7 @@ var Legend = /** @class */ (function () {
|
|
|
1160
1178
|
map.svgObject.appendChild(this.legendGroup);
|
|
1161
1179
|
if (legendTitle) {
|
|
1162
1180
|
textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
|
|
1181
|
+
textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
1163
1182
|
textOptions = new TextOption(map.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - spacing / 2, 'middle', trimTitle, '');
|
|
1164
1183
|
renderTextElement(textOptions, textStyle, textStyle.color, this.legendGroup);
|
|
1165
1184
|
}
|
|
@@ -1268,21 +1287,25 @@ var Legend = /** @class */ (function () {
|
|
|
1268
1287
|
}
|
|
1269
1288
|
else {
|
|
1270
1289
|
newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
|
|
1271
|
-
shape: !isNullOrUndefined(marker.shapeValuePath) ? data[marker.shapeValuePath] : marker.shape });
|
|
1290
|
+
shape: (!isNullOrUndefined(marker.shapeValuePath) && !isNullOrUndefined(data[marker.shapeValuePath]) && data[marker.shapeValuePath] !== '') ? data[marker.shapeValuePath] : (_this.maps.legendSettings.useMarkerShape ? marker.shape : _this.maps.legendSettings.shape) });
|
|
1272
1291
|
_this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
|
|
1273
1292
|
}
|
|
1274
1293
|
}
|
|
1275
1294
|
});
|
|
1276
1295
|
});
|
|
1277
1296
|
};
|
|
1297
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1278
1298
|
Legend.prototype.getMarkerLegendData = function (layerIndex, text, legendFill) {
|
|
1279
1299
|
var _this = this;
|
|
1300
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1280
1301
|
var legendData = [];
|
|
1281
1302
|
this.maps.layers[layerIndex].markerSettings.map(function (markerSettings, markerIndex) {
|
|
1303
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1282
1304
|
var markerData = markerSettings.dataSource;
|
|
1305
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1283
1306
|
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
1284
1307
|
var marker = _this.maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1285
|
-
if ((text === data[marker.legendText] || text === '') && legendFill
|
|
1308
|
+
if ((text === data[marker.legendText] || text === '') && legendFill === data[marker.colorValuePath]) {
|
|
1286
1309
|
legendData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
|
|
1287
1310
|
shape: !isNullOrUndefined(marker.shapeValuePath) ? data[marker.shapeValuePath] : marker.shape });
|
|
1288
1311
|
}
|
|
@@ -1650,7 +1673,7 @@ var Legend = /** @class */ (function () {
|
|
|
1650
1673
|
shape = this.legendCollection[legendIndex]['data'][i];
|
|
1651
1674
|
mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
1652
1675
|
'_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
1653
|
-
'_MarkerIndex_' +
|
|
1676
|
+
'_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
|
|
1654
1677
|
if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
|
|
1655
1678
|
mapElement = mapElement.children[0];
|
|
1656
1679
|
}
|
|
@@ -1659,7 +1682,7 @@ var Legend = /** @class */ (function () {
|
|
|
1659
1682
|
mapElement.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
|
|
1660
1683
|
mapElement.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
|
|
1661
1684
|
mapElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
|
|
1662
|
-
mapElement.setAttribute('stroke-width', (this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1685
|
+
mapElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1663
1686
|
mapElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
1664
1687
|
this.maps.layers[k].shapeSettings.opacity :
|
|
1665
1688
|
this.maps.layers[k].shapeSettings.border.opacity).toString());
|
|
@@ -1674,6 +1697,9 @@ var Legend = /** @class */ (function () {
|
|
|
1674
1697
|
if (targetEle !== null) {
|
|
1675
1698
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
1676
1699
|
legendShapeId.setAttribute('fill', '#E5E5E5');
|
|
1700
|
+
if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
|
|
1701
|
+
legendShapeId.setAttribute('stroke', '#E5E5E5');
|
|
1702
|
+
}
|
|
1677
1703
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
|
|
1678
1704
|
legendTextId.setAttribute('fill', '#E5E5E5');
|
|
1679
1705
|
}
|
|
@@ -1688,6 +1714,9 @@ var Legend = /** @class */ (function () {
|
|
|
1688
1714
|
if (targetEle !== null) {
|
|
1689
1715
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
1690
1716
|
legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
|
|
1717
|
+
if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
|
|
1718
|
+
legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
|
|
1719
|
+
}
|
|
1691
1720
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
|
|
1692
1721
|
legendTextId.setAttribute('fill', '#757575');
|
|
1693
1722
|
}
|
|
@@ -1722,7 +1751,7 @@ var Legend = /** @class */ (function () {
|
|
|
1722
1751
|
layerElement.setAttribute('fill', this.maps.layers[j].shapeSettings.fill);
|
|
1723
1752
|
layerElement.setAttribute('fill-opacity', (this.maps.layers[j].shapeSettings.opacity).toString());
|
|
1724
1753
|
layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
|
|
1725
|
-
layerElement.setAttribute('stroke-width', (this.maps.layers[j].shapeSettings.border.width).toString());
|
|
1754
|
+
layerElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.width) ? 0 : this.maps.layers[j].shapeSettings.border.width).toString());
|
|
1726
1755
|
layerElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity) ?
|
|
1727
1756
|
this.maps.layers[j].shapeSettings.opacity :
|
|
1728
1757
|
this.maps.layers[j].shapeSettings.border.opacity).toString());
|
|
@@ -1752,7 +1781,7 @@ var Legend = /** @class */ (function () {
|
|
|
1752
1781
|
layerElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity) ?
|
|
1753
1782
|
this.maps.layers[j].shapeSettings.opacity :
|
|
1754
1783
|
this.maps.layers[j].shapeSettings.border.opacity).toString());
|
|
1755
|
-
layerElement.setAttribute('stroke-width', (this.maps.layers[j].shapeSettings.border.width).toString());
|
|
1784
|
+
layerElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.width) ? 0 : this.maps.layers[j].shapeSettings.border.width).toString());
|
|
1756
1785
|
layerElement.setAttribute('fill-opacity', (this.maps.layers[j].shapeSettings.opacity).toString());
|
|
1757
1786
|
layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
|
|
1758
1787
|
if (targetEle !== null) {
|
|
@@ -1772,7 +1801,7 @@ var Legend = /** @class */ (function () {
|
|
|
1772
1801
|
targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendSettings.visible &&
|
|
1773
1802
|
targetEle.id.indexOf('_Text') === -1) {
|
|
1774
1803
|
var LegendInteractive = void 0;
|
|
1775
|
-
var legendIndex = parseFloat(targetEle.id.
|
|
1804
|
+
var legendIndex = parseFloat(targetEle.id.split(this.maps.element.id + '_Legend_Index_')[1]);
|
|
1776
1805
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1777
1806
|
var mapdata = void 0;
|
|
1778
1807
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1793,7 +1822,7 @@ var Legend = /** @class */ (function () {
|
|
|
1793
1822
|
if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
|
|
1794
1823
|
LegendInteractive.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
|
|
1795
1824
|
LegendInteractive.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
|
|
1796
|
-
LegendInteractive.setAttribute('stroke-width', (this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1825
|
+
LegendInteractive.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1797
1826
|
LegendInteractive.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
1798
1827
|
this.maps.layers[k].shapeSettings.opacity :
|
|
1799
1828
|
this.maps.layers[k].shapeSettings.border.opacity).toString());
|
|
@@ -1857,7 +1886,7 @@ var Legend = /** @class */ (function () {
|
|
|
1857
1886
|
mapLegendElement.setAttribute('fill', this.maps.layers[0].shapeSettings.fill);
|
|
1858
1887
|
mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color);
|
|
1859
1888
|
mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
|
|
1860
|
-
mapLegendElement.setAttribute('stroke-width', (this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1889
|
+
mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1861
1890
|
mapLegendElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
1862
1891
|
this.maps.layers[k].shapeSettings.opacity :
|
|
1863
1892
|
this.maps.layers[k].shapeSettings.border.opacity).toString());
|
|
@@ -1884,7 +1913,7 @@ var Legend = /** @class */ (function () {
|
|
|
1884
1913
|
this.maps.toggledShapeElementId.splice(toggledShapeIdIndex, 1);
|
|
1885
1914
|
}
|
|
1886
1915
|
mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
|
|
1887
|
-
mapLegendElement.setAttribute('stroke-width', (this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1916
|
+
mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
|
|
1888
1917
|
mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color);
|
|
1889
1918
|
mapLegendElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
1890
1919
|
this.maps.layers[k].shapeSettings.opacity : this.maps.layers[k].shapeSettings.border.opacity).toString());
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
7
|
-
t[p[i]] = s[p[i]];
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
1
|
import { markerRendering, convertTileLatLongToPoint, MapLocation } from '../index';
|
|
11
2
|
import { markerClick, markerMouseMove, markerClusterClick, markerClusterMouseMove } from '../index';
|
|
12
3
|
import { isNullOrUndefined, createElement } from '@syncfusion/ej2-base';
|
|
@@ -57,15 +48,9 @@ var Marker = /** @class */ (function () {
|
|
|
57
48
|
border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
|
|
58
49
|
shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
|
|
59
50
|
};
|
|
60
|
-
eventArgs = markerColorChoose(eventArgs, data);
|
|
61
|
-
eventArgs = markerShapeChoose(eventArgs, data);
|
|
62
51
|
_this.maps.trigger('markerRendering', eventArgs, function (MarkerArgs) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
if (markerSettings.shapeValuePath !== eventArgs.shapeValuePath) {
|
|
67
|
-
eventArgs = markerShapeChoose(eventArgs, data);
|
|
68
|
-
}
|
|
52
|
+
eventArgs = markerColorChoose(eventArgs, data);
|
|
53
|
+
eventArgs = markerShapeChoose(eventArgs, data);
|
|
69
54
|
var lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
70
55
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
71
56
|
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : 0;
|
|
@@ -295,10 +280,6 @@ var Marker = /** @class */ (function () {
|
|
|
295
280
|
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
296
281
|
value: options.data['name']
|
|
297
282
|
};
|
|
298
|
-
if (this.maps.isBlazor) {
|
|
299
|
-
var maps = eventArgs.maps, marker_1 = eventArgs.marker, blazorEventArgs = __rest(eventArgs, ["maps", "marker"]);
|
|
300
|
-
eventArgs = blazorEventArgs;
|
|
301
|
-
}
|
|
302
283
|
this.maps.trigger(markerClick, eventArgs);
|
|
303
284
|
};
|
|
304
285
|
/**
|
|
@@ -378,9 +359,6 @@ var Marker = /** @class */ (function () {
|
|
|
378
359
|
for (var _i = 0, indexes_1 = indexes; _i < indexes_1.length; _i++) {
|
|
379
360
|
var i = indexes_1[_i];
|
|
380
361
|
collection_1.push({ data: marker.dataSource[i], index: i });
|
|
381
|
-
if (this.maps.isBlazor) {
|
|
382
|
-
marker.dataSource[i]['text'] = '';
|
|
383
|
-
}
|
|
384
362
|
markCollection.push(marker.dataSource[i]);
|
|
385
363
|
}
|
|
386
364
|
isClusterSame = false;
|
package/src/maps/maps-model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Ajax } from '@syncfusion/ej2-base';import { EventHandler, Browser, EmitType, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';import { Event, remove, L10n, Collection, Internationalization, Complex
|
|
1
|
+
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Ajax } from '@syncfusion/ej2-base';import { EventHandler, Browser, EmitType, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';import { ModuleDeclaration } from '@syncfusion/ej2-base';import { SvgRenderer } from '@syncfusion/ej2-svg-base';import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition, calculateSize } from './utils/helper';import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle } from './utils/helper';import { createStyle } from './utils/helper';import { ZoomSettings, LegendSettings, Tile } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel } from './model/base-model';import { MarkerSettingsModel, SelectionSettingsModel , InitialMarkerSelectionSettingsModel} from './model/base-model';import { TitleSettingsModel, BorderModel, MarginModel, CenterPositionModel, InitialShapeSelectionSettingsModel } from './model/base-model';import { MapsAreaSettingsModel, AnnotationModel } from './model/base-model';import { Bubble } from './layers/bubble';import { Legend } from './layers/legend';import { Marker } from './layers/marker';import { Highlight } from './user-interaction/highlight';import { Selection } from './user-interaction/selection';import { MapsTooltip } from './user-interaction/tooltip';import { Zoom } from './user-interaction/zoom';import { load, click, rightClick, loaded, doubleClick, resize, shapeSelected, itemSelection, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle } from './model/theme';import { BingMap } from './layers/bing-map';import { ILoadEventArgs, ILoadedEventArgs, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';import { GeoPosition, ITooltipRenderCompleteEventArgs, ILegendRenderingEventArgs } from './model/interface';import { ILayerRenderingEventArgs, IShapeRenderingEventArgs, IMarkerRenderingEventArgs, IMarkerClickEventArgs } from './model/interface';import { IMarkerMoveEventArgs, ILabelRenderingEventArgs, IBubbleMoveEventArgs, IBubbleClickEventArgs } from './model/interface';import { IMarkerClusterClickEventArgs, IMarkerClusterMoveEventArgs, IMarkerClusterRenderingEventArgs } from './model/interface';import { ISelectionEventArgs, IShapeSelectedEventArgs, IMapPanEventArgs, IMapZoomEventArgs } from './model/interface';import { IBubbleRenderingEventArgs, IAnimationCompleteEventArgs, IPrintEventArgs, IThemeStyle } from './model/interface';import { LayerPanel } from './layers/layer-panel';import { GeoLocation, Rect, RectOption, measureText, getElementByID, MapAjax, processResult } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, convertGeoToPoint, calculateZoomLevel } from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';import { DataManager, Query } from '@syncfusion/ej2-data';import { ExportType } from '../maps/utils/enum';import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';import { Print } from './model/print';import { PdfExport } from './model/export-pdf';import { ImageExport } from './model/export-image';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -155,7 +155,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
155
155
|
* Triggers when the map is on load.
|
|
156
156
|
*
|
|
157
157
|
* @event load
|
|
158
|
-
* @blazorProperty 'OnLoad'
|
|
159
158
|
*/
|
|
160
159
|
load?: EmitType<ILoadEventArgs>;
|
|
161
160
|
|
|
@@ -163,7 +162,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
163
162
|
* Triggers before the print gets started.
|
|
164
163
|
*
|
|
165
164
|
* @event beforePrint
|
|
166
|
-
* @blazorProperty 'OnPrint'
|
|
167
165
|
*/
|
|
168
166
|
beforePrint?: EmitType<IPrintEventArgs>;
|
|
169
167
|
|
|
@@ -171,7 +169,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
171
169
|
* Triggers after the maps gets rendered.
|
|
172
170
|
*
|
|
173
171
|
* @event loaded
|
|
174
|
-
* @blazorProperty 'Loaded'
|
|
175
172
|
*/
|
|
176
173
|
loaded?: EmitType<ILoadedEventArgs>;
|
|
177
174
|
|
|
@@ -179,7 +176,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
179
176
|
* Triggers when clicking an element in maps.
|
|
180
177
|
*
|
|
181
178
|
* @event click
|
|
182
|
-
* @blazorProperty 'OnClick'
|
|
183
179
|
*/
|
|
184
180
|
click?: EmitType<IMouseEventArgs>;
|
|
185
181
|
|
|
@@ -187,7 +183,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
187
183
|
* Triggers when performing the double click operation on an element in maps.
|
|
188
184
|
*
|
|
189
185
|
* @event doubleClick
|
|
190
|
-
* @blazorProperty 'OnDoubleClick'
|
|
191
186
|
*/
|
|
192
187
|
doubleClick?: EmitType<IMouseEventArgs>;
|
|
193
188
|
|
|
@@ -195,7 +190,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
195
190
|
* Triggers when performing the right click operation on an element in maps.
|
|
196
191
|
*
|
|
197
192
|
* @event rightClick
|
|
198
|
-
* @blazorProperty 'OnRightClick'
|
|
199
193
|
*/
|
|
200
194
|
rightClick?: EmitType<IMouseEventArgs>;
|
|
201
195
|
|
|
@@ -203,7 +197,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
203
197
|
* Triggers when resizing the maps.
|
|
204
198
|
*
|
|
205
199
|
* @event resize
|
|
206
|
-
* @blazorProperty 'Resizing'
|
|
207
200
|
*/
|
|
208
201
|
resize?: EmitType<IResizeEventArgs>;
|
|
209
202
|
|
|
@@ -211,7 +204,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
211
204
|
* Triggers before the maps tooltip gets rendered.
|
|
212
205
|
*
|
|
213
206
|
* @event tooltipRender
|
|
214
|
-
* @blazorProperty 'TooltipRendering'
|
|
215
207
|
*/
|
|
216
208
|
tooltipRender?: EmitType<ITooltipRenderEventArgs>;
|
|
217
209
|
|
|
@@ -220,7 +212,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
220
212
|
*
|
|
221
213
|
* @event legendRendering
|
|
222
214
|
|
|
223
|
-
* @blazorProperty 'LegendRendering'
|
|
224
215
|
*/
|
|
225
216
|
legendRendering?: EmitType<ILegendRenderingEventArgs>;
|
|
226
217
|
|
|
@@ -229,7 +220,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
229
220
|
*
|
|
230
221
|
|
|
231
222
|
* @event tooltipRenderComplete
|
|
232
|
-
* @blazorProperty 'TooltipRenderComplete'
|
|
233
223
|
*/
|
|
234
224
|
tooltipRenderComplete?: EmitType<ITooltipRenderCompleteEventArgs>;
|
|
235
225
|
|
|
@@ -237,7 +227,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
237
227
|
* Triggers when clicking a shape in maps.
|
|
238
228
|
*
|
|
239
229
|
* @event shapeSelected
|
|
240
|
-
* @blazorProperty 'ShapeSelected'
|
|
241
230
|
*/
|
|
242
231
|
shapeSelected?: EmitType<IShapeSelectedEventArgs>;
|
|
243
232
|
|
|
@@ -245,7 +234,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
245
234
|
* Triggers when clicking the shape on maps and before the selection is applied.
|
|
246
235
|
*
|
|
247
236
|
* @event itemSelection
|
|
248
|
-
* @blazorProperty 'OnItemSelect'
|
|
249
237
|
*/
|
|
250
238
|
itemSelection?: EmitType<ISelectionEventArgs>;
|
|
251
239
|
|
|
@@ -253,7 +241,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
253
241
|
* Trigger when mouse move on the shape in maps and before the shape gets highlighted.
|
|
254
242
|
*
|
|
255
243
|
* @event itemHighlight
|
|
256
|
-
* @blazorProperty 'OnItemHighlight'
|
|
257
244
|
*/
|
|
258
245
|
itemHighlight?: EmitType<ISelectionEventArgs>;
|
|
259
246
|
|
|
@@ -261,7 +248,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
261
248
|
* Triggers when mouse move on the shape in maps and before the shape gets highlighted.
|
|
262
249
|
*
|
|
263
250
|
* @event shapeHighlight
|
|
264
|
-
* @blazorProperty 'ShapeHighlighted'
|
|
265
251
|
*/
|
|
266
252
|
shapeHighlight?: EmitType<IShapeSelectedEventArgs>;
|
|
267
253
|
|
|
@@ -269,7 +255,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
269
255
|
* Triggers before the maps layer gets rendered.
|
|
270
256
|
*
|
|
271
257
|
* @event layerRendering
|
|
272
|
-
* @blazorProperty 'LayerRendering'
|
|
273
258
|
*/
|
|
274
259
|
layerRendering?: EmitType<ILayerRenderingEventArgs>;
|
|
275
260
|
|
|
@@ -277,7 +262,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
277
262
|
* Triggers before the maps shape gets rendered.
|
|
278
263
|
*
|
|
279
264
|
* @event shapeRendering
|
|
280
|
-
* @blazorProperty 'ShapeRendering'
|
|
281
265
|
*/
|
|
282
266
|
shapeRendering?: EmitType<IShapeRenderingEventArgs>;
|
|
283
267
|
|
|
@@ -285,7 +269,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
285
269
|
* Triggers before the maps marker gets rendered.
|
|
286
270
|
*
|
|
287
271
|
* @event markerRendering
|
|
288
|
-
* @blazorProperty 'MarkerRendering'
|
|
289
272
|
*/
|
|
290
273
|
markerRendering?: EmitType<IMarkerRenderingEventArgs>;
|
|
291
274
|
|
|
@@ -300,7 +283,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
300
283
|
* Triggers when clicking on the maps marker element.
|
|
301
284
|
*
|
|
302
285
|
* @event markerClick
|
|
303
|
-
* @blazorProperty 'OnMarkerClick'
|
|
304
286
|
*/
|
|
305
287
|
markerClick?: EmitType<IMarkerClickEventArgs>;
|
|
306
288
|
|
|
@@ -322,7 +304,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
322
304
|
* Triggers when moving the mouse over the marker element in maps.
|
|
323
305
|
*
|
|
324
306
|
* @event markerMouseMove
|
|
325
|
-
* @blazorProperty 'OnMarkerMouseMove'
|
|
326
307
|
*/
|
|
327
308
|
markerMouseMove?: EmitType<IMarkerMoveEventArgs>;
|
|
328
309
|
|
|
@@ -330,7 +311,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
330
311
|
* Triggers before the data-label gets rendered.
|
|
331
312
|
*
|
|
332
313
|
* @event dataLabelRendering
|
|
333
|
-
* @blazorProperty 'DataLabelRendering'
|
|
334
314
|
*/
|
|
335
315
|
dataLabelRendering?: EmitType<ILabelRenderingEventArgs>;
|
|
336
316
|
|
|
@@ -338,7 +318,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
338
318
|
* Triggers before the bubble element gets rendered on the map.
|
|
339
319
|
*
|
|
340
320
|
* @event bubbleRendering
|
|
341
|
-
* @blazorProperty 'BubbleRendering'
|
|
342
321
|
*/
|
|
343
322
|
bubbleRendering?: EmitType<IBubbleRenderingEventArgs>;
|
|
344
323
|
|
|
@@ -346,7 +325,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
346
325
|
* Triggers when performing the click operation on the bubble element in maps.
|
|
347
326
|
*
|
|
348
327
|
* @event bubbleClick
|
|
349
|
-
* @blazorProperty 'OnBubbleClick'
|
|
350
328
|
*/
|
|
351
329
|
bubbleClick?: EmitType<IBubbleClickEventArgs>;
|
|
352
330
|
|
|
@@ -354,7 +332,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
354
332
|
* Triggers when hovering the mouse on the bubble element in maps.
|
|
355
333
|
*
|
|
356
334
|
* @event bubbleMouseMove
|
|
357
|
-
* @blazorProperty 'OnBubbleMouseMove'
|
|
358
335
|
*/
|
|
359
336
|
bubbleMouseMove?: EmitType<IBubbleMoveEventArgs>;
|
|
360
337
|
|
|
@@ -362,7 +339,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
362
339
|
* Triggers after the animation completed in the maps component.
|
|
363
340
|
*
|
|
364
341
|
* @event animationComplete
|
|
365
|
-
* @blazorProperty 'AnimationCompleted'
|
|
366
342
|
*/
|
|
367
343
|
animationComplete?: EmitType<IAnimationCompleteEventArgs>;
|
|
368
344
|
|
|
@@ -370,7 +346,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
370
346
|
* Triggers before rendering the annotation in maps.
|
|
371
347
|
*
|
|
372
348
|
* @event annotationRendering
|
|
373
|
-
* @blazorProperty 'AnnotationRendering'
|
|
374
349
|
*/
|
|
375
350
|
annotationRendering?: EmitType<IAnnotationRenderingEventArgs>;
|
|
376
351
|
|
|
@@ -378,7 +353,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
378
353
|
* Triggers before the zoom operations in the maps such as zoom in and zoom out.
|
|
379
354
|
*
|
|
380
355
|
* @event zoom
|
|
381
|
-
* @blazorProperty 'OnZoom'
|
|
382
356
|
*/
|
|
383
357
|
zoom?: EmitType<IMapZoomEventArgs>;
|
|
384
358
|
|
|
@@ -386,7 +360,6 @@ export interface MapsModel extends ComponentModel{
|
|
|
386
360
|
* Triggers before performing the panning operation.
|
|
387
361
|
*
|
|
388
362
|
* @event pan
|
|
389
|
-
* @blazorProperty 'OnPan'
|
|
390
363
|
*/
|
|
391
364
|
pan?: EmitType<IMapPanEventArgs>;
|
|
392
365
|
|