@syncfusion/ej2-maps 24.2.4 → 25.1.35

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/dist/ej2-maps.min.js +2 -2
  3. package/dist/ej2-maps.umd.min.js +2 -2
  4. package/dist/ej2-maps.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-maps.es2015.js +646 -331
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +660 -346
  8. package/dist/es6/ej2-maps.es5.js.map +1 -1
  9. package/dist/global/ej2-maps.min.js +2 -2
  10. package/dist/global/ej2-maps.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/maps/layers/bubble.js +2 -3
  14. package/src/maps/layers/color-mapping.d.ts +0 -1
  15. package/src/maps/layers/color-mapping.js +0 -1
  16. package/src/maps/layers/data-label.js +19 -17
  17. package/src/maps/layers/layer-panel.js +13 -7
  18. package/src/maps/layers/legend.js +11 -3
  19. package/src/maps/layers/marker.d.ts +4 -0
  20. package/src/maps/layers/marker.js +16 -13
  21. package/src/maps/layers/polygon.d.ts +0 -1
  22. package/src/maps/layers/polygon.js +1 -4
  23. package/src/maps/maps-model.d.ts +14 -0
  24. package/src/maps/maps.d.ts +14 -2
  25. package/src/maps/maps.js +118 -46
  26. package/src/maps/model/base-model.d.ts +51 -0
  27. package/src/maps/model/base.d.ts +43 -1
  28. package/src/maps/model/base.js +32 -0
  29. package/src/maps/model/constants.d.ts +12 -0
  30. package/src/maps/model/constants.js +12 -0
  31. package/src/maps/model/interface.d.ts +8 -0
  32. package/src/maps/user-interaction/tooltip.js +151 -110
  33. package/src/maps/user-interaction/zoom.d.ts +3 -5
  34. package/src/maps/user-interaction/zoom.js +198 -106
  35. package/src/maps/utils/helper.d.ts +7 -1
  36. package/src/maps/utils/helper.js +89 -37
  37. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -72
  38. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -49
