@syncfusion/ej2-maps 19.4.38 → 19.4.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/README.md +1 -1
- 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 +279 -67
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +278 -66
- 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/layer-panel.js +3 -2
- package/src/maps/layers/legend.d.ts +41 -2
- package/src/maps/layers/legend.js +65 -16
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +8 -0
- package/src/maps/maps.js +141 -18
- package/src/maps/model/base-model.d.ts +7 -0
- package/src/maps/model/base.d.ts +6 -0
- package/src/maps/model/base.js +3 -0
- package/src/maps/model/interface.d.ts +1 -3
- package/src/maps/user-interaction/highlight.d.ts +9 -1
- package/src/maps/user-interaction/highlight.js +18 -11
- package/src/maps/user-interaction/selection.d.ts +9 -1
- package/src/maps/user-interaction/selection.js +17 -10
- package/src/maps/user-interaction/zoom.d.ts +4 -1
- package/src/maps/user-interaction/zoom.js +9 -3
- package/src/maps/utils/enum.d.ts +3 -1
- package/src/maps/utils/helper.d.ts +2 -2
- package/src/maps/utils/helper.js +26 -10
|
@@ -45,13 +45,15 @@ function calculateSize(maps) {
|
|
|
45
45
|
const containerHeight = maps.element.clientHeight;
|
|
46
46
|
const containerElementWidth = stringToNumber(maps.element.style.width, containerWidth);
|
|
47
47
|
const containerElementHeight = stringToNumber(maps.element.style.height, containerHeight);
|
|
48
|
+
let availableSize = new Size(0, 0);
|
|
48
49
|
if (maps.width === '0px' || maps.width === '0%' || maps.height === '0%' || maps.height === '0px') {
|
|
49
|
-
|
|
50
|
+
availableSize = new Size(0, 0);
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
52
|
-
|
|
53
|
+
availableSize = new Size(stringToNumber(maps.width, containerWidth) || containerWidth || containerElementWidth || 600, stringToNumber(maps.height, containerHeight) || containerHeight || containerElementHeight || (maps.isDevice ?
|
|
53
54
|
Math.min(window.innerWidth, window.innerHeight) : 450));
|
|
54
55
|
}
|
|
56
|
+
return availableSize;
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
59
|
* Method to create svg for maps.
|
|
@@ -61,7 +63,7 @@ function calculateSize(maps) {
|
|
|
61
63
|
*/
|
|
62
64
|
function createSvg(maps) {
|
|
63
65
|
maps.renderer = new SvgRenderer(maps.element.id);
|
|
64
|
-
calculateSize(maps);
|
|
66
|
+
maps.availableSize = calculateSize(maps);
|
|
65
67
|
maps.svgObject = maps.renderer.createSvg({
|
|
66
68
|
id: maps.element.id + '_svg',
|
|
67
69
|
width: maps.availableSize.width,
|
|
@@ -804,7 +806,7 @@ function markerShapeChoose(eventArgs, data) {
|
|
|
804
806
|
const shape = ((eventArgs.shapeValuePath.indexOf('.') > -1) ?
|
|
805
807
|
(getValueFromObject(data, eventArgs.shapeValuePath).toString()) :
|
|
806
808
|
data[eventArgs.shapeValuePath]);
|
|
807
|
-
eventArgs.shape = shape;
|
|
809
|
+
eventArgs.shape = (shape.toString() !== "") ? shape : eventArgs.shape;
|
|
808
810
|
if (data[eventArgs.shapeValuePath] === 'Image') {
|
|
809
811
|
eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
810
812
|
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
@@ -813,7 +815,7 @@ function markerShapeChoose(eventArgs, data) {
|
|
|
813
815
|
}
|
|
814
816
|
else {
|
|
815
817
|
const shapes = (!isNullOrUndefined(eventArgs.shapeValuePath)) ? ((eventArgs.shapeValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.shapeValuePath).toString() : eventArgs.shape) : eventArgs.shape;
|
|
816
|
-
eventArgs.shape = shapes;
|
|
818
|
+
eventArgs.shape = (shapes.toString() !== "") ? shapes : eventArgs.shape;
|
|
817
819
|
const shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
818
820
|
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
819
821
|
data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
|
|
@@ -1376,7 +1378,7 @@ function calculateShapes(maps, shape, options, size, location, markerEle) {
|
|
|
1376
1378
|
let tempGroup;
|
|
1377
1379
|
switch (shape) {
|
|
1378
1380
|
case 'Balloon':
|
|
1379
|
-
tempGroup = drawBalloon(maps, options, size, location, markerEle);
|
|
1381
|
+
tempGroup = drawBalloon(maps, options, size, location, 'Marker', markerEle);
|
|
1380
1382
|
break;
|
|
1381
1383
|
case 'Cross':
|
|
1382
1384
|
options.d = 'M ' + location.x + ' ' + (location.y - size.height / 2) + ' L ' + location.x + ' ' + (location.y + size.height
|
|
@@ -1534,9 +1536,10 @@ function drawStar(maps, options, size, location, element) {
|
|
|
1534
1536
|
* @returns {Element} - Returns the element
|
|
1535
1537
|
* @private
|
|
1536
1538
|
*/
|
|
1537
|
-
function drawBalloon(maps, options, size, location, element) {
|
|
1539
|
+
function drawBalloon(maps, options, size, location, type, element) {
|
|
1538
1540
|
const width = size.width;
|
|
1539
1541
|
const height = size.height;
|
|
1542
|
+
let pathElement;
|
|
1540
1543
|
location.x -= width / 2;
|
|
1541
1544
|
location.y -= height;
|
|
1542
1545
|
options.d = 'M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16' +
|
|
@@ -1545,9 +1548,15 @@ function drawBalloon(maps, options, size, location, element) {
|
|
|
1545
1548
|
const x = size.width / 30;
|
|
1546
1549
|
const y = size.height / 30;
|
|
1547
1550
|
balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
+
if (type === 'Marker') {
|
|
1552
|
+
const g = maps.renderer.createGroup({ id: options.id });
|
|
1553
|
+
appendShape(balloon, g);
|
|
1554
|
+
pathElement = appendShape(g, element);
|
|
1555
|
+
}
|
|
1556
|
+
else {
|
|
1557
|
+
pathElement = balloon;
|
|
1558
|
+
}
|
|
1559
|
+
return pathElement;
|
|
1551
1560
|
}
|
|
1552
1561
|
/**
|
|
1553
1562
|
* Internal rendering of Pattern
|
|
@@ -2664,6 +2673,8 @@ function renderLegendShape(location, size, shape, options, url) {
|
|
|
2664
2673
|
const shapeY = location.y;
|
|
2665
2674
|
const x = location.x + (-shapeWidth / 2);
|
|
2666
2675
|
const y = location.y + (-shapeHeight / 2);
|
|
2676
|
+
options['stroke'] = (shape === 'HorizontalLine' || shape === 'VerticalLine' || shape === 'Cross') ? options['fill'] : options['stroke'];
|
|
2677
|
+
options['stroke-width'] = (options['stroke-width'] === 0 && (shape === 'HorizontalLine' || shape === 'VerticalLine' || shape === 'Cross')) ? 1 : options['stroke-width'];
|
|
2667
2678
|
switch (shape) {
|
|
2668
2679
|
case 'Circle':
|
|
2669
2680
|
case 'Bubble':
|
|
@@ -2675,6 +2686,11 @@ function renderLegendShape(location, size, shape, options, url) {
|
|
|
2675
2686
|
+ (shapeY + (-shapeHeight / 2));
|
|
2676
2687
|
merge(options, { 'd': renderPath });
|
|
2677
2688
|
break;
|
|
2689
|
+
case 'HorizontalLine':
|
|
2690
|
+
renderPath = 'M' + ' ' + shapeX + ' ' + shapeY + ' ' + 'L' + ' ' + (shapeX + (shapeWidth / 2)) + ' '
|
|
2691
|
+
+ shapeY;
|
|
2692
|
+
merge(options, { 'd': renderPath });
|
|
2693
|
+
break;
|
|
2678
2694
|
case 'Diamond':
|
|
2679
2695
|
renderPath = 'M' + ' ' + x + ' ' + shapeY + ' ' +
|
|
2680
2696
|
'L' + ' ' + shapeX + ' ' + (shapeY + (-shapeHeight / 2)) + ' ' +
|
|
@@ -4206,6 +4222,9 @@ __decorate$1([
|
|
|
4206
4222
|
*/
|
|
4207
4223
|
class LegendSettings extends ChildProperty {
|
|
4208
4224
|
}
|
|
4225
|
+
__decorate$1([
|
|
4226
|
+
Property(false)
|
|
4227
|
+
], LegendSettings.prototype, "useMarkerShape", void 0);
|
|
4209
4228
|
__decorate$1([
|
|
4210
4229
|
Property(false)
|
|
4211
4230
|
], LegendSettings.prototype, "toggleVisibility", void 0);
|
|
@@ -5483,7 +5502,8 @@ class LayerPanel {
|
|
|
5483
5502
|
else {
|
|
5484
5503
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
5485
5504
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
5486
|
-
width: areaRect.width, height: (areaRect.height < 0) ? 0 :
|
|
5505
|
+
width: areaRect.width, height: (areaRect.height < 0) ? 0 : !isNullOrUndefined(this.mapObject.legendModule) &&
|
|
5506
|
+
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
5487
5507
|
}));
|
|
5488
5508
|
}
|
|
5489
5509
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -5949,7 +5969,7 @@ class LayerPanel {
|
|
|
5949
5969
|
}
|
|
5950
5970
|
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
5951
5971
|
(currentShapeData['property'][properties]) : ''));
|
|
5952
|
-
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i +
|
|
5972
|
+
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i + 3).toString());
|
|
5953
5973
|
if (drawingType === 'LineString') {
|
|
5954
5974
|
pathEle.setAttribute('style', 'outline:none');
|
|
5955
5975
|
}
|
|
@@ -7167,7 +7187,15 @@ let Maps = class Maps extends Component {
|
|
|
7167
7187
|
}
|
|
7168
7188
|
this.mapLayerPanel.measureLayerPanel();
|
|
7169
7189
|
this.element.appendChild(this.svgObject);
|
|
7190
|
+
const position = this.getExtraPosition();
|
|
7170
7191
|
for (let i = 0; i < this.layers.length; i++) {
|
|
7192
|
+
if (position.x !== 0 || position.y !== 0) {
|
|
7193
|
+
let markerTemplate$$1 = document.getElementById(this.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
|
|
7194
|
+
if (!isNullOrUndefined(markerTemplate$$1)) {
|
|
7195
|
+
markerTemplate$$1.style.top = this.mapAreaRect.y + position.y + 'px';
|
|
7196
|
+
markerTemplate$$1.style.left = this.mapAreaRect.x + position.x + 'px';
|
|
7197
|
+
}
|
|
7198
|
+
}
|
|
7171
7199
|
if (this.layers[i].selectionSettings && this.layers[i].selectionSettings.enable &&
|
|
7172
7200
|
this.layers[i].initialShapeSelection.length > 0 && this.checkInitialRender) {
|
|
7173
7201
|
const checkSelection = this.layers[i].selectionSettings.enableMultiSelect;
|
|
@@ -7566,7 +7594,6 @@ let Maps = class Maps extends Component {
|
|
|
7566
7594
|
const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
|
|
7567
7595
|
const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
7568
7596
|
element.setAttribute('aria-label', this.description || title.text);
|
|
7569
|
-
element.setAttribute('tabindex', (this.tabIndex + (type === 'title' ? 1 : 2)).toString());
|
|
7570
7597
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
7571
7598
|
height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
|
|
7572
7599
|
this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
|
|
@@ -7625,6 +7652,8 @@ let Maps = class Maps extends Component {
|
|
|
7625
7652
|
EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap, this);
|
|
7626
7653
|
EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEndOnMap, this);
|
|
7627
7654
|
EventHandler.add(this.element, 'pointerleave mouseleave', this.mouseLeaveOnMap, this);
|
|
7655
|
+
EventHandler.add(this.element, 'keydown', this.keyDownHandler, this);
|
|
7656
|
+
EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);
|
|
7628
7657
|
// EventHandler.add(this.element, cancelEvent, this.mouseLeaveOnMap, this);
|
|
7629
7658
|
window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize.bind(this));
|
|
7630
7659
|
}
|
|
@@ -7642,6 +7671,8 @@ let Maps = class Maps extends Component {
|
|
|
7642
7671
|
EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap);
|
|
7643
7672
|
EventHandler.remove(this.element, Browser.touchEndEvent, this.mouseEndOnMap);
|
|
7644
7673
|
EventHandler.remove(this.element, 'pointerleave mouseleave', this.mouseLeaveOnMap);
|
|
7674
|
+
EventHandler.remove(this.element, 'keydown', this.keyDownHandler);
|
|
7675
|
+
EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
|
|
7645
7676
|
//EventHandler.remove(this.element, cancelEvent, this.mouseLeaveOnMap);
|
|
7646
7677
|
window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize);
|
|
7647
7678
|
}
|
|
@@ -7657,6 +7688,96 @@ let Maps = class Maps extends Component {
|
|
|
7657
7688
|
removeClass(document.getElementsByClassName('highlightMapStyle')[0]);
|
|
7658
7689
|
}
|
|
7659
7690
|
}
|
|
7691
|
+
keyUpHandler(event) {
|
|
7692
|
+
const id = event.target['id'];
|
|
7693
|
+
if (event.code === 'Tab' && id.indexOf('_LayerIndex_') > -1 && id.indexOf('shapeIndex') > -1) {
|
|
7694
|
+
this.keyboardHighlightSelection(id, event.type);
|
|
7695
|
+
}
|
|
7696
|
+
else if (id.indexOf('_LayerIndex_') === -1 && id.indexOf('shapeIndex') === -1 &&
|
|
7697
|
+
getElementsByClassName('highlightMapStyle').length > 0) {
|
|
7698
|
+
removeClass(getElementsByClassName('highlightMapStyle')[0]);
|
|
7699
|
+
if (this.legendSettings.visible && this.legendModule) {
|
|
7700
|
+
this.legendModule.removeShapeHighlightCollection();
|
|
7701
|
+
}
|
|
7702
|
+
}
|
|
7703
|
+
}
|
|
7704
|
+
keyboardHighlightSelection(id, key) {
|
|
7705
|
+
const layerIndex = parseInt(id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
7706
|
+
const shapeIndex = parseInt(id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
7707
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7708
|
+
const shapeData = this.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
|
|
7709
|
+
this.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
|
|
7710
|
+
const dataIndex = parseInt(id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
7711
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7712
|
+
const data = isNullOrUndefined(dataIndex) ? null : this.layers[layerIndex].dataSource[dataIndex];
|
|
7713
|
+
if (this.layers[layerIndex].selectionSettings.enable && key === 'keydown' && this.selectionModule) {
|
|
7714
|
+
this.selectionModule.selectionsettings = this.layers[layerIndex].selectionSettings;
|
|
7715
|
+
this.selectionModule.selectionType = 'Shape';
|
|
7716
|
+
this.selectionModule.selectElement(event.target, layerIndex, data, shapeData);
|
|
7717
|
+
}
|
|
7718
|
+
else if (this.highlightModule && (this.layers[layerIndex].highlightSettings.enable && key === 'keyup' &&
|
|
7719
|
+
!event.target.classList.contains('ShapeselectionMapStyle'))) {
|
|
7720
|
+
this.highlightModule.highlightSettings = this.layers[layerIndex].highlightSettings;
|
|
7721
|
+
this.highlightModule.handleHighlight(event.target, layerIndex, data, shapeData);
|
|
7722
|
+
}
|
|
7723
|
+
}
|
|
7724
|
+
keyDownHandler(event) {
|
|
7725
|
+
const zoom = this.zoomModule;
|
|
7726
|
+
if ((event.key === '+' || event.code === 'Equal') && zoom) {
|
|
7727
|
+
zoom.performZoomingByToolBar('zoomin');
|
|
7728
|
+
}
|
|
7729
|
+
else if ((event.key === '-' || event.code === 'Minus') && zoom) {
|
|
7730
|
+
zoom.performZoomingByToolBar('zoomout');
|
|
7731
|
+
}
|
|
7732
|
+
else if (event['keyCode'] === 82 && zoom) {
|
|
7733
|
+
zoom.performZoomingByToolBar('reset');
|
|
7734
|
+
}
|
|
7735
|
+
else if ((event.code === 'ArrowUp' || event.code === 'ArrowDown') && zoom) {
|
|
7736
|
+
event.preventDefault();
|
|
7737
|
+
zoom.mouseDownLatLong['x'] = 0;
|
|
7738
|
+
zoom.mouseMoveLatLong['y'] = this.mapAreaRect.height / 7;
|
|
7739
|
+
zoom.panning('None', zoom.mouseDownLatLong['x'], event.code === 'ArrowUp' ? -(zoom.mouseMoveLatLong['y']) :
|
|
7740
|
+
zoom.mouseMoveLatLong['y'], event);
|
|
7741
|
+
zoom.mouseDownLatLong['y'] = zoom.mouseMoveLatLong['y'];
|
|
7742
|
+
}
|
|
7743
|
+
else if ((event.code === 'ArrowLeft' || event.code === 'ArrowRight') && zoom) {
|
|
7744
|
+
event.preventDefault();
|
|
7745
|
+
zoom.mouseDownLatLong['y'] = 0;
|
|
7746
|
+
zoom.mouseMoveLatLong['x'] = this.mapAreaRect.width / 7;
|
|
7747
|
+
zoom.panning('None', event.code === 'ArrowLeft' ? -(zoom.mouseMoveLatLong['x']) : zoom.mouseMoveLatLong['x'], zoom.mouseDownLatLong['y'], event);
|
|
7748
|
+
zoom.mouseDownLatLong['x'] = zoom.mouseMoveLatLong['x'];
|
|
7749
|
+
}
|
|
7750
|
+
else if (event.code === 'Enter') {
|
|
7751
|
+
const id = event.target['id'];
|
|
7752
|
+
event.preventDefault();
|
|
7753
|
+
if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
|
|
7754
|
+
this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
|
|
7755
|
+
(this.legendModule.currentPage + 1);
|
|
7756
|
+
this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
|
|
7757
|
+
this.legendModule.drawLegendItem(this.legendModule.currentPage);
|
|
7758
|
+
const textContent = (document.getElementById(this.element.id + '_Paging_Text')).textContent;
|
|
7759
|
+
const text = textContent.split('/').map(Number);
|
|
7760
|
+
if (id.indexOf('_Left_Page_Rect') > -1) {
|
|
7761
|
+
if (text[0] !== 1) {
|
|
7762
|
+
event.target.focus();
|
|
7763
|
+
}
|
|
7764
|
+
event.target.style.outlineColor = text[0] - 1 !== text[1] ? '' : 'transparent';
|
|
7765
|
+
}
|
|
7766
|
+
else if (id.indexOf('_Right_Page_Rect') > -1) {
|
|
7767
|
+
if (text[0] !== text[1]) {
|
|
7768
|
+
event.target.focus();
|
|
7769
|
+
}
|
|
7770
|
+
event.target.style.outlineColor = text[0] !== text[1] + 1 ? '' : 'transparent';
|
|
7771
|
+
}
|
|
7772
|
+
if (querySelector(this.element.id + '_Legend_Border', this.element.id)) {
|
|
7773
|
+
querySelector(this.element.id + '_Legend_Border', this.element.id).style.pointerEvents = 'none';
|
|
7774
|
+
}
|
|
7775
|
+
}
|
|
7776
|
+
if (id.indexOf('shapeIndex') > -1) {
|
|
7777
|
+
this.keyboardHighlightSelection(id, event.type);
|
|
7778
|
+
}
|
|
7779
|
+
}
|
|
7780
|
+
}
|
|
7660
7781
|
/**
|
|
7661
7782
|
* Gets the selected element to be maintained or not.
|
|
7662
7783
|
*
|
|
@@ -7992,24 +8113,26 @@ let Maps = class Maps extends Component {
|
|
|
7992
8113
|
mapsOnResize(e) {
|
|
7993
8114
|
this.isResize = this.isReset = true;
|
|
7994
8115
|
const args = {
|
|
8116
|
+
cancel: false,
|
|
7995
8117
|
name: resize,
|
|
7996
8118
|
previousSize: this.availableSize,
|
|
7997
|
-
currentSize:
|
|
8119
|
+
currentSize: calculateSize(this),
|
|
7998
8120
|
maps: this
|
|
7999
8121
|
};
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
this.
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8122
|
+
this.trigger(resize, args);
|
|
8123
|
+
if (!args.cancel) {
|
|
8124
|
+
if (this.resizeTo) {
|
|
8125
|
+
clearTimeout(this.resizeTo);
|
|
8126
|
+
}
|
|
8127
|
+
if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-maps')) {
|
|
8128
|
+
this.resizeTo = setTimeout(() => {
|
|
8129
|
+
this.unWireEVents();
|
|
8130
|
+
this.createSVG();
|
|
8131
|
+
this.refreshing = true;
|
|
8132
|
+
this.wireEVents();
|
|
8133
|
+
this.render();
|
|
8134
|
+
}, 500);
|
|
8135
|
+
}
|
|
8013
8136
|
}
|
|
8014
8137
|
return false;
|
|
8015
8138
|
}
|
|
@@ -8593,6 +8716,26 @@ let Maps = class Maps extends Component {
|
|
|
8593
8716
|
});
|
|
8594
8717
|
return isVisible;
|
|
8595
8718
|
}
|
|
8719
|
+
/**
|
|
8720
|
+
* To find space between the secondary element and svg element.
|
|
8721
|
+
* @private
|
|
8722
|
+
*/
|
|
8723
|
+
getExtraPosition() {
|
|
8724
|
+
let top = 0;
|
|
8725
|
+
let left = 0;
|
|
8726
|
+
const svgElement = getElement(this.element.id + '_svg');
|
|
8727
|
+
if (!isNullOrUndefined(svgElement)) {
|
|
8728
|
+
const svgClientRects = svgElement.getClientRects();
|
|
8729
|
+
const mapsClientRects = (getElement(this.element.id + '_Secondary_Element')).getClientRects();
|
|
8730
|
+
if (svgClientRects.length !== 0 && mapsClientRects.length !== 0) {
|
|
8731
|
+
const svgClientRect = svgClientRects[0];
|
|
8732
|
+
const mapsClientRect = mapsClientRects[0];
|
|
8733
|
+
top = svgClientRect.top - mapsClientRect.top;
|
|
8734
|
+
left = svgClientRect.left - mapsClientRect.left;
|
|
8735
|
+
}
|
|
8736
|
+
}
|
|
8737
|
+
return new Point(left, top);
|
|
8738
|
+
}
|
|
8596
8739
|
/**
|
|
8597
8740
|
* To find marker visibility
|
|
8598
8741
|
*/
|
|
@@ -9789,7 +9932,14 @@ class NavigationLine {
|
|
|
9789
9932
|
*/
|
|
9790
9933
|
class Legend {
|
|
9791
9934
|
constructor(maps) {
|
|
9935
|
+
/**
|
|
9936
|
+
* @private
|
|
9937
|
+
*/
|
|
9792
9938
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
9939
|
+
/**
|
|
9940
|
+
* @private
|
|
9941
|
+
*/
|
|
9942
|
+
this.legendTotalRect = new Rect(0, 0, 0, 0);
|
|
9793
9943
|
/**
|
|
9794
9944
|
* @private
|
|
9795
9945
|
*/
|
|
@@ -9806,12 +9956,27 @@ class Legend {
|
|
|
9806
9956
|
this.textMaxWidth = 0;
|
|
9807
9957
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9808
9958
|
this.shapeHighlightCollection = [];
|
|
9959
|
+
/**
|
|
9960
|
+
* @private
|
|
9961
|
+
*/
|
|
9809
9962
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9810
9963
|
this.legendHighlightCollection = [];
|
|
9964
|
+
/**
|
|
9965
|
+
* @private
|
|
9966
|
+
*/
|
|
9811
9967
|
this.shapePreviousColor = [];
|
|
9968
|
+
/**
|
|
9969
|
+
* @private
|
|
9970
|
+
*/
|
|
9812
9971
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9813
9972
|
this.selectedNonLegendShapes = [];
|
|
9973
|
+
/**
|
|
9974
|
+
* @private
|
|
9975
|
+
*/
|
|
9814
9976
|
this.shapeToggled = true;
|
|
9977
|
+
/**
|
|
9978
|
+
* @private
|
|
9979
|
+
*/
|
|
9815
9980
|
this.legendElement = null;
|
|
9816
9981
|
this.maps = maps;
|
|
9817
9982
|
this.addEventListener();
|
|
@@ -10190,6 +10355,11 @@ class Legend {
|
|
|
10190
10355
|
this.drawLegendItem(this.currentPage);
|
|
10191
10356
|
}
|
|
10192
10357
|
}
|
|
10358
|
+
/**
|
|
10359
|
+
* @param {string} page - Specifies the legend page.
|
|
10360
|
+
* @returns {void}
|
|
10361
|
+
* @private
|
|
10362
|
+
*/
|
|
10193
10363
|
drawLegendItem(page) {
|
|
10194
10364
|
const map = this.maps;
|
|
10195
10365
|
const legend = map.legendSettings;
|
|
@@ -10197,6 +10367,7 @@ class Legend {
|
|
|
10197
10367
|
const shapeSize = new Size(legend.shapeWidth, legend.shapeHeight);
|
|
10198
10368
|
let textOptions;
|
|
10199
10369
|
const render = map.renderer;
|
|
10370
|
+
let legendShape = legend.shape;
|
|
10200
10371
|
if (page >= 0 && page < this.totalPages.length) {
|
|
10201
10372
|
if (querySelector(this.legendGroup.id, this.maps.element.id)) {
|
|
10202
10373
|
remove(querySelector(this.legendGroup.id, this.maps.element.id));
|
|
@@ -10206,8 +10377,9 @@ class Legend {
|
|
|
10206
10377
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10207
10378
|
const collection = this.totalPages[page]['Collection'][i];
|
|
10208
10379
|
const shapeBorder = collection['shapeBorder'];
|
|
10209
|
-
|
|
10380
|
+
let legendElement = render.createGroup({ id: map.element.id + '_Legend_Index_' + collection['idIndex'] });
|
|
10210
10381
|
let legendText = collection['DisplayText'];
|
|
10382
|
+
const pagingArrowPadding = 4;
|
|
10211
10383
|
const shape = ((legend.type === 'Markers') ? ((isNullOrUndefined(collection['ImageSrc'])) ?
|
|
10212
10384
|
legend.shape : 'Image') : collection['legendShape']);
|
|
10213
10385
|
const strokeColor = (legend.shape === 'HorizontalLine' || legend.shape === 'VerticalLine'
|
|
@@ -10217,8 +10389,8 @@ class Legend {
|
|
|
10217
10389
|
1 : shapeBorder.width : shapeBorder.width;
|
|
10218
10390
|
const shapeId = map.element.id + '_Legend_Shape_Index_' + collection['idIndex'];
|
|
10219
10391
|
const textId = map.element.id + '_Legend_Text_Index_' + collection['idIndex'];
|
|
10220
|
-
const shapeLocation = collection['Shape'];
|
|
10221
|
-
const textLocation = collection['Text'];
|
|
10392
|
+
const shapeLocation = new Point(collection['Shape']['x'], (collection['Shape']['y'] - pagingArrowPadding));
|
|
10393
|
+
const textLocation = new Point(collection['Text']['x'], (collection['Text']['y'] - pagingArrowPadding));
|
|
10222
10394
|
const imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
|
|
10223
10395
|
const renderOptions = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
|
|
10224
10396
|
const legendTextStyle = {
|
|
@@ -10232,7 +10404,17 @@ class Legend {
|
|
|
10232
10404
|
if (i === 0) {
|
|
10233
10405
|
this.renderLegendBorder();
|
|
10234
10406
|
}
|
|
10235
|
-
|
|
10407
|
+
if (legend.type === 'Markers' && legend.useMarkerShape) {
|
|
10408
|
+
const legendShapeData = this.legendCollection[collection['idIndex']].data[0];
|
|
10409
|
+
const marker$$1 = map.layers[legendShapeData['layerIndex']].markerSettings[legendShapeData['markerIndex']];
|
|
10410
|
+
legendShape = !isNullOrUndefined(marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']]) && marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']] !== '' ? marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']] : marker$$1.shape;
|
|
10411
|
+
}
|
|
10412
|
+
if (legendShape === "Balloon") {
|
|
10413
|
+
legendElement.appendChild(drawBalloon(map, renderOptions, shapeSize, { x: shapeLocation.x, y: (shapeLocation.y + 5) }, 'Legend'));
|
|
10414
|
+
}
|
|
10415
|
+
else {
|
|
10416
|
+
legendElement.appendChild(drawSymbol(shapeLocation, legendShape, shapeSize, collection['ImageSrc'], renderOptions));
|
|
10417
|
+
}
|
|
10236
10418
|
const legendRectSize = collection['Rect']['x'] + collection['Rect']['width'];
|
|
10237
10419
|
if (legendRectSize > this.legendBorderRect.width) {
|
|
10238
10420
|
const trimmedText = this.legendTextTrim(this.legendBorderRect.width, legendText, legendTextStyle, legendRectSize);
|
|
@@ -10251,10 +10433,10 @@ class Legend {
|
|
|
10251
10433
|
const pagingFont = legend.textStyle;
|
|
10252
10434
|
const pagingTextSize = measureText(pagingText, pagingFont);
|
|
10253
10435
|
const leftPageX = (this.legendItemRect.x + this.legendItemRect.width) - pagingTextSize.width -
|
|
10254
|
-
(width * 2) - spacing;
|
|
10436
|
+
(width * 2) - (spacing * 2) + (pagingArrowPadding / 2);
|
|
10255
10437
|
const rightPageX = (this.legendItemRect.x + this.legendItemRect.width);
|
|
10438
|
+
const pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2) - pagingArrowPadding;
|
|
10256
10439
|
const locY = (this.legendItemRect.y + this.legendItemRect.height) + (height / 2) + spacing;
|
|
10257
|
-
const pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2);
|
|
10258
10440
|
pagingGroup = render.createGroup({ id: map.element.id + '_Legend_Paging_Group' });
|
|
10259
10441
|
const leftPageElement = render.createGroup({ id: map.element.id + '_Legend_Left_Paging_Group' });
|
|
10260
10442
|
const rightPageElement = render.createGroup({ id: map.element.id + '_Legend_Right_Paging_Group' });
|
|
@@ -10262,15 +10444,19 @@ class Legend {
|
|
|
10262
10444
|
' L ' + (rightPageX - width) + ' ' + (locY + height) + ' z ';
|
|
10263
10445
|
const leftPath = ' M ' + leftPageX + ' ' + locY + ' L ' + (leftPageX + width) + ' ' + (locY - height) +
|
|
10264
10446
|
' L ' + (leftPageX + width) + ' ' + (locY + height) + ' z ';
|
|
10265
|
-
const leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', 1, 1, '', leftPath);
|
|
10447
|
+
const leftPageOptions = new PathOption(map.element.id + '_Left_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === 1 ? 0.5 : 1), 1, '', leftPath);
|
|
10266
10448
|
leftPageElement.appendChild(render.drawPath(leftPageOptions));
|
|
10267
10449
|
const leftRectPageOptions = new RectOption(map.element.id + '_Left_Page_Rect', 'transparent', {}, 1, new Rect(leftPageX - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
|
|
10268
|
-
|
|
10450
|
+
let pathEle = render.drawRectangle(leftRectPageOptions);
|
|
10451
|
+
pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
|
|
10452
|
+
leftPageElement.appendChild(pathEle);
|
|
10269
10453
|
this.wireEvents(leftPageElement);
|
|
10270
|
-
const rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', 1, 1, '', rightPath);
|
|
10454
|
+
const rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
|
|
10271
10455
|
rightPageElement.appendChild(render.drawPath(rightPageOptions));
|
|
10272
|
-
const rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(
|
|
10273
|
-
|
|
10456
|
+
const rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(rightPageX - spacing - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
|
|
10457
|
+
pathEle = render.drawRectangle(rightRectPageOptions);
|
|
10458
|
+
pathEle.setAttribute('tabindex', ((page + 1) === this.totalPages.length ? -1 : map.tabIndex + 2).toString());
|
|
10459
|
+
rightPageElement.appendChild(pathEle);
|
|
10274
10460
|
this.wireEvents(rightPageElement);
|
|
10275
10461
|
pagingGroup.appendChild(leftPageElement);
|
|
10276
10462
|
pagingGroup.appendChild(rightPageElement);
|
|
@@ -11008,13 +11194,13 @@ class Legend {
|
|
|
11008
11194
|
break;
|
|
11009
11195
|
}
|
|
11010
11196
|
if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
|
|
11011
|
-
map.totalRect = totalRect;
|
|
11197
|
+
this.legendTotalRect = map.totalRect = totalRect;
|
|
11012
11198
|
}
|
|
11013
11199
|
else {
|
|
11014
11200
|
if ((legend.height || legend.width) && legend.mode === 'Interactive') {
|
|
11015
11201
|
map.totalRect = totalRect;
|
|
11016
11202
|
}
|
|
11017
|
-
map.mapAreaRect = totalRect;
|
|
11203
|
+
this.legendTotalRect = map.mapAreaRect = totalRect;
|
|
11018
11204
|
}
|
|
11019
11205
|
this.translate = new Point(x, y);
|
|
11020
11206
|
}
|
|
@@ -11048,7 +11234,7 @@ class Legend {
|
|
|
11048
11234
|
}
|
|
11049
11235
|
else {
|
|
11050
11236
|
newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
|
|
11051
|
-
shape: !isNullOrUndefined(marker$$1.shapeValuePath) ? data[marker$$1.shapeValuePath] : marker$$1.shape });
|
|
11237
|
+
shape: (!isNullOrUndefined(marker$$1.shapeValuePath) && !isNullOrUndefined(data[marker$$1.shapeValuePath]) && data[marker$$1.shapeValuePath] !== '') ? data[marker$$1.shapeValuePath] : (this.maps.legendSettings.useMarkerShape ? marker$$1.shape : this.maps.legendSettings.shape) });
|
|
11052
11238
|
this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
|
|
11053
11239
|
}
|
|
11054
11240
|
}
|
|
@@ -11414,7 +11600,7 @@ class Legend {
|
|
|
11414
11600
|
shape = this.legendCollection[legendIndex]['data'][i];
|
|
11415
11601
|
mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
11416
11602
|
'_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
11417
|
-
'_MarkerIndex_' +
|
|
11603
|
+
'_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
|
|
11418
11604
|
if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
|
|
11419
11605
|
mapElement = mapElement.children[0];
|
|
11420
11606
|
}
|
|
@@ -11438,6 +11624,9 @@ class Legend {
|
|
|
11438
11624
|
if (targetEle !== null) {
|
|
11439
11625
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
11440
11626
|
legendShapeId.setAttribute('fill', '#E5E5E5');
|
|
11627
|
+
if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
|
|
11628
|
+
legendShapeId.setAttribute('stroke', '#E5E5E5');
|
|
11629
|
+
}
|
|
11441
11630
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
|
|
11442
11631
|
legendTextId.setAttribute('fill', '#E5E5E5');
|
|
11443
11632
|
}
|
|
@@ -11452,6 +11641,9 @@ class Legend {
|
|
|
11452
11641
|
if (targetEle !== null) {
|
|
11453
11642
|
legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
|
|
11454
11643
|
legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
|
|
11644
|
+
if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
|
|
11645
|
+
legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
|
|
11646
|
+
}
|
|
11455
11647
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
|
|
11456
11648
|
legendTextId.setAttribute('fill', '#757575');
|
|
11457
11649
|
}
|
|
@@ -11536,7 +11728,7 @@ class Legend {
|
|
|
11536
11728
|
targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendSettings.visible &&
|
|
11537
11729
|
targetEle.id.indexOf('_Text') === -1) {
|
|
11538
11730
|
let LegendInteractive;
|
|
11539
|
-
const legendIndex = parseFloat(targetEle.id.
|
|
11731
|
+
const legendIndex = parseFloat(targetEle.id.split(this.maps.element.id + '_Legend_Index_')[1]);
|
|
11540
11732
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11541
11733
|
let mapdata;
|
|
11542
11734
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -11867,14 +12059,7 @@ class Highlight {
|
|
|
11867
12059
|
this.highlightSettings = this.maps.layers[layerIndex].navigationLineSettings[index].highlightSettings;
|
|
11868
12060
|
}
|
|
11869
12061
|
if (this.highlightSettings.enable) {
|
|
11870
|
-
|
|
11871
|
-
this.maps.legendModule.shapeHighLightAndSelection(targetEle, data, this.highlightSettings, 'highlight', layerIndex);
|
|
11872
|
-
}
|
|
11873
|
-
const selectHighLight = targetEle.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible ?
|
|
11874
|
-
this.maps.legendModule.shapeToggled : true;
|
|
11875
|
-
if (selectHighLight) {
|
|
11876
|
-
this.mapHighlight(targetEle, shapeData, data);
|
|
11877
|
-
}
|
|
12062
|
+
this.handleHighlight(targetEle, layerIndex, data, shapeData);
|
|
11878
12063
|
}
|
|
11879
12064
|
else {
|
|
11880
12065
|
const element = document.getElementsByClassName('highlightMapStyle')[0];
|
|
@@ -11898,21 +12083,35 @@ class Highlight {
|
|
|
11898
12083
|
targetEle.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
|
|
11899
12084
|
}
|
|
11900
12085
|
removeClass(targetEle);
|
|
11901
|
-
if (this.maps.legendSettings.visible) {
|
|
12086
|
+
if (this.maps.legendSettings.visible && this.maps.legendModule) {
|
|
11902
12087
|
this.maps.legendModule.removeShapeHighlightCollection();
|
|
11903
12088
|
}
|
|
11904
12089
|
}
|
|
11905
12090
|
else if ((targetEle.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') !== -1 ||
|
|
11906
|
-
targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) &&
|
|
12091
|
+
targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendModule &&
|
|
11907
12092
|
this.maps.legendSettings.visible && targetEle.id.indexOf('_Text') === -1) {
|
|
11908
12093
|
this.maps.legendModule.legendHighLightAndSelection(targetEle, 'highlight');
|
|
11909
12094
|
}
|
|
11910
12095
|
else {
|
|
11911
|
-
if (this.maps.legendSettings.visible) {
|
|
12096
|
+
if (this.maps.legendSettings.visible && this.maps.legendModule) {
|
|
11912
12097
|
this.maps.legendModule.removeLegendHighlightCollection();
|
|
11913
12098
|
}
|
|
11914
12099
|
}
|
|
11915
12100
|
}
|
|
12101
|
+
/**
|
|
12102
|
+
* @private
|
|
12103
|
+
*/
|
|
12104
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12105
|
+
handleHighlight(targetElement, layerIndex, data, shapeData) {
|
|
12106
|
+
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule) {
|
|
12107
|
+
this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
|
|
12108
|
+
}
|
|
12109
|
+
const selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
|
|
12110
|
+
this.maps.legendModule.shapeToggled : true;
|
|
12111
|
+
if (selectHighLight) {
|
|
12112
|
+
this.mapHighlight(targetElement, shapeData, data);
|
|
12113
|
+
}
|
|
12114
|
+
}
|
|
11916
12115
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11917
12116
|
mapHighlight(targetEle, shapeData, data) {
|
|
11918
12117
|
const layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
@@ -12069,24 +12268,31 @@ class Selection {
|
|
|
12069
12268
|
this.selectionType = 'navigationline';
|
|
12070
12269
|
}
|
|
12071
12270
|
if (this.selectionsettings.enable) {
|
|
12072
|
-
this.
|
|
12073
|
-
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
|
|
12074
|
-
this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
|
|
12075
|
-
}
|
|
12076
|
-
const shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible) ?
|
|
12077
|
-
this.maps.legendModule.shapeToggled : true;
|
|
12078
|
-
if (shapeToggled) {
|
|
12079
|
-
this.selectMap(targetElement, shapeData, data);
|
|
12080
|
-
}
|
|
12271
|
+
this.selectElement(targetElement, layerIndex, data, shapeData);
|
|
12081
12272
|
}
|
|
12082
12273
|
}
|
|
12083
|
-
else if (this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable &&
|
|
12274
|
+
else if ((this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable && this.maps.legendModule) &&
|
|
12084
12275
|
!isNullOrUndefined(targetElement.id) && targetElement.id.indexOf('_Text') === -1 &&
|
|
12085
12276
|
(targetElement.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') > -1 ||
|
|
12086
12277
|
targetElement.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1)) {
|
|
12087
12278
|
this.maps.legendModule.legendHighLightAndSelection(targetElement, 'selection');
|
|
12088
12279
|
}
|
|
12089
12280
|
}
|
|
12281
|
+
/**
|
|
12282
|
+
* @private
|
|
12283
|
+
*/
|
|
12284
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12285
|
+
selectElement(targetElement, layerIndex, data, shapeData) {
|
|
12286
|
+
this.maps.mapSelect = targetElement ? true : false;
|
|
12287
|
+
if (this.maps.legendModule && this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
|
|
12288
|
+
this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
|
|
12289
|
+
}
|
|
12290
|
+
const shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible && this.maps.legendModule) ?
|
|
12291
|
+
this.maps.legendModule.shapeToggled : true;
|
|
12292
|
+
if (shapeToggled) {
|
|
12293
|
+
this.selectMap(targetElement, shapeData, data);
|
|
12294
|
+
}
|
|
12295
|
+
}
|
|
12090
12296
|
// eslint-disable-next-line valid-jsdoc
|
|
12091
12297
|
/**
|
|
12092
12298
|
* Public method for selection
|
|
@@ -13461,6 +13667,9 @@ class Zoom {
|
|
|
13461
13667
|
}
|
|
13462
13668
|
}
|
|
13463
13669
|
}
|
|
13670
|
+
/**
|
|
13671
|
+
* @private
|
|
13672
|
+
*/
|
|
13464
13673
|
panning(direction, xDifference, yDifference, mouseLocation) {
|
|
13465
13674
|
const map = this.maps;
|
|
13466
13675
|
let panArgs;
|
|
@@ -13479,6 +13688,8 @@ class Zoom {
|
|
|
13479
13688
|
yDifference = !isNullOrUndefined(yDifference) ? yDifference : (down.y - move.y);
|
|
13480
13689
|
this.maps.mergeCluster();
|
|
13481
13690
|
if (!map.isTileMap) {
|
|
13691
|
+
const legendElement = document.getElementById(map.element.id + '_Legend_Group');
|
|
13692
|
+
const legendHeight = !isNullOrUndefined(legendElement) ? legendElement.getClientRects()[0].height : 0;
|
|
13482
13693
|
x = translatePoint.x - xDifference / scale;
|
|
13483
13694
|
y = translatePoint.y - yDifference / scale;
|
|
13484
13695
|
const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
@@ -13486,7 +13697,7 @@ class Zoom {
|
|
|
13486
13697
|
const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
|
|
13487
13698
|
((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
|
|
13488
13699
|
const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
|
|
13489
|
-
((layerRect.top + layerRect.height + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
13700
|
+
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
13490
13701
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13491
13702
|
const location = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
|
|
13492
13703
|
panArgs = {
|
|
@@ -13888,8 +14099,9 @@ class Zoom {
|
|
|
13888
14099
|
x = (size.width - toolBarSize.width) - padding;
|
|
13889
14100
|
break;
|
|
13890
14101
|
}
|
|
13891
|
-
|
|
13892
|
-
element.style.
|
|
14102
|
+
let extraPosition = map.getExtraPosition();
|
|
14103
|
+
element.style.left = x + extraPosition.x + 'px';
|
|
14104
|
+
element.style.top = y + extraPosition.y + 'px';
|
|
13893
14105
|
const color = this.maps.zoomSettings.highlightColor || this.maps.themeStyle.zoomSelectionColor;
|
|
13894
14106
|
const css = ' .e-maps-toolbar:hover > circle { stroke:' + color + '; } .e-maps-toolbar:hover > path { fill: ' + color + ' ; stroke: ' + color + '; }' +
|
|
13895
14107
|
'.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } ' +
|