@syncfusion/ej2-maps 26.2.10 → 27.1.50
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/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +276 -256
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +276 -256
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/maps/layers/data-label.js +11 -7
- package/src/maps/layers/layer-panel.d.ts +0 -9
- package/src/maps/layers/layer-panel.js +16 -69
- package/src/maps/layers/legend.js +27 -11
- package/src/maps/layers/marker.js +2 -1
- package/src/maps/layers/navigation-selected-line.js +1 -1
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +23 -5
- package/src/maps/maps.js +58 -64
- package/src/maps/model/export-pdf.js +2 -1
- package/src/maps/model/print.js +2 -1
- package/src/maps/model/theme.js +54 -53
- package/src/maps/user-interaction/annotation.js +6 -4
- package/src/maps/user-interaction/tooltip.js +16 -11
- package/src/maps/user-interaction/zoom.js +7 -3
- package/src/maps/utils/helper.d.ts +8 -0
- package/src/maps/utils/helper.js +75 -31
- package/hotfix/26.1.35_Vol2.txt +0 -1
package/src/maps/maps.js
CHANGED
|
@@ -26,7 +26,7 @@ import { Event, remove, L10n, Collection, Internationalization, Complex } from '
|
|
|
26
26
|
import { SvgRenderer } from '@syncfusion/ej2-svg-base';
|
|
27
27
|
import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition, calculateSize } from './utils/helper';
|
|
28
28
|
import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle, querySelector } from './utils/helper';
|
|
29
|
-
import { createStyle } from './utils/helper';
|
|
29
|
+
import { createStyle, getProcessedMarginValue } from './utils/helper';
|
|
30
30
|
import { ZoomSettings, LegendSettings } from './model/base';
|
|
31
31
|
import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';
|
|
32
32
|
import { load, click, onclick, rightClick, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
|
|
@@ -90,8 +90,6 @@ var Maps = /** @class */ (function (_super) {
|
|
|
90
90
|
/** @private */
|
|
91
91
|
_this.centerPositionChanged = false;
|
|
92
92
|
/** @private */
|
|
93
|
-
_this.isTileMapSubLayer = false;
|
|
94
|
-
/** @private */
|
|
95
93
|
_this.markerNullCount = 0;
|
|
96
94
|
/** @private */
|
|
97
95
|
_this.tileTranslatePoint = new Point(0, 0);
|
|
@@ -456,37 +454,11 @@ var Maps = /** @class */ (function (_super) {
|
|
|
456
454
|
var tileElement = document.getElementById(this.element.id + '_tile_parent');
|
|
457
455
|
var tileElement1 = document.getElementById(this.element.id + '_tiles');
|
|
458
456
|
var tile = tileElement.getBoundingClientRect();
|
|
459
|
-
var bottom = void 0;
|
|
460
457
|
var top_1;
|
|
461
458
|
var left = void 0;
|
|
462
459
|
left = parseFloat(tileElement.style.left);
|
|
463
|
-
var
|
|
464
|
-
|
|
465
|
-
if (this.isTileMap && this.isTileMapSubLayer && this.legendSettings.position === 'Bottom' && this.legendSettings.visible) {
|
|
466
|
-
if (this.legendSettings.mode !== 'Default') {
|
|
467
|
-
if (titleTextSize.width !== 0 && titleTextSize.height !== 0) {
|
|
468
|
-
top_1 = parseFloat(tileElement.style.top) + (subTitleTextSize.height / 2)
|
|
469
|
-
- (this.legendModule.legendBorderRect.height / 2);
|
|
470
|
-
}
|
|
471
|
-
else {
|
|
472
|
-
top_1 = parseFloat(tileElement.style.top) - this.mapAreaRect.y;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
else {
|
|
476
|
-
left = this.legendModule.legendBorderRect.x;
|
|
477
|
-
if (titleTextSize.width !== 0 && titleTextSize.height !== 0) {
|
|
478
|
-
top_1 = parseFloat(tileElement.style.top) + (subTitleTextSize['height'] / 2)
|
|
479
|
-
- this.legendModule.legendBorderRect.y;
|
|
480
|
-
}
|
|
481
|
-
else {
|
|
482
|
-
top_1 = parseFloat(tileElement.style.top) + (subTitleTextSize['height'] / 2);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
487
|
-
bottom = svg.bottom - tile.bottom - element.offsetTop;
|
|
488
|
-
top_1 = parseFloat(tileElement.style.top);
|
|
489
|
-
}
|
|
460
|
+
var bottom = svg.bottom - tile.bottom - element.offsetTop;
|
|
461
|
+
top_1 = parseFloat(tileElement.style.top);
|
|
490
462
|
top_1 = (bottom <= 11) ? top_1 : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top_1 * 2);
|
|
491
463
|
left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
|
|
492
464
|
tileElement.style.top = top_1 + 'px';
|
|
@@ -711,8 +683,9 @@ var Maps = /** @class */ (function (_super) {
|
|
|
711
683
|
var mapsElement = document.getElementById(this.element.id);
|
|
712
684
|
if (!isNullOrUndefined(mapsElement)) {
|
|
713
685
|
var element = mapsElement.getBoundingClientRect();
|
|
686
|
+
var marginLeft = getProcessedMarginValue(this.margin.left);
|
|
714
687
|
var minPosition = this.isTileMap ?
|
|
715
|
-
this.pointToLatLong((this.mapAreaRect.x -
|
|
688
|
+
this.pointToLatLong((this.mapAreaRect.x - marginLeft), -this.mapAreaRect.y) :
|
|
716
689
|
this.getGeoLocation(0, (this.mapAreaRect.x + element.left), this.mapAreaRect.y);
|
|
717
690
|
var maxPosition = this.isTileMap ? this.pointToLatLong(this.mapAreaRect.width, (this.mapAreaRect.height - this.mapAreaRect.y)) :
|
|
718
691
|
this.getGeoLocation(0, (this.mapAreaRect.x + element.left + this.mapAreaRect.width), (this.mapAreaRect.y + this.mapAreaRect.height));
|
|
@@ -779,8 +752,9 @@ var Maps = /** @class */ (function (_super) {
|
|
|
779
752
|
var ele = createElement('div', {
|
|
780
753
|
id: this.element.id + '_tile_parent'
|
|
781
754
|
});
|
|
755
|
+
var marginRight = getProcessedMarginValue(this.margin.right);
|
|
782
756
|
ele.style.cssText = 'position: absolute; left: ' +
|
|
783
|
-
(this.mapAreaRect.x) + 'px; right: ' + (
|
|
757
|
+
(this.mapAreaRect.x) + 'px; right: ' + (marginRight) + 'px; top: '
|
|
784
758
|
+ (this.mapAreaRect.y + padding) + 'px; height: ' +
|
|
785
759
|
(this.mapAreaRect.height) + 'px; width: '
|
|
786
760
|
+ (this.mapAreaRect.width) + 'px; overflow: hidden;';
|
|
@@ -788,7 +762,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
788
762
|
id: this.element.id + '_tiles'
|
|
789
763
|
});
|
|
790
764
|
ele1.style.cssText = 'position: absolute; left: ' +
|
|
791
|
-
(this.mapAreaRect.x) + 'px; right: ' + (
|
|
765
|
+
(this.mapAreaRect.x) + 'px; right: ' + (marginRight) + 'px; top: '
|
|
792
766
|
+ (this.mapAreaRect.y + padding) + 'px; height: ' + (this.mapAreaRect.height) + 'px; width: '
|
|
793
767
|
+ (this.mapAreaRect.width) + 'px; overflow: hidden;';
|
|
794
768
|
this.element.appendChild(ele);
|
|
@@ -879,7 +853,11 @@ var Maps = /** @class */ (function (_super) {
|
|
|
879
853
|
opacity: title.textStyle.opacity
|
|
880
854
|
};
|
|
881
855
|
var height;
|
|
882
|
-
var
|
|
856
|
+
var marginTop = getProcessedMarginValue(this.margin.top);
|
|
857
|
+
var marginBottom = getProcessedMarginValue(this.margin.bottom);
|
|
858
|
+
var marginLeft = getProcessedMarginValue(this.margin.left);
|
|
859
|
+
var marginRight = getProcessedMarginValue(this.margin.right);
|
|
860
|
+
var width = Math.abs((marginLeft + marginRight) - this.availableSize.width);
|
|
883
861
|
style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
|
|
884
862
|
style.fontWeight = type === 'title' ? style.fontWeight || this.themeStyle.titleFontWeight : style.fontWeight || this.themeStyle.titleFontWeight;
|
|
885
863
|
style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || this.themeStyle.subTitleFontSize || Theme.mapsSubTitleFont.size);
|
|
@@ -889,16 +867,16 @@ var Maps = /** @class */ (function (_super) {
|
|
|
889
867
|
}
|
|
890
868
|
var trimmedTitle = textTrim(width, title.text, style);
|
|
891
869
|
var elementSize = measureText(trimmedTitle, style);
|
|
892
|
-
var rect = (isNullOrUndefined(bounds)) ? new Rect(
|
|
893
|
-
var location_1 = findPosition(rect, title.alignment, elementSize, type);
|
|
870
|
+
var rect = (isNullOrUndefined(bounds)) ? new Rect(marginLeft, marginTop, this.availableSize.width, this.availableSize.height) : bounds;
|
|
871
|
+
var location_1 = findPosition(rect, !isNullOrUndefined(title.alignment) ? title.alignment : 'Center', elementSize, type);
|
|
894
872
|
var options = new TextOption(this.element.id + '_Map_' + type, location_1.x, location_1.y, 'start', trimmedTitle);
|
|
895
873
|
var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
|
|
896
874
|
var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
897
875
|
element.setAttribute('aria-label', title.text);
|
|
898
876
|
element.setAttribute('role', 'region');
|
|
899
877
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
900
|
-
height = Math.abs((titleBounds.y +
|
|
901
|
-
this.mapAreaRect = new Rect(
|
|
878
|
+
height = Math.abs((titleBounds.y + marginBottom) - this.availableSize.height);
|
|
879
|
+
this.mapAreaRect = new Rect(marginLeft, titleBounds.y + 10, width, height - 10);
|
|
902
880
|
}
|
|
903
881
|
if (type !== 'subtitle' && title.subtitleSettings.text) {
|
|
904
882
|
this.renderTitle(title.subtitleSettings, 'subtitle', titleBounds, groupEle);
|
|
@@ -908,8 +886,8 @@ var Maps = /** @class */ (function (_super) {
|
|
|
908
886
|
}
|
|
909
887
|
}
|
|
910
888
|
else {
|
|
911
|
-
height = Math.abs((
|
|
912
|
-
this.mapAreaRect = new Rect(
|
|
889
|
+
height = Math.abs((marginTop + marginBottom) - this.availableSize.height);
|
|
890
|
+
this.mapAreaRect = new Rect(marginLeft, marginTop, width, height);
|
|
913
891
|
}
|
|
914
892
|
};
|
|
915
893
|
/**
|
|
@@ -993,13 +971,20 @@ var Maps = /** @class */ (function (_super) {
|
|
|
993
971
|
removeClass(document.getElementsByClassName('highlightMapStyle')[0]);
|
|
994
972
|
}
|
|
995
973
|
};
|
|
974
|
+
/**
|
|
975
|
+
* This method is used to perform operations when keyboard key from maps.
|
|
976
|
+
*
|
|
977
|
+
* @param {KeyboardEvent} event - Specifies the keyboard event on maps.
|
|
978
|
+
* @returns {void}
|
|
979
|
+
* @private
|
|
980
|
+
*/
|
|
996
981
|
Maps.prototype.keyUpHandler = function (event) {
|
|
997
982
|
var id = event.target['id'];
|
|
998
983
|
if (this.isTileMap) {
|
|
999
984
|
this.removeTileMap();
|
|
1000
985
|
}
|
|
1001
986
|
if (event.code === 'Tab' && id.indexOf('_LayerIndex_') > -1 && id.indexOf('shapeIndex') > -1) {
|
|
1002
|
-
this.keyboardHighlightSelection(id, event
|
|
987
|
+
this.keyboardHighlightSelection(id, event);
|
|
1003
988
|
}
|
|
1004
989
|
else if (id.indexOf('_LayerIndex_') === -1 && id.indexOf('shapeIndex') === -1 &&
|
|
1005
990
|
getElementsByClassName('highlightMapStyle').length > 0) {
|
|
@@ -1009,7 +994,8 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1009
994
|
}
|
|
1010
995
|
}
|
|
1011
996
|
};
|
|
1012
|
-
Maps.prototype.keyboardHighlightSelection = function (id,
|
|
997
|
+
Maps.prototype.keyboardHighlightSelection = function (id, event) {
|
|
998
|
+
var key = event.type;
|
|
1013
999
|
var layerIndex = parseInt(id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
1014
1000
|
var shapeIndex = parseInt(id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
1015
1001
|
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1029,6 +1015,13 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1029
1015
|
this.highlightModule.handleHighlight(event.target, layerIndex, data, shapeData);
|
|
1030
1016
|
}
|
|
1031
1017
|
};
|
|
1018
|
+
/**
|
|
1019
|
+
* This method is used to perform operations when keyboard down from maps.
|
|
1020
|
+
*
|
|
1021
|
+
* @param {KeyboardEvent} event - Specifies the keyboard event on maps.
|
|
1022
|
+
* @returns {void}
|
|
1023
|
+
* @private
|
|
1024
|
+
*/
|
|
1032
1025
|
Maps.prototype.keyDownHandler = function (event) {
|
|
1033
1026
|
var zoom = this.zoomModule;
|
|
1034
1027
|
var id = event.target['id'];
|
|
@@ -1094,7 +1087,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1094
1087
|
}
|
|
1095
1088
|
}
|
|
1096
1089
|
if (id.indexOf('shapeIndex') > -1) {
|
|
1097
|
-
this.keyboardHighlightSelection(id, event
|
|
1090
|
+
this.keyboardHighlightSelection(id, event);
|
|
1098
1091
|
}
|
|
1099
1092
|
}
|
|
1100
1093
|
if (this.zoomModule) {
|
|
@@ -1788,7 +1781,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1788
1781
|
* @returns {void}
|
|
1789
1782
|
*/
|
|
1790
1783
|
Maps.prototype.shapeSelection = function (layerIndex, propertyName, name, enable) {
|
|
1791
|
-
if (!this.isDestroyed) {
|
|
1784
|
+
if (!this.isDestroyed && !isNullOrUndefined(this.layers[layerIndex])) {
|
|
1792
1785
|
var targetEle = void 0;
|
|
1793
1786
|
var subLayerIndex = void 0;
|
|
1794
1787
|
var popertyNameArray = Array.isArray(propertyName) ? propertyName : Array(propertyName);
|
|
@@ -1807,7 +1800,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1807
1800
|
}
|
|
1808
1801
|
}
|
|
1809
1802
|
}
|
|
1810
|
-
if (selectionsettings.enable) {
|
|
1803
|
+
if (!isNullOrUndefined(selectionsettings) && selectionsettings.enable) {
|
|
1811
1804
|
var targetId = void 0;
|
|
1812
1805
|
var dataIndex = void 0;
|
|
1813
1806
|
var shapeIndex = void 0;
|
|
@@ -2013,6 +2006,9 @@ var Maps = /** @class */ (function (_super) {
|
|
|
2013
2006
|
if (!isNullOrUndefined(this.mapsTooltipModule)) {
|
|
2014
2007
|
this.mapsTooltipModule.removeEventListener();
|
|
2015
2008
|
}
|
|
2009
|
+
if (!isNullOrUndefined(this.bingMap)) {
|
|
2010
|
+
this.bingMap.destroy();
|
|
2011
|
+
}
|
|
2016
2012
|
_super.prototype.destroy.call(this);
|
|
2017
2013
|
this.shapeSelectionItem = [];
|
|
2018
2014
|
this.toggledElementId = [];
|
|
@@ -2554,16 +2550,13 @@ var Maps = /** @class */ (function (_super) {
|
|
|
2554
2550
|
* @returns {GeoPosition}- Returns the geographical coordinates.
|
|
2555
2551
|
*/
|
|
2556
2552
|
Maps.prototype.getGeoLocation = function (layerIndex, x, y) {
|
|
2557
|
-
var latitude =
|
|
2558
|
-
var longitude =
|
|
2559
|
-
if (!this.isDestroyed) {
|
|
2553
|
+
var latitude = null;
|
|
2554
|
+
var longitude = null;
|
|
2555
|
+
if (!this.isDestroyed && !this.isTileMap) {
|
|
2560
2556
|
var container = document.getElementById(this.element.id);
|
|
2561
2557
|
var elementClientRect = this.element.getBoundingClientRect();
|
|
2562
|
-
var
|
|
2563
|
-
var
|
|
2564
|
-
(elementClientRect.left - bodyClientRect.left) : 0);
|
|
2565
|
-
var pageY = y - (isNullOrUndefined(this.markerDragArgument) ? container.offsetTop ||
|
|
2566
|
-
(elementClientRect.top - bodyClientRect.top) : 0);
|
|
2558
|
+
var pageX = x - container.offsetLeft - (elementClientRect.left - container.offsetLeft) - window.scrollX;
|
|
2559
|
+
var pageY = y - container.offsetTop - (elementClientRect.top - container.offsetTop) - window.scrollY;
|
|
2567
2560
|
var currentLayer = this.layersCollection[layerIndex];
|
|
2568
2561
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2569
2562
|
var translate = getTranslate(this, currentLayer, false);
|
|
@@ -2590,15 +2583,16 @@ var Maps = /** @class */ (function (_super) {
|
|
|
2590
2583
|
* @returns {GeoPosition} - Returns the geographical coordinates.
|
|
2591
2584
|
*/
|
|
2592
2585
|
Maps.prototype.getTileGeoLocation = function (x, y) {
|
|
2593
|
-
var latitude =
|
|
2594
|
-
var longitude =
|
|
2595
|
-
if (
|
|
2596
|
-
var
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2586
|
+
var latitude = null;
|
|
2587
|
+
var longitude = null;
|
|
2588
|
+
if (this.isTileMap) {
|
|
2589
|
+
var element = document.getElementById(this.element.id + '_tile_parent');
|
|
2590
|
+
if (!this.isDestroyed && !isNullOrUndefined(element)) {
|
|
2591
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2592
|
+
var latLong = this.pointToLatLong(x + this.mapAreaRect.x - element.offsetLeft, y + this.mapAreaRect.y - element.offsetTop);
|
|
2593
|
+
latitude = latLong['latitude'];
|
|
2594
|
+
longitude = latLong['longitude'];
|
|
2595
|
+
}
|
|
2602
2596
|
}
|
|
2603
2597
|
return { latitude: latitude, longitude: longitude };
|
|
2604
2598
|
};
|
|
@@ -2614,7 +2608,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
2614
2608
|
var longitude = 0;
|
|
2615
2609
|
if (!this.isDestroyed && !isNullOrUndefined(this.translatePoint)) {
|
|
2616
2610
|
var padding = 10;
|
|
2617
|
-
pageY = pageY + padding;
|
|
2611
|
+
pageY = !isNullOrUndefined(this.markerDragArgument) ? pageY + padding : pageY;
|
|
2618
2612
|
var mapSize = 256 * Math.pow(2, this.tileZoomLevel);
|
|
2619
2613
|
var x1 = (this.clip(pageX - (this.translatePoint.x * this.scale), 0, mapSize - 1) / mapSize) - 0.5;
|
|
2620
2614
|
var y1 = 0.5 - (this.clip(pageY - (this.translatePoint.y * this.scale), 0, mapSize - 1) / mapSize);
|
|
@@ -43,7 +43,8 @@ var PdfExport = /** @class */ (function () {
|
|
|
43
43
|
var exportElement = maps.svgObject.cloneNode(true);
|
|
44
44
|
var backgroundElement = exportElement.childNodes[0];
|
|
45
45
|
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
46
|
-
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
46
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
47
|
+
maps.theme === 'Fluent2')
|
|
47
48
|
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
48
49
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
49
50
|
}
|
package/src/maps/model/print.js
CHANGED
|
@@ -54,7 +54,8 @@ var Print = /** @class */ (function () {
|
|
|
54
54
|
backgroundElement = backgroundElement.childNodes[0];
|
|
55
55
|
if (!isNullOrUndefined(backgroundElement)) {
|
|
56
56
|
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
57
|
-
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
57
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
58
|
+
maps.theme === 'Fluent2')
|
|
58
59
|
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
59
60
|
backgroundElement.setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
60
61
|
}
|
package/src/maps/model/theme.js
CHANGED
|
@@ -175,14 +175,6 @@ export function getShapeColor(theme) {
|
|
|
175
175
|
themePalette = ['#10B981', '#22D3EE', '#2DD4BF', '#4ADE80', '#8B5CF6',
|
|
176
176
|
'#E879F9', '#F472B6', '#F87171', '#F97316', '#FCD34D'];
|
|
177
177
|
break;
|
|
178
|
-
case 'bootstrap5':
|
|
179
|
-
themePalette = ['#262E0B', '#668E1F', '#AF6E10', '#862C0B', '#1F2D50',
|
|
180
|
-
'#64680B', '#311508', '#4C4C81', '#0C7DA0', '#862C0B'];
|
|
181
|
-
break;
|
|
182
|
-
case 'bootstrap5dark':
|
|
183
|
-
themePalette = ['#5ECB9B', '#A860F1', '#EBA844', '#557EF7', '#E9599B',
|
|
184
|
-
'#BFC529', '#3BC6CF', '#7A68EC', '#74B706', '#EA6266'];
|
|
185
|
-
break;
|
|
186
178
|
case 'fluent':
|
|
187
179
|
themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
|
|
188
180
|
'#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
|
|
@@ -208,6 +200,11 @@ export function getShapeColor(theme) {
|
|
|
208
200
|
themePalette = ['#9BB449', '#2A72D5', '#43B786', '#3F579A', '#584EC6',
|
|
209
201
|
'#E85F9C', '#6E7A89', '#EA6266', '#0B6A0B', '#C19C00'];
|
|
210
202
|
break;
|
|
203
|
+
case 'bootstrap5':
|
|
204
|
+
case 'bootstrap5dark':
|
|
205
|
+
themePalette = ['#6610F2', '#6f42C1', '#D63384', '#DC3545',
|
|
206
|
+
'#FD7E14', '#FFC107', '#198754', '#0DCAF0'];
|
|
207
|
+
break;
|
|
211
208
|
default:
|
|
212
209
|
themePalette = ['#B5E485', '#7BC1E8', '#DF819C', '#EC9B79', '#78D0D3',
|
|
213
210
|
'#D6D572', '#9178E3', '#A1E5B4', '#87A4B4', '#E4C16C'];
|
|
@@ -504,68 +501,72 @@ export function getThemeStyle(theme) {
|
|
|
504
501
|
break;
|
|
505
502
|
case 'bootstrap5':
|
|
506
503
|
style = {
|
|
507
|
-
backgroundColor: '
|
|
508
|
-
areaBackgroundColor: '
|
|
504
|
+
backgroundColor: 'transparent',
|
|
505
|
+
areaBackgroundColor: 'transparent',
|
|
509
506
|
titleFontColor: '#212529',
|
|
510
507
|
subTitleFontColor: '#212529',
|
|
511
508
|
legendTitleFontColor: '#212529',
|
|
512
509
|
legendTextColor: '#212529',
|
|
513
510
|
dataLabelFontColor: '#212529',
|
|
514
|
-
tooltipFontColor: '#
|
|
515
|
-
tooltipFillColor: '#
|
|
516
|
-
zoomFillColor: '#
|
|
517
|
-
fontFamily: '
|
|
518
|
-
fontSize: '
|
|
519
|
-
fontWeight: '
|
|
511
|
+
tooltipFontColor: '#FFFFFF',
|
|
512
|
+
tooltipFillColor: '#000000',
|
|
513
|
+
zoomFillColor: '#6E757D',
|
|
514
|
+
fontFamily: 'Segoe UI',
|
|
515
|
+
fontSize: '10px',
|
|
516
|
+
fontWeight: '400',
|
|
520
517
|
titleFontSize: '14px',
|
|
521
|
-
|
|
522
|
-
|
|
518
|
+
subTitleFontSize: '12px',
|
|
519
|
+
legendFontSize: '10px',
|
|
520
|
+
tooltipFillOpacity: 0.9,
|
|
523
521
|
tooltipTextOpacity: 1,
|
|
524
|
-
labelFontFamily: '
|
|
525
|
-
titleFontWeight: '
|
|
526
|
-
zoomSelectionColor: '#
|
|
522
|
+
labelFontFamily: 'Segoe UI',
|
|
523
|
+
titleFontWeight: '400',
|
|
524
|
+
zoomSelectionColor: '#212529',
|
|
525
|
+
zoomBorderColor: '#DEE2E6',
|
|
527
526
|
shapeFill: '#E9ECEF',
|
|
528
|
-
shapeBorderColor: '#
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
527
|
+
shapeBorderColor: '#DEE2E6',
|
|
528
|
+
zoomButtonRadius: 32,
|
|
529
|
+
rectangleZoomBorderColor: '#0D6EFD',
|
|
530
|
+
rectangleZoomFillColor: '#86B7FE',
|
|
531
|
+
rectangleZoomFillOpacity: 0.30,
|
|
532
532
|
legendBorderColor: '#000000',
|
|
533
533
|
legendBorderWidth: 0,
|
|
534
|
-
tooltipBorderColor: 'transparent'
|
|
535
|
-
zoomButtonRadius: 30
|
|
534
|
+
tooltipBorderColor: 'transparent'
|
|
536
535
|
};
|
|
537
536
|
break;
|
|
538
537
|
case 'bootstrap5dark':
|
|
539
538
|
style = {
|
|
540
|
-
backgroundColor: '
|
|
541
|
-
areaBackgroundColor: '
|
|
542
|
-
titleFontColor: '#
|
|
543
|
-
subTitleFontColor: '#
|
|
544
|
-
legendTitleFontColor: '#
|
|
545
|
-
legendTextColor: '#
|
|
546
|
-
dataLabelFontColor: '#
|
|
539
|
+
backgroundColor: 'transparent',
|
|
540
|
+
areaBackgroundColor: 'transparent',
|
|
541
|
+
titleFontColor: '#DEE2E6',
|
|
542
|
+
subTitleFontColor: '#DEE2E6',
|
|
543
|
+
legendTitleFontColor: '#DEE2E6',
|
|
544
|
+
legendTextColor: '#DEE2E6',
|
|
545
|
+
dataLabelFontColor: '#DEE2E6',
|
|
547
546
|
tooltipFontColor: '#212529',
|
|
548
|
-
tooltipFillColor: '#
|
|
549
|
-
zoomFillColor: '#
|
|
550
|
-
fontFamily: '
|
|
551
|
-
fontSize: '
|
|
552
|
-
fontWeight: '
|
|
547
|
+
tooltipFillColor: '#FFFFFF',
|
|
548
|
+
zoomFillColor: '#ADB5BD',
|
|
549
|
+
fontFamily: 'Segoe UI',
|
|
550
|
+
fontSize: '10px',
|
|
551
|
+
fontWeight: '400',
|
|
553
552
|
titleFontSize: '14px',
|
|
554
|
-
|
|
555
|
-
|
|
553
|
+
subTitleFontSize: '12px',
|
|
554
|
+
legendFontSize: '10px',
|
|
555
|
+
tooltipFillOpacity: 0.9,
|
|
556
556
|
tooltipTextOpacity: 1,
|
|
557
|
-
labelFontFamily: '
|
|
558
|
-
titleFontWeight: '
|
|
559
|
-
zoomSelectionColor: '#
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
557
|
+
labelFontFamily: 'Segoe UI',
|
|
558
|
+
titleFontWeight: '400',
|
|
559
|
+
zoomSelectionColor: '#F8F9FA',
|
|
560
|
+
zoomBorderColor: '#495057',
|
|
561
|
+
shapeFill: '#343A40',
|
|
562
|
+
shapeBorderColor: '#495057',
|
|
563
|
+
zoomButtonRadius: 32,
|
|
564
|
+
rectangleZoomFillColor: '#86B7FE',
|
|
565
|
+
rectangleZoomBorderColor: '#0D6EFD',
|
|
566
|
+
rectangleZoomFillOpacity: 0.30,
|
|
565
567
|
legendBorderColor: '#000000',
|
|
566
568
|
legendBorderWidth: 0,
|
|
567
|
-
tooltipBorderColor: 'transparent'
|
|
568
|
-
zoomButtonRadius: 30
|
|
569
|
+
tooltipBorderColor: 'transparent'
|
|
569
570
|
};
|
|
570
571
|
break;
|
|
571
572
|
case 'fluent':
|
|
@@ -794,8 +795,8 @@ export function getThemeStyle(theme) {
|
|
|
794
795
|
titleFontWeight: '600',
|
|
795
796
|
zoomSelectionColor: '#FFFFFF',
|
|
796
797
|
zoomBorderColor: '#FFFFFF',
|
|
797
|
-
shapeFill: '#
|
|
798
|
-
shapeBorderColor: '#
|
|
798
|
+
shapeFill: '#FFFFFF',
|
|
799
|
+
shapeBorderColor: '#FFFFFF',
|
|
799
800
|
rectangleZoomFillColor: '#1AEBFF',
|
|
800
801
|
rectangleZoomFillOpacity: 0.25,
|
|
801
802
|
rectangleZoomBorderColor: '#1AEBFF',
|
|
@@ -76,10 +76,12 @@ var Annotations = /** @class */ (function () {
|
|
|
76
76
|
var bounds = map.svgObject.getBoundingClientRect();
|
|
77
77
|
left = Math.abs(bounds.left - elementRect.left);
|
|
78
78
|
top = Math.abs(bounds.top - elementRect.top);
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
parseFloat(
|
|
79
|
+
var annotationX = !isNullOrUndefined(annotation.x) ? annotation.x : '0%';
|
|
80
|
+
var annotationY = !isNullOrUndefined(annotation.y) ? annotation.y : '0%';
|
|
81
|
+
var annotationXValue = (annotationX.indexOf('%') > -1) ? (availSize.width / 100) * parseFloat(annotationX) :
|
|
82
|
+
parseFloat(annotationX);
|
|
83
|
+
var annotationYValue = (annotationY.indexOf('%') > -1) ? (availSize.height / 100) * parseFloat(annotationY) :
|
|
84
|
+
parseFloat(annotationY);
|
|
83
85
|
left = (annotation.horizontalAlignment === 'None') ? (left + annotationXValue) : left;
|
|
84
86
|
top = (annotation.verticalAlignment === 'None') ? (top + annotationYValue) : top;
|
|
85
87
|
switch (annotation.verticalAlignment) {
|
|
@@ -92,7 +92,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
92
92
|
layer.shapePropertyPath : [layer.shapePropertyPath]);
|
|
93
93
|
if (!isNullOrUndefined(properties)) {
|
|
94
94
|
for (var k = 0; k < properties.length; k++) {
|
|
95
|
-
if (!isNullOrUndefined(layer.dataSource)) {
|
|
95
|
+
if (!isNullOrUndefined(layer.dataSource) && !isNullOrUndefined(layer.shapeDataPath)) {
|
|
96
96
|
for (var i = 0; i < layer['dataSource']['length']; i++) {
|
|
97
97
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
98
|
var data = layer.dataSource[i];
|
|
@@ -138,7 +138,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
138
138
|
formatValue(((option.valuePath.indexOf('.') > -1) ?
|
|
139
139
|
(getValueFromObject(layer.dataSource[index], option.valuePath)) :
|
|
140
140
|
layer.dataSource[index][option.valuePath]), this.maps) : value[shapePath];
|
|
141
|
-
if (isNullOrUndefined(currentData)) {
|
|
141
|
+
if (isNullOrUndefined(currentData) && !isNullOrUndefined(option.valuePath)) {
|
|
142
142
|
currentData = (option.valuePath.indexOf('.') > -1) ?
|
|
143
143
|
(getValueFromObject(value, option.valuePath)) : value[option.valuePath];
|
|
144
144
|
}
|
|
@@ -161,10 +161,12 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
161
161
|
currentData = marker.template.split('>')[1].split('<')[0];
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
(
|
|
167
|
-
|
|
164
|
+
if (!isNullOrUndefined(marker.tooltipSettings.valuePath)) {
|
|
165
|
+
currentData =
|
|
166
|
+
formatValue(((marker.tooltipSettings.valuePath.indexOf('.') > -1) ?
|
|
167
|
+
(getValueFromObject(marker.dataSource[dataIndex], marker.tooltipSettings.valuePath)) :
|
|
168
|
+
marker.dataSource[dataIndex][marker.tooltipSettings.valuePath]), this.maps);
|
|
169
|
+
}
|
|
168
170
|
}
|
|
169
171
|
}
|
|
170
172
|
}
|
|
@@ -181,10 +183,12 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
181
183
|
currentData = this.formatter(bubble.tooltipSettings.format, bubble.dataSource[dataIndex]);
|
|
182
184
|
}
|
|
183
185
|
else {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
(
|
|
187
|
-
|
|
186
|
+
if (!isNullOrUndefined(bubble.tooltipSettings.valuePath)) {
|
|
187
|
+
currentData =
|
|
188
|
+
formatValue(((bubble.tooltipSettings.valuePath.indexOf('.') > -1) ?
|
|
189
|
+
(getValueFromObject(bubble.dataSource[dataIndex], bubble.tooltipSettings.valuePath)) :
|
|
190
|
+
bubble.dataSource[dataIndex][bubble.tooltipSettings.valuePath]), this.maps);
|
|
191
|
+
}
|
|
188
192
|
}
|
|
189
193
|
}
|
|
190
194
|
//location.y = this.template(option, location);
|
|
@@ -234,7 +238,8 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
234
238
|
options: tooltipOption,
|
|
235
239
|
fill: isPolygon ? polygonFill : option.fill,
|
|
236
240
|
maps: this.maps, latitude: latitude, longitude: longitude,
|
|
237
|
-
element: target, eventArgs: e, content: isPolygon ? polygon.tooltipText
|
|
241
|
+
element: target, eventArgs: e, content: isPolygon ? (!isNullOrUndefined(polygon.tooltipText) ? polygon.tooltipText : '') :
|
|
242
|
+
!isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
238
243
|
};
|
|
239
244
|
if (tooltipArgs.content !== '' || tooltipArgs.options['template'] !== '') {
|
|
240
245
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Point, getElementByID, PathOption, Rect, convertGeoToPoint, CircleOption, convertTileLatLongToPoint, measureTextElement } from '../utils/helper';
|
|
2
2
|
import { RectOption, createTooltip, calculateScale, getTouchCenter, getTouches, targetTouches } from '../utils/helper';
|
|
3
|
-
import { MapLocation, zoomAnimate, smoothTranslate, measureText, textTrim, clusterTemplate, marker } from '../utils/helper';
|
|
3
|
+
import { MapLocation, zoomAnimate, smoothTranslate, measureText, textTrim, clusterTemplate, marker, getProcessedMarginValue } from '../utils/helper';
|
|
4
4
|
import { markerTemplate, removeElement, getElement, clusterSeparate, markerColorChoose, calculatePolygonPath } from '../utils/helper';
|
|
5
5
|
import { markerShapeChoose } from '../utils/helper';
|
|
6
6
|
import { isNullOrUndefined, EventHandler, Browser, remove, createElement, animationMode } from '@syncfusion/ej2-base';
|
|
@@ -1124,6 +1124,7 @@ var Zoom = /** @class */ (function () {
|
|
|
1124
1124
|
var layerY = event.type.indexOf('mouse') > -1 || event.type.indexOf('key') > -1 ? event['layerY'] : event.touches[0].pageY;
|
|
1125
1125
|
this.maps.mergeCluster();
|
|
1126
1126
|
if (!map.isTileMap) {
|
|
1127
|
+
var marginTop = getProcessedMarginValue(map.margin.top);
|
|
1127
1128
|
var legendElement = document.getElementById(map.element.id + '_Legend_Group');
|
|
1128
1129
|
var legendHeight = !isNullOrUndefined(legendElement) ? legendElement.getClientRects()[0].height : 0;
|
|
1129
1130
|
x = translatePoint.x - xDifference / scale;
|
|
@@ -1133,7 +1134,7 @@ var Zoom = /** @class */ (function () {
|
|
|
1133
1134
|
var panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
|
|
1134
1135
|
((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
|
|
1135
1136
|
var panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
|
|
1136
|
-
((layerRect.top + layerRect.height + legendHeight +
|
|
1137
|
+
((layerRect.top + layerRect.height + legendHeight + marginTop) >= (elementRect.top + elementRect.height))));
|
|
1137
1138
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1138
1139
|
var location_3 = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, layerX, layerY);
|
|
1139
1140
|
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
@@ -1730,7 +1731,7 @@ var Zoom = /** @class */ (function () {
|
|
|
1730
1731
|
* @private
|
|
1731
1732
|
*/
|
|
1732
1733
|
Zoom.prototype.removeToolbarOpacity = function (factor, id) {
|
|
1733
|
-
if (this.maps.zoomModule && this.maps.zoomSettings.enable) {
|
|
1734
|
+
if (!isNullOrUndefined(this.maps) && this.maps.zoomModule && this.maps.zoomSettings.enable) {
|
|
1734
1735
|
if (getElementByID(this.maps.element.id + '_Zooming_KitCollection') && id.indexOf(this.maps.element.id + '_Zooming_') > -1) {
|
|
1735
1736
|
if (this.maps.isDevice) {
|
|
1736
1737
|
getElementByID(this.maps.element.id + '_Zooming_KitCollection').setAttribute('opacity', '1');
|
|
@@ -1981,6 +1982,9 @@ var Zoom = /** @class */ (function () {
|
|
|
1981
1982
|
//eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1982
1983
|
target = e.target;
|
|
1983
1984
|
}
|
|
1985
|
+
if (!this.isTouch) {
|
|
1986
|
+
e.preventDefault();
|
|
1987
|
+
}
|
|
1984
1988
|
if (!this.maps.zoomSettings.enablePanning) {
|
|
1985
1989
|
this.isPan = this.isPanModeEnabled = this.panColor !== this.selectionColor ? this.maps.zoomSettings.enablePanning
|
|
1986
1990
|
: this.zoomColor === this.selectionColor;
|
|
@@ -929,6 +929,14 @@ export declare function getElementByID(id: string): Element;
|
|
|
929
929
|
* @private
|
|
930
930
|
*/
|
|
931
931
|
export declare function getClientElement(id: string): ClientRect;
|
|
932
|
+
/**
|
|
933
|
+
* Function to return the number value for the string value.
|
|
934
|
+
*
|
|
935
|
+
* @param {string | number} marginValue - Specifies the margin value.
|
|
936
|
+
* @returns {number} - Returns the number value.
|
|
937
|
+
* @private
|
|
938
|
+
*/
|
|
939
|
+
export declare function getProcessedMarginValue(marginValue: string | number): number;
|
|
932
940
|
/**
|
|
933
941
|
* To apply internalization.
|
|
934
942
|
*
|