@syncfusion/ej2-maps 23.2.7 → 24.1.47

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.
@@ -1,7 +1,7 @@
1
1
  import { Point, getElementByID, PathOption, Rect, convertGeoToPoint, CircleOption, convertTileLatLongToPoint } from '../utils/helper';
2
2
  import { RectOption, createTooltip, calculateScale, getTouchCenter, getTouches, targetTouches } from '../utils/helper';
3
3
  import { MapLocation, zoomAnimate, smoothTranslate, measureText, textTrim, clusterTemplate, marker } from '../utils/helper';
4
- import { markerTemplate, removeElement, getElement, clusterSeparate, markerColorChoose } from '../utils/helper';
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';
7
7
  import { changeBorderWidth, markerRendering } from '../index';
@@ -64,10 +64,10 @@ var Zoom = /** @class */ (function () {
64
64
  Zoom.prototype.performZooming = function (position, newZoomFactor, type) {
65
65
  var _this = this;
66
66
  var map = this.maps;
67
- map.previousProjection = map.projectionType;
67
+ map.previousProjection = newZoomFactor <= 1.5 ? undefined : map.projectionType;
68
68
  map.defaultState = false;
69
69
  map.initialCheck = false;
70
- map.markerZoomedState = false;
70
+ map.markerZoomedState = map.isMarkerZoomCompleted = false;
71
71
  map.zoomPersistence = map.enablePersistence;
72
72
  var prevLevel = map.tileZoomLevel;
73
73
  var scale = map.previousScale = map.scale;
@@ -115,6 +115,7 @@ var Zoom = /** @class */ (function () {
115
115
  map.translatePoint = new Point(translatePointX, translatePointY);
116
116
  }
117
117
  map.scale = newZoomFactor;
118
+ map.zoomTranslatePoint = map.translatePoint;
118
119
  if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
119
120
  map.translatePoint = map.previousPoint;
120
121
  map.scale = map.mapScaleValue = map.previousScale;
@@ -136,6 +137,7 @@ var Zoom = /** @class */ (function () {
136
137
  newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
137
138
  map.scale = Math.pow(2, newZoomFactor - 1);
138
139
  }
140
+ map.mapScaleValue = isNaN(map.mapScaleValue) ? 1 : map.mapScaleValue;
139
141
  map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
140
142
  map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
141
143
  if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
@@ -189,18 +191,28 @@ var Zoom = /** @class */ (function () {
189
191
  Zoom.prototype.triggerZoomEvent = function (prevTilePoint, prevLevel, type) {
190
192
  var map = this.maps;
191
193
  var zoomArgs;
194
+ if (map.isTileMap) {
195
+ map.mapScaleValue = isNullOrUndefined(map.mapScaleValue) ? 1 : map.mapScaleValue;
196
+ map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
197
+ map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
198
+ }
199
+ var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
192
200
  if (!map.isTileMap) {
193
201
  zoomArgs = {
194
202
  cancel: false, name: 'zoom', type: type, maps: map,
195
203
  tileTranslatePoint: {}, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
196
- tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale }
204
+ tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale },
205
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
206
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
197
207
  };
198
208
  }
199
209
  else {
200
210
  zoomArgs = {
201
211
  cancel: false, name: 'zoom', type: type, maps: map,
202
212
  tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint }, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
203
- tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale }
213
+ tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale },
214
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
215
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
204
216
  };
205
217
  }
206
218
  map.trigger('zoom', zoomArgs);
@@ -249,6 +261,7 @@ var Zoom = /** @class */ (function () {
249
261
  map.translatePoint = new Point(translatePointX, translatePointY);
250
262
  }
251
263
  map.scale = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
264
+ map.zoomTranslatePoint = map.translatePoint;
252
265
  isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
253
266
  if (isZoomCancelled) {
254
267
  map.translatePoint = map.previousPoint;
@@ -304,6 +317,7 @@ var Zoom = /** @class */ (function () {
304
317
  var map = this.maps;
305
318
  var prevLevel = map.tileZoomLevel;
306
319
  var availSize = map.mapAreaRect;
320
+ map.isMarkerZoomCompleted = false;
307
321
  map.previousScale = map.scale;
308
322
  map.previousPoint = map.translatePoint;
309
323
  map.previousProjection = map.projectionType;
@@ -420,7 +434,9 @@ var Zoom = /** @class */ (function () {
420
434
  Zoom.prototype.animateTransform = function (element, animate, x, y, scale) {
421
435
  var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
422
436
  if (!animate || duration === 0 || this.maps.isTileMap) {
423
- element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
437
+ if (!(this.maps.isTileMap && element.id.indexOf('_Polygons_Group') > -1)) {
438
+ element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
439
+ }
424
440
  return;
425
441
  }
426
442
  if (!this.maps.isTileMap) {
@@ -431,6 +447,7 @@ var Zoom = /** @class */ (function () {
431
447
  * @private
432
448
  */
433
449
  Zoom.prototype.applyTransform = function (maps, animate) {
450
+ var _this = this;
434
451
  var layerIndex;
435
452
  this.templateCount = 0;
436
453
  var layer;
@@ -448,60 +465,73 @@ var Zoom = /** @class */ (function () {
448
465
  removeElement(maps.element.id + '_mapsTooltip');
449
466
  }
450
467
  if (this.layerCollectionEle) {
451
- for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
452
- var layerElement = this.layerCollectionEle.childNodes[i_1];
468
+ var _loop_1 = function (i_1) {
469
+ var layerElement = this_1.layerCollectionEle.childNodes[i_1];
453
470
  if (layerElement.tagName === 'g') {
454
- this.templateCount++;
455
- this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
456
- this.currentLayer = maps.layersCollection[this.index];
457
- var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
471
+ this_1.templateCount++;
472
+ this_1.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
473
+ this_1.currentLayer = maps.layersCollection[this_1.index];
474
+ var factor_1 = maps.mapLayerPanel.calculateFactor(this_1.currentLayer);
458
475
  var elementCount = layerElement.childElementCount;
459
- for (var j = 0; j < elementCount; j++) {
476
+ var _loop_2 = function (j) {
460
477
  var currentEle = layerElement.childNodes[j];
461
478
  if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
462
479
  && (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
463
480
  if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
464
481
  currentEle.remove();
465
482
  if (layerElement.children.length > 0 && layerElement.children[0]) {
466
- layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
483
+ layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this_1.currentLayer, maps.tileZoomLevel, this_1.index), layerElement.children[1]);
467
484
  }
468
485
  else {
469
- layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
486
+ layerElement.appendChild(maps.navigationLineModule.renderNavigation(this_1.currentLayer, maps.tileZoomLevel, this_1.index));
487
+ }
488
+ }
489
+ else if (maps.isTileMap && (currentEle.id.indexOf('_Polygons_Group') > -1)) {
490
+ if (this_1.currentLayer.polygonSettings.polygons.length > 0) {
491
+ this_1.currentLayer.polygonSettings.polygons.map(function (polygonSettings, polygonIndex) {
492
+ var markerData = polygonSettings.points;
493
+ var path = calculatePolygonPath(maps, maps.tileZoomLevel, _this.currentLayer, markerData);
494
+ var element = document.getElementById(maps.element.id + '_LayerIndex_' + _this.index + '_PolygonIndex_' + polygonIndex);
495
+ element.setAttribute('d', path);
496
+ });
497
+ document.getElementById(maps.element.id + '_LayerIndex_' + this_1.index + '_Polygons_Group').style.visibility = '';
470
498
  }
471
499
  }
472
500
  else if (currentEle.id.indexOf('Legend') === -1) {
473
- changeBorderWidth(currentEle, this.index, scale, maps);
501
+ changeBorderWidth(currentEle, this_1.index, scale, maps);
474
502
  maps.zoomTranslatePoint = maps.translatePoint;
475
- this.animateTransform(currentEle, animate, x, y, scale);
503
+ this_1.animateTransform(currentEle, animate, x, y, scale);
476
504
  }
477
505
  }
478
506
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
479
- if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
480
- this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate);
507
+ if ((!this_1.isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
508
+ this_1.markerTranslates(currentEle.childNodes[0], factor_1, x, y, scale, 'Marker', layerElement, animate);
481
509
  }
482
510
  currentEle = layerElement.childNodes[j];
483
- var markerAnimation = void 0;
511
+ var markerAnimation_1;
484
512
  if (!isNullOrUndefined(currentEle) && currentEle.id.indexOf('Markers') !== -1) {
485
- for (var k = 0; k < currentEle.childElementCount; k++) {
486
- this.markerTranslate(currentEle.childNodes[k], factor, x, y, scale, 'Marker', animate);
487
- var layerIndex_1 = parseInt(currentEle.childNodes[k]['id'].split('_LayerIndex_')[1].split('_')[0], 10);
488
- var dataIndex = parseInt(currentEle.childNodes[k]['id'].split('_dataIndex_')[1].split('_')[0], 10);
489
- var markerIndex = parseInt(currentEle.childNodes[k]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
490
- markerAnimation = this.currentLayer.markerSettings[markerIndex].animationDuration > 0 || animationMode === 'Enable';
491
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
492
- var markerSelectionValues = this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
493
- for (var x_1 = 0; x_1 < this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length; x_1++) {
494
- if (this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['latitude'] ===
495
- markerSelectionValues['latitude'] ||
496
- this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
497
- markerSelectionValues['longitude']) {
498
- maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
513
+ Array.prototype.forEach.call(currentEle.childNodes, function (childNode, k) {
514
+ _this.markerTranslate(childNode, factor_1, x, y, scale, 'Marker', animate);
515
+ var layerIndex = parseInt(childNode['id'].split('_LayerIndex_')[1].split('_')[0], 10);
516
+ var dataIndex = parseInt(childNode['id'].split('_dataIndex_')[1].split('_')[0], 10);
517
+ var markerIndex = parseInt(childNode['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
518
+ markerAnimation_1 = _this.currentLayer.markerSettings[markerIndex].animationDuration > 0 || animationMode === 'Enable';
519
+ if (_this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length > 0) {
520
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
521
+ var markerSelectionValues = _this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
522
+ for (var x_1 = 0; x_1 < _this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length; x_1++) {
523
+ if (_this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['latitude'] ===
524
+ markerSelectionValues['latitude'] ||
525
+ _this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
526
+ markerSelectionValues['longitude']) {
527
+ maps.markerSelection(_this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], _this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
528
+ }
499
529
  }
500
530
  }
501
- if (((this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
531
+ if (((_this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && _this.currentLayer.type === 'SubLayer')) && !_this.isPanning) {
502
532
  if (maps.isTileMap) {
503
533
  var groupElement = document.querySelector('.GroupElement');
504
- if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
534
+ if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation_1) {
505
535
  groupElement.style.display = 'none';
506
536
  }
507
537
  }
@@ -510,8 +540,8 @@ var Zoom = /** @class */ (function () {
510
540
  currentEle.style.cssText = markerStyle;
511
541
  }
512
542
  }
513
- }
514
- if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
543
+ });
544
+ if (this_1.isPanning && maps.markerModule.sameMarkerData.length > 0) {
515
545
  clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
516
546
  }
517
547
  else if (maps.markerModule.sameMarkerData.length > 0) {
@@ -521,7 +551,7 @@ var Zoom = /** @class */ (function () {
521
551
  }
522
552
  }
523
553
  if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
524
- && !this.isPanning) {
554
+ && !this_1.isPanning) {
525
555
  var mapsTooltip = maps.mapsTooltipModule;
526
556
  var tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
527
557
  if (!isNullOrUndefined(tooltipElement)) {
@@ -559,7 +589,7 @@ var Zoom = /** @class */ (function () {
559
589
  var centerY = bubbleCollection['center']['y'];
560
590
  var currentX = ((centerX + x) * scale);
561
591
  var currentY = ((centerY + y) * scale);
562
- var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
592
+ var duration = this_1.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this_1.currentLayer.animationDuration;
563
593
  if (!animate || duration === 0) {
564
594
  childElement.setAttribute('transform', 'translate( ' + currentX + ' ' + currentY + ' )');
565
595
  }
@@ -571,25 +601,25 @@ var Zoom = /** @class */ (function () {
571
601
  }
572
602
  }
573
603
  }
574
- else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
575
- this.intersect = [];
604
+ else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this_1.index])) {
605
+ this_1.intersect = [];
576
606
  maps.zoomLabelPositions = [];
577
607
  maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
578
608
  var labelAnimate = !maps.isTileMap && animate;
579
609
  for (var k = 0; k < currentEle.childElementCount; k++) {
580
610
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
581
611
  var labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
582
- this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
583
- maps.zoomShapeCollection.push(this.zoomshapewidth);
584
- this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
585
- var dataLabel = maps.layers[this.index].dataLabelSettings;
612
+ this_1.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
613
+ maps.zoomShapeCollection.push(this_1.zoomshapewidth);
614
+ this_1.dataLabelTranslate(currentEle.childNodes[k], factor_1, x, y, scale, 'DataLabel', labelAnimate);
615
+ var dataLabel = maps.layers[this_1.index].dataLabelSettings;
586
616
  var border = dataLabel.border;
587
617
  if (k > 0 && border['width'] > 1) {
588
618
  if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
589
619
  var labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
590
620
  var labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
591
621
  var zoomtext = currentEle.childNodes[k]['textContent'];
592
- var style = maps.layers[this.index].dataLabelSettings.textStyle;
622
+ var style = maps.layers[this_1.index].dataLabelSettings.textStyle;
593
623
  var zoomtextSize = measureText(zoomtext, style);
594
624
  var padding = 5;
595
625
  var rectElement = currentEle.childNodes[k - 1];
@@ -602,9 +632,16 @@ var Zoom = /** @class */ (function () {
602
632
  }
603
633
  }
604
634
  }
635
+ };
636
+ for (var j = 0; j < elementCount; j++) {
637
+ _loop_2(j);
605
638
  }
606
639
  }
607
640
  maps.arrangeTemplate();
641
+ };
642
+ var this_1 = this;
643
+ for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
644
+ _loop_1(i_1);
608
645
  }
609
646
  if (!isNullOrUndefined(this.currentLayer)) {
610
647
  if (!animate || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
@@ -644,7 +681,7 @@ var Zoom = /** @class */ (function () {
644
681
  removeElement(markerTemplateElements.id);
645
682
  }
646
683
  var currentLayers = this.maps.layersCollection[layerIndex];
647
- currentLayers.markerSettings.map(function (markerSettings, markerIndex) {
684
+ Array.prototype.forEach.call(currentLayers.markerSettings, function (markerSettings, markerIndex) {
648
685
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
649
686
  var markerDatas = markerSettings.dataSource;
650
687
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -693,9 +730,22 @@ var Zoom = /** @class */ (function () {
693
730
  _this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
694
731
  ? _this.maps.markerNullCount + 1 : _this.maps.markerNullCount;
695
732
  var markerDataLength = markerDatas.length - _this.maps.markerNullCount;
733
+ var isMarkersClustered = false;
696
734
  if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
697
735
  if (_this.maps.isTileMap) {
698
- layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
736
+ var polygonsElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
737
+ var polygonElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
738
+ if (!isNullOrUndefined(polygonsElement)) {
739
+ polygonsElement.insertAdjacentElement('afterend', markerSVGObject);
740
+ }
741
+ else {
742
+ if (!isNullOrUndefined(polygonElement)) {
743
+ polygonElement.insertAdjacentElement('afterend', markerSVGObject);
744
+ }
745
+ else {
746
+ layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
747
+ }
748
+ }
699
749
  }
700
750
  else {
701
751
  layerElement.appendChild(markerSVGObject);
@@ -703,13 +753,13 @@ var Zoom = /** @class */ (function () {
703
753
  if (currentLayers.markerClusterSettings.allowClustering) {
704
754
  _this.maps.svgObject.appendChild(markerSVGObject);
705
755
  _this.maps.element.appendChild(_this.maps.svgObject);
706
- clusterTemplate(currentLayers, markerSVGObject, _this.maps, layerIndex, markerSVGObject, layerElement, true, true);
756
+ isMarkersClustered = clusterTemplate(currentLayers, markerSVGObject, _this.maps, layerIndex, markerSVGObject, layerElement, true, true);
707
757
  }
708
758
  }
709
759
  if (markerTemplateElements.childElementCount === (markerDataLength - markerCounts - nullCount) && getElementByID(_this.maps.element.id + '_Secondary_Element')) {
710
760
  getElementByID(_this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
711
761
  if (scale >= 1) {
712
- if (currentLayers.markerClusterSettings.allowClustering) {
762
+ if (currentLayers.markerClusterSettings.allowClustering && !isMarkersClustered) {
713
763
  clusterTemplate(currentLayers, markerTemplateElements, _this.maps, layerIndex, markerSVGObject, layerElement, false, true);
714
764
  }
715
765
  }
@@ -735,6 +785,8 @@ var Zoom = /** @class */ (function () {
735
785
  i + '_Markers_Template_Group');
736
786
  var datalabelTemplateElemement = getElementByID(maps.element.id + '_LayerIndex_'
737
787
  + i + '_Label_Template_Group');
788
+ var polygonElement = getElementByID(maps.element.id + '_LayerIndex_'
789
+ + i + '_Polygons_Group');
738
790
  if ((!isNullOrUndefined(markerTemplateElement)) && markerTemplateElement.childElementCount > 0) {
739
791
  markerTemplateElement.style.visibility = 'visible';
740
792
  for (var k = 0; k < markerTemplateElement.childElementCount; k++) {
@@ -746,6 +798,12 @@ var Zoom = /** @class */ (function () {
746
798
  this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template');
747
799
  }
748
800
  }
801
+ if (!isNullOrUndefined(polygonElement)) {
802
+ for (var k = 0; k < polygonElement.childElementCount; k++) {
803
+ var width = maps.layersCollection[i].polygonSettings.polygons[k].borderWidth;
804
+ polygonElement.childNodes[k].childNodes[0].setAttribute('stroke-width', (width / scale).toString());
805
+ }
806
+ }
749
807
  }
750
808
  };
751
809
  Zoom.prototype.dataLabelTranslate = function (element, factor, x, y, scale, type, animate) {
@@ -800,7 +858,6 @@ var Zoom = /** @class */ (function () {
800
858
  zoomtextSize = measureText(zoomtext, style);
801
859
  var start = labelY - zoomtextSize['height'] / 4;
802
860
  var end = labelY + zoomtextSize['height'] / 4;
803
- labelY = end;
804
861
  var xpositionEnds = labelX + zoomtextSize['width'] / 2;
805
862
  var xpositionStart = labelX - zoomtextSize['width'] / 2;
806
863
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -973,12 +1030,16 @@ var Zoom = /** @class */ (function () {
973
1030
  for (var i = 0; i < map.layersCollection.length; i++) {
974
1031
  var markerTemplateElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
975
1032
  var lineElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_line_Group');
1033
+ var polygonElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Polygons_Group');
976
1034
  if (!isNullOrUndefined(markerTemplateElement)) {
977
1035
  markerTemplateElement.style.visibility = 'hidden';
978
1036
  }
979
1037
  if (!isNullOrUndefined(lineElement)) {
980
1038
  lineElement.style.visibility = 'hidden';
981
1039
  }
1040
+ if (!isNullOrUndefined(polygonElement)) {
1041
+ polygonElement.style.visibility = 'hidden';
1042
+ }
982
1043
  }
983
1044
  }
984
1045
  };
@@ -1020,10 +1081,13 @@ var Zoom = /** @class */ (function () {
1020
1081
  ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
1021
1082
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1022
1083
  var location_3 = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
1084
+ var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
1023
1085
  panArgs = {
1024
1086
  cancel: false, name: pan, maps: map,
1025
1087
  tileTranslatePoint: {}, translatePoint: { previous: translatePoint, current: new Point(x, y) },
1026
- scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude']
1088
+ scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude'],
1089
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
1090
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
1027
1091
  };
1028
1092
  map.trigger(pan, panArgs);
1029
1093
  if (!panArgs.cancel) {
@@ -1057,11 +1121,14 @@ var Zoom = /** @class */ (function () {
1057
1121
  map.translatePoint.y = (map.tileTranslatePoint.y - yDifference) / map.scale;
1058
1122
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1059
1123
  var location_4 = this.maps.getTileGeoLocation(mouseLocation['layerX'], mouseLocation['layerY']);
1124
+ var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
1060
1125
  panArgs = {
1061
1126
  cancel: false, name: pan, maps: map,
1062
1127
  tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint },
1063
1128
  translatePoint: { previous: translatePoint, current: map.translatePoint }, scale: map.scale,
1064
- tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude']
1129
+ tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude'],
1130
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
1131
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
1065
1132
  };
1066
1133
  map.trigger(pan, panArgs);
1067
1134
  map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
@@ -1084,7 +1151,7 @@ var Zoom = /** @class */ (function () {
1084
1151
  Zoom.prototype.toolBarZooming = function (zoomFactor, type) {
1085
1152
  var _this = this;
1086
1153
  var map = this.maps;
1087
- map.initialCheck = false;
1154
+ map.initialCheck = map.isMarkerZoomCompleted = false;
1088
1155
  map.defaultState = ((type === 'Reset' && zoomFactor === 1 && !(map.zoomSettings.resetToInitial && map.applyZoomReset))
1089
1156
  || (type === 'ZoomOut' && zoomFactor === 1));
1090
1157
  var prevLevel = map.tileZoomLevel;
@@ -1097,7 +1164,7 @@ var Zoom = /** @class */ (function () {
1097
1164
  var size = map.mapAreaRect;
1098
1165
  var translatePoint = map.previousPoint = map.translatePoint;
1099
1166
  var prevTilePoint = map.tileTranslatePoint;
1100
- map.previousProjection = (type !== 'Reset') ? map.projectionType : null;
1167
+ map.previousProjection = type === 'Reset' ? undefined : map.projectionType;
1101
1168
  zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
1102
1169
  zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
1103
1170
  zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;
@@ -1362,7 +1429,10 @@ var Zoom = /** @class */ (function () {
1362
1429
  isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) + 1 <= this.maps.zoomSettings.maxZoom;
1363
1430
  break;
1364
1431
  case 'zoomout':
1365
- isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) - 1 >= this.maps.zoomSettings.minZoom;
1432
+ var scaleValue = this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale;
1433
+ isToolbarPerform = (this.maps.projectionType === 'Miller' || this.maps.projectionType === 'Winkel3' ||
1434
+ this.maps.projectionType === 'AitOff') ? Math.round(scaleValue) - 1 >= this.maps.zoomSettings.minZoom :
1435
+ (scaleValue) - 1 >= this.maps.zoomSettings.minZoom;
1366
1436
  break;
1367
1437
  case 'reset':
1368
1438
  isToolbarPerform = Math.round(this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) != this.maps.zoomSettings.minZoom;
@@ -1796,8 +1866,9 @@ var Zoom = /** @class */ (function () {
1796
1866
  var pageX = e.pageX;
1797
1867
  var pageY = e.pageY;
1798
1868
  var target = e.target;
1869
+ var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
1799
1870
  if (this.maps.zoomSettings.enable && this.maps.zoomSettings.doubleClickZoom
1800
- && !(e.target['id'].indexOf('_Zooming_') > -1)) {
1871
+ && !(e.target['id'].indexOf('_Zooming_') > -1) && isNullOrUndefined(tooltipElement)) {
1801
1872
  var position = this.getMousePosition(pageX, pageY);
1802
1873
  var map = this.maps;
1803
1874
  var size = map.availableSize;
@@ -1973,8 +2044,9 @@ var Zoom = /** @class */ (function () {
1973
2044
  */
1974
2045
  Zoom.prototype.click = function (e) {
1975
2046
  var map = this.maps;
2047
+ var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
1976
2048
  if ((map.markerModule && map.markerModule.sameMarkerData.length > 0) ||
1977
- (e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1)) {
2049
+ (e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1) || !isNullOrUndefined(tooltipElement)) {
1978
2050
  return null;
1979
2051
  }
1980
2052
  if (this.isSingleClick && map.zoomSettings.zoomOnClick && !(e.target['id'].indexOf('_Zooming_') > -1) && !map.zoomSettings.doubleClickZoom
@@ -79,6 +79,10 @@ export declare function radiansToDegrees(radian: number): number;
79
79
  * @private
80
80
  */
81
81
  export declare function convertGeoToPoint(latitude: number, longitude: number, factor: number, layer: LayerSettings, mapModel: Maps): Point;
82
+ /**
83
+ * @private
84
+ */
85
+ export declare function calculatePolygonPath(maps: Maps, factor: number, currentLayer: LayerSettings, markerData: Coordinate[]): string;
82
86
  /**
83
87
  * Converting tile latitude and longitude to point
84
88
  *
@@ -175,6 +179,20 @@ export declare class Point {
175
179
  y: number;
176
180
  constructor(x: number, y: number);
177
181
  }
182
+ /**
183
+ * Defines the latitude and longitude values that define a map location.
184
+ */
185
+ export declare class Coordinate {
186
+ /**
187
+ * Gets or sets the latitude of a coordinate on a map.
188
+ */
189
+ latitude: number;
190
+ /**
191
+ * Gets or sets the longitude of a coordinate on a map.
192
+ */
193
+ longitude: number;
194
+ constructor(latitude: number, longitude: number);
195
+ }
178
196
  /**
179
197
  * Map internal class for min and max
180
198
  *
@@ -465,7 +483,7 @@ export declare function markerShapeChoose(eventArgs: IMarkerRenderingEventArgs,
465
483
  * @returns {void}
466
484
  * @private
467
485
  */
468
- export declare function clusterTemplate(currentLayer: LayerSettings, markerTemplate: HTMLElement | Element, maps: Maps, layerIndex: number, markerCollection: Element, layerElement: Element, check: boolean, zoomCheck: boolean): void;
486
+ export declare function clusterTemplate(currentLayer: LayerSettings, markerTemplate: HTMLElement | Element, maps: Maps, layerIndex: number, markerCollection: Element, layerElement: Element, check: boolean, zoomCheck: boolean): boolean;
469
487
  /**
470
488
  *
471
489
  * @param {MarkerClusterData[]} sameMarkerData - Specifies the marker data