@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
package/src/maps/model/theme.js
CHANGED
|
@@ -191,6 +191,14 @@ export function getShapeColor(theme) {
|
|
|
191
191
|
themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
|
|
192
192
|
'#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
|
|
193
193
|
break;
|
|
194
|
+
case 'material3':
|
|
195
|
+
themePalette = ['#6200EE', '#E77A16', '#82C100', '#7107DC', '#05BB3D',
|
|
196
|
+
'#D21020', '#FAD200', '#0085FF', '#9204EA', '#08EE9B'];
|
|
197
|
+
break;
|
|
198
|
+
case 'material3dark':
|
|
199
|
+
themePalette = ['#4EAAFF', '#FA4EAB', '#FFF500', '#17EA58', '#38FFE7',
|
|
200
|
+
'#FF9E45', '#B3F32F', '#B93CE4', '#FC5664', '#9B55FF'];
|
|
201
|
+
break;
|
|
194
202
|
default:
|
|
195
203
|
themePalette = ['#B5E485', '#7BC1E8', '#DF819C', '#EC9B79', '#78D0D3',
|
|
196
204
|
'#D6D572', '#9178E3', '#A1E5B4', '#87A4B4', '#E4C16C'];
|
|
@@ -339,9 +347,14 @@ export function getThemeStyle(theme) {
|
|
|
339
347
|
zoomFillColor: '#FFFFFF',
|
|
340
348
|
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
341
349
|
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
350
|
+
fontSize: '12px',
|
|
351
|
+
fontWeight: 'Medium',
|
|
342
352
|
titleFontWeight: 'Medium',
|
|
343
353
|
zoomSelectionColor: '#e61576',
|
|
344
|
-
shapeFill: '#A6A6A6'
|
|
354
|
+
shapeFill: '#A6A6A6',
|
|
355
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
356
|
+
rectangleZoomFillOpacity: 0.5,
|
|
357
|
+
rectangleZoomBorderColor: "#009900"
|
|
345
358
|
};
|
|
346
359
|
break;
|
|
347
360
|
case 'highcontrast':
|
|
@@ -358,10 +371,15 @@ export function getThemeStyle(theme) {
|
|
|
358
371
|
tooltipFillColor: '#ffffff',
|
|
359
372
|
zoomFillColor: '#FFFFFF',
|
|
360
373
|
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
374
|
+
fontSize: '12px',
|
|
375
|
+
fontWeight: 'Medium',
|
|
361
376
|
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
362
377
|
titleFontWeight: 'Medium',
|
|
363
378
|
zoomSelectionColor: '#e61576',
|
|
364
|
-
shapeFill: '#A6A6A6'
|
|
379
|
+
shapeFill: '#A6A6A6',
|
|
380
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
381
|
+
rectangleZoomFillOpacity: 0.5,
|
|
382
|
+
rectangleZoomBorderColor: "#009900"
|
|
365
383
|
};
|
|
366
384
|
break;
|
|
367
385
|
case 'bootstrap4':
|
|
@@ -377,6 +395,8 @@ export function getThemeStyle(theme) {
|
|
|
377
395
|
tooltipFillColor: '#000000',
|
|
378
396
|
zoomFillColor: '#5B6269',
|
|
379
397
|
fontFamily: 'HelveticaNeue-Medium',
|
|
398
|
+
fontSize: '12px',
|
|
399
|
+
fontWeight: 'Medium',
|
|
380
400
|
titleFontSize: '16px',
|
|
381
401
|
legendFontSize: '14px',
|
|
382
402
|
tooltipFillOpacity: 1,
|
|
@@ -384,7 +404,10 @@ export function getThemeStyle(theme) {
|
|
|
384
404
|
labelFontFamily: 'HelveticaNeue-Medium',
|
|
385
405
|
titleFontWeight: 'Medium',
|
|
386
406
|
zoomSelectionColor: '#e61576',
|
|
387
|
-
shapeFill: '#A6A6A6'
|
|
407
|
+
shapeFill: '#A6A6A6',
|
|
408
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
409
|
+
rectangleZoomFillOpacity: 0.5,
|
|
410
|
+
rectangleZoomBorderColor: "#009900"
|
|
388
411
|
};
|
|
389
412
|
break;
|
|
390
413
|
case 'tailwind':
|
|
@@ -400,6 +423,8 @@ export function getThemeStyle(theme) {
|
|
|
400
423
|
tooltipFillColor: '#111827',
|
|
401
424
|
zoomFillColor: '#6b7280',
|
|
402
425
|
fontFamily: 'Inter',
|
|
426
|
+
fontSize: '12px',
|
|
427
|
+
fontWeight: 'Medium',
|
|
403
428
|
titleFontSize: '14px',
|
|
404
429
|
legendFontSize: '12px',
|
|
405
430
|
tooltipFillOpacity: 1,
|
|
@@ -407,7 +432,10 @@ export function getThemeStyle(theme) {
|
|
|
407
432
|
labelFontFamily: 'Inter',
|
|
408
433
|
titleFontWeight: '500',
|
|
409
434
|
zoomSelectionColor: '#374151',
|
|
410
|
-
shapeFill: '#E5E7EB'
|
|
435
|
+
shapeFill: '#E5E7EB',
|
|
436
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
437
|
+
rectangleZoomFillOpacity: 0.5,
|
|
438
|
+
rectangleZoomBorderColor: "#009900"
|
|
411
439
|
};
|
|
412
440
|
break;
|
|
413
441
|
case 'tailwinddark':
|
|
@@ -423,6 +451,8 @@ export function getThemeStyle(theme) {
|
|
|
423
451
|
tooltipFillColor: '#F9FAFB',
|
|
424
452
|
zoomFillColor: '#D1D5DB',
|
|
425
453
|
fontFamily: 'Inter',
|
|
454
|
+
fontSize: '12px',
|
|
455
|
+
fontWeight: 'Medium',
|
|
426
456
|
titleFontSize: '14px',
|
|
427
457
|
legendFontSize: '12px',
|
|
428
458
|
tooltipFillOpacity: 1,
|
|
@@ -430,7 +460,10 @@ export function getThemeStyle(theme) {
|
|
|
430
460
|
labelFontFamily: 'Inter',
|
|
431
461
|
titleFontWeight: '500',
|
|
432
462
|
zoomSelectionColor: '#F3F4F6',
|
|
433
|
-
shapeFill: '#374151'
|
|
463
|
+
shapeFill: '#374151',
|
|
464
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
465
|
+
rectangleZoomFillOpacity: 0.5,
|
|
466
|
+
rectangleZoomBorderColor: "#009900"
|
|
434
467
|
};
|
|
435
468
|
break;
|
|
436
469
|
case 'bootstrap5':
|
|
@@ -446,6 +479,8 @@ export function getThemeStyle(theme) {
|
|
|
446
479
|
tooltipFillColor: '#212529',
|
|
447
480
|
zoomFillColor: '#6C757D',
|
|
448
481
|
fontFamily: 'Helvetica Neue',
|
|
482
|
+
fontSize: '12px',
|
|
483
|
+
fontWeight: 'Medium',
|
|
449
484
|
titleFontSize: '14px',
|
|
450
485
|
legendFontSize: '12px',
|
|
451
486
|
tooltipFillOpacity: 1,
|
|
@@ -453,7 +488,10 @@ export function getThemeStyle(theme) {
|
|
|
453
488
|
labelFontFamily: 'Helvetica Neue',
|
|
454
489
|
titleFontWeight: 'normal',
|
|
455
490
|
zoomSelectionColor: '#343A40',
|
|
456
|
-
shapeFill: '#E9ECEF'
|
|
491
|
+
shapeFill: '#E9ECEF',
|
|
492
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
493
|
+
rectangleZoomFillOpacity: 0.5,
|
|
494
|
+
rectangleZoomBorderColor: "#009900"
|
|
457
495
|
};
|
|
458
496
|
break;
|
|
459
497
|
case 'bootstrap5dark':
|
|
@@ -469,6 +507,8 @@ export function getThemeStyle(theme) {
|
|
|
469
507
|
tooltipFillColor: '#E9ECEF',
|
|
470
508
|
zoomFillColor: '#B5BABE',
|
|
471
509
|
fontFamily: 'Helvetica Neue',
|
|
510
|
+
fontSize: '12px',
|
|
511
|
+
fontWeight: 'Medium',
|
|
472
512
|
titleFontSize: '14px',
|
|
473
513
|
legendFontSize: '12px',
|
|
474
514
|
tooltipFillOpacity: 1,
|
|
@@ -476,7 +516,10 @@ export function getThemeStyle(theme) {
|
|
|
476
516
|
labelFontFamily: 'Helvetica Neue',
|
|
477
517
|
titleFontWeight: 'normal',
|
|
478
518
|
zoomSelectionColor: '#DEE2E6',
|
|
479
|
-
shapeFill: '#495057'
|
|
519
|
+
shapeFill: '#495057',
|
|
520
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
521
|
+
rectangleZoomFillOpacity: 0.5,
|
|
522
|
+
rectangleZoomBorderColor: "#009900"
|
|
480
523
|
};
|
|
481
524
|
break;
|
|
482
525
|
case 'fluent':
|
|
@@ -492,6 +535,8 @@ export function getThemeStyle(theme) {
|
|
|
492
535
|
tooltipFillColor: '#FFFFFF',
|
|
493
536
|
zoomFillColor: '#A19F9D',
|
|
494
537
|
fontFamily: 'Segoe UI',
|
|
538
|
+
fontSize: '12px',
|
|
539
|
+
fontWeight: 'Medium',
|
|
495
540
|
titleFontSize: '14px',
|
|
496
541
|
legendFontSize: '12px',
|
|
497
542
|
tooltipFillOpacity: 1,
|
|
@@ -499,7 +544,10 @@ export function getThemeStyle(theme) {
|
|
|
499
544
|
labelFontFamily: 'Segoe UI',
|
|
500
545
|
titleFontWeight: '600',
|
|
501
546
|
zoomSelectionColor: '#323130',
|
|
502
|
-
shapeFill: '#F3F2F1'
|
|
547
|
+
shapeFill: '#F3F2F1',
|
|
548
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
549
|
+
rectangleZoomFillOpacity: 0.5,
|
|
550
|
+
rectangleZoomBorderColor: "#009900"
|
|
503
551
|
};
|
|
504
552
|
break;
|
|
505
553
|
case 'fluentdark':
|
|
@@ -515,6 +563,8 @@ export function getThemeStyle(theme) {
|
|
|
515
563
|
tooltipFillColor: '#252423',
|
|
516
564
|
zoomFillColor: '#484644',
|
|
517
565
|
fontFamily: 'Segoe UI',
|
|
566
|
+
fontSize: '12px',
|
|
567
|
+
fontWeight: 'Medium',
|
|
518
568
|
titleFontSize: '14px',
|
|
519
569
|
legendFontSize: '12px',
|
|
520
570
|
tooltipFillOpacity: 1,
|
|
@@ -522,7 +572,68 @@ export function getThemeStyle(theme) {
|
|
|
522
572
|
labelFontFamily: 'Segoe UI',
|
|
523
573
|
titleFontWeight: '600',
|
|
524
574
|
zoomSelectionColor: '#F3F2F1',
|
|
525
|
-
shapeFill: '#252423'
|
|
575
|
+
shapeFill: '#252423',
|
|
576
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
577
|
+
rectangleZoomFillOpacity: 0.5,
|
|
578
|
+
rectangleZoomBorderColor: "#009900"
|
|
579
|
+
};
|
|
580
|
+
break;
|
|
581
|
+
case 'material3':
|
|
582
|
+
style = {
|
|
583
|
+
backgroundColor: 'transparent',
|
|
584
|
+
areaBackgroundColor: 'transparent',
|
|
585
|
+
titleFontColor: '#1C1B1F',
|
|
586
|
+
subTitleFontColor: '#1C1B1F',
|
|
587
|
+
legendTitleFontColor: '#1C1B1F',
|
|
588
|
+
legendTextColor: '#49454E',
|
|
589
|
+
dataLabelFontColor: '#1C1B1F',
|
|
590
|
+
tooltipFontColor: '#F4EFF4',
|
|
591
|
+
tooltipFillColor: '#313033',
|
|
592
|
+
zoomFillColor: '#49454E',
|
|
593
|
+
fontFamily: 'Roboto',
|
|
594
|
+
fontSize: '14px',
|
|
595
|
+
titleFontSize: '16px',
|
|
596
|
+
subTitleFontSize: '14px',
|
|
597
|
+
legendFontSize: '12px',
|
|
598
|
+
tooltipFillOpacity: 1,
|
|
599
|
+
tooltipTextOpacity: 1,
|
|
600
|
+
labelFontFamily: 'Roboto',
|
|
601
|
+
titleFontWeight: '500',
|
|
602
|
+
fontWeight: '400',
|
|
603
|
+
zoomSelectionColor: '#49454E',
|
|
604
|
+
shapeFill: '#E7E0EC',
|
|
605
|
+
rectangleZoomFillColor: '#6750A4',
|
|
606
|
+
rectangleZoomFillOpacity: 0.24,
|
|
607
|
+
rectangleZoomBorderColor: "#6750A4"
|
|
608
|
+
};
|
|
609
|
+
break;
|
|
610
|
+
case 'material3dark':
|
|
611
|
+
style = {
|
|
612
|
+
backgroundColor: 'transparent',
|
|
613
|
+
areaBackgroundColor: 'transparent',
|
|
614
|
+
titleFontColor: '#E6E1E5',
|
|
615
|
+
subTitleFontColor: '#E6E1E5',
|
|
616
|
+
legendTitleFontColor: '#E6E1E5',
|
|
617
|
+
legendTextColor: '#CAC4D0',
|
|
618
|
+
dataLabelFontColor: '#E6E1E5',
|
|
619
|
+
tooltipFontColor: '#313033',
|
|
620
|
+
tooltipFillColor: '#E6E1E5',
|
|
621
|
+
zoomFillColor: '#E6E1E5',
|
|
622
|
+
fontFamily: 'Roboto',
|
|
623
|
+
fontSize: '14px',
|
|
624
|
+
titleFontSize: '16px',
|
|
625
|
+
subTitleFontSize: '14px',
|
|
626
|
+
legendFontSize: '12px',
|
|
627
|
+
tooltipFillOpacity: 1,
|
|
628
|
+
tooltipTextOpacity: 1,
|
|
629
|
+
labelFontFamily: 'Roboto',
|
|
630
|
+
titleFontWeight: '500',
|
|
631
|
+
fontWeight: '400',
|
|
632
|
+
zoomSelectionColor: '#E6E1E5',
|
|
633
|
+
shapeFill: '#49454F',
|
|
634
|
+
rectangleZoomFillColor: '#D0BCFF',
|
|
635
|
+
rectangleZoomFillOpacity: 0.24,
|
|
636
|
+
rectangleZoomBorderColor: "#D0BCFF"
|
|
526
637
|
};
|
|
527
638
|
break;
|
|
528
639
|
default:
|
|
@@ -540,9 +651,14 @@ export function getThemeStyle(theme) {
|
|
|
540
651
|
zoomFillColor: '#737373',
|
|
541
652
|
labelFontFamily: 'Roboto, Noto, Sans-serif',
|
|
542
653
|
fontFamily: 'Roboto, Noto, Sans-serif',
|
|
654
|
+
fontSize: '12px',
|
|
655
|
+
fontWeight: 'Medium',
|
|
543
656
|
titleFontWeight: 'Medium',
|
|
544
657
|
zoomSelectionColor: '#e61576',
|
|
545
|
-
shapeFill: '#A6A6A6'
|
|
658
|
+
shapeFill: '#A6A6A6',
|
|
659
|
+
rectangleZoomFillColor: '#d3d3d3',
|
|
660
|
+
rectangleZoomFillOpacity: 0.5,
|
|
661
|
+
rectangleZoomBorderColor: "#009900"
|
|
546
662
|
};
|
|
547
663
|
break;
|
|
548
664
|
}
|
|
@@ -127,7 +127,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
127
127
|
currentData = this.formatter(marker.tooltipSettings.format, marker.dataSource[dataIndex]);
|
|
128
128
|
}
|
|
129
129
|
else {
|
|
130
|
-
if (marker.template && !marker.tooltipSettings.valuePath) {
|
|
130
|
+
if (typeof marker.template !== 'function' && marker.template && !marker.tooltipSettings.valuePath) {
|
|
131
131
|
currentData = marker.template.split('>')[1].split('<')[0];
|
|
132
132
|
}
|
|
133
133
|
else {
|
|
@@ -170,7 +170,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
170
170
|
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
171
171
|
document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
172
172
|
}
|
|
173
|
-
if (option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
173
|
+
if (typeof option.template !== 'function' && option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
174
174
|
option.template = option.template[Object.keys(option.template)[0]];
|
|
175
175
|
}
|
|
176
176
|
templateData = this.setTooltipContent(option, templateData);
|
|
@@ -195,10 +195,14 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
195
195
|
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
196
196
|
(targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
|
|
197
197
|
_this.maps['isProtectedOnChange'] = true;
|
|
198
|
+
tooltipArgs.options['textStyle']['size'] = tooltipArgs.options['textStyle']['size']
|
|
199
|
+
|| _this.maps.themeStyle.fontSize;
|
|
198
200
|
tooltipArgs.options['textStyle']['color'] = tooltipArgs.options['textStyle']['color']
|
|
199
201
|
|| _this.maps.themeStyle.tooltipFontColor;
|
|
200
202
|
tooltipArgs.options['textStyle']['fontFamily'] = tooltipArgs.options['textStyle']['fontFamily']
|
|
201
203
|
|| _this.maps.themeStyle.fontFamily;
|
|
204
|
+
tooltipArgs.options['textStyle']['fontWeight'] = tooltipArgs.options['textStyle']['fontWeight']
|
|
205
|
+
|| _this.maps.themeStyle.fontWeight;
|
|
202
206
|
tooltipArgs.options['textStyle']['opacity'] = tooltipArgs.options['textStyle']['opacity']
|
|
203
207
|
|| _this.maps.themeStyle.tooltipTextOpacity;
|
|
204
208
|
if (tooltipArgs.cancel) {
|
|
@@ -73,93 +73,103 @@ var Zoom = /** @class */ (function () {
|
|
|
73
73
|
var scale = map.previousScale = map.scale;
|
|
74
74
|
var maxZoom = map.zoomSettings.maxZoom;
|
|
75
75
|
var minZoom = map.zoomSettings.minZoom;
|
|
76
|
-
newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
|
|
77
76
|
newZoomFactor = maxZoom >= newZoomFactor ? newZoomFactor : maxZoom;
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
77
|
+
var isToolbarPerform = true;
|
|
78
|
+
switch (type.toLowerCase()) {
|
|
79
|
+
case 'zoomin':
|
|
80
|
+
isToolbarPerform = newZoomFactor <= this.maps.zoomSettings.maxZoom;
|
|
81
|
+
break;
|
|
82
|
+
case 'zoomout':
|
|
83
|
+
isToolbarPerform = newZoomFactor >= this.maps.zoomSettings.minZoom;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
if (isToolbarPerform) {
|
|
87
|
+
var prevTilePoint = map.tileTranslatePoint;
|
|
88
|
+
if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
89
|
+
|| map.isReset)) {
|
|
90
|
+
var availSize = map.mapAreaRect;
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
+
var minBounds = map.baseMapRectBounds['min'];
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
|
+
var maxBounds = map.baseMapRectBounds['max'];
|
|
95
|
+
var mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
96
|
+
var mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
97
|
+
var translatePointX = void 0;
|
|
98
|
+
var translatePointY = void 0;
|
|
99
|
+
if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
100
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
101
|
+
mapTotalWidth = availSize.width / 2;
|
|
102
|
+
mapTotalHeight = availSize.height;
|
|
103
|
+
}
|
|
104
|
+
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
105
|
+
newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
|
|
106
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
var point = map.translatePoint;
|
|
110
|
+
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
111
|
+
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
112
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
113
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
114
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
115
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
116
|
+
}
|
|
117
|
+
map.scale = newZoomFactor;
|
|
118
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
119
|
+
map.translatePoint = map.previousPoint;
|
|
120
|
+
map.scale = map.mapScaleValue = map.previousScale;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
this.applyTransform(map);
|
|
94
124
|
}
|
|
95
|
-
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
96
|
-
newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
|
|
97
|
-
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
var point = map.translatePoint;
|
|
101
|
-
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
102
|
-
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
103
|
-
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
104
|
-
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
105
|
-
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
106
|
-
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
107
|
-
}
|
|
108
|
-
map.scale = newZoomFactor;
|
|
109
|
-
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
110
|
-
map.translatePoint = map.previousPoint;
|
|
111
|
-
map.scale = map.mapScaleValue = map.previousScale;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this.applyTransform(map);
|
|
115
125
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
map.zoomSettings.zoomFactor = newZoomFactor;
|
|
121
|
-
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
122
|
-
if (type === 'ZoomOut' && map.zoomSettings.resetToInitial && map.applyZoomReset && newZoomFactor <= map.initialZoomLevel) {
|
|
123
|
-
map.initialCheck = true;
|
|
124
|
-
map.zoomPersistence = false;
|
|
125
|
-
map.tileTranslatePoint.x = map.initialTileTranslate.x;
|
|
126
|
-
map.tileTranslatePoint.y = map.initialTileTranslate.y;
|
|
127
|
-
newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
126
|
+
else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
|
|
127
|
+
this.getTileTranslatePosition(prevLevel, newZoomFactor, position, type);
|
|
128
|
+
map.tileZoomLevel = newZoomFactor;
|
|
129
|
+
map.zoomSettings.zoomFactor = newZoomFactor;
|
|
128
130
|
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
map.zoomSettings.zoomFactor = map.previousScale;
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
if (document.querySelector('.GroupElement')) {
|
|
140
|
-
document.querySelector('.GroupElement').style.display = 'none';
|
|
131
|
+
if (type === 'ZoomOut' && map.zoomSettings.resetToInitial && map.applyZoomReset && newZoomFactor <= map.initialZoomLevel) {
|
|
132
|
+
map.initialCheck = true;
|
|
133
|
+
map.zoomPersistence = false;
|
|
134
|
+
map.tileTranslatePoint.x = map.initialTileTranslate.x;
|
|
135
|
+
map.tileTranslatePoint.y = map.initialTileTranslate.y;
|
|
136
|
+
newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
137
|
+
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
141
138
|
}
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
140
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
141
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
142
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
143
|
+
map.scale = map.previousScale;
|
|
144
|
+
map.tileZoomLevel = prevLevel;
|
|
145
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
144
146
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
149
|
-
setTimeout(function () {
|
|
150
|
-
// if (type === 'ZoomOut') {
|
|
151
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
152
|
-
// if (element1.childElementCount) {
|
|
153
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
154
|
-
// } else {
|
|
155
|
-
// element1 = element1;
|
|
156
|
-
// }
|
|
157
|
-
// }
|
|
158
|
-
_this.applyTransform(_this.maps);
|
|
159
|
-
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
160
|
-
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
147
|
+
else {
|
|
148
|
+
if (document.querySelector('.GroupElement')) {
|
|
149
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
161
150
|
}
|
|
162
|
-
|
|
151
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
152
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
153
|
+
}
|
|
154
|
+
this.markerLineAnimation(map);
|
|
155
|
+
map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
|
|
156
|
+
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
157
|
+
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
158
|
+
setTimeout(function () {
|
|
159
|
+
// if (type === 'ZoomOut') {
|
|
160
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
161
|
+
// if (element1.childElementCount) {
|
|
162
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
163
|
+
// } else {
|
|
164
|
+
// element1 = element1;
|
|
165
|
+
// }
|
|
166
|
+
// }
|
|
167
|
+
_this.applyTransform(_this.maps);
|
|
168
|
+
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
169
|
+
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
170
|
+
}
|
|
171
|
+
}, animationDuration);
|
|
172
|
+
}
|
|
163
173
|
}
|
|
164
174
|
}
|
|
165
175
|
this.maps.zoomNotApplied = false;
|
|
@@ -375,7 +385,7 @@ var Zoom = /** @class */ (function () {
|
|
|
375
385
|
var down = this.mouseDownPoints;
|
|
376
386
|
var move = this.mouseMovePoints;
|
|
377
387
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
378
|
-
var border = { width: 1, color:
|
|
388
|
+
var border = { width: 1, color: this.maps.themeStyle.rectangleZoomBorderColor };
|
|
379
389
|
var width = Math.abs(move.x - down.x);
|
|
380
390
|
var height = Math.abs(move.y - down.y);
|
|
381
391
|
var x = ((move.x > down.x) ? down.x : down.x - width);
|
|
@@ -390,7 +400,7 @@ var Zoom = /** @class */ (function () {
|
|
|
390
400
|
height: map.availableSize.height,
|
|
391
401
|
style: 'position: absolute;'
|
|
392
402
|
});
|
|
393
|
-
var rectOption = new RectOption(map.element.id + '_ZoomRect',
|
|
403
|
+
var rectOption = new RectOption(map.element.id + '_ZoomRect', this.maps.themeStyle.rectangleZoomFillColor, border, this.maps.themeStyle.rectangleZoomFillOpacity, this.zoomingRect, 0, 0, '', '3');
|
|
394
404
|
rectSVGObject.appendChild(map.renderer.drawRectangle(rectOption));
|
|
395
405
|
getElementByID(map.element.id + '_Secondary_Element').appendChild(rectSVGObject);
|
|
396
406
|
}
|
|
@@ -783,6 +793,7 @@ var Zoom = /** @class */ (function () {
|
|
|
783
793
|
zoomtextSize = measureText(zoomtext, style);
|
|
784
794
|
var start = labelY - zoomtextSize['height'] / 4;
|
|
785
795
|
var end = labelY + zoomtextSize['height'] / 4;
|
|
796
|
+
labelY = end;
|
|
786
797
|
var xpositionEnds = labelX + zoomtextSize['width'] / 2;
|
|
787
798
|
var xpositionStart = labelX - zoomtextSize['width'] / 2;
|
|
788
799
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1338,11 +1349,23 @@ var Zoom = /** @class */ (function () {
|
|
|
1338
1349
|
e.stopImmediatePropagation();
|
|
1339
1350
|
var isTouch = e.pointerType === 'touch' || e.pointerType === '2' || (e.type.indexOf('touch') > -1);
|
|
1340
1351
|
var toolbar = target.id.split('_Zooming_ToolBar_')[1].split('_')[0];
|
|
1341
|
-
|
|
1352
|
+
var isToolbarPerform = true;
|
|
1353
|
+
switch (toolbar.toLowerCase()) {
|
|
1354
|
+
case 'zoomin':
|
|
1355
|
+
isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) + 1 <= this.maps.zoomSettings.maxZoom;
|
|
1356
|
+
break;
|
|
1357
|
+
case 'zoomout':
|
|
1358
|
+
isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) - 1 >= this.maps.zoomSettings.minZoom;
|
|
1359
|
+
break;
|
|
1360
|
+
case 'reset':
|
|
1361
|
+
isToolbarPerform = Math.round(this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) != this.maps.zoomSettings.minZoom;
|
|
1362
|
+
break;
|
|
1363
|
+
}
|
|
1364
|
+
if (isTouch && isToolbarPerform) {
|
|
1342
1365
|
this.handled = true;
|
|
1343
1366
|
this.performZoomingByToolBar(toolbar);
|
|
1344
1367
|
}
|
|
1345
|
-
else if ((e.type === 'mousedown' || e.type === 'pointerdown') && !this.handled) {
|
|
1368
|
+
else if ((e.type === 'mousedown' || e.type === 'pointerdown') && !this.handled && isToolbarPerform) {
|
|
1346
1369
|
this.handled = false;
|
|
1347
1370
|
this.performZoomingByToolBar(toolbar);
|
|
1348
1371
|
}
|
|
@@ -1427,7 +1450,7 @@ var Zoom = /** @class */ (function () {
|
|
|
1427
1450
|
map.markerCenterLatitude = null;
|
|
1428
1451
|
map.markerCenterLongitude = null;
|
|
1429
1452
|
this.isZoomSelection = false;
|
|
1430
|
-
this.isPan =
|
|
1453
|
+
this.isPan = map.zoomSettings.enablePanning;
|
|
1431
1454
|
this.toolBarZooming(map.zoomSettings.minZoom, 'Reset');
|
|
1432
1455
|
if ((this.isPan && !this.isZoomSelection) || (!this.isPan && this.isZoomSelection)) {
|
|
1433
1456
|
if (!this.maps.zoomSettings.enablePanning) {
|
package/src/maps/utils/enum.d.ts
CHANGED
|
@@ -44,7 +44,11 @@ export declare type MapsTheme =
|
|
|
44
44
|
/** Renders a map with Fluent theme. */
|
|
45
45
|
'Fluent' |
|
|
46
46
|
/** Render a map with Fluent dark theme. */
|
|
47
|
-
'FluentDark'
|
|
47
|
+
'FluentDark' |
|
|
48
|
+
/** Renders a map with material3 theme. */
|
|
49
|
+
'Material3' |
|
|
50
|
+
/** Renders a map with material3dark theme. */
|
|
51
|
+
'Material3Dark';
|
|
48
52
|
/**
|
|
49
53
|
* Defines the position of the legend.
|
|
50
54
|
*/
|
|
@@ -884,7 +884,7 @@ export declare function Internalize(maps: Maps, value: number): string;
|
|
|
884
884
|
* @returns {Function} - Returns the function
|
|
885
885
|
* @private
|
|
886
886
|
*/
|
|
887
|
-
export declare function getTemplateFunction(template: string, maps: Maps): any;
|
|
887
|
+
export declare function getTemplateFunction(template: string | Function, maps: Maps): any;
|
|
888
888
|
/**
|
|
889
889
|
* Function to get element from id.
|
|
890
890
|
*
|
package/src/maps/utils/helper.js
CHANGED
|
@@ -846,7 +846,7 @@ export function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, ma
|
|
|
846
846
|
}
|
|
847
847
|
else if (shape === 'Image') {
|
|
848
848
|
x = location.x - (size.width / 2);
|
|
849
|
-
y = location.y - (size.height / 2);
|
|
849
|
+
y = location.y - (markerID.indexOf('cluster') > -1 ? (size.height / 2) : size.height);
|
|
850
850
|
merge(pathOptions, { 'href': imageUrl, 'height': size.height, 'width': size.width, x: x, y: y });
|
|
851
851
|
markerEle = maps.renderer.drawImage(pathOptions);
|
|
852
852
|
}
|
|
@@ -2393,13 +2393,16 @@ export function getTemplateFunction(template, maps) {
|
|
|
2393
2393
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2394
2394
|
var templateFn = null;
|
|
2395
2395
|
try {
|
|
2396
|
-
if (document.querySelectorAll(template).length) {
|
|
2396
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
2397
2397
|
templateFn = templateComplier(document.querySelector(template).innerHTML.trim());
|
|
2398
2398
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2399
2399
|
}
|
|
2400
2400
|
else if (maps.isVue || maps.isVue3) {
|
|
2401
2401
|
templateFn = templateComplier(template);
|
|
2402
2402
|
}
|
|
2403
|
+
else if (typeof template === 'function') {
|
|
2404
|
+
templateFn = templateComplier(template);
|
|
2405
|
+
}
|
|
2403
2406
|
}
|
|
2404
2407
|
catch (e) {
|
|
2405
2408
|
templateFn = templateComplier(template);
|