@syncfusion/ej2-maps 21.2.5 → 22.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -0
- package/CHANGELOG.md +1 -33
- 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 +316 -133
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +316 -133
- 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/data-label.js +2 -0
- package/src/maps/layers/layer-panel.js +7 -6
- package/src/maps/layers/legend.js +4 -0
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +4 -0
- package/src/maps/maps.js +16 -18
- package/src/maps/model/base-model.d.ts +8 -4
- package/src/maps/model/base.d.ts +8 -4
- package/src/maps/model/base.js +4 -4
- package/src/maps/model/export-image.js +15 -2
- package/src/maps/model/export-pdf.js +11 -3
- package/src/maps/model/interface.d.ts +22 -4
- package/src/maps/model/print.js +14 -1
- package/src/maps/model/theme.js +126 -10
- package/src/maps/user-interaction/tooltip.js +6 -2
- package/src/maps/user-interaction/zoom.js +108 -85
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +1 -1
- package/src/maps/utils/helper.js +5 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Animation, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Fetch, Internationalization, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, compile, createElement, extend, isNullOrUndefined, merge, print, remove, setValue } from '@syncfusion/ej2-base';
|
|
2
2
|
import { SvgRenderer, Tooltip } from '@syncfusion/ej2-svg-base';
|
|
3
3
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
4
4
|
import { PdfBitmap, PdfDocument, PdfPageOrientation } from '@syncfusion/ej2-pdf-export';
|
|
@@ -775,7 +775,7 @@ function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCol
|
|
|
775
775
|
}
|
|
776
776
|
else if (shape === 'Image') {
|
|
777
777
|
x = location.x - (size.width / 2);
|
|
778
|
-
y = location.y - (size.height / 2);
|
|
778
|
+
y = location.y - (markerID.indexOf('cluster') > -1 ? (size.height / 2) : size.height);
|
|
779
779
|
merge(pathOptions, { 'href': imageUrl, 'height': size.height, 'width': size.width, x: x, y: y });
|
|
780
780
|
markerEle = maps.renderer.drawImage(pathOptions);
|
|
781
781
|
}
|
|
@@ -2319,13 +2319,16 @@ function getTemplateFunction(template, maps) {
|
|
|
2319
2319
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2320
2320
|
let templateFn = null;
|
|
2321
2321
|
try {
|
|
2322
|
-
if (document.querySelectorAll(template).length) {
|
|
2322
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
2323
2323
|
templateFn = compile(document.querySelector(template).innerHTML.trim());
|
|
2324
2324
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2325
2325
|
}
|
|
2326
2326
|
else if (maps.isVue || maps.isVue3) {
|
|
2327
2327
|
templateFn = compile(template);
|
|
2328
2328
|
}
|
|
2329
|
+
else if (typeof template === 'function') {
|
|
2330
|
+
templateFn = compile(template);
|
|
2331
|
+
}
|
|
2329
2332
|
}
|
|
2330
2333
|
catch (e) {
|
|
2331
2334
|
templateFn = compile(template);
|
|
@@ -3517,6 +3520,14 @@ function getShapeColor(theme) {
|
|
|
3517
3520
|
themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
|
|
3518
3521
|
'#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
|
|
3519
3522
|
break;
|
|
3523
|
+
case 'material3':
|
|
3524
|
+
themePalette = ['#6200EE', '#E77A16', '#82C100', '#7107DC', '#05BB3D',
|
|
3525
|
+
'#D21020', '#FAD200', '#0085FF', '#9204EA', '#08EE9B'];
|
|
3526
|
+
break;
|
|
3527
|
+
case 'material3dark':
|
|
3528
|
+
themePalette = ['#4EAAFF', '#FA4EAB', '#FFF500', '#17EA58', '#38FFE7',
|
|
3529
|
+
'#FF9E45', '#B3F32F', '#B93CE4', '#FC5664', '#9B55FF'];
|
|
3530
|
+
break;
|
|
3520
3531
|
default:
|
|
3521
3532
|
themePalette = ['#B5E485', '#7BC1E8', '#DF819C', '#EC9B79', '#78D0D3',
|
|
3522
3533
|
'#D6D572', '#9178E3', '#A1E5B4', '#87A4B4', '#E4C16C'];
|
|
@@ -3665,9 +3676,14 @@ function getThemeStyle(theme) {
|
|
|
3665
3676
|
zoomFillColor: '#FFFFFF',
|
|
3666
3677
|
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
3667
3678
|
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
3679
|
+
fontSize: '12px',
|
|
3680
|
+
fontWeight: 'Medium',
|
|
3668
3681
|
titleFontWeight: 'Medium',
|
|
3669
3682
|
zoomSelectionColor: '#e61576',
|
|
3670
|
-
shapeFill: '#A6A6A6'
|
|
3683
|
+
shapeFill: '#A6A6A6',
|
|
3684
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3685
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3686
|
+
rectangleZoomBorderColor: "#009900"
|
|
3671
3687
|
};
|
|
3672
3688
|
break;
|
|
3673
3689
|
case 'highcontrast':
|
|
@@ -3684,10 +3700,15 @@ function getThemeStyle(theme) {
|
|
|
3684
3700
|
tooltipFillColor: '#ffffff',
|
|
3685
3701
|
zoomFillColor: '#FFFFFF',
|
|
3686
3702
|
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
3703
|
+
fontSize: '12px',
|
|
3704
|
+
fontWeight: 'Medium',
|
|
3687
3705
|
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
3688
3706
|
titleFontWeight: 'Medium',
|
|
3689
3707
|
zoomSelectionColor: '#e61576',
|
|
3690
|
-
shapeFill: '#A6A6A6'
|
|
3708
|
+
shapeFill: '#A6A6A6',
|
|
3709
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3710
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3711
|
+
rectangleZoomBorderColor: "#009900"
|
|
3691
3712
|
};
|
|
3692
3713
|
break;
|
|
3693
3714
|
case 'bootstrap4':
|
|
@@ -3703,6 +3724,8 @@ function getThemeStyle(theme) {
|
|
|
3703
3724
|
tooltipFillColor: '#000000',
|
|
3704
3725
|
zoomFillColor: '#5B6269',
|
|
3705
3726
|
fontFamily: 'HelveticaNeue-Medium',
|
|
3727
|
+
fontSize: '12px',
|
|
3728
|
+
fontWeight: 'Medium',
|
|
3706
3729
|
titleFontSize: '16px',
|
|
3707
3730
|
legendFontSize: '14px',
|
|
3708
3731
|
tooltipFillOpacity: 1,
|
|
@@ -3710,7 +3733,10 @@ function getThemeStyle(theme) {
|
|
|
3710
3733
|
labelFontFamily: 'HelveticaNeue-Medium',
|
|
3711
3734
|
titleFontWeight: 'Medium',
|
|
3712
3735
|
zoomSelectionColor: '#e61576',
|
|
3713
|
-
shapeFill: '#A6A6A6'
|
|
3736
|
+
shapeFill: '#A6A6A6',
|
|
3737
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3738
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3739
|
+
rectangleZoomBorderColor: "#009900"
|
|
3714
3740
|
};
|
|
3715
3741
|
break;
|
|
3716
3742
|
case 'tailwind':
|
|
@@ -3726,6 +3752,8 @@ function getThemeStyle(theme) {
|
|
|
3726
3752
|
tooltipFillColor: '#111827',
|
|
3727
3753
|
zoomFillColor: '#6b7280',
|
|
3728
3754
|
fontFamily: 'Inter',
|
|
3755
|
+
fontSize: '12px',
|
|
3756
|
+
fontWeight: 'Medium',
|
|
3729
3757
|
titleFontSize: '14px',
|
|
3730
3758
|
legendFontSize: '12px',
|
|
3731
3759
|
tooltipFillOpacity: 1,
|
|
@@ -3733,7 +3761,10 @@ function getThemeStyle(theme) {
|
|
|
3733
3761
|
labelFontFamily: 'Inter',
|
|
3734
3762
|
titleFontWeight: '500',
|
|
3735
3763
|
zoomSelectionColor: '#374151',
|
|
3736
|
-
shapeFill: '#E5E7EB'
|
|
3764
|
+
shapeFill: '#E5E7EB',
|
|
3765
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3766
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3767
|
+
rectangleZoomBorderColor: "#009900"
|
|
3737
3768
|
};
|
|
3738
3769
|
break;
|
|
3739
3770
|
case 'tailwinddark':
|
|
@@ -3749,6 +3780,8 @@ function getThemeStyle(theme) {
|
|
|
3749
3780
|
tooltipFillColor: '#F9FAFB',
|
|
3750
3781
|
zoomFillColor: '#D1D5DB',
|
|
3751
3782
|
fontFamily: 'Inter',
|
|
3783
|
+
fontSize: '12px',
|
|
3784
|
+
fontWeight: 'Medium',
|
|
3752
3785
|
titleFontSize: '14px',
|
|
3753
3786
|
legendFontSize: '12px',
|
|
3754
3787
|
tooltipFillOpacity: 1,
|
|
@@ -3756,7 +3789,10 @@ function getThemeStyle(theme) {
|
|
|
3756
3789
|
labelFontFamily: 'Inter',
|
|
3757
3790
|
titleFontWeight: '500',
|
|
3758
3791
|
zoomSelectionColor: '#F3F4F6',
|
|
3759
|
-
shapeFill: '#374151'
|
|
3792
|
+
shapeFill: '#374151',
|
|
3793
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3794
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3795
|
+
rectangleZoomBorderColor: "#009900"
|
|
3760
3796
|
};
|
|
3761
3797
|
break;
|
|
3762
3798
|
case 'bootstrap5':
|
|
@@ -3772,6 +3808,8 @@ function getThemeStyle(theme) {
|
|
|
3772
3808
|
tooltipFillColor: '#212529',
|
|
3773
3809
|
zoomFillColor: '#6C757D',
|
|
3774
3810
|
fontFamily: 'Helvetica Neue',
|
|
3811
|
+
fontSize: '12px',
|
|
3812
|
+
fontWeight: 'Medium',
|
|
3775
3813
|
titleFontSize: '14px',
|
|
3776
3814
|
legendFontSize: '12px',
|
|
3777
3815
|
tooltipFillOpacity: 1,
|
|
@@ -3779,7 +3817,10 @@ function getThemeStyle(theme) {
|
|
|
3779
3817
|
labelFontFamily: 'Helvetica Neue',
|
|
3780
3818
|
titleFontWeight: 'normal',
|
|
3781
3819
|
zoomSelectionColor: '#343A40',
|
|
3782
|
-
shapeFill: '#E9ECEF'
|
|
3820
|
+
shapeFill: '#E9ECEF',
|
|
3821
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3822
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3823
|
+
rectangleZoomBorderColor: "#009900"
|
|
3783
3824
|
};
|
|
3784
3825
|
break;
|
|
3785
3826
|
case 'bootstrap5dark':
|
|
@@ -3795,6 +3836,8 @@ function getThemeStyle(theme) {
|
|
|
3795
3836
|
tooltipFillColor: '#E9ECEF',
|
|
3796
3837
|
zoomFillColor: '#B5BABE',
|
|
3797
3838
|
fontFamily: 'Helvetica Neue',
|
|
3839
|
+
fontSize: '12px',
|
|
3840
|
+
fontWeight: 'Medium',
|
|
3798
3841
|
titleFontSize: '14px',
|
|
3799
3842
|
legendFontSize: '12px',
|
|
3800
3843
|
tooltipFillOpacity: 1,
|
|
@@ -3802,7 +3845,10 @@ function getThemeStyle(theme) {
|
|
|
3802
3845
|
labelFontFamily: 'Helvetica Neue',
|
|
3803
3846
|
titleFontWeight: 'normal',
|
|
3804
3847
|
zoomSelectionColor: '#DEE2E6',
|
|
3805
|
-
shapeFill: '#495057'
|
|
3848
|
+
shapeFill: '#495057',
|
|
3849
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3850
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3851
|
+
rectangleZoomBorderColor: "#009900"
|
|
3806
3852
|
};
|
|
3807
3853
|
break;
|
|
3808
3854
|
case 'fluent':
|
|
@@ -3818,6 +3864,8 @@ function getThemeStyle(theme) {
|
|
|
3818
3864
|
tooltipFillColor: '#FFFFFF',
|
|
3819
3865
|
zoomFillColor: '#A19F9D',
|
|
3820
3866
|
fontFamily: 'Segoe UI',
|
|
3867
|
+
fontSize: '12px',
|
|
3868
|
+
fontWeight: 'Medium',
|
|
3821
3869
|
titleFontSize: '14px',
|
|
3822
3870
|
legendFontSize: '12px',
|
|
3823
3871
|
tooltipFillOpacity: 1,
|
|
@@ -3825,7 +3873,10 @@ function getThemeStyle(theme) {
|
|
|
3825
3873
|
labelFontFamily: 'Segoe UI',
|
|
3826
3874
|
titleFontWeight: '600',
|
|
3827
3875
|
zoomSelectionColor: '#323130',
|
|
3828
|
-
shapeFill: '#F3F2F1'
|
|
3876
|
+
shapeFill: '#F3F2F1',
|
|
3877
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3878
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3879
|
+
rectangleZoomBorderColor: "#009900"
|
|
3829
3880
|
};
|
|
3830
3881
|
break;
|
|
3831
3882
|
case 'fluentdark':
|
|
@@ -3841,6 +3892,8 @@ function getThemeStyle(theme) {
|
|
|
3841
3892
|
tooltipFillColor: '#252423',
|
|
3842
3893
|
zoomFillColor: '#484644',
|
|
3843
3894
|
fontFamily: 'Segoe UI',
|
|
3895
|
+
fontSize: '12px',
|
|
3896
|
+
fontWeight: 'Medium',
|
|
3844
3897
|
titleFontSize: '14px',
|
|
3845
3898
|
legendFontSize: '12px',
|
|
3846
3899
|
tooltipFillOpacity: 1,
|
|
@@ -3848,7 +3901,68 @@ function getThemeStyle(theme) {
|
|
|
3848
3901
|
labelFontFamily: 'Segoe UI',
|
|
3849
3902
|
titleFontWeight: '600',
|
|
3850
3903
|
zoomSelectionColor: '#F3F2F1',
|
|
3851
|
-
shapeFill: '#252423'
|
|
3904
|
+
shapeFill: '#252423',
|
|
3905
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3906
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3907
|
+
rectangleZoomBorderColor: "#009900"
|
|
3908
|
+
};
|
|
3909
|
+
break;
|
|
3910
|
+
case 'material3':
|
|
3911
|
+
style = {
|
|
3912
|
+
backgroundColor: 'transparent',
|
|
3913
|
+
areaBackgroundColor: 'transparent',
|
|
3914
|
+
titleFontColor: '#1C1B1F',
|
|
3915
|
+
subTitleFontColor: '#1C1B1F',
|
|
3916
|
+
legendTitleFontColor: '#1C1B1F',
|
|
3917
|
+
legendTextColor: '#49454E',
|
|
3918
|
+
dataLabelFontColor: '#1C1B1F',
|
|
3919
|
+
tooltipFontColor: '#F4EFF4',
|
|
3920
|
+
tooltipFillColor: '#313033',
|
|
3921
|
+
zoomFillColor: '#49454E',
|
|
3922
|
+
fontFamily: 'Roboto',
|
|
3923
|
+
fontSize: '14px',
|
|
3924
|
+
titleFontSize: '16px',
|
|
3925
|
+
subTitleFontSize: '14px',
|
|
3926
|
+
legendFontSize: '12px',
|
|
3927
|
+
tooltipFillOpacity: 1,
|
|
3928
|
+
tooltipTextOpacity: 1,
|
|
3929
|
+
labelFontFamily: 'Roboto',
|
|
3930
|
+
titleFontWeight: '500',
|
|
3931
|
+
fontWeight: '400',
|
|
3932
|
+
zoomSelectionColor: '#49454E',
|
|
3933
|
+
shapeFill: '#E7E0EC',
|
|
3934
|
+
rectangleZoomFillColor: '#6750A4',
|
|
3935
|
+
rectangleZoomFillOpacity: 0.24,
|
|
3936
|
+
rectangleZoomBorderColor: "#6750A4"
|
|
3937
|
+
};
|
|
3938
|
+
break;
|
|
3939
|
+
case 'material3dark':
|
|
3940
|
+
style = {
|
|
3941
|
+
backgroundColor: 'transparent',
|
|
3942
|
+
areaBackgroundColor: 'transparent',
|
|
3943
|
+
titleFontColor: '#E6E1E5',
|
|
3944
|
+
subTitleFontColor: '#E6E1E5',
|
|
3945
|
+
legendTitleFontColor: '#E6E1E5',
|
|
3946
|
+
legendTextColor: '#CAC4D0',
|
|
3947
|
+
dataLabelFontColor: '#E6E1E5',
|
|
3948
|
+
tooltipFontColor: '#313033',
|
|
3949
|
+
tooltipFillColor: '#E6E1E5',
|
|
3950
|
+
zoomFillColor: '#E6E1E5',
|
|
3951
|
+
fontFamily: 'Roboto',
|
|
3952
|
+
fontSize: '14px',
|
|
3953
|
+
titleFontSize: '16px',
|
|
3954
|
+
subTitleFontSize: '14px',
|
|
3955
|
+
legendFontSize: '12px',
|
|
3956
|
+
tooltipFillOpacity: 1,
|
|
3957
|
+
tooltipTextOpacity: 1,
|
|
3958
|
+
labelFontFamily: 'Roboto',
|
|
3959
|
+
titleFontWeight: '500',
|
|
3960
|
+
fontWeight: '400',
|
|
3961
|
+
zoomSelectionColor: '#E6E1E5',
|
|
3962
|
+
shapeFill: '#49454F',
|
|
3963
|
+
rectangleZoomFillColor: '#D0BCFF',
|
|
3964
|
+
rectangleZoomFillOpacity: 0.24,
|
|
3965
|
+
rectangleZoomBorderColor: "#D0BCFF"
|
|
3852
3966
|
};
|
|
3853
3967
|
break;
|
|
3854
3968
|
default:
|
|
@@ -3866,9 +3980,14 @@ function getThemeStyle(theme) {
|
|
|
3866
3980
|
zoomFillColor: '#737373',
|
|
3867
3981
|
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
3868
3982
|
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
3983
|
+
fontSize: '12px',
|
|
3984
|
+
fontWeight: 'Medium',
|
|
3869
3985
|
titleFontWeight: 'Medium',
|
|
3870
3986
|
zoomSelectionColor: '#e61576',
|
|
3871
|
-
shapeFill: '#A6A6A6'
|
|
3987
|
+
shapeFill: '#A6A6A6',
|
|
3988
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
3989
|
+
rectangleZoomFillOpacity: 0.5,
|
|
3990
|
+
rectangleZoomBorderColor: "#009900"
|
|
3872
3991
|
};
|
|
3873
3992
|
break;
|
|
3874
3993
|
}
|
|
@@ -4102,7 +4221,7 @@ __decorate$1([
|
|
|
4102
4221
|
Complex({ color: 'transparent', width: 1 }, Border)
|
|
4103
4222
|
], TooltipSettings.prototype, "border", void 0);
|
|
4104
4223
|
__decorate$1([
|
|
4105
|
-
Complex(
|
|
4224
|
+
Complex({ fontFamily: null, size: null, fontWeight: null }, Font)
|
|
4106
4225
|
], TooltipSettings.prototype, "textStyle", void 0);
|
|
4107
4226
|
__decorate$1([
|
|
4108
4227
|
Property(null)
|
|
@@ -4531,7 +4650,7 @@ __decorate$1([
|
|
|
4531
4650
|
Property('')
|
|
4532
4651
|
], LegendSettings.prototype, "height", void 0);
|
|
4533
4652
|
__decorate$1([
|
|
4534
|
-
Complex({ fontFamily: null }, Font)
|
|
4653
|
+
Complex({ fontFamily: null, fontWeight: null }, Font)
|
|
4535
4654
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
4536
4655
|
__decorate$1([
|
|
4537
4656
|
Property(15)
|
|
@@ -4552,7 +4671,7 @@ __decorate$1([
|
|
|
4552
4671
|
Complex({}, CommonTitleSettings)
|
|
4553
4672
|
], LegendSettings.prototype, "title", void 0);
|
|
4554
4673
|
__decorate$1([
|
|
4555
|
-
Complex({ size:
|
|
4674
|
+
Complex({ size: null, color: Theme.legendTitleFont.color, fontStyle: Theme.legendTitleFont.fontStyle, fontWeight: null, fontFamily: null }, Font)
|
|
4556
4675
|
], LegendSettings.prototype, "titleStyle", void 0);
|
|
4557
4676
|
__decorate$1([
|
|
4558
4677
|
Property('Bottom')
|
|
@@ -4611,7 +4730,7 @@ __decorate$1([
|
|
|
4611
4730
|
Property(5)
|
|
4612
4731
|
], DataLabelSettings.prototype, "ry", void 0);
|
|
4613
4732
|
__decorate$1([
|
|
4614
|
-
Complex({}, Font)
|
|
4733
|
+
Complex({ fontWeight: null }, Font)
|
|
4615
4734
|
], DataLabelSettings.prototype, "textStyle", void 0);
|
|
4616
4735
|
__decorate$1([
|
|
4617
4736
|
Property('')
|
|
@@ -5841,7 +5960,7 @@ class LayerPanel {
|
|
|
5841
5960
|
this.horizontalPan = false;
|
|
5842
5961
|
this.horizontalPanXCount = 0;
|
|
5843
5962
|
this.mapObject = map;
|
|
5844
|
-
this.ajaxModule = new
|
|
5963
|
+
this.ajaxModule = new Fetch();
|
|
5845
5964
|
this.ajaxResponse = [];
|
|
5846
5965
|
}
|
|
5847
5966
|
measureLayerPanel() {
|
|
@@ -6078,14 +6197,13 @@ class LayerPanel {
|
|
|
6078
6197
|
const bing = new BingMap(this.mapObject);
|
|
6079
6198
|
const bingType = layer.bingMapType === 'AerialWithLabel' ? 'AerialWithLabelsOnDemand' : layer.bingMapType;
|
|
6080
6199
|
const url = 'https://dev.virtualearth.net/REST/V1/Imagery/Metadata/' + bingType;
|
|
6081
|
-
const ajax = new
|
|
6200
|
+
const ajax = new Fetch({
|
|
6082
6201
|
url: url + '?output=json&include=ImageryProviders&urischeme=https&key=' + layer.key
|
|
6083
6202
|
});
|
|
6203
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6084
6204
|
ajax.onSuccess = (json) => {
|
|
6085
6205
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6086
|
-
const
|
|
6087
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6088
|
-
const resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
6206
|
+
const resource = json['resourceSets'][0]['resources'][0];
|
|
6089
6207
|
const imageUrl = resource['imageUrl'];
|
|
6090
6208
|
const subDomains = resource['imageUrlSubdomains'];
|
|
6091
6209
|
const maxZoom = resource['zoomMax'];
|
|
@@ -7094,6 +7212,7 @@ class LayerPanel {
|
|
|
7094
7212
|
imgElement.setAttribute('width', '256px');
|
|
7095
7213
|
imgElement.setAttribute('src', tile.src);
|
|
7096
7214
|
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
7215
|
+
imgElement.style.setProperty('user-select', 'none');
|
|
7097
7216
|
child.appendChild(imgElement);
|
|
7098
7217
|
animateElement.appendChild(child);
|
|
7099
7218
|
}
|
|
@@ -7103,6 +7222,7 @@ class LayerPanel {
|
|
|
7103
7222
|
imgElement.setAttribute('height', '256px');
|
|
7104
7223
|
imgElement.setAttribute('width', '256px');
|
|
7105
7224
|
imgElement.setAttribute('src', tile.src);
|
|
7225
|
+
imgElement.style.setProperty('user-select', 'none');
|
|
7106
7226
|
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
7107
7227
|
const child = createElement('div', { id: mapId + '_tile_' + id });
|
|
7108
7228
|
child.style.position = 'absolute';
|
|
@@ -7715,11 +7835,11 @@ let Maps = class Maps extends Component {
|
|
|
7715
7835
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7716
7836
|
processAjaxRequest(layer, localAjax, type) {
|
|
7717
7837
|
this.serverProcess['request']++;
|
|
7718
|
-
const
|
|
7719
|
-
|
|
7720
|
-
this.processResponseJsonData('
|
|
7838
|
+
const fetchApiModule = new Fetch(localAjax.dataOptions, localAjax.type, localAjax.contentType);
|
|
7839
|
+
fetchApiModule.onSuccess = (args) => {
|
|
7840
|
+
this.processResponseJsonData('Fetch', args, layer, type);
|
|
7721
7841
|
};
|
|
7722
|
-
|
|
7842
|
+
fetchApiModule.send(localAjax.sendData);
|
|
7723
7843
|
}
|
|
7724
7844
|
/**
|
|
7725
7845
|
* This method is used to process the JSON data to render the maps.
|
|
@@ -7735,10 +7855,10 @@ let Maps = class Maps extends Component {
|
|
|
7735
7855
|
this.serverProcess['response']++;
|
|
7736
7856
|
if (processType) {
|
|
7737
7857
|
if (dataType === 'ShapeData') {
|
|
7738
|
-
layer.shapeData = (processType === 'DataManager') ? processResult(data) :
|
|
7858
|
+
layer.shapeData = (processType === 'DataManager') ? processResult(data) : data;
|
|
7739
7859
|
}
|
|
7740
7860
|
else {
|
|
7741
|
-
layer.dataSource = (processType === 'DataManager') ? processResult(data) :
|
|
7861
|
+
layer.dataSource = (processType === 'DataManager') ? processResult(data) : data;
|
|
7742
7862
|
}
|
|
7743
7863
|
}
|
|
7744
7864
|
if (!isNullOrUndefined(processType) && this.serverProcess['request'] === this.serverProcess['response']) {
|
|
@@ -7970,8 +8090,8 @@ let Maps = class Maps extends Component {
|
|
|
7970
8090
|
let element = getElementByID(this.element.id + '_Secondary_Element');
|
|
7971
8091
|
let rect = this.element.getBoundingClientRect();
|
|
7972
8092
|
let svgRect = getElementByID(this.element.id + '_svg').getBoundingClientRect();
|
|
7973
|
-
element.style.
|
|
7974
|
-
element.style.
|
|
8093
|
+
element.style.left = Math.max(svgRect.left - rect.left, 0) + 'px';
|
|
8094
|
+
element.style.top = Math.max(svgRect.top - rect.top, 0) + 'px';
|
|
7975
8095
|
}
|
|
7976
8096
|
zoomingChange() {
|
|
7977
8097
|
let left;
|
|
@@ -8193,8 +8313,8 @@ let Maps = class Maps extends Component {
|
|
|
8193
8313
|
let height;
|
|
8194
8314
|
const width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
|
|
8195
8315
|
style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
|
|
8196
|
-
style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
|
|
8197
|
-
style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
|
|
8316
|
+
style.fontWeight = type === 'title' ? style.fontWeight || this.themeStyle.titleFontWeight : style.fontWeight || this.themeStyle.titleFontWeight;
|
|
8317
|
+
style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || this.themeStyle.subTitleFontSize || Theme.mapsSubTitleFont.size);
|
|
8198
8318
|
if (title.text) {
|
|
8199
8319
|
if (isNullOrUndefined(groupEle)) {
|
|
8200
8320
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -8919,7 +9039,7 @@ let Maps = class Maps extends Component {
|
|
|
8919
9039
|
* @param e - Specifies the arguments of window resize event.
|
|
8920
9040
|
*/
|
|
8921
9041
|
mapsOnResize(e) {
|
|
8922
|
-
if (!this.isDestroyed) {
|
|
9042
|
+
if (!this.isDestroyed && !this.isExportInitialTileMap) {
|
|
8923
9043
|
this.isResize = this.isReset = true;
|
|
8924
9044
|
const args = {
|
|
8925
9045
|
cancel: false,
|
|
@@ -9654,17 +9774,15 @@ let Maps = class Maps extends Component {
|
|
|
9654
9774
|
let promise;
|
|
9655
9775
|
if (!this.isDestroyed) {
|
|
9656
9776
|
promise = new Promise((resolve, reject) => {
|
|
9657
|
-
const
|
|
9777
|
+
const fetchApi = new Fetch({
|
|
9658
9778
|
url: url
|
|
9659
9779
|
});
|
|
9660
|
-
|
|
9661
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9662
|
-
const jsonObject = JSON.parse(json);
|
|
9780
|
+
fetchApi.onSuccess = (json) => {
|
|
9663
9781
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9664
|
-
const resource =
|
|
9782
|
+
const resource = json['resourceSets'][0]['resources'][0];
|
|
9665
9783
|
resolve(resource['imageUrl']);
|
|
9666
9784
|
};
|
|
9667
|
-
|
|
9785
|
+
fetchApi.send();
|
|
9668
9786
|
});
|
|
9669
9787
|
}
|
|
9670
9788
|
return promise;
|
|
@@ -10330,6 +10448,7 @@ class DataLabel {
|
|
|
10330
10448
|
let locationX;
|
|
10331
10449
|
let locationY;
|
|
10332
10450
|
style.fontFamily = this.maps.theme.toLowerCase() !== 'material' ? this.maps.themeStyle.labelFontFamily : style.fontFamily;
|
|
10451
|
+
style.fontWeight = style.fontWeight || this.maps.themeStyle.fontWeight || Theme.dataLabelFont.fontWeight;
|
|
10333
10452
|
shape = shapes['property'];
|
|
10334
10453
|
const properties = (Object.prototype.toString.call(layer.shapePropertyPath) === '[object Array]' ?
|
|
10335
10454
|
layer.shapePropertyPath : [layer.shapePropertyPath]);
|
|
@@ -11316,6 +11435,7 @@ class Legend {
|
|
|
11316
11435
|
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily :
|
|
11317
11436
|
this.maps.themeStyle.fontFamily;
|
|
11318
11437
|
legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
|
|
11438
|
+
legendTextStyle.fontWeight = legendTextStyle.fontWeight || map.themeStyle.fontWeight;
|
|
11319
11439
|
if (i === 0) {
|
|
11320
11440
|
this.renderLegendBorder();
|
|
11321
11441
|
}
|
|
@@ -12084,6 +12204,8 @@ class Legend {
|
|
|
12084
12204
|
if (legendTitle) {
|
|
12085
12205
|
textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
|
|
12086
12206
|
textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
12207
|
+
textStyle.size = !isNullOrUndefined(textStyle.size) ? textStyle.size : this.maps.themeStyle.subTitleFontSize || Theme.legendTitleFont.size;
|
|
12208
|
+
textStyle.fontWeight = !isNullOrUndefined(textStyle.fontWeight) ? textStyle.fontWeight : this.maps.themeStyle.titleFontWeight || Theme.legendTitleFont.fontWeight;
|
|
12087
12209
|
textOptions = new TextOption(map.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - spacing / 2, 'middle', trimTitle, '');
|
|
12088
12210
|
renderTextElement(textOptions, textStyle, textStyle.color, this.legendGroup);
|
|
12089
12211
|
}
|
|
@@ -13690,7 +13812,7 @@ class MapsTooltip {
|
|
|
13690
13812
|
currentData = this.formatter(marker$$1.tooltipSettings.format, marker$$1.dataSource[dataIndex]);
|
|
13691
13813
|
}
|
|
13692
13814
|
else {
|
|
13693
|
-
if (marker$$1.template && !marker$$1.tooltipSettings.valuePath) {
|
|
13815
|
+
if (typeof marker$$1.template !== 'function' && marker$$1.template && !marker$$1.tooltipSettings.valuePath) {
|
|
13694
13816
|
currentData = marker$$1.template.split('>')[1].split('<')[0];
|
|
13695
13817
|
}
|
|
13696
13818
|
else {
|
|
@@ -13733,7 +13855,7 @@ class MapsTooltip {
|
|
|
13733
13855
|
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
13734
13856
|
document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
13735
13857
|
}
|
|
13736
|
-
if (option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
13858
|
+
if (typeof option.template !== 'function' && option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
13737
13859
|
option.template = option.template[Object.keys(option.template)[0]];
|
|
13738
13860
|
}
|
|
13739
13861
|
templateData = this.setTooltipContent(option, templateData);
|
|
@@ -13758,10 +13880,14 @@ class MapsTooltip {
|
|
|
13758
13880
|
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
13759
13881
|
(targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
|
|
13760
13882
|
this.maps['isProtectedOnChange'] = true;
|
|
13883
|
+
tooltipArgs.options['textStyle']['size'] = tooltipArgs.options['textStyle']['size']
|
|
13884
|
+
|| this.maps.themeStyle.fontSize;
|
|
13761
13885
|
tooltipArgs.options['textStyle']['color'] = tooltipArgs.options['textStyle']['color']
|
|
13762
13886
|
|| this.maps.themeStyle.tooltipFontColor;
|
|
13763
13887
|
tooltipArgs.options['textStyle']['fontFamily'] = tooltipArgs.options['textStyle']['fontFamily']
|
|
13764
13888
|
|| this.maps.themeStyle.fontFamily;
|
|
13889
|
+
tooltipArgs.options['textStyle']['fontWeight'] = tooltipArgs.options['textStyle']['fontWeight']
|
|
13890
|
+
|| this.maps.themeStyle.fontWeight;
|
|
13765
13891
|
tooltipArgs.options['textStyle']['opacity'] = tooltipArgs.options['textStyle']['opacity']
|
|
13766
13892
|
|| this.maps.themeStyle.tooltipTextOpacity;
|
|
13767
13893
|
if (tooltipArgs.cancel) {
|
|
@@ -14038,93 +14164,103 @@ class Zoom {
|
|
|
14038
14164
|
const scale = map.previousScale = map.scale;
|
|
14039
14165
|
const maxZoom = map.zoomSettings.maxZoom;
|
|
14040
14166
|
const minZoom = map.zoomSettings.minZoom;
|
|
14041
|
-
newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
|
|
14042
14167
|
newZoomFactor = maxZoom >= newZoomFactor ? newZoomFactor : maxZoom;
|
|
14043
|
-
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14168
|
+
let isToolbarPerform = true;
|
|
14169
|
+
switch (type.toLowerCase()) {
|
|
14170
|
+
case 'zoomin':
|
|
14171
|
+
isToolbarPerform = newZoomFactor <= this.maps.zoomSettings.maxZoom;
|
|
14172
|
+
break;
|
|
14173
|
+
case 'zoomout':
|
|
14174
|
+
isToolbarPerform = newZoomFactor >= this.maps.zoomSettings.minZoom;
|
|
14175
|
+
break;
|
|
14176
|
+
}
|
|
14177
|
+
if (isToolbarPerform) {
|
|
14178
|
+
const prevTilePoint = map.tileTranslatePoint;
|
|
14179
|
+
if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
14180
|
+
|| map.isReset)) {
|
|
14181
|
+
const availSize = map.mapAreaRect;
|
|
14182
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14183
|
+
const minBounds = map.baseMapRectBounds['min'];
|
|
14184
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14185
|
+
const maxBounds = map.baseMapRectBounds['max'];
|
|
14186
|
+
let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
14187
|
+
let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
14188
|
+
let translatePointX;
|
|
14189
|
+
let translatePointY;
|
|
14190
|
+
if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
14191
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
14192
|
+
mapTotalWidth = availSize.width / 2;
|
|
14193
|
+
mapTotalHeight = availSize.height;
|
|
14194
|
+
}
|
|
14195
|
+
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
14196
|
+
newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
|
|
14197
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
14198
|
+
}
|
|
14199
|
+
else {
|
|
14200
|
+
const point = map.translatePoint;
|
|
14201
|
+
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
14202
|
+
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
14203
|
+
const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
14204
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
14205
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
14206
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14207
|
+
}
|
|
14208
|
+
map.scale = newZoomFactor;
|
|
14209
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14210
|
+
map.translatePoint = map.previousPoint;
|
|
14211
|
+
map.scale = map.mapScaleValue = map.previousScale;
|
|
14212
|
+
}
|
|
14213
|
+
else {
|
|
14214
|
+
this.applyTransform(map);
|
|
14059
14215
|
}
|
|
14060
|
-
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
14061
|
-
newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
|
|
14062
|
-
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
14063
|
-
}
|
|
14064
|
-
else {
|
|
14065
|
-
const point = map.translatePoint;
|
|
14066
|
-
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
14067
|
-
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
14068
|
-
const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
14069
|
-
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
14070
|
-
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
14071
|
-
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14072
|
-
}
|
|
14073
|
-
map.scale = newZoomFactor;
|
|
14074
|
-
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14075
|
-
map.translatePoint = map.previousPoint;
|
|
14076
|
-
map.scale = map.mapScaleValue = map.previousScale;
|
|
14077
14216
|
}
|
|
14078
|
-
else {
|
|
14079
|
-
this.
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
|
|
14083
|
-
this.getTileTranslatePosition(prevLevel, newZoomFactor, position, type);
|
|
14084
|
-
map.tileZoomLevel = newZoomFactor;
|
|
14085
|
-
map.zoomSettings.zoomFactor = newZoomFactor;
|
|
14086
|
-
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
14087
|
-
if (type === 'ZoomOut' && map.zoomSettings.resetToInitial && map.applyZoomReset && newZoomFactor <= map.initialZoomLevel) {
|
|
14088
|
-
map.initialCheck = true;
|
|
14089
|
-
map.zoomPersistence = false;
|
|
14090
|
-
map.tileTranslatePoint.x = map.initialTileTranslate.x;
|
|
14091
|
-
map.tileTranslatePoint.y = map.initialTileTranslate.y;
|
|
14092
|
-
newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
14217
|
+
else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
|
|
14218
|
+
this.getTileTranslatePosition(prevLevel, newZoomFactor, position, type);
|
|
14219
|
+
map.tileZoomLevel = newZoomFactor;
|
|
14220
|
+
map.zoomSettings.zoomFactor = newZoomFactor;
|
|
14093
14221
|
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
14094
|
-
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14101
|
-
|
|
14102
|
-
|
|
14103
|
-
|
|
14104
|
-
if (
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
|
|
14108
|
-
|
|
14109
|
-
}
|
|
14110
|
-
|
|
14111
|
-
|
|
14112
|
-
|
|
14113
|
-
|
|
14114
|
-
setTimeout(() => {
|
|
14115
|
-
// if (type === 'ZoomOut') {
|
|
14116
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
14117
|
-
// if (element1.childElementCount) {
|
|
14118
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
14119
|
-
// } else {
|
|
14120
|
-
// element1 = element1;
|
|
14121
|
-
// }
|
|
14122
|
-
// }
|
|
14123
|
-
this.applyTransform(this.maps);
|
|
14222
|
+
if (type === 'ZoomOut' && map.zoomSettings.resetToInitial && map.applyZoomReset && newZoomFactor <= map.initialZoomLevel) {
|
|
14223
|
+
map.initialCheck = true;
|
|
14224
|
+
map.zoomPersistence = false;
|
|
14225
|
+
map.tileTranslatePoint.x = map.initialTileTranslate.x;
|
|
14226
|
+
map.tileTranslatePoint.y = map.initialTileTranslate.y;
|
|
14227
|
+
newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
14228
|
+
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
14229
|
+
}
|
|
14230
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14231
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14232
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14233
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
14234
|
+
map.scale = map.previousScale;
|
|
14235
|
+
map.tileZoomLevel = prevLevel;
|
|
14236
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
14237
|
+
}
|
|
14238
|
+
else {
|
|
14239
|
+
if (document.querySelector('.GroupElement')) {
|
|
14240
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
14241
|
+
}
|
|
14124
14242
|
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
14125
|
-
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = '
|
|
14243
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
14126
14244
|
}
|
|
14127
|
-
|
|
14245
|
+
this.markerLineAnimation(map);
|
|
14246
|
+
map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
|
|
14247
|
+
const element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
14248
|
+
const animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
14249
|
+
setTimeout(() => {
|
|
14250
|
+
// if (type === 'ZoomOut') {
|
|
14251
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
14252
|
+
// if (element1.childElementCount) {
|
|
14253
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
14254
|
+
// } else {
|
|
14255
|
+
// element1 = element1;
|
|
14256
|
+
// }
|
|
14257
|
+
// }
|
|
14258
|
+
this.applyTransform(this.maps);
|
|
14259
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
14260
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
14261
|
+
}
|
|
14262
|
+
}, animationDuration);
|
|
14263
|
+
}
|
|
14128
14264
|
}
|
|
14129
14265
|
}
|
|
14130
14266
|
this.maps.zoomNotApplied = false;
|
|
@@ -14339,7 +14475,7 @@ class Zoom {
|
|
|
14339
14475
|
const down = this.mouseDownPoints;
|
|
14340
14476
|
const move = this.mouseMovePoints;
|
|
14341
14477
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14342
|
-
const border = { width: 1, color:
|
|
14478
|
+
const border = { width: 1, color: this.maps.themeStyle.rectangleZoomBorderColor };
|
|
14343
14479
|
const width = Math.abs(move.x - down.x);
|
|
14344
14480
|
const height = Math.abs(move.y - down.y);
|
|
14345
14481
|
const x = ((move.x > down.x) ? down.x : down.x - width);
|
|
@@ -14354,7 +14490,7 @@ class Zoom {
|
|
|
14354
14490
|
height: map.availableSize.height,
|
|
14355
14491
|
style: 'position: absolute;'
|
|
14356
14492
|
});
|
|
14357
|
-
const rectOption = new RectOption(map.element.id + '_ZoomRect',
|
|
14493
|
+
const rectOption = new RectOption(map.element.id + '_ZoomRect', this.maps.themeStyle.rectangleZoomFillColor, border, this.maps.themeStyle.rectangleZoomFillOpacity, this.zoomingRect, 0, 0, '', '3');
|
|
14358
14494
|
rectSVGObject.appendChild(map.renderer.drawRectangle(rectOption));
|
|
14359
14495
|
getElementByID(map.element.id + '_Secondary_Element').appendChild(rectSVGObject);
|
|
14360
14496
|
}
|
|
@@ -14739,6 +14875,7 @@ class Zoom {
|
|
|
14739
14875
|
zoomtextSize = measureText(zoomtext, style);
|
|
14740
14876
|
const start = labelY - zoomtextSize['height'] / 4;
|
|
14741
14877
|
const end = labelY + zoomtextSize['height'] / 4;
|
|
14878
|
+
labelY = end;
|
|
14742
14879
|
const xpositionEnds = labelX + zoomtextSize['width'] / 2;
|
|
14743
14880
|
const xpositionStart = labelX - zoomtextSize['width'] / 2;
|
|
14744
14881
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -15285,11 +15422,23 @@ class Zoom {
|
|
|
15285
15422
|
e.stopImmediatePropagation();
|
|
15286
15423
|
const isTouch = e.pointerType === 'touch' || e.pointerType === '2' || (e.type.indexOf('touch') > -1);
|
|
15287
15424
|
const toolbar = target.id.split('_Zooming_ToolBar_')[1].split('_')[0];
|
|
15288
|
-
|
|
15425
|
+
let isToolbarPerform = true;
|
|
15426
|
+
switch (toolbar.toLowerCase()) {
|
|
15427
|
+
case 'zoomin':
|
|
15428
|
+
isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) + 1 <= this.maps.zoomSettings.maxZoom;
|
|
15429
|
+
break;
|
|
15430
|
+
case 'zoomout':
|
|
15431
|
+
isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) - 1 >= this.maps.zoomSettings.minZoom;
|
|
15432
|
+
break;
|
|
15433
|
+
case 'reset':
|
|
15434
|
+
isToolbarPerform = Math.round(this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) != this.maps.zoomSettings.minZoom;
|
|
15435
|
+
break;
|
|
15436
|
+
}
|
|
15437
|
+
if (isTouch && isToolbarPerform) {
|
|
15289
15438
|
this.handled = true;
|
|
15290
15439
|
this.performZoomingByToolBar(toolbar);
|
|
15291
15440
|
}
|
|
15292
|
-
else if ((e.type === 'mousedown' || e.type === 'pointerdown') && !this.handled) {
|
|
15441
|
+
else if ((e.type === 'mousedown' || e.type === 'pointerdown') && !this.handled && isToolbarPerform) {
|
|
15293
15442
|
this.handled = false;
|
|
15294
15443
|
this.performZoomingByToolBar(toolbar);
|
|
15295
15444
|
}
|
|
@@ -15374,7 +15523,7 @@ class Zoom {
|
|
|
15374
15523
|
map.markerCenterLatitude = null;
|
|
15375
15524
|
map.markerCenterLongitude = null;
|
|
15376
15525
|
this.isZoomSelection = false;
|
|
15377
|
-
this.isPan =
|
|
15526
|
+
this.isPan = map.zoomSettings.enablePanning;
|
|
15378
15527
|
this.toolBarZooming(map.zoomSettings.minZoom, 'Reset');
|
|
15379
15528
|
if ((this.isPan && !this.isZoomSelection) || (!this.isPan && this.isZoomSelection)) {
|
|
15380
15529
|
if (!this.maps.zoomSettings.enablePanning) {
|
|
@@ -16033,6 +16182,19 @@ class Print {
|
|
|
16033
16182
|
getHTMLContent(maps, elements) {
|
|
16034
16183
|
const div = createElement('div');
|
|
16035
16184
|
const divElement = maps.element.cloneNode(true);
|
|
16185
|
+
let backgroundElement = (!maps.isTileMap ? divElement.getElementsByTagName('svg')[0] : divElement.getElementsByTagName('svg')[1]);
|
|
16186
|
+
if (!isNullOrUndefined(backgroundElement)) {
|
|
16187
|
+
backgroundElement = backgroundElement.childNodes[0];
|
|
16188
|
+
if (!isNullOrUndefined(backgroundElement)) {
|
|
16189
|
+
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
16190
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
16191
|
+
backgroundElement.setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
16192
|
+
}
|
|
16193
|
+
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
16194
|
+
backgroundElement.setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
16195
|
+
}
|
|
16196
|
+
}
|
|
16197
|
+
}
|
|
16036
16198
|
if (maps.isTileMap) {
|
|
16037
16199
|
for (let i = 0; i < divElement.childElementCount; i++) {
|
|
16038
16200
|
if (divElement.children[i].id === maps.element.id + '_tile_parent') {
|
|
@@ -16127,10 +16289,18 @@ class ImageExport {
|
|
|
16127
16289
|
const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
16128
16290
|
let svgDataElement;
|
|
16129
16291
|
let tileSvg;
|
|
16130
|
-
|
|
16292
|
+
let svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
|
|
16293
|
+
const backgroundElement = svgObject.childNodes[0];
|
|
16294
|
+
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
16295
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
16296
|
+
svgObject.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
16297
|
+
}
|
|
16298
|
+
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
16299
|
+
svgObject.childNodes[0].setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
16300
|
+
}
|
|
16131
16301
|
if (!maps.isTileMap) {
|
|
16132
16302
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
16133
|
-
|
|
16303
|
+
svgObject.outerHTML + '</svg>';
|
|
16134
16304
|
}
|
|
16135
16305
|
else {
|
|
16136
16306
|
tileSvg = getElementByID(maps.element.id + '_Tile_SVG').cloneNode(true);
|
|
@@ -16169,6 +16339,7 @@ class ImageExport {
|
|
|
16169
16339
|
image.src = url;
|
|
16170
16340
|
}
|
|
16171
16341
|
else {
|
|
16342
|
+
maps.isExportInitialTileMap = true;
|
|
16172
16343
|
const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
16173
16344
|
const top = parseFloat(svgParentElement.getAttribute('y'));
|
|
16174
16345
|
const left = parseFloat(svgParentElement.getAttribute('x'));
|
|
@@ -16178,7 +16349,9 @@ class ImageExport {
|
|
|
16178
16349
|
const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
|
|
16179
16350
|
const exportTileImg = new Image();
|
|
16180
16351
|
exportTileImg.crossOrigin = 'Anonymous';
|
|
16181
|
-
|
|
16352
|
+
let background = maps.background ? maps.background : ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) ? '#ffffff' :
|
|
16353
|
+
(maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent') ? '#000000' : '#ffffff';
|
|
16354
|
+
ctxt.fillStyle = background;
|
|
16182
16355
|
ctxt.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
16183
16356
|
ctxt.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
16184
16357
|
const titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
@@ -16208,8 +16381,10 @@ class ImageExport {
|
|
|
16208
16381
|
if (allowDownload) {
|
|
16209
16382
|
triggerDownload(fileName, type, localBase64, isDownload);
|
|
16210
16383
|
localStorage.removeItem('local-canvasImage');
|
|
16384
|
+
maps.isExportInitialTileMap = false;
|
|
16211
16385
|
}
|
|
16212
16386
|
else {
|
|
16387
|
+
maps.isExportInitialTileMap = false;
|
|
16213
16388
|
if (type === 'PNG') {
|
|
16214
16389
|
resolve(localBase64);
|
|
16215
16390
|
}
|
|
@@ -16284,6 +16459,9 @@ class PdfExport {
|
|
|
16284
16459
|
export(maps, type, fileName, allowDownload, orientation) {
|
|
16285
16460
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16286
16461
|
const promise = new Promise((resolve, reject) => {
|
|
16462
|
+
if (maps.isTileMap) {
|
|
16463
|
+
maps.isExportInitialTileMap = true;
|
|
16464
|
+
}
|
|
16287
16465
|
const canvasElement = createElement('canvas', {
|
|
16288
16466
|
id: 'ej2-canvas',
|
|
16289
16467
|
attrs: {
|
|
@@ -16297,10 +16475,12 @@ class PdfExport {
|
|
|
16297
16475
|
const exportElement = maps.svgObject.cloneNode(true);
|
|
16298
16476
|
const backgroundElement = exportElement.childNodes[0];
|
|
16299
16477
|
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
16300
|
-
if ((maps.theme === 'Tailwind' || maps.theme === '
|
|
16301
|
-
|| maps.theme === 'Fluent' || maps.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
16478
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
16302
16479
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
16303
16480
|
}
|
|
16481
|
+
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
16482
|
+
exportElement.childNodes[0].setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
16483
|
+
}
|
|
16304
16484
|
const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
|
|
16305
16485
|
[(new XMLSerializer()).serializeToString(exportElement)], { type: 'image/svg+xml' }));
|
|
16306
16486
|
const pdfDocument = new PdfDocument();
|
|
@@ -16336,7 +16516,9 @@ class PdfExport {
|
|
|
16336
16516
|
const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
|
|
16337
16517
|
const tileImg = new Image();
|
|
16338
16518
|
tileImg.crossOrigin = 'Anonymous';
|
|
16339
|
-
|
|
16519
|
+
let background = maps.background ? maps.background : ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) ? '#ffffff' :
|
|
16520
|
+
(maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent') ? '#000000' : '#ffffff';
|
|
16521
|
+
ctx.fillStyle = background;
|
|
16340
16522
|
ctx.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
16341
16523
|
ctx.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
16342
16524
|
const titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
@@ -16366,6 +16548,7 @@ class PdfExport {
|
|
|
16366
16548
|
pdfDocument.pageSettings.orientation = orientation;
|
|
16367
16549
|
x = x.slice(x.indexOf(',') + 1);
|
|
16368
16550
|
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
|
|
16551
|
+
maps.isExportInitialTileMap = false;
|
|
16369
16552
|
if (allowDownload) {
|
|
16370
16553
|
pdfDocument.save(fileName + '.pdf');
|
|
16371
16554
|
pdfDocument.destroy();
|