@syncfusion/ej2-maps 19.4.47 → 19.4.48
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 +8 -0
- 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 +191 -42
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +191 -42
- 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 +43 -11
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +3 -0
- package/src/maps/maps.js +106 -9
- 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 +6 -1
|
@@ -5502,7 +5502,8 @@ class LayerPanel {
|
|
|
5502
5502
|
else {
|
|
5503
5503
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
5504
5504
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
5505
|
-
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
|
|
5506
5507
|
}));
|
|
5507
5508
|
}
|
|
5508
5509
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -5968,7 +5969,7 @@ class LayerPanel {
|
|
|
5968
5969
|
}
|
|
5969
5970
|
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
5970
5971
|
(currentShapeData['property'][properties]) : ''));
|
|
5971
|
-
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i +
|
|
5972
|
+
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i + 3).toString());
|
|
5972
5973
|
if (drawingType === 'LineString') {
|
|
5973
5974
|
pathEle.setAttribute('style', 'outline:none');
|
|
5974
5975
|
}
|
|
@@ -7593,7 +7594,6 @@ let Maps = class Maps extends Component {
|
|
|
7593
7594
|
const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
|
|
7594
7595
|
const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
7595
7596
|
element.setAttribute('aria-label', this.description || title.text);
|
|
7596
|
-
element.setAttribute('tabindex', (this.tabIndex + (type === 'title' ? 1 : 2)).toString());
|
|
7597
7597
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
7598
7598
|
height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
|
|
7599
7599
|
this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
|
|
@@ -7652,6 +7652,8 @@ let Maps = class Maps extends Component {
|
|
|
7652
7652
|
EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap, this);
|
|
7653
7653
|
EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEndOnMap, this);
|
|
7654
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);
|
|
7655
7657
|
// EventHandler.add(this.element, cancelEvent, this.mouseLeaveOnMap, this);
|
|
7656
7658
|
window.addEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize.bind(this));
|
|
7657
7659
|
}
|
|
@@ -7669,6 +7671,8 @@ let Maps = class Maps extends Component {
|
|
|
7669
7671
|
EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap);
|
|
7670
7672
|
EventHandler.remove(this.element, Browser.touchEndEvent, this.mouseEndOnMap);
|
|
7671
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);
|
|
7672
7676
|
//EventHandler.remove(this.element, cancelEvent, this.mouseLeaveOnMap);
|
|
7673
7677
|
window.removeEventListener((Browser.isTouch && ('orientation' in window && 'onorientationchange' in window)) ? 'orientationchange' : 'resize', this.mapsOnResize);
|
|
7674
7678
|
}
|
|
@@ -7684,6 +7688,96 @@ let Maps = class Maps extends Component {
|
|
|
7684
7688
|
removeClass(document.getElementsByClassName('highlightMapStyle')[0]);
|
|
7685
7689
|
}
|
|
7686
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
|
+
}
|
|
7687
7781
|
/**
|
|
7688
7782
|
* Gets the selected element to be maintained or not.
|
|
7689
7783
|
*
|
|
@@ -8627,14 +8721,18 @@ let Maps = class Maps extends Component {
|
|
|
8627
8721
|
* @private
|
|
8628
8722
|
*/
|
|
8629
8723
|
getExtraPosition() {
|
|
8630
|
-
let top;
|
|
8631
|
-
let left;
|
|
8724
|
+
let top = 0;
|
|
8725
|
+
let left = 0;
|
|
8632
8726
|
const svgElement = getElement(this.element.id + '_svg');
|
|
8633
8727
|
if (!isNullOrUndefined(svgElement)) {
|
|
8634
|
-
const
|
|
8635
|
-
const
|
|
8636
|
-
|
|
8637
|
-
|
|
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
|
+
}
|
|
8638
8736
|
}
|
|
8639
8737
|
return new Point(left, top);
|
|
8640
8738
|
}
|
|
@@ -9834,7 +9932,14 @@ class NavigationLine {
|
|
|
9834
9932
|
*/
|
|
9835
9933
|
class Legend {
|
|
9836
9934
|
constructor(maps) {
|
|
9935
|
+
/**
|
|
9936
|
+
* @private
|
|
9937
|
+
*/
|
|
9837
9938
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
9939
|
+
/**
|
|
9940
|
+
* @private
|
|
9941
|
+
*/
|
|
9942
|
+
this.legendTotalRect = new Rect(0, 0, 0, 0);
|
|
9838
9943
|
/**
|
|
9839
9944
|
* @private
|
|
9840
9945
|
*/
|
|
@@ -9851,12 +9956,27 @@ class Legend {
|
|
|
9851
9956
|
this.textMaxWidth = 0;
|
|
9852
9957
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9853
9958
|
this.shapeHighlightCollection = [];
|
|
9959
|
+
/**
|
|
9960
|
+
* @private
|
|
9961
|
+
*/
|
|
9854
9962
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9855
9963
|
this.legendHighlightCollection = [];
|
|
9964
|
+
/**
|
|
9965
|
+
* @private
|
|
9966
|
+
*/
|
|
9856
9967
|
this.shapePreviousColor = [];
|
|
9968
|
+
/**
|
|
9969
|
+
* @private
|
|
9970
|
+
*/
|
|
9857
9971
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9858
9972
|
this.selectedNonLegendShapes = [];
|
|
9973
|
+
/**
|
|
9974
|
+
* @private
|
|
9975
|
+
*/
|
|
9859
9976
|
this.shapeToggled = true;
|
|
9977
|
+
/**
|
|
9978
|
+
* @private
|
|
9979
|
+
*/
|
|
9860
9980
|
this.legendElement = null;
|
|
9861
9981
|
this.maps = maps;
|
|
9862
9982
|
this.addEventListener();
|
|
@@ -10235,6 +10355,11 @@ class Legend {
|
|
|
10235
10355
|
this.drawLegendItem(this.currentPage);
|
|
10236
10356
|
}
|
|
10237
10357
|
}
|
|
10358
|
+
/**
|
|
10359
|
+
* @param {string} page - Specifies the legend page.
|
|
10360
|
+
* @returns {void}
|
|
10361
|
+
* @private
|
|
10362
|
+
*/
|
|
10238
10363
|
drawLegendItem(page) {
|
|
10239
10364
|
const map = this.maps;
|
|
10240
10365
|
const legend = map.legendSettings;
|
|
@@ -10254,6 +10379,7 @@ class Legend {
|
|
|
10254
10379
|
const shapeBorder = collection['shapeBorder'];
|
|
10255
10380
|
let legendElement = render.createGroup({ id: map.element.id + '_Legend_Index_' + collection['idIndex'] });
|
|
10256
10381
|
let legendText = collection['DisplayText'];
|
|
10382
|
+
const pagingArrowPadding = 4;
|
|
10257
10383
|
const shape = ((legend.type === 'Markers') ? ((isNullOrUndefined(collection['ImageSrc'])) ?
|
|
10258
10384
|
legend.shape : 'Image') : collection['legendShape']);
|
|
10259
10385
|
const strokeColor = (legend.shape === 'HorizontalLine' || legend.shape === 'VerticalLine'
|
|
@@ -10263,8 +10389,8 @@ class Legend {
|
|
|
10263
10389
|
1 : shapeBorder.width : shapeBorder.width;
|
|
10264
10390
|
const shapeId = map.element.id + '_Legend_Shape_Index_' + collection['idIndex'];
|
|
10265
10391
|
const textId = map.element.id + '_Legend_Text_Index_' + collection['idIndex'];
|
|
10266
|
-
const shapeLocation = collection['Shape'];
|
|
10267
|
-
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));
|
|
10268
10394
|
const imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
|
|
10269
10395
|
const renderOptions = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
|
|
10270
10396
|
const legendTextStyle = {
|
|
@@ -10307,10 +10433,10 @@ class Legend {
|
|
|
10307
10433
|
const pagingFont = legend.textStyle;
|
|
10308
10434
|
const pagingTextSize = measureText(pagingText, pagingFont);
|
|
10309
10435
|
const leftPageX = (this.legendItemRect.x + this.legendItemRect.width) - pagingTextSize.width -
|
|
10310
|
-
(width * 2) - spacing;
|
|
10436
|
+
(width * 2) - (spacing * 2) + (pagingArrowPadding / 2);
|
|
10311
10437
|
const rightPageX = (this.legendItemRect.x + this.legendItemRect.width);
|
|
10438
|
+
const pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2) - pagingArrowPadding;
|
|
10312
10439
|
const locY = (this.legendItemRect.y + this.legendItemRect.height) + (height / 2) + spacing;
|
|
10313
|
-
const pageTextX = rightPageX - width - (pagingTextSize.width / 2) - (spacing / 2);
|
|
10314
10440
|
pagingGroup = render.createGroup({ id: map.element.id + '_Legend_Paging_Group' });
|
|
10315
10441
|
const leftPageElement = render.createGroup({ id: map.element.id + '_Legend_Left_Paging_Group' });
|
|
10316
10442
|
const rightPageElement = render.createGroup({ id: map.element.id + '_Legend_Right_Paging_Group' });
|
|
@@ -10318,15 +10444,19 @@ class Legend {
|
|
|
10318
10444
|
' L ' + (rightPageX - width) + ' ' + (locY + height) + ' z ';
|
|
10319
10445
|
const leftPath = ' M ' + leftPageX + ' ' + locY + ' L ' + (leftPageX + width) + ' ' + (locY - height) +
|
|
10320
10446
|
' L ' + (leftPageX + width) + ' ' + (locY + height) + ' z ';
|
|
10321
|
-
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);
|
|
10322
10448
|
leftPageElement.appendChild(render.drawPath(leftPageOptions));
|
|
10323
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, '', '');
|
|
10324
|
-
|
|
10450
|
+
let pathEle = render.drawRectangle(leftRectPageOptions);
|
|
10451
|
+
pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
|
|
10452
|
+
leftPageElement.appendChild(pathEle);
|
|
10325
10453
|
this.wireEvents(leftPageElement);
|
|
10326
|
-
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);
|
|
10327
10455
|
rightPageElement.appendChild(render.drawPath(rightPageOptions));
|
|
10328
|
-
const rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(
|
|
10329
|
-
|
|
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);
|
|
10330
10460
|
this.wireEvents(rightPageElement);
|
|
10331
10461
|
pagingGroup.appendChild(leftPageElement);
|
|
10332
10462
|
pagingGroup.appendChild(rightPageElement);
|
|
@@ -11064,13 +11194,13 @@ class Legend {
|
|
|
11064
11194
|
break;
|
|
11065
11195
|
}
|
|
11066
11196
|
if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
|
|
11067
|
-
map.totalRect = totalRect;
|
|
11197
|
+
this.legendTotalRect = map.totalRect = totalRect;
|
|
11068
11198
|
}
|
|
11069
11199
|
else {
|
|
11070
11200
|
if ((legend.height || legend.width) && legend.mode === 'Interactive') {
|
|
11071
11201
|
map.totalRect = totalRect;
|
|
11072
11202
|
}
|
|
11073
|
-
map.mapAreaRect = totalRect;
|
|
11203
|
+
this.legendTotalRect = map.mapAreaRect = totalRect;
|
|
11074
11204
|
}
|
|
11075
11205
|
this.translate = new Point(x, y);
|
|
11076
11206
|
}
|
|
@@ -11929,14 +12059,7 @@ class Highlight {
|
|
|
11929
12059
|
this.highlightSettings = this.maps.layers[layerIndex].navigationLineSettings[index].highlightSettings;
|
|
11930
12060
|
}
|
|
11931
12061
|
if (this.highlightSettings.enable) {
|
|
11932
|
-
|
|
11933
|
-
this.maps.legendModule.shapeHighLightAndSelection(targetEle, data, this.highlightSettings, 'highlight', layerIndex);
|
|
11934
|
-
}
|
|
11935
|
-
const selectHighLight = targetEle.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible ?
|
|
11936
|
-
this.maps.legendModule.shapeToggled : true;
|
|
11937
|
-
if (selectHighLight) {
|
|
11938
|
-
this.mapHighlight(targetEle, shapeData, data);
|
|
11939
|
-
}
|
|
12062
|
+
this.handleHighlight(targetEle, layerIndex, data, shapeData);
|
|
11940
12063
|
}
|
|
11941
12064
|
else {
|
|
11942
12065
|
const element = document.getElementsByClassName('highlightMapStyle')[0];
|
|
@@ -11960,21 +12083,35 @@ class Highlight {
|
|
|
11960
12083
|
targetEle.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
|
|
11961
12084
|
}
|
|
11962
12085
|
removeClass(targetEle);
|
|
11963
|
-
if (this.maps.legendSettings.visible) {
|
|
12086
|
+
if (this.maps.legendSettings.visible && this.maps.legendModule) {
|
|
11964
12087
|
this.maps.legendModule.removeShapeHighlightCollection();
|
|
11965
12088
|
}
|
|
11966
12089
|
}
|
|
11967
12090
|
else if ((targetEle.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') !== -1 ||
|
|
11968
|
-
targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) &&
|
|
12091
|
+
targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendModule &&
|
|
11969
12092
|
this.maps.legendSettings.visible && targetEle.id.indexOf('_Text') === -1) {
|
|
11970
12093
|
this.maps.legendModule.legendHighLightAndSelection(targetEle, 'highlight');
|
|
11971
12094
|
}
|
|
11972
12095
|
else {
|
|
11973
|
-
if (this.maps.legendSettings.visible) {
|
|
12096
|
+
if (this.maps.legendSettings.visible && this.maps.legendModule) {
|
|
11974
12097
|
this.maps.legendModule.removeLegendHighlightCollection();
|
|
11975
12098
|
}
|
|
11976
12099
|
}
|
|
11977
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
|
+
}
|
|
11978
12115
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11979
12116
|
mapHighlight(targetEle, shapeData, data) {
|
|
11980
12117
|
const layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
@@ -12131,24 +12268,31 @@ class Selection {
|
|
|
12131
12268
|
this.selectionType = 'navigationline';
|
|
12132
12269
|
}
|
|
12133
12270
|
if (this.selectionsettings.enable) {
|
|
12134
|
-
this.
|
|
12135
|
-
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
|
|
12136
|
-
this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.selectionsettings, 'selection', layerIndex);
|
|
12137
|
-
}
|
|
12138
|
-
const shapeToggled = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible) ?
|
|
12139
|
-
this.maps.legendModule.shapeToggled : true;
|
|
12140
|
-
if (shapeToggled) {
|
|
12141
|
-
this.selectMap(targetElement, shapeData, data);
|
|
12142
|
-
}
|
|
12271
|
+
this.selectElement(targetElement, layerIndex, data, shapeData);
|
|
12143
12272
|
}
|
|
12144
12273
|
}
|
|
12145
|
-
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) &&
|
|
12146
12275
|
!isNullOrUndefined(targetElement.id) && targetElement.id.indexOf('_Text') === -1 &&
|
|
12147
12276
|
(targetElement.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') > -1 ||
|
|
12148
12277
|
targetElement.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1)) {
|
|
12149
12278
|
this.maps.legendModule.legendHighLightAndSelection(targetElement, 'selection');
|
|
12150
12279
|
}
|
|
12151
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
|
+
}
|
|
12152
12296
|
// eslint-disable-next-line valid-jsdoc
|
|
12153
12297
|
/**
|
|
12154
12298
|
* Public method for selection
|
|
@@ -13523,6 +13667,9 @@ class Zoom {
|
|
|
13523
13667
|
}
|
|
13524
13668
|
}
|
|
13525
13669
|
}
|
|
13670
|
+
/**
|
|
13671
|
+
* @private
|
|
13672
|
+
*/
|
|
13526
13673
|
panning(direction, xDifference, yDifference, mouseLocation) {
|
|
13527
13674
|
const map = this.maps;
|
|
13528
13675
|
let panArgs;
|
|
@@ -13541,6 +13688,8 @@ class Zoom {
|
|
|
13541
13688
|
yDifference = !isNullOrUndefined(yDifference) ? yDifference : (down.y - move.y);
|
|
13542
13689
|
this.maps.mergeCluster();
|
|
13543
13690
|
if (!map.isTileMap) {
|
|
13691
|
+
const legendElement = document.getElementById(map.element.id + '_Legend_Group');
|
|
13692
|
+
const legendHeight = !isNullOrUndefined(legendElement) ? legendElement.getClientRects()[0].height : 0;
|
|
13544
13693
|
x = translatePoint.x - xDifference / scale;
|
|
13545
13694
|
y = translatePoint.y - yDifference / scale;
|
|
13546
13695
|
const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
@@ -13548,7 +13697,7 @@ class Zoom {
|
|
|
13548
13697
|
const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
|
|
13549
13698
|
((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
|
|
13550
13699
|
const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
|
|
13551
|
-
((layerRect.top + layerRect.height + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
13700
|
+
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
13552
13701
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13553
13702
|
const location = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
|
|
13554
13703
|
panArgs = {
|