@@ -398,28 +398,26 @@ class GeoLocation {
398
398
  function measureText(text, font) {
399
399
  let measureObject = document.getElementById('mapsmeasuretext');
400
400
  if (measureObject === null) {
401
- measureObject = createElement('text', { id: 'mapsmeasuretext' });
401
+ measureObject = document.createElement('text');
402
+ measureObject.id = 'mapsmeasuretext';
402
403
  document.body.appendChild(measureObject);
403
404
  }
404
405
  measureObject.innerText = text;
405
- measureObject.style.position = 'absolute';
406
- if (typeof (font.size) === 'number') {
407
- measureObject.style.fontSize = (font.size) + 'px';
408
- }
409
- else {
410
- measureObject.style.fontSize = font.size;
411
- }
412
- measureObject.style.fontWeight = font.fontWeight;
413
- measureObject.style.fontStyle = font.fontStyle;
414
- measureObject.style.fontFamily = font.fontFamily;
415
- measureObject.style.visibility = 'hidden';
416
- measureObject.style.top = '-100';
417
- measureObject.style.left = '0';
418
- measureObject.style.whiteSpace = 'nowrap';
419
- // For bootstrap line height issue
420
- measureObject.style.lineHeight = 'normal';
406
+ measureObject.style.cssText = 'position: absolute; font-size: ' + (typeof (font.size) === 'number' ? (font.size + 'px') : font.size) +
407
+ '; font-weight: ' + font.fontWeight + '; font-style: ' + font.fontStyle + '; font-family: ' + font.fontFamily +
408
+ '; visibility: hidden; top: -100; left: 0; whiteSpace: nowrap; lineHeight: normal';
421
409
  return new Size(measureObject.clientWidth, measureObject.clientHeight);
422
410
  }
411
+ /** @private */
412
+ function measureTextElement(text, font) {
413
+ const canvas = document.createElement('canvas');
414
+ const context = canvas.getContext('2d');
415
+ context.font = `${font.fontStyle} ${font.fontWeight} ${typeof font.size === 'number' ? font.size + 'px' : font.size} ${font.fontFamily}`;
416
+ const metrics = context.measureText(text);
417
+ const width = metrics.width;
418
+ const height = parseFloat(font.size) || 16;
419
+ return new Size(width, height);
420
+ }
423
421
  /**
424
422
  * Internal use of text options
425
423
  *
@@ -930,6 +928,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
930
928
  factor = maps.mapLayerPanel.calculateFactor(currentLayer);
931
929
  }
932
930
  let isClusteringCompleted = false;
931
+ const currentZoomFactor = !maps.isTileMap ? maps.mapScaleValue : maps.tileZoomLevel;
933
932
  maps.trigger('markerClusterRendering', eventArg, (clusterargs) => {
934
933
  Array.prototype.forEach.call(markerTemplate.childNodes, (markerElement, o) => {
935
934
  indexCollection = [];
@@ -938,20 +937,28 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
938
937
  bounds1 = tempElement.getBoundingClientRect();
939
938
  indexCollection.push(o);
940
939
  if (!isNullOrUndefined(bounds1)) {
941
- Array.prototype.forEach.call(markerTemplate.childNodes, (otherMarkerElement, p) => {
942
- if (p >= o + 1 && otherMarkerElement['style']['visibility'] !== 'hidden') {
943
- tempElement = otherMarkerElement;
944
- bounds2 = tempElement.getBoundingClientRect();
945
- if (!isNullOrUndefined(bounds2)) {
946
- if (!(bounds1.left > bounds2.right || bounds1.right < bounds2.left
947
- || bounds1.top > bounds2.bottom || bounds1.bottom < bounds2.top)) {
948
- colloideBounds.push(bounds2);
949
- otherMarkerElement['style']['visibility'] = 'hidden';
950
- indexCollection.push(p);
940
+ const list = (maps.markerModule.zoomedMarkerCluster.length > 0 && maps.markerModule.zoomedMarkerCluster[layerIndex] && maps.markerModule.zoomedMarkerCluster[layerIndex][o] && maps.markerModule.zoomedMarkerCluster[layerIndex][o].length > 0)
941
+ || (maps.markerModule.initialMarkerCluster.length > 0 && maps.markerModule.initialMarkerCluster[layerIndex] && maps.markerModule.initialMarkerCluster[layerIndex][o] && maps.markerModule.initialMarkerCluster[layerIndex][o].length > 0) ?
942
+ (maps.previousScale < currentZoomFactor ? maps.markerModule.zoomedMarkerCluster[layerIndex][o] : maps.markerModule.initialMarkerCluster[layerIndex][o]) : null;
943
+ if (!isNullOrUndefined(list) && list.length !== 0) {
944
+ Array.prototype.forEach.call(list, (currentIndex, p) => {
945
+ if (o !== currentIndex) {
946
+ let otherMarkerElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
947
+ + 0 + '_dataIndex_' + currentIndex);
948
+ if (otherMarkerElement['style']['visibility'] !== 'hidden') {
949
+ markerBoundsComparer(otherMarkerElement, bounds1, colloideBounds, indexCollection, currentIndex);
951
950
  }
952
951
  }
953
- }
954
- });
952
+ });
953
+ }
954
+ else {
955
+ Array.prototype.forEach.call(markerTemplate.childNodes, (otherMarkerElement, p) => {
956
+ if (p >= o + 1 && otherMarkerElement['style']['visibility'] !== 'hidden') {
957
+ markerBoundsComparer(otherMarkerElement, bounds1, colloideBounds, indexCollection, p);
958
+ }
959
+ });
960
+ }
961
+ markerClusterListHandler(maps, currentZoomFactor, layerIndex, o, indexCollection);
955
962
  tempX = bounds1.left + bounds1.width / 2;
956
963
  tempY = bounds1.top + bounds1.height;
957
964
  if (colloideBounds.length > 0) {
@@ -1026,6 +1033,9 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1026
1033
  }
1027
1034
  colloideBounds = [];
1028
1035
  }
1036
+ else {
1037
+ markerClusterListHandler(maps, currentZoomFactor, layerIndex, o, indexCollection);
1038
+ }
1029
1039
  isClusteringCompleted = true;
1030
1040
  });
1031
1041
  layerElement.appendChild(clusterGroup);
@@ -1114,6 +1124,30 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1114
1124
  });
1115
1125
  return isClusteringCompleted;
1116
1126
  }
1127
+ /** @private */
1128
+ function markerClusterListHandler(maps, currentZoomFactor, layerIndex, index, indexCollection) {
1129
+ if (currentZoomFactor == 1) {
1130
+ const initialMarkerClusterList = isNullOrUndefined(maps.markerModule.initialMarkerCluster[layerIndex][index]) ? [] : indexCollection.length > 1 ? indexCollection : [];
1131
+ maps.markerModule.initialMarkerCluster[layerIndex][index] = initialMarkerClusterList;
1132
+ const zoomedMarkerClusterList = isNullOrUndefined(maps.markerModule.zoomedMarkerCluster[layerIndex][index]) ? [] : indexCollection.length > 1 ? indexCollection : [];
1133
+ maps.markerModule.zoomedMarkerCluster[layerIndex][index] = zoomedMarkerClusterList;
1134
+ }
1135
+ else if (currentZoomFactor > 1) {
1136
+ maps.markerModule.zoomedMarkerCluster[layerIndex][index] = indexCollection.length > 1 ? indexCollection : [];
1137
+ }
1138
+ }
1139
+ /** @private */
1140
+ function markerBoundsComparer(tempElement, markerBounds, colloideBounds, indexCollection, p) {
1141
+ let currentMarkerBound = tempElement.getBoundingClientRect();
1142
+ if (!isNullOrUndefined(currentMarkerBound)) {
1143
+ if (!(markerBounds.left > currentMarkerBound.right || markerBounds.right < currentMarkerBound.left
1144
+ || markerBounds.top > currentMarkerBound.bottom || markerBounds.bottom < currentMarkerBound.top)) {
1145
+ colloideBounds.push(currentMarkerBound);
1146
+ tempElement['style']['visibility'] = 'hidden';
1147
+ indexCollection.push(p);
1148
+ }
1149
+ }
1150
+ }
1117
1151
  /**
1118
1152
  *
1119
1153
  * @param {MarkerClusterData[]} sameMarkerData - Specifies the marker data
@@ -1905,22 +1939,40 @@ function isCustomPath(layerData) {
1905
1939
  * @returns {string} - Returns the string
1906
1940
  * @private
1907
1941
  */
1908
- function textTrim(maxWidth, text, font) {
1942
+ function textTrim(maxWidth, text, font, width, isCanvasMeasure, widthList) {
1909
1943
  let label = text;
1910
- let size = measureText(text, font).width;
1911
- if (size > maxWidth) {
1944
+ if (isNullOrUndefined(width)) {
1945
+ if (!isCanvasMeasure) {
1946
+ width = measureText(text, font).width;
1947
+ }
1948
+ else {
1949
+ width = measureTextElement(text, font).width;
1950
+ }
1951
+ }
1952
+ if (width > maxWidth) {
1912
1953
  const textLength = text.length;
1913
1954
  for (let i = textLength - 1; i >= 0; --i) {
1914
1955
  label = text.substring(0, i) + '...';
1915
- size = measureText(label, font).width;
1916
- if (size <= maxWidth || label.length < 4) {
1956
+ if (!isCanvasMeasure) {
1957
+ width = measureText(label, font).width;
1958
+ }
1959
+ else {
1960
+ width = measureTextElement(label, font).width;
1961
+ }
1962
+ if (width <= maxWidth || label.length < 4) {
1917
1963
  if (label.length < 4) {
1918
1964
  label = ' ';
1919
1965
  }
1966
+ if (!isNullOrUndefined(widthList)) {
1967
+ widthList.push(width);
1968
+ }
1920
1969
  return label;
1921
1970
  }
1922
1971
  }
1923
1972
  }
1973
+ if (!isNullOrUndefined(widthList)) {
1974
+ widthList.push(width);
1975
+ }
1924
1976
  return label;
1925
1977
  }
1926
1978
  /**
@@ -1998,11 +2050,11 @@ function getTranslate(mapObject, layer, animate) {
1998
2050
  }
1999
2051
  if (mapObject.zoomSettings.shouldZoomInitially && mapObject.zoomSettings.enable) {
2000
2052
  mapObject.mapScaleValue = scaleFactor = zoomFactorValue = ((mapObject.zoomSettings.shouldZoomInitially || mapObject.enablePersistence) && mapObject.scale === 1)
2001
- ? mapObject.scale : (isNullOrUndefined(mapObject.markerZoomFactor)) ? 1 : mapObject.markerZoomFactor;
2002
- if (mapObject.mapScaleValue !== mapObject.markerZoomFactor && !mapObject.enablePersistence) {
2053
+ ? mapObject.scale : (isNullOrUndefined(mapObject.markerZoomFactor)) ? 1 : (mapObject.markerZoomedState ? mapObject.markerZoomFactor : parseInt(mapObject.scale.toString()));
2054
+ if (mapObject.markerZoomedState && mapObject.mapScaleValue !== mapObject.markerZoomFactor && !mapObject.enablePersistence) {
2003
2055
  mapObject.mapScaleValue = zoomFactorValue = mapObject.markerZoomFactor;
2004
2056
  }
2005
- if (!isNullOrUndefined(mapObject.markerCenterLatitude) && !isNullOrUndefined(mapObject.markerCenterLongitude)) {
2057
+ if (mapObject.markerZoomedState && !isNullOrUndefined(mapObject.markerCenterLatitude) && !isNullOrUndefined(mapObject.markerCenterLongitude)) {
2006
2058
  centerLatitude = mapObject.markerCenterLatitude;
2007
2059
  centerLongitude = mapObject.markerCenterLongitude;
2008
2060
  }
@@ -4283,6 +4335,23 @@ __decorate$1([
4283
4335
  __decorate$1([
4284
4336
  Property(null)
4285
4337
  ], TooltipSettings.prototype, "valuePath", void 0);
4338
+ /**
4339
+ * Specifies the properties such as visibility, fill, border and text style to customize the tooltip.
4340
+ */
4341
+ class PolygonTooltipSettings extends ChildProperty {
4342
+ }
4343
+ __decorate$1([
4344
+ Property(false)
4345
+ ], PolygonTooltipSettings.prototype, "visible", void 0);
4346
+ __decorate$1([
4347
+ Property('')
4348
+ ], PolygonTooltipSettings.prototype, "fill", void 0);
4349
+ __decorate$1([
4350
+ Complex({ color: 'transparent', width: 1 }, Border)
4351
+ ], PolygonTooltipSettings.prototype, "border", void 0);
4352
+ __decorate$1([
4353
+ Complex({ fontFamily: null, size: null, fontWeight: null }, Font)
4354
+ ], PolygonTooltipSettings.prototype, "textStyle", void 0);
4286
4355
  /**
4287
4356
  * Gets or sets the options to customize the margin of the maps.
4288
4357
  */
@@ -4479,6 +4548,12 @@ __decorate$1([
4479
4548
  __decorate$1([
4480
4549
  Property([])
4481
4550
  ], PolygonSetting.prototype, "points", void 0);
4551
+ __decorate$1([
4552
+ Property('')
4553
+ ], PolygonSetting.prototype, "tooltipText", void 0);
4554
+ __decorate$1([
4555
+ Property('')
4556
+ ], PolygonSetting.prototype, "tooltipTemplate", void 0);
4482
4557
  /**
4483
4558
  * Defines the properties of the polygon shapes that will be rendered on a map layer.
4484
4559
  * The selection and highlight settings for polygon shapes can also be defined.
@@ -4494,6 +4569,9 @@ __decorate$1([
4494
4569
  __decorate$1([
4495
4570
  Complex({}, HighlightSettings)
4496
4571
  ], PolygonSettings.prototype, "highlightSettings", void 0);
4572
+ __decorate$1([
4573
+ Complex({}, PolygonTooltipSettings)
4574
+ ], PolygonSettings.prototype, "tooltipSettings", void 0);
4497
4575
  /**
4498
4576
  * Gets or sets the options to customize the navigation lines in maps which is used to connect different locations.
4499
4577
  */
@@ -5277,6 +5355,18 @@ const annotationRendering = 'annotationRendering';
5277
5355
  * @private
5278
5356
  */
5279
5357
  const itemSelection = 'itemSelection';
5358
+ /**
5359
+ * Specifies the maps pan complete event name.
5360
+ *
5361
+ * @private
5362
+ */
5363
+ const panComplete = 'panComplete';
5364
+ /**
5365
+ * Specifies the maps zoom complete event name.
5366
+ *
5367
+ * @private
5368
+ */
5369
+ const zoomComplete = 'zoomComplete';
5280
5370
  /**
5281
5371
  * Specifies the maps item highlight event name.
5282
5372
  *
@@ -5348,7 +5438,6 @@ class BingMap {
5348
5438
  */
5349
5439
  class ColorMapping {
5350
5440
  constructor(maps) {
5351
- this.maps = maps;
5352
5441
  }
5353
5442
  /**
5354
5443
  * To get color based on shape settings.
@@ -5725,8 +5814,10 @@ class LayerPanel {
5725
5814
  else if (panel.mapObject.defaultState) {
5726
5815
  panel.mapObject.previousZoomFactor = panel.mapObject.tileZoomLevel;
5727
5816
  panel.mapObject.tileZoomLevel = zoomFactorValue;
5728
- panel.mapObject.tileTranslatePoint.x = 0;
5729
- panel.mapObject.tileTranslatePoint.y = 0;
5817
+ if (!isNullOrUndefined(panel.mapObject.tileTranslatePoint)) {
5818
+ panel.mapObject.tileTranslatePoint.x = 0;
5819
+ panel.mapObject.tileTranslatePoint.y = 0;
5820
+ }
5730
5821
  }
5731
5822
  if (zoomFactorValue <= 1 && !isNullOrUndefined(panel.mapObject.height) && !panel.mapObject.zoomSettings.shouldZoomInitially
5732
5823
  && (panel.mapObject.tileZoomLevel === panel.mapObject.tileZoomScale) && this.mapObject.initialCheck) {
@@ -5734,8 +5825,10 @@ class LayerPanel {
5734
5825
  }
5735
5826
  if (!isNullOrUndefined(panel.mapObject.centerLatOfGivenLocation) && !isNullOrUndefined(panel.mapObject.centerLongOfGivenLocation) &&
5736
5827
  panel.mapObject.zoomNotApplied) {
5737
- centerTileMap.y = panel.mapObject.centerLatOfGivenLocation;
5738
- centerTileMap.x = panel.mapObject.centerLongOfGivenLocation;
5828
+ if (!isNullOrUndefined(centerTileMap)) {
5829
+ centerTileMap.y = panel.mapObject.centerLatOfGivenLocation;
5830
+ centerTileMap.x = panel.mapObject.centerLongOfGivenLocation;
5831
+ }
5739
5832
  panel.mapObject.tileZoomLevel = panel.mapObject.mapScaleValue = panel.mapObject.scaleOfGivenLocation;
5740
5833
  }
5741
5834
  panel.mapObject.tileTranslatePoint = panel.panTileMap(panel.mapObject.availableSize.width, panel.mapObject.availableSize.height, centerTileMap);
@@ -5746,8 +5839,10 @@ class LayerPanel {
5746
5839
  const padding = this.mapObject.layers[this.mapObject.baseLayerIndex].layerType !== 'GoogleStaticMap' ?
5747
5840
  20 : 0;
5748
5841
  const totalSize = Math.pow(2, this.mapObject.initialZoomLevel) * 256;
5749
- this.mapObject.initialTileTranslate.x = (this.mapObject.availableSize.width / 2) - (totalSize / 2);
5750
- this.mapObject.initialTileTranslate.y = (this.mapObject.availableSize.height / 2) - (totalSize / 2) + padding;
5842
+ if (!isNullOrUndefined(this.mapObject.initialTileTranslate)) {
5843
+ this.mapObject.initialTileTranslate.x = (this.mapObject.availableSize.width / 2) - (totalSize / 2);
5844
+ this.mapObject.initialTileTranslate.y = (this.mapObject.availableSize.height / 2) - (totalSize / 2) + padding;
5845
+ }
5751
5846
  }
5752
5847
  panel.generateTiles(panel.mapObject.tileZoomLevel, panel.mapObject.tileTranslatePoint, null, bing);
5753
5848
  if (!isNullOrUndefined(panel.mapObject.previousZoomFactor)
@@ -6252,7 +6347,7 @@ class LayerPanel {
6252
6347
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6253
6348
  const intersect = [];
6254
6349
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6255
- renderData.map((currentShapeData, i) => {
6350
+ Array.prototype.forEach.call(renderData, (currentShapeData, i) => {
6256
6351
  this.renderLabel(this.currentLayer, layerIndex, currentShapeData, group, i, labelTemplateEle, intersect);
6257
6352
  });
6258
6353
  this.groupElements.push(group);
@@ -7378,6 +7473,9 @@ let Maps = class Maps extends Component {
7378
7473
  this.trigger(load, { maps: this });
7379
7474
  this.createSVG();
7380
7475
  this.findBaseAndSubLayers();
7476
+ if (!isNullOrUndefined(this.markerModule)) {
7477
+ this.markerModule.initializeMarkerClusterList();
7478
+ }
7381
7479
  this.createSecondaryElement();
7382
7480
  this.addTabIndex();
7383
7481
  this.themeStyle = getThemeStyle(this.theme);
@@ -7830,15 +7928,22 @@ let Maps = class Maps extends Component {
7830
7928
  * @returns {void}
7831
7929
  */
7832
7930
  getMinMaxLatitudeLongitude() {
7833
- const element = document.getElementById(this.element.id).getBoundingClientRect();
7834
- let minPosition = this.isTileMap ? this.pointToLatLong((this.mapAreaRect.x - this.margin.left), -this.mapAreaRect.y) : this.getGeoLocation(0, (this.mapAreaRect.x + element.left), this.mapAreaRect.y);
7835
- let maxPosition = this.isTileMap ? this.pointToLatLong(this.mapAreaRect.width, (this.mapAreaRect.height - this.mapAreaRect.y)) :
7836
- this.getGeoLocation(0, (this.mapAreaRect.x + element.left + this.mapAreaRect.width), (this.mapAreaRect.y + this.mapAreaRect.height));
7837
- const MinMaxLatitudeLongitude = {
7838
- minLatitude: minPosition.latitude, maxLatitude: maxPosition.latitude, minLongitude: minPosition.longitude,
7839
- maxLongitude: maxPosition.longitude
7840
- };
7841
- return MinMaxLatitudeLongitude;
7931
+ const mapsElement = document.getElementById(this.element.id);
7932
+ if (!isNullOrUndefined(mapsElement)) {
7933
+ const element = mapsElement.getBoundingClientRect();
7934
+ let minPosition = this.isTileMap ? this.pointToLatLong((this.mapAreaRect.x - this.margin.left), -this.mapAreaRect.y) : this.getGeoLocation(0, (this.mapAreaRect.x + element.left), this.mapAreaRect.y);
7935
+ let maxPosition = this.isTileMap ? this.pointToLatLong(this.mapAreaRect.width, (this.mapAreaRect.height - this.mapAreaRect.y)) :
7936
+ this.getGeoLocation(0, (this.mapAreaRect.x + element.left + this.mapAreaRect.width), (this.mapAreaRect.y + this.mapAreaRect.height));
7937
+ const MinMaxLatitudeLongitude = {
7938
+ minLatitude: minPosition.latitude, maxLatitude: maxPosition.latitude, minLongitude: minPosition.longitude,
7939
+ maxLongitude: maxPosition.longitude
7940
+ };
7941
+ return MinMaxLatitudeLongitude;
7942
+ }
7943
+ else {
7944
+ return { minLatitude: 0, maxLatitude: 0, minLongitude: 0,
7945
+ maxLongitude: 0 };
7946
+ }
7842
7947
  }
7843
7948
  /**
7844
7949
  * @returns {void}
@@ -7851,10 +7956,9 @@ let Maps = class Maps extends Component {
7851
7956
  const templateElements = document.getElementsByClassName(this.element.id + '_template');
7852
7957
  if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
7853
7958
  getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
7854
- for (let i = 0; i < templateElements.length; i++) {
7959
+ Array.prototype.forEach.call(templateElements, (templateGroupEle, i) => {
7855
7960
  let offSetLetValue = 0;
7856
7961
  let offSetTopValue = 0;
7857
- const templateGroupEle = templateElements[i];
7858
7962
  if (!isNullOrUndefined(templateGroupEle) && templateGroupEle.childElementCount > 0) {
7859
7963
  const layerOffset = getElementByID(this.element.id + '_Layer_Collections').getBoundingClientRect();
7860
7964
  const elementOffset = getElementByID(templateGroupEle.id).getBoundingClientRect();
@@ -7864,21 +7968,22 @@ let Maps = class Maps extends Component {
7864
7968
  offSetTopValue = this.isTileMap ? 0 : (layerOffset.top < elementOffset.top) ?
7865
7969
  -(Math.abs(elementOffset.top - layerOffset.top)) : Math.abs(elementOffset.top - layerOffset.top);
7866
7970
  }
7867
- for (let j = 0; j < templateGroupEle.childElementCount; j++) {
7868
- const currentTemplate = templateGroupEle.childNodes[j];
7971
+ Array.prototype.forEach.call(templateGroupEle.childNodes, (currentTemplate, j) => {
7869
7972
  if (currentTemplate.id.indexOf('Marker') !== -1) {
7870
- const elementOffset = getElementByID(currentTemplate.id).getBoundingClientRect();
7871
- currentTemplate.style.left = parseFloat(currentTemplate.style.left) - (this.isTileMap ? 0 : elementOffset.width / 2) + 'px';
7872
- currentTemplate.style.top = parseFloat(currentTemplate.style.top) - (this.isTileMap ? 0 : elementOffset.height / 2) + 'px';
7973
+ if (currentTemplate.style.visibility != "hidden") {
7974
+ const elementOffset = getElementByID(currentTemplate.id).getBoundingClientRect();
7975
+ currentTemplate.style.left = parseFloat(currentTemplate.style.left) - (this.isTileMap ? 0 : elementOffset.width / 2) + 'px';
7976
+ currentTemplate.style.top = parseFloat(currentTemplate.style.top) - (this.isTileMap ? 0 : elementOffset.height / 2) + 'px';
7977
+ }
7873
7978
  }
7874
7979
  else {
7875
7980
  currentTemplate.style.left = parseFloat(currentTemplate.style.left) + offSetLetValue + 'px';
7876
7981
  currentTemplate.style.top = parseFloat(currentTemplate.style.top) + offSetTopValue + 'px';
7877
7982
  currentTemplate.style.transform = 'translate(-50%, -50%)';
7878
7983
  }
7879
- }
7984
+ });
7880
7985
  }
7881
- }
7986
+ });
7882
7987
  }
7883
7988
  }
7884
7989
  createTile() {
@@ -8005,7 +8110,8 @@ let Maps = class Maps extends Component {
8005
8110
  const options = new TextOption(this.element.id + '_Map_' + type, location.x, location.y, 'start', trimmedTitle);
8006
8111
  const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
8007
8112
  const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
8008
- element.setAttribute('aria-label', this.description || title.text);
8113
+ element.setAttribute('aria-label', title.text);
8114
+ element.setAttribute('role', 'region');
8009
8115
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
8010
8116
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
8011
8117
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -8156,7 +8262,7 @@ let Maps = class Maps extends Component {
8156
8262
  }
8157
8263
  else if (this.zoomSettings.enable && zoom && event['keyCode'] === 82) {
8158
8264
  zoom.performZoomingByToolBar('reset');
8159
- zoom.isPanning = false;
8265
+ zoom.isPanModeEnabled = false;
8160
8266
  }
8161
8267
  else if (this.zoomSettings.enable && this.zoomSettings.enablePanning && zoom
8162
8268
  && (event.code === 'ArrowUp' || event.code === 'ArrowDown')) {
@@ -8319,12 +8425,12 @@ let Maps = class Maps extends Component {
8319
8425
  return latLongValue;
8320
8426
  }
8321
8427
  /** @private */
8322
- getClickLocation(targetId, pageX, pageY, targetElement, x, y) {
8428
+ getClickLocation(targetId, pageX, pageY, targetElement, x, y, type) {
8323
8429
  let layerIndex = 0;
8324
8430
  let latLongValue;
8325
- if (targetId.indexOf('_LayerIndex_') !== -1 && !this.isTileMap &&
8326
- (parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
8327
- (parseInt(this.mouseDownEvent['y'], 10) === parseInt(this.mouseClickEvent['y'], 10))) {
8431
+ if (targetId.indexOf('_LayerIndex_') !== -1 && !this.isTileMap && (!isNullOrUndefined(type) ||
8432
+ ((parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
8433
+ (parseInt(this.mouseDownEvent['y'], 10) === parseInt(this.mouseClickEvent['y'], 10))))) {
8328
8434
  layerIndex = parseFloat(targetId.split('_LayerIndex_')[1].split('_')[0]);
8329
8435
  if (this.layers[layerIndex].geometryType === 'Normal') {
8330
8436
  if (targetId.indexOf('_shapeIndex_') > -1) {
@@ -8383,8 +8489,9 @@ let Maps = class Maps extends Component {
8383
8489
  latLongValue = this.getGeoLocation(layerIndex, x, y);
8384
8490
  }
8385
8491
  }
8386
- else if (this.isTileMap && (parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
8387
- (parseInt(this.mouseDownEvent['y'], 10) === parseInt(this.mouseClickEvent['y'], 10))) {
8492
+ else if (this.isTileMap && (!isNullOrUndefined(type) ||
8493
+ ((parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
8494
+ (parseInt(this.mouseDownEvent['y'], 10) === parseInt(this.mouseClickEvent['y'], 10))))) {
8388
8495
  latLongValue = this.getTileGeoLocation(x, y);
8389
8496
  }
8390
8497
  return latLongValue;
@@ -9114,13 +9221,51 @@ let Maps = class Maps extends Component {
9114
9221
  this.mouseDownEvent = { x: null, y: null };
9115
9222
  this.mouseClickEvent = { x: null, y: null };
9116
9223
  this.formatFunction = null;
9117
- //TODO: Calling the below code throws spec issue.
9118
- //this.renderer = null;
9119
- this.availableSize = new Size(0, 0);
9224
+ this.localeObject = null;
9225
+ this.defaultLocalConstants = null;
9226
+ this.intl = null;
9227
+ this.mapAreaRect = null;
9228
+ this.layersCollection = null;
9229
+ this.themeStyle = null;
9230
+ this.totalRect = null;
9231
+ this.baseSize = null;
9232
+ this.baseMapBounds = null;
9233
+ this.baseMapRectBounds = null;
9234
+ this.baseTranslatePoint = null;
9235
+ this.baseTileTranslatePoint = null;
9236
+ this.markerZoomCenterPoint = null;
9237
+ this.currentTiles = null;
9238
+ this.serverProcess = null;
9239
+ this.toolbarProperties = null;
9240
+ this.zoomLabelPositions = null;
9241
+ this.resizeEvent = null;
9242
+ this.availableSize = null;
9120
9243
  if (document.getElementById('mapsmeasuretext')) {
9121
9244
  document.getElementById('mapsmeasuretext').remove();
9122
9245
  }
9123
9246
  this.removeSvg();
9247
+ this.svgObject = null;
9248
+ this.mapLayerPanel = null;
9249
+ this.renderer = null;
9250
+ this.translatePoint = null;
9251
+ this.tileTranslatePoint = null;
9252
+ this.previousPoint = null;
9253
+ this.dataLabelShape = [];
9254
+ this.zoomShapeCollection = [];
9255
+ this.selectedElementId = [];
9256
+ this.selectedMarkerElementId = [];
9257
+ this.selectedBubbleElementId = [];
9258
+ this.shapeSelectionClass = null;
9259
+ this.markerSelectionClass = null;
9260
+ this.bubbleSelectionClass = null;
9261
+ this.navigationSelectionClass = null;
9262
+ this.selectedNavigationElementId = [];
9263
+ this.polygonSelectionClass = null;
9264
+ this.selectedPolygonElementId = [];
9265
+ this.legendSelectionClass = null;
9266
+ this.previousTranslate = null;
9267
+ this.initialTileTranslate = null;
9268
+ this.markerDragArgument = null;
9124
9269
  }
9125
9270
  /**
9126
9271
  * Gets component name
@@ -9261,85 +9406,99 @@ let Maps = class Maps extends Component {
9261
9406
  if (this.isBubbleVisible()) {
9262
9407
  modules.push({
9263
9408
  member: 'Bubble',
9264
- args: [this]
9409
+ args: [this],
9410
+ name: 'Bubble'
9265
9411
  });
9266
9412
  }
9267
9413
  if (isVisible.highlight) {
9268
9414
  modules.push({
9269
9415
  member: 'Highlight',
9270
- args: [this]
9416
+ args: [this],
9417
+ name: 'Highlight'
9271
9418
  });
9272
9419
  }
9273
9420
  if (isVisible.selection) {
9274
9421
  modules.push({
9275
9422
  member: 'Selection',
9276
- args: [this]
9423
+ args: [this],
9424
+ name: 'Selection'
9277
9425
  });
9278
9426
  }
9279
9427
  if (this.legendSettings.visible) {
9280
9428
  modules.push({
9281
9429
  member: 'Legend',
9282
- args: [this]
9430
+ args: [this],
9431
+ name: 'Legend'
9283
9432
  });
9284
9433
  }
9285
9434
  if (this.zoomSettings.enable || this.zoomSettings.zoomFactor > this.zoomSettings.minZoom) {
9286
9435
  modules.push({
9287
9436
  member: 'Zoom',
9288
- args: [this]
9437
+ args: [this],
9438
+ name: 'Zoom'
9289
9439
  });
9290
9440
  }
9291
9441
  if (this.isMarkersVisible()) {
9292
9442
  modules.push({
9293
9443
  member: 'Marker',
9294
- args: [this]
9444
+ args: [this],
9445
+ name: 'Marker'
9295
9446
  });
9296
9447
  }
9297
9448
  if (this.isDataLabelVisible()) {
9298
9449
  modules.push({
9299
9450
  member: 'DataLabel',
9300
- args: [this]
9451
+ args: [this],
9452
+ name: 'DataLabel'
9301
9453
  });
9302
9454
  }
9303
9455
  if (this.isNavigationVisible()) {
9304
9456
  modules.push({
9305
9457
  member: 'NavigationLine',
9306
- args: [this]
9458
+ args: [this],
9459
+ name: 'NavigationLine'
9307
9460
  });
9308
9461
  }
9309
9462
  if (this.isPolygonVisible()) {
9310
9463
  modules.push({
9311
9464
  member: 'Polygon',
9312
- args: [this]
9465
+ args: [this],
9466
+ name: 'Polygon'
9313
9467
  });
9314
9468
  }
9315
9469
  if (isVisible.tooltip) {
9316
9470
  modules.push({
9317
9471
  member: 'MapsTooltip',
9318
- args: [this]
9472
+ args: [this],
9473
+ name: 'MapsTooltip'
9319
9474
  });
9320
9475
  }
9321
9476
  if (annotationEnable) {
9322
9477
  modules.push({
9323
9478
  member: 'Annotations',
9324
- args: [this, Annotations]
9479
+ args: [this, Annotations],
9480
+ name: 'Annotations'
9325
9481
  });
9326
9482
  }
9327
9483
  if (this.allowPrint) {
9328
9484
  modules.push({
9329
9485
  member: 'Print',
9330
- args: [this]
9486
+ args: [this],
9487
+ name: 'Print'
9331
9488
  });
9332
9489
  }
9333
9490
  if (this.allowImageExport) {
9334
9491
  modules.push({
9335
9492
  member: 'ImageExport',
9336
- args: [this]
9493
+ args: [this],
9494
+ name: 'ImageExport'
9337
9495
  });
9338
9496
  }
9339
9497
  if (this.allowPdfExport) {
9340
9498
  modules.push({
9341
9499
  member: 'PdfExport',
9342
- args: [this]
9500
+ args: [this],
9501
+ name: 'PdfExport'
9343
9502
  });
9344
9503
  }
9345
9504
  return modules;
@@ -9533,6 +9692,7 @@ let Maps = class Maps extends Component {
9533
9692
  if (polygon.points.length > 0) {
9534
9693
  isSelection = layer.polygonSettings.highlightSettings.enable || isSelection;
9535
9694
  isHighlight = layer.polygonSettings.selectionSettings.enable || isHighlight;
9695
+ istooltipVisible = layer.polygonSettings.tooltipSettings.visible || istooltipVisible;
9536
9696
  }
9537
9697
  }
9538
9698
  for (const marker$$1 of markers) {
@@ -9809,6 +9969,12 @@ __decorate([
9809
9969
  __decorate([
9810
9970
  Event()
9811
9971
  ], Maps.prototype, "pan", void 0);
9972
+ __decorate([
9973
+ Event()
9974
+ ], Maps.prototype, "panComplete", void 0);
9975
+ __decorate([
9976
+ Event()
9977
+ ], Maps.prototype, "zoomComplete", void 0);
9812
9978
  Maps = __decorate([
9813
9979
  NotifyPropertyChanges
9814
9980
  ], Maps);
@@ -10033,10 +10199,10 @@ class Bubble {
10033
10199
  getbubble(target) {
10034
10200
  const id = target.split('_LayerIndex_');
10035
10201
  const index = parseInt(id[1].split('_')[0], 10);
10036
- const layer = this.maps.layers[index];
10037
10202
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10038
10203
  let data;
10039
10204
  if (target.indexOf('_BubbleIndex_') > -1) {
10205
+ const layer = this.maps.layers[index];
10040
10206
  const bubbleIndex = parseInt(id[1].split('_BubbleIndex_')[1], 10);
10041
10207
  const dataIndex = parseInt(id[1].split('_BubbleIndex_')[1].split('_dataIndex_')[1], 10);
10042
10208
  if (!isNaN(bubbleIndex)) {
@@ -10086,8 +10252,7 @@ class Bubble {
10086
10252
  */
10087
10253
  destroy() {
10088
10254
  this.bubbleCollection = [];
10089
- //TODO: Calling the below code throws spec issue.
10090
- //this.maps = null;
10255
+ this.maps = null;
10091
10256
  }
10092
10257
  }
10093
10258
 
@@ -10099,6 +10264,8 @@ class Marker {
10099
10264
  this.maps = maps;
10100
10265
  this.trackElements = [];
10101
10266
  this.sameMarkerData = [];
10267
+ this.initialMarkerCluster = [];
10268
+ this.zoomedMarkerCluster = [];
10102
10269
  }
10103
10270
  markerRender(maps, layerElement, layerIndex, factor, type) {
10104
10271
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -10130,13 +10297,11 @@ class Marker {
10130
10297
  getZoomTranslate(maps, currentLayer, allowAnimation) :
10131
10298
  getTranslate(maps, currentLayer, allowAnimation);
10132
10299
  }
10133
- for (let markerIndex = 0; markerIndex < currentLayer.markerSettings.length; markerIndex++) {
10134
- let markerSettings = currentLayer.markerSettings[markerIndex];
10300
+ Array.prototype.forEach.call(currentLayer.markerSettings, (markerSettings, markerIndex) => {
10135
10301
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10136
10302
  const markerData = markerSettings.dataSource;
10137
10303
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10138
- for (let dataIndex = 0; dataIndex < markerData.length; dataIndex++) {
10139
- let data = markerData[dataIndex];
10304
+ Array.prototype.forEach.call(markerData, (data, dataIndex) => {
10140
10305
  maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
10141
10306
  let eventArgs = {
10142
10307
  cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
@@ -10210,8 +10375,8 @@ class Marker {
10210
10375
  }
10211
10376
  }
10212
10377
  });
10213
- }
10214
- }
10378
+ });
10379
+ });
10215
10380
  }
10216
10381
  /**
10217
10382
  * To find zoom level for individual layers like India, USA.
@@ -10570,6 +10735,13 @@ class Marker {
10570
10735
  };
10571
10736
  this.maps.trigger(markerClusterMouseMove, eventArgs);
10572
10737
  }
10738
+ /** @private */
10739
+ initializeMarkerClusterList() {
10740
+ for (let i = 0; i < this.maps.layers.length; i++) {
10741
+ this.initialMarkerCluster[i] = [];
10742
+ this.zoomedMarkerCluster[i] = [];
10743
+ }
10744
+ }
10573
10745
  /**
10574
10746
  * Get module name.
10575
10747
  *
@@ -10589,6 +10761,8 @@ class Marker {
10589
10761
  this.trackElements = [];
10590
10762
  this.markerSVGObject = null;
10591
10763
  this.sameMarkerData = [];
10764
+ this.initialMarkerCluster = [];
10765
+ this.zoomedMarkerCluster = [];
10592
10766
  }
10593
10767
  }
10594
10768
 
@@ -10597,7 +10771,6 @@ class Marker {
10597
10771
  */
10598
10772
  class Polygon {
10599
10773
  constructor(maps) {
10600
- this.maps = maps;
10601
10774
  }
10602
10775
  /**
10603
10776
  * To render polygon for maps
@@ -10622,7 +10795,7 @@ class Polygon {
10622
10795
  const path = calculatePolygonPath(maps, factor, currentLayer, polygonData);
10623
10796
  const pathOptions = new PathOption(maps.element.id + '_LayerIndex_' + layerIndex + '_PolygonIndex_' + polygonIndex, polygonSetting.fill, (polygonSetting.borderWidth / factor), polygonSetting.borderColor, polygonSetting.opacity, polygonSetting.borderOpacity, '', path);
10624
10797
  const polygonEle = maps.renderer.drawPath(pathOptions);
10625
- maintainSelection(this.maps.selectedPolygonElementId, this.maps.polygonSelectionClass, polygonEle, 'PolygonselectionMapStyle');
10798
+ maintainSelection(maps.selectedPolygonElementId, maps.polygonSelectionClass, polygonEle, 'PolygonselectionMapStyle');
10626
10799
  polygonSVGObject.appendChild(polygonEle);
10627
10800
  polygonsSVGObject.appendChild(polygonSVGObject);
10628
10801
  });
@@ -10643,7 +10816,6 @@ class Polygon {
10643
10816
  * @private
10644
10817
  */
10645
10818
  destroy() {
10646
- this.maps = null;
10647
10819
  }
10648
10820
  }
10649
10821
 
@@ -10727,7 +10899,7 @@ class DataLabel {
10727
10899
  let locationY;
10728
10900
  style.fontFamily = this.maps.theme.toLowerCase() !== 'material' ? this.maps.themeStyle.labelFontFamily : style.fontFamily;
10729
10901
  style.fontWeight = style.fontWeight || this.maps.themeStyle.fontWeight || Theme.dataLabelFont.fontWeight;
10730
- shape = shapes['property'];
10902
+ shape = !isNullOrUndefined(shapes) ? shapes['property'] : null;
10731
10903
  const properties = (Object.prototype.toString.call(layer.shapePropertyPath) === '[object Array]' ?
10732
10904
  layer.shapePropertyPath : [layer.shapePropertyPath]);
10733
10905
  let propertyPath;
@@ -10759,7 +10931,7 @@ class DataLabel {
10759
10931
  datasrcObj = this.getDataLabel(
10760
10932
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10761
10933
  layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
10762
- if (!isNullOrUndefined(shapes['property'])) {
10934
+ if (!isNullOrUndefined(shapes) && !isNullOrUndefined(shapes['property'])) {
10763
10935
  shapePoint = [[]];
10764
10936
  if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
10765
10937
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -10862,13 +11034,13 @@ class DataLabel {
10862
11034
  if (eventargs.text !== text && !eventargs.cancel) {
10863
11035
  text = eventargs.text;
10864
11036
  }
10865
- const textSize = measureText(text, style);
11037
+ const textSize = measureTextElement(text, style);
10866
11038
  let trimmedLable = text;
10867
11039
  let elementSize = textSize;
10868
- const startY = location['y'] - textSize['height'] / 4;
10869
- const endY = location['y'] + textSize['height'] / 4;
10870
- const start = ((location['y'] + transPoint['y']) * scale) - textSize['height'] / 4;
10871
- const end = ((location['y'] + transPoint['y']) * scale) + textSize['height'] / 4;
11040
+ const startY = location['y'] - textSize['height'] / 2;
11041
+ const endY = location['y'] + textSize['height'] / 2;
11042
+ const start = ((location['y'] + transPoint['y']) * scale) - textSize['height'] / 2;
11043
+ const end = ((location['y'] + transPoint['y']) * scale) + textSize['height'] / 2;
10872
11044
  position = filter(shapePoint[midIndex], startY, endY);
10873
11045
  if (!isPoint && position.length > 5 && (shapeData['geometry']['type'] !== 'MultiPolygon') &&
10874
11046
  (shapeData['type'] !== 'MultiPolygon')) {
@@ -10909,8 +11081,8 @@ class DataLabel {
10909
11081
  if (dataLabelSettings.smartLabelMode === 'Trim') {
10910
11082
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10911
11083
  const textType = typeof text === 'number' ? text.toString() : text;
10912
- trimmedLable = textTrim(width, textType, style);
10913
- elementSize = measureText(trimmedLable, style);
11084
+ trimmedLable = textTrim(width, textType, style, null, true);
11085
+ elementSize = measureTextElement(trimmedLable, style);
10914
11086
  options = new TextOption(labelId, textLocation.x, textLocation.y, 'middle', trimmedLable, '', '');
10915
11087
  }
10916
11088
  if (dataLabelSettings.smartLabelMode === 'None') {
@@ -10951,19 +11123,19 @@ class DataLabel {
10951
11123
  if (this.value[index]['leftWidth'] > intersect[j]['leftWidth']) {
10952
11124
  width = intersect[j]['rightWidth'] - this.value[index]['leftWidth'];
10953
11125
  difference = width - (this.value[index]['rightWidth'] - this.value[index]['leftWidth']);
10954
- trimmedLable = textTrim(difference, text, style);
11126
+ trimmedLable = textTrim(difference, text, style, null, true);
10955
11127
  break;
10956
11128
  }
10957
11129
  if (this.value[index]['leftWidth'] < intersect[j]['leftWidth']) {
10958
11130
  width = this.value[index]['rightWidth'] - intersect[j]['leftWidth'];
10959
11131
  difference = Math.abs(width - (this.value[index]['rightWidth'] - this.value[index]['leftWidth']));
10960
- trimmedLable = textTrim(difference, text, style);
11132
+ trimmedLable = textTrim(difference, text, style, null, true);
10961
11133
  break;
10962
11134
  }
10963
11135
  }
10964
11136
  }
10965
11137
  }
10966
- elementSize = measureText(trimmedLable, style);
11138
+ elementSize = measureTextElement(trimmedLable, style);
10967
11139
  intersect.push(this.value[index]);
10968
11140
  options = new TextOption(labelId, textLocation.x, (textLocation.y), 'middle', trimmedLable, '', '');
10969
11141
  }
@@ -10997,6 +11169,8 @@ class DataLabel {
10997
11169
  }
10998
11170
  }
10999
11171
  element = renderTextElement(options, style, style.color || this.maps.themeStyle.dataLabelFontColor, group);
11172
+ element.setAttribute('aria-label', text);
11173
+ element.setAttribute('role', 'region');
11000
11174
  element.setAttribute('visibility', layer.dataLabelSettings.animationDuration > 0 || animationMode === 'Enable' ? 'hidden' : 'visibile');
11001
11175
  if (zoomLabelsPosition && scaleZoomValue > 1 && !this.maps.zoomNotApplied) {
11002
11176
  element.setAttribute('transform', 'translate( ' + ((location['x'] + labelArgs.offsetX)) + ' '
@@ -11006,7 +11180,7 @@ class DataLabel {
11006
11180
  }
11007
11181
  else {
11008
11182
  element.setAttribute('transform', 'translate( ' + (((location['x'] + transPoint.x) * scale) + labelArgs.offsetX) + ' '
11009
- + ((((location['y'] + transPoint.y) * scale) + (elementSize.height / 4)) + labelArgs.offsetY) + ' )');
11183
+ + ((((location['y'] + transPoint.y) * scale) + (elementSize.height / 2)) + labelArgs.offsetY) + ' )');
11010
11184
  }
11011
11185
  group.appendChild(element);
11012
11186
  }
@@ -11056,16 +11230,16 @@ class DataLabel {
11056
11230
  getPoint(shapes, points) {
11057
11231
  if (shapes['type'] === 'MultiLineString') {
11058
11232
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11059
- shapes.map((current) => {
11233
+ Array.prototype.forEach.call(shapes, (current) => {
11060
11234
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11061
- current.map((shape) => {
11235
+ Array.prototype.forEach.call(current, (shape) => {
11062
11236
  points.push(new Point(shape['point']['x'], shape['point']['y']));
11063
11237
  });
11064
11238
  });
11065
11239
  }
11066
11240
  else {
11067
11241
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11068
- shapes.map((current) => {
11242
+ Array.prototype.forEach.call(shapes, (current) => {
11069
11243
  points.push(new Point(current['point']['x'], current['point']['y']));
11070
11244
  });
11071
11245
  }
@@ -11685,7 +11859,9 @@ class Legend {
11685
11859
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
11686
11860
  textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
11687
11861
  textFont.size = map.themeStyle.legendFontSize || textFont.size;
11688
- renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
11862
+ const element = renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
11863
+ element.setAttribute('aria-label', item['text']);
11864
+ element.setAttribute('role', 'region');
11689
11865
  this.legendGroup.appendChild(render.drawRectangle(rectOptions));
11690
11866
  this.legendToggle();
11691
11867
  }
@@ -11762,7 +11938,9 @@ class Legend {
11762
11938
  legendText = trimmedText;
11763
11939
  }
11764
11940
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
11765
- renderTextElement(textOptions, legendTextStyle, legendTextStyle.color, legendElement);
11941
+ const element = renderTextElement(textOptions, legendTextStyle, legendTextStyle.color, legendElement);
11942
+ element.setAttribute('aria-label', legendText);
11943
+ element.setAttribute('role', 'region');
11766
11944
  this.legendGroup.appendChild(legendElement);
11767
11945
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11768
11946
  if (i === (this.totalPages[page]['Collection'].length - 1)) {
@@ -11838,6 +12016,8 @@ class Legend {
11838
12016
  };
11839
12017
  const pagingTextElement = render.createText(pageTextOptions, pagingText);
11840
12018
  pagingTextElement.style.cssText = 'user-select: none;';
12019
+ pagingTextElement.setAttribute('aria-label', pagingText);
12020
+ pagingTextElement.setAttribute('role', 'region');
11841
12021
  pagingGroup.appendChild(pagingTextElement);
11842
12022
  this.legendGroup.appendChild(pagingGroup);
11843
12023
  }
@@ -12533,7 +12713,9 @@ class Legend {
12533
12713
  textStyle.size = !isNullOrUndefined(textStyle.size) ? textStyle.size : this.maps.themeStyle.subTitleFontSize || Theme.legendTitleFont.size;
12534
12714
  textStyle.fontWeight = !isNullOrUndefined(textStyle.fontWeight) ? textStyle.fontWeight : this.maps.themeStyle.titleFontWeight || Theme.legendTitleFont.fontWeight;
12535
12715
  textOptions = new TextOption(map.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - spacing / 2, 'middle', trimTitle, '');
12536
- renderTextElement(textOptions, textStyle, textStyle.color, this.legendGroup);
12716
+ const element = renderTextElement(textOptions, textStyle, textStyle.color, this.legendGroup);
12717
+ element.setAttribute('aria-label', legendTitle);
12718
+ element.setAttribute('role', 'region');
12537
12719
  }
12538
12720
  }
12539
12721
  changeNextPage(e) {
@@ -14076,6 +14258,7 @@ class MapsTooltip {
14076
14258
  }
14077
14259
  }
14078
14260
  let option;
14261
+ let polygonTooltipOption;
14079
14262
  let currentData = '';
14080
14263
  const targetId = target.id;
14081
14264
  let tooltipEle;
@@ -14088,10 +14271,30 @@ class MapsTooltip {
14088
14271
  let markerFill;
14089
14272
  const location = getMousePosition(pageX, pageY, this.maps.svgObject);
14090
14273
  this.tooltipTargetID = targetId;
14274
+ let polygonTextStyle;
14275
+ let polygonFill;
14276
+ let polygon;
14277
+ let latitude = null;
14278
+ let longitude = null;
14279
+ const latLongValue = this.maps.getClickLocation(targetId, e.pageX, e.pageY, target, e['layerX'], e['layerY'], 'tooltip');
14280
+ if (!isNullOrUndefined(latLongValue)) {
14281
+ latitude = latLongValue.latitude;
14282
+ longitude = latLongValue.longitude;
14283
+ }
14284
+ const isPolygon = targetId.indexOf('_PolygonIndex_') > -1;
14091
14285
  const istooltipRender = (targetId.indexOf('_shapeIndex_') > -1)
14092
- || (targetId.indexOf('_MarkerIndex_') > -1) || (targetId.indexOf('_BubbleIndex_') > -1);
14286
+ || (targetId.indexOf('_MarkerIndex_') > -1) || (targetId.indexOf('_BubbleIndex_') > -1)
14287
+ || (targetId.indexOf('_PolygonIndex_') > -1);
14093
14288
  if (istooltipRender && this.maps.markerDragArgument === null) {
14094
- if (targetId.indexOf('_shapeIndex_') > -1) {
14289
+ if (targetId.indexOf('_PolygonIndex_') > -1) {
14290
+ const polygonIndex = parseInt(targetId.split('_PolygonIndex_')[1].split('_')[0], 10);
14291
+ polygonTooltipOption = layer.polygonSettings.tooltipSettings;
14292
+ polygon = layer.polygonSettings.polygons[polygonIndex];
14293
+ polygonTextStyle = polygonTooltipOption.textStyle;
14294
+ polygonFill = polygonTooltipOption.fill;
14295
+ tooltipContent.push(polygon.tooltipText);
14296
+ }
14297
+ else if (targetId.indexOf('_shapeIndex_') > -1) {
14095
14298
  option = layer.tooltipSettings;
14096
14299
  const shape = parseInt(targetId.split('_shapeIndex_')[1].split('_')[0], 10);
14097
14300
  if (isNullOrUndefined(layer.layerData) || isNullOrUndefined(layer.layerData[shape])) {
@@ -14194,116 +14397,135 @@ class MapsTooltip {
14194
14397
  }
14195
14398
  //location.y = this.template(option, location);
14196
14399
  }
14197
- if (document.getElementById(this.tooltipId)) {
14198
- tooltipEle = document.getElementById(this.tooltipId);
14199
- }
14200
- else {
14201
- tooltipEle = createElement('div', {
14202
- id: this.maps.element.id + '_mapsTooltip',
14203
- className: 'EJ2-maps-Tooltip'
14204
- });
14205
- if (isNullOrUndefined(option.template) || option.template === '' || this.maps.tooltipDisplayMode === 'MouseMove') {
14206
- tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
14400
+ if (isPolygon ? polygonTooltipOption.visible : option.visible) {
14401
+ if (document.getElementById(this.tooltipId)) {
14402
+ tooltipEle = document.getElementById(this.tooltipId);
14207
14403
  }
14208
14404
  else {
14209
- tooltipEle.style.position = 'absolute';
14210
- }
14211
- document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
14212
- }
14213
- if (typeof option.template !== 'function' && option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
14214
- option.template = option.template[Object.keys(option.template)[0]];
14215
- }
14216
- templateData = this.setTooltipContent(option, templateData);
14217
- const tooltipTextStyle = {
14218
- color: option.textStyle.color, fontFamily: option.textStyle.fontFamily, fontStyle: option.textStyle.fontStyle,
14219
- fontWeight: option.textStyle.fontWeight, opacity: option.textStyle.opacity, size: option.textStyle.size
14220
- };
14221
- const tooltipOption = {
14222
- location: location, text: tooltipContent, data: templateData,
14223
- textStyle: tooltipTextStyle,
14224
- template: option.template
14225
- };
14226
- tooltipArgs = {
14227
- cancel: false, name: tooltipRender,
14228
- options: tooltipOption,
14229
- fill: option.fill,
14230
- maps: this.maps,
14231
- element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
14232
- };
14233
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
14234
- this.maps.trigger(tooltipRender, tooltipArgs, (args) => {
14235
- if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
14236
- (targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
14237
- this.maps['isProtectedOnChange'] = true;
14238
- tooltipArgs.options['textStyle']['size'] = tooltipArgs.options['textStyle']['size']
14239
- || this.maps.themeStyle.fontSize;
14240
- tooltipArgs.options['textStyle']['color'] = tooltipArgs.options['textStyle']['color']
14241
- || this.maps.themeStyle.tooltipFontColor;
14242
- tooltipArgs.options['textStyle']['fontFamily'] = tooltipArgs.options['textStyle']['fontFamily']
14243
- || this.maps.themeStyle.fontFamily;
14244
- tooltipArgs.options['textStyle']['fontWeight'] = tooltipArgs.options['textStyle']['fontWeight']
14245
- || this.maps.themeStyle.fontWeight;
14246
- tooltipArgs.options['textStyle']['opacity'] = tooltipArgs.options['textStyle']['opacity']
14247
- || this.maps.themeStyle.tooltipTextOpacity;
14248
- if (tooltipArgs.cancel) {
14249
- this.svgTooltip = new Tooltip({
14250
- enable: true,
14251
- header: '',
14252
- data: option['data'],
14253
- template: option['template'],
14254
- content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
14255
- [currentData.toString()],
14256
- shapes: [],
14257
- location: option['location'],
14258
- palette: [markerFill],
14259
- areaBounds: this.maps.mapAreaRect,
14260
- textStyle: option['textStyle'],
14261
- availableSize: this.maps.availableSize,
14262
- fill: option.fill || this.maps.themeStyle.tooltipFillColor,
14263
- enableShadow: true
14264
- });
14405
+ tooltipEle = createElement('div', {
14406
+ id: this.maps.element.id + '_mapsTooltip',
14407
+ className: 'EJ2-maps-Tooltip'
14408
+ });
14409
+ if (isNullOrUndefined(isPolygon ? polygon.tooltipTemplate : option.template) || (isPolygon ? polygon.tooltipTemplate === '' : option.template === '') || this.maps.tooltipDisplayMode === 'MouseMove') {
14410
+ tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
14265
14411
  }
14266
14412
  else {
14267
- this.svgTooltip = new Tooltip({
14268
- enable: true,
14269
- header: '',
14270
- data: tooltipArgs.options['data'],
14271
- template: tooltipArgs.options['template'],
14272
- content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
14273
- [currentData.toString()],
14274
- shapes: [],
14275
- location: tooltipArgs.options['location'],
14276
- palette: [markerFill],
14277
- areaBounds: this.maps.mapAreaRect,
14278
- textStyle: tooltipArgs.options['textStyle'],
14279
- availableSize: this.maps.availableSize,
14280
- fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor,
14281
- enableShadow: true
14282
- });
14413
+ tooltipEle.style.position = 'absolute';
14283
14414
  }
14284
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14285
- if (this.maps.isVue || this.maps.isVue3) {
14286
- this.svgTooltip.controlInstance = this.maps;
14415
+ document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
14416
+ }
14417
+ if (typeof (isPolygon ? polygon.tooltipTemplate !== 'function' : option.template !== 'function') && (isPolygon ? polygon.tooltipTemplate !== null : option.template !== null) && Object.keys(typeof (isPolygon ? polygon.tooltipTemplate === 'object' : option.template === 'object') ? (isPolygon ? polygon.tooltipTemplate : option.template) : {}).length === 1) {
14418
+ if (isPolygon) {
14419
+ polygon.tooltipTemplate = polygon.tooltipTemplate[Object.keys(polygon.tooltipTemplate)[0]];
14420
+ }
14421
+ else {
14422
+ option.template = option.template[Object.keys(option.template)[0]];
14287
14423
  }
14288
- this.svgTooltip.opacity = this.maps.themeStyle.tooltipFillOpacity || this.svgTooltip.opacity;
14289
- this.svgTooltip.appendTo(tooltipEle);
14290
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14291
- this.maps.renderReactTemplates();
14424
+ }
14425
+ templateData = this.setTooltipContent(option, templateData);
14426
+ const tooltipTextStyle = {
14427
+ // eslint-disable-next-line max-len
14428
+ color: isPolygon ? polygonTextStyle.color : option.textStyle.color, fontFamily: isPolygon ? polygonTextStyle.fontFamily : option.textStyle.fontFamily, fontStyle: isPolygon ? polygonTextStyle.fontStyle : option.textStyle.fontStyle,
14429
+ // eslint-disable-next-line max-len
14430
+ fontWeight: isPolygon ? polygonTextStyle.fontWeight : option.textStyle.fontWeight, opacity: isPolygon ? polygonTextStyle.opacity : option.textStyle.opacity, size: isPolygon ? polygonTextStyle.size : option.textStyle.size
14431
+ };
14432
+ const tooltipOption = {
14433
+ location: location, text: tooltipContent, data: templateData,
14434
+ textStyle: tooltipTextStyle,
14435
+ template: isPolygon ? polygon.tooltipTemplate : option.template
14436
+ };
14437
+ tooltipArgs = {
14438
+ cancel: false, name: tooltipRender,
14439
+ options: tooltipOption,
14440
+ fill: isPolygon ? polygonFill : option.fill,
14441
+ maps: this.maps, latitude: latitude, longitude: longitude,
14442
+ element: target, eventArgs: e, content: isPolygon ? polygon.tooltipText : !isNullOrUndefined(currentData) ? currentData.toString() : ''
14443
+ };
14444
+ if (tooltipArgs.content !== '' || tooltipArgs.options['template'] !== '') {
14445
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14446
+ this.maps.trigger(tooltipRender, tooltipArgs, (args) => {
14447
+ if (!tooltipArgs.cancel && !isNullOrUndefined(currentData) &&
14448
+ (targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
14449
+ this.maps['isProtectedOnChange'] = true;
14450
+ tooltipArgs.options['textStyle']['size'] = tooltipArgs.options['textStyle']['size']
14451
+ || this.maps.themeStyle.fontSize;
14452
+ tooltipArgs.options['textStyle']['color'] = tooltipArgs.options['textStyle']['color']
14453
+ || this.maps.themeStyle.tooltipFontColor;
14454
+ tooltipArgs.options['textStyle']['fontFamily'] = tooltipArgs.options['textStyle']['fontFamily']
14455
+ || this.maps.themeStyle.fontFamily;
14456
+ tooltipArgs.options['textStyle']['fontWeight'] = tooltipArgs.options['textStyle']['fontWeight']
14457
+ || this.maps.themeStyle.fontWeight;
14458
+ tooltipArgs.options['textStyle']['opacity'] = tooltipArgs.options['textStyle']['opacity']
14459
+ || this.maps.themeStyle.tooltipTextOpacity;
14460
+ if (tooltipArgs.cancel) {
14461
+ this.svgTooltip = new Tooltip({
14462
+ enable: true,
14463
+ header: '',
14464
+ data: option['data'],
14465
+ template: option['template'],
14466
+ content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
14467
+ [currentData.toString()],
14468
+ shapes: [],
14469
+ location: option['location'],
14470
+ palette: [markerFill],
14471
+ areaBounds: this.maps.mapAreaRect,
14472
+ textStyle: option['textStyle'],
14473
+ availableSize: this.maps.availableSize,
14474
+ fill: option.fill || this.maps.themeStyle.tooltipFillColor,
14475
+ enableShadow: true,
14476
+ border: isPolygon ? polygonTooltipOption.border : option.border
14477
+ });
14478
+ }
14479
+ else {
14480
+ this.svgTooltip = new Tooltip({
14481
+ enable: true,
14482
+ header: '',
14483
+ data: tooltipArgs.options['data'],
14484
+ template: tooltipArgs.options['template'],
14485
+ content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
14486
+ [currentData.toString()],
14487
+ shapes: [],
14488
+ location: tooltipArgs.options['location'],
14489
+ palette: [markerFill],
14490
+ areaBounds: this.maps.mapAreaRect,
14491
+ textStyle: tooltipArgs.options['textStyle'],
14492
+ availableSize: this.maps.availableSize,
14493
+ fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor,
14494
+ enableShadow: true,
14495
+ border: isPolygon ? polygonTooltipOption.border : option.border
14496
+ });
14497
+ }
14498
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14499
+ if (this.maps.isVue || this.maps.isVue3) {
14500
+ this.svgTooltip.controlInstance = this.maps;
14501
+ }
14502
+ this.svgTooltip.opacity = this.maps.themeStyle.tooltipFillOpacity || this.svgTooltip.opacity;
14503
+ this.svgTooltip.appendTo(tooltipEle);
14504
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14505
+ this.maps.renderReactTemplates();
14506
+ }
14507
+ else {
14508
+ this.clearTooltip(e.target);
14509
+ }
14510
+ });
14511
+ }
14512
+ else {
14513
+ this.clearTooltip(e.target);
14514
+ }
14515
+ if (this.svgTooltip) {
14516
+ this.maps.trigger('tooltipRenderComplete', {
14517
+ cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption,
14518
+ element: this.svgTooltip.element
14519
+ });
14520
+ }
14521
+ if (this.svgTooltip) {
14522
+ this.maps.trigger('tooltipRenderComplete', {
14523
+ cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption, element: this.svgTooltip.element
14524
+ });
14292
14525
  }
14293
14526
  else {
14294
14527
  this.clearTooltip(e.target);
14295
14528
  }
14296
- });
14297
- if (this.svgTooltip) {
14298
- this.maps.trigger('tooltipRenderComplete', {
14299
- cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption,
14300
- element: this.svgTooltip.element
14301
- });
14302
- }
14303
- if (this.svgTooltip) {
14304
- this.maps.trigger('tooltipRenderComplete', {
14305
- cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption, element: this.svgTooltip.element
14306
- });
14307
14529
  }
14308
14530
  else {
14309
14531
  this.clearTooltip(e.target);
@@ -14352,10 +14574,12 @@ class MapsTooltip {
14352
14574
  * @private
14353
14575
  */
14354
14576
  mouseUpHandler(e) {
14355
- this.renderTooltip(e);
14356
- if (this.maps.tooltipDisplayMode === 'MouseMove') {
14357
- clearTimeout(this.clearTimeout);
14358
- this.clearTimeout = setTimeout(this.removeTooltip.bind(this), 2000);
14577
+ if (!isNullOrUndefined(this.maps)) {
14578
+ this.renderTooltip(e);
14579
+ if (this.maps.tooltipDisplayMode === 'MouseMove') {
14580
+ clearTimeout(this.clearTimeout);
14581
+ this.clearTimeout = setTimeout(this.removeTooltip.bind(this), 2000);
14582
+ }
14359
14583
  }
14360
14584
  }
14361
14585
  /**
@@ -14409,7 +14633,7 @@ class MapsTooltip {
14409
14633
  return;
14410
14634
  }
14411
14635
  if (this.maps.tooltipDisplayMode === 'DoubleClick') {
14412
- this.maps.off('dblclick', this.removeTooltip);
14636
+ this.maps.off('dblclick', this.renderTooltip);
14413
14637
  }
14414
14638
  else if (this.maps.tooltipDisplayMode === 'Click') {
14415
14639
  this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
@@ -14440,8 +14664,7 @@ class MapsTooltip {
14440
14664
  this.svgTooltip.destroy();
14441
14665
  }
14442
14666
  this.svgTooltip = null;
14443
- //TODO: Calling the below code throws spec issue.
14444
- //this.maps = null;
14667
+ this.maps = null;
14445
14668
  }
14446
14669
  }
14447
14670
 
@@ -14451,7 +14674,7 @@ class MapsTooltip {
14451
14674
  class Zoom {
14452
14675
  constructor(maps) {
14453
14676
  /** @private */
14454
- this.isPanning = false;
14677
+ this.isPanModeEnabled = false;
14455
14678
  /** @private */
14456
14679
  this.mouseEnter = false;
14457
14680
  /** @private */
@@ -14472,9 +14695,6 @@ class Zoom {
14472
14695
  this.startTouches = [];
14473
14696
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14474
14697
  /** @private */
14475
- this.intersect = [];
14476
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14477
- /** @private */
14478
14698
  this.mouseDownLatLong = { x: 0, y: 0 };
14479
14699
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14480
14700
  /** @private */
@@ -14610,6 +14830,7 @@ class Zoom {
14610
14830
  }, animationDuration);
14611
14831
  }
14612
14832
  }
14833
+ this.triggerZoomComplete(map, prevLevel, type);
14613
14834
  }
14614
14835
  this.maps.zoomNotApplied = false;
14615
14836
  if (this.maps.isDevice) {
@@ -14698,12 +14919,12 @@ class Zoom {
14698
14919
  map.translatePoint = new Point(translatePointX, translatePointY);
14699
14920
  }
14700
14921
  map.scale = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
14701
- map.zoomTranslatePoint = map.translatePoint;
14702
14922
  isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
14703
14923
  if (isZoomCancelled) {
14704
14924
  map.translatePoint = map.previousPoint;
14705
14925
  map.scale = map.previousScale;
14706
14926
  }
14927
+ map.zoomTranslatePoint = map.translatePoint;
14707
14928
  }
14708
14929
  else {
14709
14930
  zoomCalculationFactor = prevLevel + (Math.round(prevLevel + (((size.width / zoomRect.width) + (size.height / zoomRect.height)) / 2)));
@@ -14733,6 +14954,7 @@ class Zoom {
14733
14954
  }
14734
14955
  }
14735
14956
  this.isZoomFinal = this.isZoomSelection && Math.round(map.scale) === this.maps.zoomSettings.maxZoom;
14957
+ this.triggerZoomComplete(map, prevLevel, '');
14736
14958
  this.removeToolbarOpacity(map.scale, this.maps.element.id + '_Zooming_');
14737
14959
  }
14738
14960
  setInteraction(newInteraction) {
@@ -14825,10 +15047,41 @@ class Zoom {
14825
15047
  if (!isZoomCancelled) {
14826
15048
  this.applyTransform(map);
14827
15049
  }
15050
+ this.triggerZoomComplete(map, prevLevel, '');
14828
15051
  if (Browser.isDevice) {
14829
15052
  this.removeToolbarOpacity(map.isTileMap ? Math.round(map.tileZoomLevel) : map.scale, map.element.id + '_Zooming_');
14830
15053
  }
14831
15054
  }
15055
+ triggerZoomComplete(map, prevLevel, type) {
15056
+ if (map.zoomSettings.enable) {
15057
+ let zoomArgs;
15058
+ if (map.isTileMap) {
15059
+ map.mapScaleValue = isNullOrUndefined(map.mapScaleValue) ? 1 : map.mapScaleValue;
15060
+ map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
15061
+ map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
15062
+ }
15063
+ const minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
15064
+ if (!map.isTileMap) {
15065
+ zoomArgs = {
15066
+ cancel: false, name: 'zoomComplete', type: type, maps: map,
15067
+ tileTranslatePoint: {}, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
15068
+ tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale },
15069
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
15070
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
15071
+ };
15072
+ }
15073
+ else {
15074
+ zoomArgs = {
15075
+ cancel: false, name: 'zoomComplete', type: type, maps: map,
15076
+ tileTranslatePoint: { previous: map.tileTranslatePoint, current: map.tileTranslatePoint }, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
15077
+ tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale },
15078
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
15079
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
15080
+ };
15081
+ }
15082
+ this.maps.trigger('zoomComplete', zoomArgs);
15083
+ }
15084
+ }
14832
15085
  /**
14833
15086
  * @private
14834
15087
  */
@@ -14882,13 +15135,14 @@ class Zoom {
14882
15135
  /**
14883
15136
  * @private
14884
15137
  */
14885
- applyTransform(maps, animate$$1) {
15138
+ applyTransform(maps, animate$$1, isPanning) {
14886
15139
  let layerIndex;
14887
15140
  this.templateCount = 0;
14888
15141
  let markerStyle;
14889
15142
  const scale = maps.scale;
14890
15143
  const x = maps.translatePoint.x;
14891
15144
  const y = maps.translatePoint.y;
15145
+ let currentLabelIndex = 0;
14892
15146
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14893
15147
  maps.zoomShapeCollection = [];
14894
15148
  if (document.getElementById(maps.element.id + '_mapsTooltip')) {
@@ -14934,7 +15188,7 @@ class Zoom {
14934
15188
  }
14935
15189
  }
14936
15190
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
14937
- if ((!this.isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
15191
+ if ((!this.isPanModeEnabled) && !isNullOrUndefined(currentEle.childNodes[0])) {
14938
15192
  this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
14939
15193
  }
14940
15194
  currentEle = layerElement.childNodes[j];
@@ -14958,7 +15212,7 @@ class Zoom {
14958
15212
  }
14959
15213
  }
14960
15214
  }
14961
- if (((this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
15215
+ if (((this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && this.currentLayer.type === 'SubLayer')) && !this.isPanModeEnabled) {
14962
15216
  if (maps.isTileMap) {
14963
15217
  const groupElement = document.querySelector('.GroupElement');
14964
15218
  if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
@@ -14971,7 +15225,7 @@ class Zoom {
14971
15225
  }
14972
15226
  }
14973
15227
  });
14974
- if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
15228
+ if (this.isPanModeEnabled && maps.markerModule.sameMarkerData.length > 0) {
14975
15229
  clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
14976
15230
  }
14977
15231
  else if (maps.markerModule.sameMarkerData.length > 0) {
@@ -14981,7 +15235,7 @@ class Zoom {
14981
15235
  }
14982
15236
  }
14983
15237
  if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
14984
- && !this.isPanning) {
15238
+ && !this.isPanModeEnabled) {
14985
15239
  const mapsTooltip = maps.mapsTooltipModule;
14986
15240
  const tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
14987
15241
  if (!isNullOrUndefined(tooltipElement)) {
@@ -15032,16 +15286,17 @@ class Zoom {
15032
15286
  }
15033
15287
  }
15034
15288
  else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
15035
- this.intersect = [];
15036
15289
  maps.zoomLabelPositions = [];
15037
15290
  maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
15038
15291
  const labelAnimate = !maps.isTileMap && animate$$1;
15039
- for (let k = 0; k < currentEle.childElementCount; k++) {
15292
+ const intersect = [];
15293
+ Array.prototype.forEach.call(currentEle.childNodes, (childNode, k) => {
15040
15294
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
15041
15295
  const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
15042
- this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
15043
- maps.zoomShapeCollection.push(this.zoomshapewidth);
15044
- this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
15296
+ var zoomShapeWidth = currentEle.childNodes[k].id;
15297
+ maps.zoomShapeCollection.push(zoomShapeWidth);
15298
+ this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate, currentLabelIndex, isPanning, intersect);
15299
+ currentLabelIndex++;
15045
15300
  const dataLabel = maps.layers[this.index].dataLabelSettings;
15046
15301
  const border = dataLabel.border;
15047
15302
  if (k > 0 && border['width'] > 1) {
@@ -15060,7 +15315,7 @@ class Zoom {
15060
15315
  }
15061
15316
  }
15062
15317
  }
15063
- }
15318
+ });
15064
15319
  }
15065
15320
  }
15066
15321
  }
@@ -15200,6 +15455,7 @@ class Zoom {
15200
15455
  * @private
15201
15456
  */
15202
15457
  processTemplate(x, y, scale, maps) {
15458
+ let currentLabelIndex = 0;
15203
15459
  for (let i = 0; i < this.templateCount; i++) {
15204
15460
  const factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
15205
15461
  const markerTemplateElement = getElementByID(maps.element.id + '_LayerIndex_' +
@@ -15216,7 +15472,8 @@ class Zoom {
15216
15472
  }
15217
15473
  if ((!isNullOrUndefined(datalabelTemplateElemement)) && datalabelTemplateElemement.childElementCount > 0) {
15218
15474
  for (let k = 0; k < datalabelTemplateElemement.childElementCount; k++) {
15219
- this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template');
15475
+ this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template', false, currentLabelIndex);
15476
+ currentLabelIndex++;
15220
15477
  }
15221
15478
  }
15222
15479
  if (!isNullOrUndefined(polygonElement)) {
@@ -15227,7 +15484,7 @@ class Zoom {
15227
15484
  }
15228
15485
  }
15229
15486
  }
15230
- dataLabelTranslate(element, factor, x, y, scale, type, animate$$1 = false) {
15487
+ dataLabelTranslate(element, factor, x, y, scale, type, animate$$1 = false, currentLabelIndex, isPanning, intersect) {
15231
15488
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15232
15489
  const labelCollection = this.maps.dataLabelModule.dataLabelCollections;
15233
15490
  let text;
@@ -15243,77 +15500,80 @@ class Zoom {
15243
15500
  labelIndex = parseFloat(element.id.split('_LabelIndex_')[1].split('_')[0]);
15244
15501
  }
15245
15502
  const duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
15246
- for (let l = 0; l < labelCollection.length; l++) {
15247
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15248
- const label = labelCollection[l];
15249
- if (label['layerIndex'] === layerIndex && label['shapeIndex'] === shapeIndex
15250
- && label['labelIndex'] === labelIndex) {
15251
- let labelX = label['location']['x'];
15252
- let labelY = label['location']['y'];
15253
- if (type === 'Template') {
15254
- let locationX = 0;
15255
- let locationY = 0;
15256
- if (this.maps.isTileMap) {
15257
- zoomtext = label['dataLabelText'];
15258
- zoomtextSize = measureText(zoomtext, style);
15259
- locationX = ((labelX + x) * scale) - (zoomtextSize['width'] / 2);
15260
- locationY = ((labelY + y) * scale) - (zoomtextSize['height']);
15261
- }
15262
- else {
15263
- const layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
15264
- labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
15265
- labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
15266
- const layerOffset = layerEle.getBoundingClientRect();
15267
- const elementOffset = element.parentElement.getBoundingClientRect();
15268
- locationX = ((labelX) + (layerOffset.left - elementOffset.left));
15269
- locationY = ((labelY) + (layerOffset.top - elementOffset.top));
15270
- }
15271
- element.style.left = locationX + 'px';
15272
- element.style.top = locationY + 'px';
15273
- }
15274
- else {
15275
- labelX = ((labelX + x) * scale);
15276
- labelY = ((labelY + y) * scale);
15503
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15504
+ let label = labelCollection[currentLabelIndex];
15505
+ let index = currentLabelIndex;
15506
+ if (label['layerIndex'] === layerIndex && label['shapeIndex'] === shapeIndex
15507
+ && label['labelIndex'] === labelIndex) {
15508
+ let labelX = label['location']['x'];
15509
+ let labelY = label['location']['y'];
15510
+ if (type === 'Template') {
15511
+ let locationX = 0;
15512
+ let locationY = 0;
15513
+ if (this.maps.isTileMap) {
15277
15514
  zoomtext = label['dataLabelText'];
15278
15515
  zoomtextSize = measureText(zoomtext, style);
15279
- const start = labelY - zoomtextSize['height'] / 4;
15280
- const end = labelY + zoomtextSize['height'] / 4;
15516
+ locationX = ((labelX + x) * scale) - (zoomtextSize['width'] / 2);
15517
+ locationY = ((labelY + y) * scale) - (zoomtextSize['height']);
15518
+ }
15519
+ else {
15520
+ const layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
15521
+ labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
15522
+ labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
15523
+ const layerOffset = layerEle.getBoundingClientRect();
15524
+ const elementOffset = element.parentElement.getBoundingClientRect();
15525
+ locationX = ((labelX) + (layerOffset.left - elementOffset.left));
15526
+ locationY = ((labelY) + (layerOffset.top - elementOffset.top));
15527
+ }
15528
+ element.style.left = locationX + 'px';
15529
+ element.style.top = locationY + 'px';
15530
+ }
15531
+ else {
15532
+ labelX = ((labelX + x) * scale);
15533
+ labelY = ((labelY + y) * scale);
15534
+ zoomtext = label['dataLabelText'];
15535
+ if (!animate$$1 || duration === 0) {
15536
+ element.setAttribute('transform', 'translate( ' + labelX + ' ' + labelY + ' )');
15537
+ }
15538
+ if ((isNullOrUndefined(isPanning) || !isPanning) && (this.maps.layers[this.index].dataLabelSettings.smartLabelMode !== 'None' ||
15539
+ this.maps.layers[this.index].dataLabelSettings.intersectionAction !== 'None')) {
15540
+ zoomtextSize = measureTextElement(zoomtext, style);
15541
+ const start = labelY - zoomtextSize['height'] / 2;
15542
+ const end = labelY + zoomtextSize['height'] / 2;
15281
15543
  const xpositionEnds = labelX + zoomtextSize['width'] / 2;
15282
15544
  const xpositionStart = labelX - zoomtextSize['width'] / 2;
15283
15545
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15284
15546
  const textLocations = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
15285
- if (!animate$$1 || duration === 0) {
15286
- element.setAttribute('transform', 'translate( ' + labelX + ' ' + labelY + ' )');
15287
- }
15288
15547
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
15289
15548
  if (scale > 1) {
15290
- text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
15549
+ text = ((this.maps.dataLabelShape[index] * scale) >= zoomtextSize['width']) ? zoomtext : '';
15291
15550
  element.textContent = text;
15292
15551
  }
15293
15552
  else {
15294
- text = (this.maps.dataLabelShape[l] >= zoomtextSize['width']) ? zoomtext : '';
15553
+ text = (this.maps.dataLabelShape[index] >= zoomtextSize['width']) ? zoomtext : '';
15295
15554
  element.textContent = text;
15296
15555
  }
15297
15556
  }
15557
+ let widthList = [];
15298
15558
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
15299
15559
  if (scale > 1) {
15300
- zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
15560
+ zoomtrimLabel = textTrim((this.maps.dataLabelShape[index] * scale), zoomtext, style, zoomtextSize.width, true, widthList);
15301
15561
  text = zoomtrimLabel;
15302
15562
  element.textContent = text;
15303
15563
  }
15304
15564
  else {
15305
- zoomtrimLabel = textTrim(this.maps.dataLabelShape[l], zoomtext, style);
15565
+ zoomtrimLabel = textTrim(this.maps.dataLabelShape[index], zoomtext, style, zoomtextSize.width, true, widthList);
15306
15566
  text = zoomtrimLabel;
15307
15567
  element.textContent = text;
15308
15568
  }
15309
15569
  }
15310
15570
  if (this.maps.layers[this.index].dataLabelSettings.intersectionAction === 'Hide') {
15311
- for (let m = 0; m < this.intersect.length; m++) {
15312
- if (!isNullOrUndefined(this.intersect[m])) {
15313
- if (textLocations['leftWidth'] > this.intersect[m]['rightWidth']
15314
- || textLocations['rightWidth'] < this.intersect[m]['leftWidth']
15315
- || textLocations['heightTop'] > this.intersect[m]['heightBottom']
15316
- || textLocations['heightBottom'] < this.intersect[m]['heightTop']) {
15571
+ for (let m = 0; m < intersect.length; m++) {
15572
+ if (!isNullOrUndefined(intersect[m])) {
15573
+ if (textLocations['leftWidth'] > intersect[m]['rightWidth']
15574
+ || textLocations['rightWidth'] < intersect[m]['leftWidth']
15575
+ || textLocations['heightTop'] > intersect[m]['heightBottom']
15576
+ || textLocations['heightBottom'] < intersect[m]['heightTop']) {
15317
15577
  text = !isNullOrUndefined(text) ? text : zoomtext;
15318
15578
  element.textContent = text;
15319
15579
  }
@@ -15324,50 +15584,53 @@ class Zoom {
15324
15584
  }
15325
15585
  }
15326
15586
  }
15327
- this.intersect.push(textLocations);
15587
+ intersect.push(textLocations);
15328
15588
  }
15329
15589
  if (this.maps.layers[this.index].dataLabelSettings.intersectionAction === 'Trim') {
15330
- for (let j = 0; j < this.intersect.length; j++) {
15331
- if (!isNullOrUndefined(this.intersect[j])) {
15332
- if (textLocations['rightWidth'] < this.intersect[j]['leftWidth']
15333
- || textLocations['leftWidth'] > this.intersect[j]['rightWidth']
15334
- || textLocations['heightBottom'] < this.intersect[j]['heightTop']
15335
- || textLocations['heightTop'] > this.intersect[j]['heightBottom']) {
15590
+ for (let j = 0; j < intersect.length; j++) {
15591
+ if (!isNullOrUndefined(intersect[j])) {
15592
+ if (textLocations['rightWidth'] < intersect[j]['leftWidth']
15593
+ || textLocations['leftWidth'] > intersect[j]['rightWidth']
15594
+ || textLocations['heightBottom'] < intersect[j]['heightTop']
15595
+ || textLocations['heightTop'] > intersect[j]['heightBottom']) {
15336
15596
  trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
15337
15597
  if (scale > 1) {
15338
- trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
15598
+ let trimmedWidth = widthList.length > 0 ? widthList[0] : zoomtextSize.width;
15599
+ trimmedLable = textTrim((this.maps.dataLabelShape[index] * scale), trimmedLable, style, trimmedWidth, true);
15339
15600
  }
15340
15601
  element.textContent = trimmedLable;
15341
15602
  }
15342
15603
  else {
15343
- if (textLocations['leftWidth'] > this.intersect[j]['leftWidth']) {
15344
- const width = this.intersect[j]['rightWidth'] - textLocations['leftWidth'];
15604
+ if (textLocations['leftWidth'] > intersect[j]['leftWidth']) {
15605
+ const width = intersect[j]['rightWidth'] - textLocations['leftWidth'];
15345
15606
  const difference = width - (textLocations['rightWidth'] - textLocations['leftWidth']);
15346
15607
  text = !isNullOrUndefined(text) ? text : zoomtext;
15347
- trimmedLable = textTrim(difference, text, style);
15608
+ let trimmedWidth = widthList.length > 0 ? widthList[0] : zoomtextSize.width;
15609
+ trimmedLable = textTrim(difference, text, style, trimmedWidth, true);
15348
15610
  element.textContent = trimmedLable;
15349
15611
  break;
15350
15612
  }
15351
- if (textLocations['leftWidth'] < this.intersect[j]['leftWidth']) {
15352
- const width = textLocations['rightWidth'] - this.intersect[j]['leftWidth'];
15613
+ if (textLocations['leftWidth'] < intersect[j]['leftWidth']) {
15614
+ const width = textLocations['rightWidth'] - intersect[j]['leftWidth'];
15353
15615
  const difference = Math.abs(width - (textLocations['rightWidth'] - textLocations['leftWidth']));
15354
15616
  text = !isNullOrUndefined(text) ? text : zoomtext;
15355
- trimmedLable = textTrim(difference, text, style);
15617
+ let trimmedWidth = widthList.length > 0 ? widthList[0] : zoomtextSize.width;
15618
+ trimmedLable = textTrim(difference, text, style, trimmedWidth, true);
15356
15619
  element.textContent = trimmedLable;
15357
15620
  break;
15358
15621
  }
15359
15622
  }
15360
15623
  }
15361
15624
  }
15362
- this.intersect.push(textLocations);
15625
+ intersect.push(textLocations);
15363
15626
  if (isNullOrUndefined(trimmedLable)) {
15364
- trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
15627
+ trimmedLable = textTrim((this.maps.dataLabelShape[index] * scale), zoomtext, style, zoomtextSize.width, true);
15365
15628
  element.textContent = trimmedLable;
15366
15629
  }
15367
15630
  }
15368
- if (animate$$1 || duration > 0) {
15369
- smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
15370
- }
15631
+ }
15632
+ if (animate$$1 || duration > 0) {
15633
+ smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
15371
15634
  }
15372
15635
  }
15373
15636
  }
@@ -15512,15 +15775,15 @@ class Zoom {
15512
15775
  if (!panArgs.cancel) {
15513
15776
  if (panningXDirection && panningYDirection) {
15514
15777
  map.translatePoint = new Point(x, y);
15515
- this.applyTransform(map);
15778
+ this.applyTransform(map, false, true);
15516
15779
  }
15517
15780
  else if (panningXDirection) {
15518
15781
  map.translatePoint = new Point(x, map.translatePoint.y);
15519
- this.applyTransform(map);
15782
+ this.applyTransform(map, false, true);
15520
15783
  }
15521
15784
  else if (panningYDirection) {
15522
15785
  map.translatePoint = new Point(map.translatePoint.x, y);
15523
- this.applyTransform(map);
15786
+ this.applyTransform(map, false, true);
15524
15787
  }
15525
15788
  }
15526
15789
  this.maps.zoomNotApplied = false;
@@ -15551,7 +15814,7 @@ class Zoom {
15551
15814
  };
15552
15815
  map.trigger(pan, panArgs);
15553
15816
  map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
15554
- this.applyTransform(map);
15817
+ this.applyTransform(map, false, true);
15555
15818
  }
15556
15819
  map.zoomTranslatePoint = map.translatePoint;
15557
15820
  this.mouseDownPoints = this.mouseMovePoints;
@@ -15670,6 +15933,7 @@ class Zoom {
15670
15933
  }
15671
15934
  this.maps.zoomNotApplied = false;
15672
15935
  }
15936
+ this.triggerZoomComplete(map, prevLevel, type);
15673
15937
  }
15674
15938
  /**
15675
15939
  * @private
@@ -15959,7 +16223,7 @@ class Zoom {
15959
16223
  }
15960
16224
  panningStyle(toolbar) {
15961
16225
  const svg = getElementByID(this.maps.element.id + '_svg');
15962
- if (toolbar === 'pan' || (this.isPanning && toolbar !== 'reset')) {
16226
+ if (toolbar === 'pan' || (this.isPanModeEnabled && toolbar !== 'reset')) {
15963
16227
  svg.setAttribute('class', 'e-maps-panning');
15964
16228
  }
15965
16229
  else {
@@ -16306,8 +16570,8 @@ class Zoom {
16306
16570
  this.isTouch = true;
16307
16571
  touches = e.touches;
16308
16572
  target = e.target;
16309
- pageX = touches[0].clientX;
16310
- pageY = touches[0].clientY;
16573
+ pageX = touches[0].pageX;
16574
+ pageY = touches[0].pageY;
16311
16575
  }
16312
16576
  else {
16313
16577
  pageX = e.pageX;
@@ -16315,11 +16579,11 @@ class Zoom {
16315
16579
  target = e.target;
16316
16580
  }
16317
16581
  if (!this.maps.zoomSettings.enablePanning) {
16318
- this.isPan = this.isPanning = this.panColor !== this.selectionColor ? this.maps.zoomSettings.enablePanning
16582
+ this.isPan = this.isPanModeEnabled = this.panColor !== this.selectionColor ? this.maps.zoomSettings.enablePanning
16319
16583
  : this.zoomColor === this.selectionColor;
16320
16584
  }
16321
16585
  else {
16322
- this.isPan = this.isPanning = !this.isZoomSelection;
16586
+ this.isPan = this.isPanModeEnabled = !this.isZoomSelection;
16323
16587
  }
16324
16588
  this.mouseDownLatLong = { x: pageX, y: pageY };
16325
16589
  let scale = this.maps.isTileMap ? Math.round(this.maps.tileZoomLevel) : Math.round(this.maps.mapScaleValue);
@@ -16346,8 +16610,8 @@ class Zoom {
16346
16610
  this.isTouch = true;
16347
16611
  target = e.target;
16348
16612
  touches = e.touches;
16349
- pageX = touches[0].clientX;
16350
- pageY = touches[0].clientY;
16613
+ pageX = touches[0].pageX;
16614
+ pageY = touches[0].pageY;
16351
16615
  }
16352
16616
  else {
16353
16617
  pageX = e.pageX;
@@ -16381,7 +16645,7 @@ class Zoom {
16381
16645
  this.mouseMovePoints = this.getMousePosition(pageX, pageY);
16382
16646
  const targetId = e.target['id'];
16383
16647
  const targetEle = e.target;
16384
- if (zoom.enable && this.isPanning && this.maps.markerDragId.indexOf('_MarkerIndex_') == -1 && ((Browser.isDevice && touches.length >= 1) || !Browser.isDevice)) {
16648
+ if (zoom.enable && this.isPanModeEnabled && this.maps.markerDragId.indexOf('_MarkerIndex_') == -1 && ((Browser.isDevice && touches.length >= 1) || !Browser.isDevice)) {
16385
16649
  e.preventDefault();
16386
16650
  this.maps.element.style.cursor = 'pointer';
16387
16651
  this.mouseMoveLatLong = { x: pageX, y: pageY };
@@ -16411,13 +16675,66 @@ class Zoom {
16411
16675
  mouseUpHandler(e) {
16412
16676
  const map = this.maps;
16413
16677
  this.rectZoomingStart = false;
16414
- this.isPanning = false;
16415
16678
  this.isSingleClick = this.isSingleClick ? true : false;
16416
16679
  this.isTouch = false;
16417
16680
  this.touchStartList = [];
16418
16681
  this.touchMoveList = [];
16419
16682
  this.lastScale = 1;
16420
16683
  this.maps.element.style.cursor = 'auto';
16684
+ // eslint-disable-next-line max-len
16685
+ if (this.isPanModeEnabled && this.maps.zoomSettings.enablePanning && !isNullOrUndefined(this.maps.previousPoint) &&
16686
+ (this.maps.translatePoint.x !== this.maps.previousPoint.x && this.maps.translatePoint.y !== this.maps.previousPoint.y)) {
16687
+ let pageX;
16688
+ let pageY;
16689
+ let layerX = 0;
16690
+ let layerY = 0;
16691
+ let target;
16692
+ const rect = this.maps.element.getBoundingClientRect();
16693
+ const element = e.target;
16694
+ if (e.type.indexOf('touch') !== -1) {
16695
+ let touchArg = e;
16696
+ layerX = pageX = touchArg.changedTouches[0].pageX;
16697
+ pageY = touchArg.changedTouches[0].pageY;
16698
+ layerY = pageY - (this.maps.isTileMap ? 10 : 0);
16699
+ target = touchArg.target;
16700
+ this.maps.mouseClickEvent = { x: pageX, y: pageY };
16701
+ }
16702
+ else {
16703
+ pageX = e.pageX;
16704
+ pageY = e.pageY;
16705
+ layerX = e['layerX'];
16706
+ layerY = e['layerY'] - (this.maps.isTileMap ? 10 : 0);
16707
+ target = e.target;
16708
+ }
16709
+ let panCompleteEventArgs;
16710
+ const minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
16711
+ if (!this.maps.isTileMap) {
16712
+ this.maps.mouseClickEvent['x'] = this.maps.mouseDownEvent['x'];
16713
+ this.maps.mouseClickEvent['y'] = this.maps.mouseDownEvent['y'];
16714
+ const location = this.maps.getClickLocation(element.id, pageX, pageY, element, pageX, pageY);
16715
+ panCompleteEventArgs = {
16716
+ cancel: false, name: 'panComplete', maps: this.maps,
16717
+ tileTranslatePoint: {}, translatePoint: { previous: this.maps.previousPoint, current: this.maps.translatePoint },
16718
+ scale: this.maps.scale, tileZoomLevel: this.maps.tileZoomLevel, latitude: !isNullOrUndefined(location) ?
16719
+ location.latitude : 0, longitude: !isNullOrUndefined(location) ? location.longitude : 0,
16720
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
16721
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
16722
+ };
16723
+ }
16724
+ else {
16725
+ const location = this.maps.getTileGeoLocation(layerX, layerY);
16726
+ panCompleteEventArgs = {
16727
+ cancel: false, name: 'panComplete', maps: this.maps,
16728
+ tileTranslatePoint: { previous: this.maps.tileTranslatePoint, current: this.maps.tileTranslatePoint },
16729
+ translatePoint: { previous: this.maps.previousPoint, current: this.maps.translatePoint }, scale: this.maps.scale,
16730
+ tileZoomLevel: this.maps.tileZoomLevel, latitude: location.latitude, longitude: location.longitude,
16731
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
16732
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
16733
+ };
16734
+ }
16735
+ this.maps.trigger('panComplete', panCompleteEventArgs);
16736
+ }
16737
+ this.isPanModeEnabled = false;
16421
16738
  if ((!isNullOrUndefined(this.distanceX) || !isNullOrUndefined(this.distanceY)) && (!isNullOrUndefined(this.currentLayer) && this.currentLayer.type === 'SubLayer')) {
16422
16739
  this.toAlignSublayer();
16423
16740
  this.distanceX = this.distanceY = null;
@@ -16434,7 +16751,7 @@ class Zoom {
16434
16751
  * @private
16435
16752
  */
16436
16753
  mouseCancelHandler(e) {
16437
- this.isPanning = false;
16754
+ this.isPanModeEnabled = false;
16438
16755
  this.isTouch = false;
16439
16756
  this.rectZoomingStart = false;
16440
16757
  const zoomRectElement = getElementByID(this.maps.element.id + '_Selection_Rect_Zooming');
@@ -16514,7 +16831,7 @@ class Zoom {
16514
16831
  this.maps.off(Browser.touchMoveEvent, this.mouseMoveHandler);
16515
16832
  this.maps.off(Browser.touchStartEvent, this.mouseDownHandler);
16516
16833
  this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
16517
- this.maps.off(this.cancelEvent, this.mouseCancelHandler);
16834
+ EventHandler.remove(this.maps.element, this.cancelEvent, this.mouseCancelHandler);
16518
16835
  }
16519
16836
  /**
16520
16837
  * Get module name.
@@ -16543,14 +16860,12 @@ class Zoom {
16543
16860
  this.mouseDownPoints = null;
16544
16861
  this.mouseMovePoints = null;
16545
16862
  this.startTouches = [];
16546
- this.zoomshapewidth = null;
16547
- this.intersect = [];
16548
16863
  this.mouseDownLatLong = null;
16549
16864
  this.mouseMoveLatLong = null;
16550
16865
  this.removeEventListener();
16551
- //TODO: Calling the below code throws spec issue.
16552
- //this.maps = null;
16866
+ this.layerCollectionEle = null;
16553
16867
  this.currentLayer = null;
16868
+ this.maps = null;
16554
16869
  }
16555
16870
  }
16556
16871
 
@@ -17023,5 +17338,5 @@ class PdfExport {
17023
17338
  * exporting all modules from maps index
17024
17339
  */
17025
17340
 
17026
- export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerDragStart, markerDragEnd, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, ZoomToolbarButtonSettings, ZoomToolbarTooltipSettings, ZoomToolbarSettings, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, PolygonSetting, PolygonSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, calculatePolygonPath, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, Coordinate, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, getHexColor, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, Polygon, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
17341
+ export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerDragStart, markerDragEnd, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, panComplete, zoomComplete, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, ZoomToolbarButtonSettings, ZoomToolbarTooltipSettings, ZoomToolbarSettings, Border, CenterPosition, TooltipSettings, PolygonTooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, PolygonSetting, PolygonSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, calculatePolygonPath, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, Coordinate, MinMax, GeoLocation, measureText, measureTextElement, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, markerClusterListHandler, markerBoundsComparer, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, getHexColor, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, Polygon, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
17027
17342
  //# sourceMappingURL=ej2-maps.es2015.js.map