@syncfusion/ej2-maps 20.2.43 → 20.3.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/dist/ej2-maps.min.js +10 -0
  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 +317 -258
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +321 -263
  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/bing-map.d.ts +4 -0
  14. package/src/maps/layers/bing-map.js +7 -0
  15. package/src/maps/layers/bubble.d.ts +1 -2
  16. package/src/maps/layers/bubble.js +4 -5
  17. package/src/maps/layers/data-label.d.ts +1 -4
  18. package/src/maps/layers/data-label.js +13 -15
  19. package/src/maps/layers/layer-panel.d.ts +5 -0
  20. package/src/maps/layers/layer-panel.js +28 -5
  21. package/src/maps/layers/legend.d.ts +1 -2
  22. package/src/maps/layers/legend.js +26 -5
  23. package/src/maps/layers/marker.d.ts +2 -4
  24. package/src/maps/layers/marker.js +44 -44
  25. package/src/maps/layers/navigation-selected-line.d.ts +1 -2
  26. package/src/maps/layers/navigation-selected-line.js +7 -13
  27. package/src/maps/maps.js +18 -9
  28. package/src/maps/model/export-image.d.ts +2 -4
  29. package/src/maps/model/export-image.js +19 -27
  30. package/src/maps/model/export-pdf.d.ts +4 -6
  31. package/src/maps/model/export-pdf.js +22 -30
  32. package/src/maps/model/interface.d.ts +8 -0
  33. package/src/maps/model/print.d.ts +2 -5
  34. package/src/maps/model/print.js +15 -23
  35. package/src/maps/user-interaction/annotation.d.ts +1 -2
  36. package/src/maps/user-interaction/annotation.js +2 -3
  37. package/src/maps/user-interaction/highlight.d.ts +1 -2
  38. package/src/maps/user-interaction/highlight.js +3 -5
  39. package/src/maps/user-interaction/selection.d.ts +1 -2
  40. package/src/maps/user-interaction/selection.js +3 -5
  41. package/src/maps/user-interaction/tooltip.d.ts +1 -4
  42. package/src/maps/user-interaction/tooltip.js +7 -2
  43. package/src/maps/user-interaction/zoom.d.ts +2 -7
  44. package/src/maps/user-interaction/zoom.js +83 -66
  45. package/src/maps/utils/helper.js +22 -11
@@ -1039,7 +1039,10 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1039
1039
  markerCluster.remove();
1040
1040
  }
1041
1041
  if (zoomCheck) {
1042
- document.getElementById(maps.element.id + '_Layer_Collections').appendChild(layerElement);
1042
+ let layerGroupElement = document.getElementById(maps.element.id + '_Layer_Collections');
1043
+ if (!isNullOrUndefined(layerGroupElement)) {
1044
+ layerGroupElement.appendChild(layerElement);
1045
+ }
1043
1046
  }
1044
1047
  });
1045
1048
  }
@@ -1056,15 +1059,16 @@ function mergeSeparateCluster(sameMarkerData, maps, markerElement) {
1056
1059
  const markerIndex = sameMarkerData[0].markerIndex;
1057
1060
  const dataIndex = sameMarkerData[0].dataIndex;
1058
1061
  const markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
1062
+ const marker = maps.layers[layerIndex].markerSettings[markerIndex];
1059
1063
  const clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
1060
- const clusterEle = getElement(clusterId);
1064
+ const clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElement(clusterId + '_Group') : getElement(clusterId);
1061
1065
  const clusterEleLabel = getElement(clusterId + '_datalabel_' + clusterIndex);
1062
1066
  clusterEle.setAttribute('visibility', 'visible');
1063
1067
  clusterEleLabel.setAttribute('visibility', 'visible');
1064
1068
  let markerEle;
1065
1069
  const markerDataLength = sameMarkerData[0].data.length;
1066
1070
  for (let i = 0; i < markerDataLength; i++) {
1067
- markerEle = getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
1071
+ markerEle = marker.shape === 'Balloon' ? getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
1068
1072
  markerEle['style']['visibility'] = 'hidden';
1069
1073
  }
1070
1074
  removeElement(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine');
@@ -1086,13 +1090,13 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1086
1090
  const getElementFunction = isDom ? getElement : markerElement.querySelector.bind(markerElement);
1087
1091
  const getQueryConnect = isDom ? '' : '#';
1088
1092
  const markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
1093
+ const marker = maps.layers[layerIndex].markerSettings[markerIndex];
1089
1094
  const clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
1090
- const clusterEle = getElementFunction(getQueryConnect + '' + clusterId);
1095
+ const clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + clusterId + '_Group') : getElementFunction(getQueryConnect + '' + clusterId);
1091
1096
  const clusterEleLabel = getElementFunction(getQueryConnect + '' + clusterId + '_datalabel_' + clusterIndex);
1092
1097
  clusterEle.setAttribute('visibility', 'hidden');
1093
1098
  clusterEleLabel.setAttribute('visibility', 'hidden');
1094
- const marker = maps.layers[layerIndex].markerSettings[markerIndex];
1095
- let markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
1099
+ let markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
1096
1100
  const height = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().height : marker.height;
1097
1101
  const width = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().width : marker.width;
1098
1102
  const centerX = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[0];
@@ -1128,7 +1132,7 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1128
1132
  const x1 = centerX + radius * Math.sin((Math.PI * 2 * newAngle) / 360);
1129
1133
  const y1 = centerY + radius * Math.cos((Math.PI * 2 * newAngle) / 360);
1130
1134
  path += start + 'L ' + (x1) + ' ' + y1 + ' ';
1131
- markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
1135
+ markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
1132
1136
  if (markerEle.parentElement.id.indexOf('Template_Group') > -1) {
1133
1137
  markerEle['style']['transform'] = '';
1134
1138
  markerEle['style']['left'] = maps.isTileMap ? x1 - (width / 2) + 'px' : (x1 - (width / 2) - 10) + 'px';
@@ -1149,7 +1153,12 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1149
1153
  markerElement = isDom ? getElementFunction(maps.element.id + '_Markers_Group') : markerElement;
1150
1154
  const groupEle = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine' });
1151
1155
  groupEle.appendChild(maps.renderer.drawPath(options));
1152
- markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0'));
1156
+ if (marker.shape === 'Balloon') {
1157
+ markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0_Group'));
1158
+ }
1159
+ else {
1160
+ markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0'));
1161
+ }
1153
1162
  }
1154
1163
  /**
1155
1164
  *
@@ -1176,6 +1185,7 @@ function marker(eventArgs, markerSettings, markerData, dataIndex, location, tran
1176
1185
  dashArray: markerSettings.dashArray, borderOpacity: isNullOrUndefined(eventArgs.border.opacity) ? markerSettings.opacity :
1177
1186
  eventArgs.border.opacity
1178
1187
  };
1188
+ removeElement(markerID);
1179
1189
  const ele = drawSymbols(eventArgs.shape, eventArgs.imageUrl, { x: 0, y: 0 }, markerID, shapeCustom, markerCollection, maps);
1180
1190
  const x = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x;
1181
1191
  const y = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y;
@@ -1553,7 +1563,7 @@ function drawBalloon(maps, options, size, location, type, element) {
1553
1563
  const y = size.height / 30;
1554
1564
  balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
1555
1565
  if (type === 'Marker') {
1556
- const g = maps.renderer.createGroup({ id: options.id });
1566
+ const g = maps.renderer.createGroup({ id: options.id + '_Group' });
1557
1567
  appendShape(balloon, g);
1558
1568
  pathElement = appendShape(g, element);
1559
1569
  }
@@ -1973,6 +1983,7 @@ function getTranslate(mapObject, layer, animate) {
1973
1983
  mapHeight = size.height;
1974
1984
  }
1975
1985
  scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
1986
+ scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
1976
1987
  mapWidth *= scaleFactor;
1977
1988
  mapHeight *= scaleFactor;
1978
1989
  const widthDiff = min['x'] !== 0 && mapObject.translateType === 'layers' ? availSize.width - size.width : 0;
@@ -2023,6 +2034,7 @@ function getTranslate(mapObject, layer, animate) {
2023
2034
  else {
2024
2035
  if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1 || mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
2025
2036
  scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
2037
+ scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
2026
2038
  mapWidth *= scaleFactor;
2027
2039
  x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
2028
2040
  mapHeight *= scaleFactor;
@@ -3062,8 +3074,7 @@ function animate(element, delay, duration, process, end) {
3062
3074
  window.cancelAnimationFrame(clearAnimation);
3063
3075
  end.call(this, { element: element });
3064
3076
  if (element.id.indexOf('Marker') > -1) {
3065
- console.log(element);
3066
- let markerElement = getElementByID(element.id.split('_')[0] + '_Markers_Group');
3077
+ let markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
3067
3078
  markerElement.setAttribute('style', markerStyle);
3068
3079
  }
3069
3080
  }
@@ -4640,42 +4651,42 @@ class Marker {
4640
4651
  this.trackElements = [];
4641
4652
  this.sameMarkerData = [];
4642
4653
  }
4643
- markerRender(layerElement, layerIndex, factor, type) {
4654
+ markerRender(maps, layerElement, layerIndex, factor, type) {
4644
4655
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4645
4656
  let templateFn;
4646
4657
  let markerCount = 0;
4647
4658
  let nullCount = 0;
4648
4659
  let markerTemplateCount = 0;
4649
- this.maps.translateType = 'marker';
4650
- const currentLayer = this.maps.layersCollection[layerIndex];
4651
- this.markerSVGObject = this.maps.renderer.createGroup({
4652
- id: this.maps.element.id + '_Markers_Group',
4660
+ maps.translateType = 'marker';
4661
+ const currentLayer = maps.layersCollection[layerIndex];
4662
+ this.markerSVGObject = maps.renderer.createGroup({
4663
+ id: maps.element.id + '_Markers_Group',
4653
4664
  class: 'GroupElement',
4654
4665
  style: 'pointer-events: auto;'
4655
4666
  });
4656
4667
  const markerTemplateEle = createElement('div', {
4657
- id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
4658
- className: this.maps.element.id + '_template',
4668
+ id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
4669
+ className: maps.element.id + '_template',
4659
4670
  styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
4660
- 'top:' + this.maps.mapAreaRect.y + 'px;' +
4661
- 'left:' + this.maps.mapAreaRect.x + 'px;' +
4662
- 'height:' + this.maps.mapAreaRect.height + 'px;' +
4663
- 'width:' + this.maps.mapAreaRect.width + 'px;'
4671
+ 'top:' + maps.mapAreaRect.y + 'px;' +
4672
+ 'left:' + maps.mapAreaRect.x + 'px;' +
4673
+ 'height:' + maps.mapAreaRect.height + 'px;' +
4674
+ 'width:' + maps.mapAreaRect.width + 'px;'
4664
4675
  });
4665
4676
  currentLayer.markerSettings.map((markerSettings, markerIndex) => {
4666
4677
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4667
4678
  const markerData = markerSettings.dataSource;
4668
4679
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4669
4680
  Array.prototype.forEach.call(markerData, (data, dataIndex) => {
4670
- this.maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : this.maps.markerNullCount;
4681
+ maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
4671
4682
  let eventArgs = {
4672
4683
  cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
4673
4684
  width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
4674
- template: markerSettings.template, data: data, maps: this.maps, marker: markerSettings,
4685
+ template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
4675
4686
  border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
4676
4687
  shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
4677
4688
  };
4678
- this.maps.trigger('markerRendering', eventArgs, (MarkerArgs) => {
4689
+ maps.trigger('markerRendering', eventArgs, (MarkerArgs) => {
4679
4690
  eventArgs = markerColorChoose(eventArgs, data);
4680
4691
  eventArgs = markerShapeChoose(eventArgs, data);
4681
4692
  const lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
@@ -4686,56 +4697,56 @@ class Marker {
4686
4697
  parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
4687
4698
  const offset = markerSettings.offset;
4688
4699
  if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
4689
- const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
4700
+ const markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
4690
4701
  + markerIndex + '_dataIndex_' + dataIndex;
4691
- let location = (this.maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, this.maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, this.maps);
4692
- const animate$$1 = currentLayer.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
4702
+ let location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
4703
+ const animate$$1 = currentLayer.animationDuration !== 0 || isNullOrUndefined(maps.zoomModule);
4693
4704
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4694
- const translate = (this.maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(this.maps.zoomModule)) ? location = convertTileLatLongToPoint(new MapLocation(lng, lat), this.maps.tileZoomLevel, this.maps.tileTranslatePoint, true) : new Object() :
4695
- !isNullOrUndefined(this.maps.zoomModule) && this.maps.zoomSettings.zoomFactor > 1 ?
4696
- getZoomTranslate(this.maps, currentLayer, animate$$1) :
4697
- getTranslate(this.maps, currentLayer, animate$$1);
4698
- const scale = type === 'AddMarker' ? this.maps.scale : translate['scale'];
4699
- const transPoint = type === 'AddMarker' ? this.maps.translatePoint : translate['location'];
4705
+ const translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
4706
+ !isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
4707
+ getZoomTranslate(maps, currentLayer, animate$$1) :
4708
+ getTranslate(maps, currentLayer, animate$$1);
4709
+ const scale = type === 'AddMarker' ? maps.scale : translate['scale'];
4710
+ const transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
4700
4711
  if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
4701
4712
  markerTemplateCount++;
4702
- markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location, transPoint, scale, offset, this.maps);
4713
+ markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location, transPoint, scale, offset, maps);
4703
4714
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4704
- this.maps.renderReactTemplates();
4715
+ maps.renderReactTemplates();
4705
4716
  }
4706
4717
  else if (!eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
4707
4718
  markerCount++;
4708
- marker(eventArgs, markerSettings, markerData, dataIndex, location, transPoint, markerID, offset, scale, this.maps, this.markerSVGObject);
4719
+ marker(eventArgs, markerSettings, markerData, dataIndex, location, transPoint, markerID, offset, scale, maps, this.markerSVGObject);
4709
4720
  }
4710
4721
  }
4711
4722
  nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
4712
4723
  markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
4713
4724
  markerCount += (eventArgs.cancel) ? 1 : 0;
4714
- this.maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
4715
- const markerDataLength = markerData.length - this.maps.markerNullCount;
4725
+ maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ? maps.markerNullCount + 1 : maps.markerNullCount;
4726
+ const markerDataLength = markerData.length - maps.markerNullCount;
4716
4727
  if (this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
4717
4728
  layerElement.appendChild(this.markerSVGObject);
4718
4729
  if (currentLayer.markerClusterSettings.allowClustering) {
4719
- this.maps.svgObject.appendChild(this.markerSVGObject);
4720
- this.maps.element.appendChild(this.maps.svgObject);
4730
+ maps.svgObject.appendChild(this.markerSVGObject);
4731
+ maps.element.appendChild(maps.svgObject);
4721
4732
  if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
4722
- && this.maps.zoomSettings.enable) {
4733
+ && maps.zoomSettings.enable) {
4723
4734
  layerElement.appendChild(this.markerSVGObject);
4724
4735
  }
4725
4736
  else {
4726
- clusterTemplate(currentLayer, this.markerSVGObject, this.maps, layerIndex, this.markerSVGObject, layerElement, true, false);
4737
+ clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
4727
4738
  }
4728
4739
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4729
- this.maps.renderReactTemplates();
4740
+ maps.renderReactTemplates();
4730
4741
  }
4731
4742
  }
4732
- if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(this.maps.element.id + '_Secondary_Element')) {
4733
- getElementByID(this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
4734
- if (this.maps.checkInitialRender) {
4743
+ if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
4744
+ getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
4745
+ if (maps.checkInitialRender) {
4735
4746
  if (currentLayer.markerClusterSettings.allowClustering) {
4736
- clusterTemplate(currentLayer, markerTemplateEle, this.maps, layerIndex, this.markerSVGObject, layerElement, false, false);
4747
+ clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, this.markerSVGObject, layerElement, false, false);
4737
4748
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4738
- this.maps.renderReactTemplates();
4749
+ maps.renderReactTemplates();
4739
4750
  }
4740
4751
  }
4741
4752
  }
@@ -4978,7 +4989,7 @@ class Marker {
4978
4989
  }
4979
4990
  if ((target.indexOf('_cluster_') > -1)) {
4980
4991
  let isClusterSame = false;
4981
- const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? target.split('_datalabel_')[0] : target);
4992
+ const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? layer.markerClusterSettings.shape === 'Balloon' ? target.split('_datalabel_')[0] + '_Group' : target.split('_datalabel_')[0] : layer.markerClusterSettings.shape === 'Balloon' ? target + '_Group' : target);
4982
4993
  const indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].innerHTML.split(',').map(Number) : clusterElement.innerHTML.split(',').map(Number);
4983
4994
  collection = [];
4984
4995
  for (const i of indexes) {
@@ -5047,14 +5058,14 @@ class Marker {
5047
5058
  /**
5048
5059
  * To destroy the layers.
5049
5060
  *
5050
- * @param {Maps} maps - Specifies the instance of the map
5051
5061
  * @returns {void}
5052
5062
  * @private
5053
5063
  */
5054
- destroy(maps) {
5055
- /**
5056
- * Destroy method performed here
5057
- */
5064
+ destroy() {
5065
+ this.maps = null;
5066
+ this.trackElements = [];
5067
+ this.markerSVGObject = null;
5068
+ this.sameMarkerData = [];
5058
5069
  }
5059
5070
  }
5060
5071
 
@@ -5288,6 +5299,13 @@ class BingMap {
5288
5299
  return '';
5289
5300
  }
5290
5301
  }
5302
+ /**
5303
+ * @private
5304
+ */
5305
+ destroy() {
5306
+ this.maps = null;
5307
+ this.subDomains = [];
5308
+ }
5291
5309
  }
5292
5310
 
5293
5311
  /**
@@ -5701,7 +5719,7 @@ class LayerPanel {
5701
5719
  panel.layerObject.appendChild(panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex));
5702
5720
  }
5703
5721
  if (panel.mapObject.markerModule) {
5704
- panel.mapObject.markerModule.markerRender(panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
5722
+ panel.mapObject.markerModule.markerRender(this.mapObject, panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
5705
5723
  }
5706
5724
  panel.translateLayerElements(panel.layerObject, layerIndex);
5707
5725
  panel.layerGroup.appendChild(panel.layerObject);
@@ -5779,7 +5797,7 @@ class LayerPanel {
5779
5797
  proxy.renderTileLayer(proxy, layer, layerIndex, bing);
5780
5798
  this.mapObject.arrangeTemplate();
5781
5799
  if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
5782
- this.mapObject.zoomModule.applyTransform(true);
5800
+ this.mapObject.zoomModule.applyTransform(this.mapObject, true);
5783
5801
  }
5784
5802
  };
5785
5803
  ajax.send();
@@ -5823,7 +5841,7 @@ class LayerPanel {
5823
5841
  proxy.renderTileLayer(proxy, layer, layerIndex, bing);
5824
5842
  this.mapObject.arrangeTemplate();
5825
5843
  if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
5826
- this.mapObject.zoomModule.applyTransform(true);
5844
+ this.mapObject.zoomModule.applyTransform(this.mapObject, true);
5827
5845
  }
5828
5846
  }
5829
5847
  bubbleCalculation(bubbleSettings, range) {
@@ -6114,6 +6132,7 @@ class LayerPanel {
6114
6132
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
6115
6133
  (currentShapeData['property'][properties]) : ''));
6116
6134
  pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
6135
+ pathEle.setAttribute('role', '');
6117
6136
  if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
6118
6137
  pathEle.setAttribute('style', 'outline:none');
6119
6138
  }
@@ -6188,7 +6207,7 @@ class LayerPanel {
6188
6207
  this.layerObject.appendChild(element);
6189
6208
  });
6190
6209
  if (this.mapObject.markerModule) {
6191
- this.mapObject.markerModule.markerRender(this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
6210
+ this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
6192
6211
  : this.currentFactor), null);
6193
6212
  }
6194
6213
  this.translateLayerElements(this.layerObject, layerIndex);
@@ -6738,6 +6757,7 @@ class LayerPanel {
6738
6757
  imgElement.setAttribute('height', '256px');
6739
6758
  imgElement.setAttribute('width', '256px');
6740
6759
  imgElement.setAttribute('src', tile.src);
6760
+ imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
6741
6761
  const mapId = this.mapObject.element.id;
6742
6762
  imgElement.onload = () => {
6743
6763
  if (document.getElementById(mapId + '_tile_' + id) && type === 'Pan') {
@@ -6845,7 +6865,7 @@ class LayerPanel {
6845
6865
  '&zoom=' + zoom + '&center=' + center + '&maptype=' + mapType + '&key=' + apikey;
6846
6866
  document.getElementById(this.mapObject.element.id + '_tile_parent').innerHTML
6847
6867
  = '<div id="' + this.mapObject.element.id + '_StaticGoogleMap"' + 'style="position:absolute; left:' + eleWidth + 'px; top:'
6848
- + eleHeight + 'px"><img src="' + staticMapString + '"></div>';
6868
+ + eleHeight + 'px"><img src="' + staticMapString + '"' + 'alt="' + this.mapObject.getLocalizedLabel('ImageNotFound') + '"></div>';
6849
6869
  }
6850
6870
  /**
6851
6871
  * To find the tile translate point
@@ -6903,6 +6923,27 @@ class LayerPanel {
6903
6923
  this.mapObject.previousTileHeight = factorY;
6904
6924
  return new Point(x, y);
6905
6925
  }
6926
+ /**
6927
+ * @returns {void}
6928
+ * @private
6929
+ */
6930
+ destroy() {
6931
+ this.mapObject = null;
6932
+ this.groupElements = [];
6933
+ this.layerObject = null;
6934
+ this.currentLayer = null;
6935
+ this.rectBounds = null;
6936
+ this.tiles = [];
6937
+ this.clipRectElement = null;
6938
+ this.tileSvgObject = null;
6939
+ this.ajaxModule = null;
6940
+ this.ajaxResponse = [];
6941
+ this.layerGroup = null;
6942
+ if (!isNullOrUndefined(this.bing)) {
6943
+ this.bing.destroy();
6944
+ }
6945
+ this.bing = null;
6946
+ }
6906
6947
  }
6907
6948
 
6908
6949
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -7015,12 +7056,11 @@ class Annotations {
7015
7056
  /**
7016
7057
  * To destroy the annotation.
7017
7058
  *
7018
- * @param {Maps} map - Specifies the instance of the maps
7019
7059
  * @returns {void}
7020
7060
  * @private
7021
7061
  */
7022
- destroy(map) {
7023
- // Destroy method performed here
7062
+ destroy() {
7063
+ this.map = null;
7024
7064
  }
7025
7065
  }
7026
7066
 
@@ -7366,7 +7406,9 @@ let Maps = class Maps extends Component {
7366
7406
  this.dataLabelShape = [];
7367
7407
  }
7368
7408
  this.mapLayerPanel.measureLayerPanel();
7369
- this.element.appendChild(this.svgObject);
7409
+ if (!isNullOrUndefined(this.svgObject)) {
7410
+ this.element.appendChild(this.svgObject);
7411
+ }
7370
7412
  const position = this.getExtraPosition();
7371
7413
  for (let i = 0; i < this.layers.length; i++) {
7372
7414
  if (position.x !== 0 || position.y !== 0) {
@@ -7555,6 +7597,7 @@ let Maps = class Maps extends Component {
7555
7597
  */
7556
7598
  addTabIndex() {
7557
7599
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
7600
+ this.element.setAttribute('role', '');
7558
7601
  this.element.setAttribute('tabindex', this.tabIndex.toString());
7559
7602
  }
7560
7603
  // private setSecondaryElementPosition(): void {
@@ -7619,7 +7662,7 @@ let Maps = class Maps extends Component {
7619
7662
  }
7620
7663
  }
7621
7664
  if (this.zoomModule && (this.previousScale !== this.scale)) {
7622
- this.zoomModule.applyTransform(true);
7665
+ this.zoomModule.applyTransform(this, true);
7623
7666
  }
7624
7667
  }
7625
7668
  }
@@ -7796,6 +7839,7 @@ let Maps = class Maps extends Component {
7796
7839
  const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
7797
7840
  const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
7798
7841
  element.setAttribute('aria-label', this.description || title.text);
7842
+ element.setAttribute('role', '');
7799
7843
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
7800
7844
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
7801
7845
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -8371,7 +8415,7 @@ let Maps = class Maps extends Component {
8371
8415
  this.scale = zoomFactor;
8372
8416
  this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
8373
8417
  this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
8374
- this.zoomModule.applyTransform();
8418
+ this.zoomModule.applyTransform(this);
8375
8419
  }
8376
8420
  else {
8377
8421
  position = { x: size.width / 2, y: size.height / 2 };
@@ -8449,7 +8493,7 @@ let Maps = class Maps extends Component {
8449
8493
  this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
8450
8494
  }
8451
8495
  const markerModule = new Marker(this);
8452
- markerModule.markerRender(layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
8496
+ markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
8453
8497
  this.arrangeTemplate();
8454
8498
  }
8455
8499
  }
@@ -8655,7 +8699,8 @@ let Maps = class Maps extends Component {
8655
8699
  Zoom: 'Zoom',
8656
8700
  ZoomOut: 'Zoom out',
8657
8701
  Pan: 'Pan',
8658
- Reset: 'Reset'
8702
+ Reset: 'Reset',
8703
+ ImageNotFound: 'Image Not Found'
8659
8704
  };
8660
8705
  }
8661
8706
  /**
@@ -8663,6 +8708,7 @@ let Maps = class Maps extends Component {
8663
8708
  */
8664
8709
  destroy() {
8665
8710
  this.unWireEVents();
8711
+ super.destroy();
8666
8712
  this.shapeSelectionItem = [];
8667
8713
  this.toggledShapeElementId = [];
8668
8714
  this.toggledLegendId = [];
@@ -8677,11 +8723,14 @@ let Maps = class Maps extends Component {
8677
8723
  this.zoomLabelPositions = [];
8678
8724
  this.mouseDownEvent = { x: null, y: null };
8679
8725
  this.mouseClickEvent = { x: null, y: null };
8726
+ this.formatFunction = null;
8727
+ //TODO: Calling the below code throws spec issue.
8728
+ //this.renderer = null;
8729
+ this.availableSize = new Size(0, 0);
8680
8730
  if (document.getElementById('mapsmeasuretext')) {
8681
8731
  document.getElementById('mapsmeasuretext').remove();
8682
8732
  }
8683
8733
  this.removeSvg();
8684
- super.destroy();
8685
8734
  }
8686
8735
  /**
8687
8736
  * Gets component name
@@ -8993,7 +9042,7 @@ let Maps = class Maps extends Component {
8993
9042
  */
8994
9043
  print(id) {
8995
9044
  if ((this.allowPrint) && (this.printModule)) {
8996
- this.printModule.print(id);
9045
+ this.printModule.print(this, id);
8997
9046
  }
8998
9047
  }
8999
9048
  /**
@@ -9011,12 +9060,12 @@ let Maps = class Maps extends Component {
9011
9060
  }
9012
9061
  if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
9013
9062
  return new Promise((resolve, reject) => {
9014
- resolve(this.imageExportModule.export(type, fileName, allowDownload));
9063
+ resolve(this.imageExportModule.export(this, type, fileName, allowDownload));
9015
9064
  });
9016
9065
  }
9017
9066
  else if ((this.allowPdfExport) && (this.pdfExportModule)) {
9018
9067
  return new Promise((resolve, reject) => {
9019
- resolve(this.pdfExportModule.export(type, fileName, allowDownload, orientation));
9068
+ resolve(this.pdfExportModule.export(this, type, fileName, allowDownload, orientation));
9020
9069
  });
9021
9070
  }
9022
9071
  return null;
@@ -9591,14 +9640,13 @@ class Bubble {
9591
9640
  /**
9592
9641
  * To destroy the bubble.
9593
9642
  *
9594
- * @param {Maps} maps - Specifies the instance of the maps.
9595
9643
  * @returns {void}
9596
9644
  * @private
9597
9645
  */
9598
- destroy(maps) {
9599
- /**
9600
- * Destroy method performed here
9601
- */
9646
+ destroy() {
9647
+ this.bubbleCollection = [];
9648
+ //TODO: Calling the below code throws spec issue.
9649
+ //this.maps = null;
9602
9650
  }
9603
9651
  }
9604
9652
 
@@ -9794,7 +9842,7 @@ class DataLabel {
9794
9842
  const eventargs = {
9795
9843
  name: dataLabelRendering, maps: this.maps, cancel: false, border: { color: dataLabel.border.color,
9796
9844
  width: dataLabel.border.width, opacity: dataLabel.border.opacity }, datalabel: dataLabel,
9797
- fill: dataLabel.fill, template: dataLabel.template, text: text
9845
+ fill: dataLabel.fill, template: dataLabel.template, text: text, offsetX: 0, offsetY: 0
9798
9846
  };
9799
9847
  this.maps.trigger('dataLabelRendering', eventargs, (labelArgs) => {
9800
9848
  if (eventargs.cancel) {
@@ -9844,8 +9892,8 @@ class DataLabel {
9844
9892
  datasrcObj : shapeData['properties'], this.maps, eventargs.template, this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
9845
9893
  templateElement.innerHTML = !templateFn ? eventargs.template : '';
9846
9894
  labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, this.maps);
9847
- labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + 'px';
9848
- labelElement.style.top = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + 'px';
9895
+ labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
9896
+ labelElement.style.top = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + labelArgs.offsetY + 'px';
9849
9897
  labelTemplateElement.appendChild(labelElement);
9850
9898
  }
9851
9899
  else {
@@ -9933,26 +9981,26 @@ class DataLabel {
9933
9981
  y = ((location['y'] + transPoint['y']) * scale) - textSize['height'] / 2;
9934
9982
  }
9935
9983
  border.opacity = isNullOrUndefined(border.opacity) ? opacity : border.opacity;
9936
- const rectOptions = new RectOption(this.maps.element.id + '_LayerIndex_' + layerIndex + '_shapeIndex_' + index + '_rectIndex_' + index, fill, border, opacity, new Rect(x, y, textSize['width'], textSize['height']), rx, ry);
9984
+ const rectOptions = new RectOption(this.maps.element.id + '_LayerIndex_' + layerIndex + '_shapeIndex_' + index + '_rectIndex_' + index, fill, border, opacity, new Rect((x + labelArgs.offsetX), (y + labelArgs.offsetY), textSize['width'], textSize['height']), rx, ry);
9937
9985
  const rect = this.maps.renderer.drawRectangle(rectOptions);
9938
9986
  group.appendChild(rect);
9939
9987
  }
9940
9988
  }
9941
9989
  element = renderTextElement(options, style, style.color || this.maps.themeStyle.dataLabelFontColor, group);
9942
9990
  if (zoomLabelsPosition && scaleZoomValue > 1 && !this.maps.zoomNotApplied) {
9943
- element.setAttribute('transform', 'translate( ' + ((location['x'])) + ' '
9944
- + (((location['y']))) + ' )');
9991
+ element.setAttribute('transform', 'translate( ' + ((location['x'] + labelArgs.offsetX)) + ' '
9992
+ + (((location['y'] + labelArgs.offsetY))) + ' )');
9945
9993
  location['x'] = locationX;
9946
9994
  location['y'] = locationY;
9947
9995
  }
9948
9996
  else {
9949
- element.setAttribute('transform', 'translate( ' + ((location['x'] + transPoint.x) * scale) + ' '
9950
- + (((location['y'] + transPoint.y) * scale) + (elementSize.height / 4)) + ' )');
9997
+ element.setAttribute('transform', 'translate( ' + (((location['x'] + transPoint.x) * scale) + labelArgs.offsetX) + ' '
9998
+ + ((((location['y'] + transPoint.y) * scale) + (elementSize.height / 4)) + labelArgs.offsetY) + ' )');
9951
9999
  }
9952
10000
  group.appendChild(element);
9953
10001
  }
9954
10002
  this.dataLabelCollections.push({
9955
- location: { x: location['x'], y: location['y'] },
10003
+ location: { x: location['x'] + labelArgs.offsetX, y: location['y'] + labelArgs.offsetY },
9956
10004
  element: isNullOrUndefined(labelElement) ? element : labelElement,
9957
10005
  layerIndex: layerIndex,
9958
10006
  shapeIndex: sublayerIndexLabel ? oldIndex : index,
@@ -9995,16 +10043,14 @@ class DataLabel {
9995
10043
  return 'DataLabel';
9996
10044
  }
9997
10045
  /**
9998
- * To destroy the layers.
9999
10046
  *
10000
- * @param {Maps} maps - Specifies the instance of the maps.
10001
10047
  * @returns {void}
10002
10048
  * @private
10003
10049
  */
10004
- destroy(maps) {
10005
- /**
10006
- * Destroy method performed here
10007
- */
10050
+ destroy() {
10051
+ this.dataLabelCollections = [];
10052
+ this.value = null;
10053
+ this.maps = null;
10008
10054
  }
10009
10055
  }
10010
10056
 
@@ -10155,14 +10201,11 @@ class NavigationLine {
10155
10201
  /**
10156
10202
  * To destroy the layers.
10157
10203
  *
10158
- * @param {Maps} maps - Specifies the instance of the map
10159
10204
  * @returns {void}
10160
10205
  * @private
10161
10206
  */
10162
- destroy(maps) {
10163
- /**
10164
- * Destroy method performed here
10165
- */
10207
+ destroy() {
10208
+ this.maps = null;
10166
10209
  }
10167
10210
  }
10168
10211
 
@@ -11919,6 +11962,9 @@ class Legend {
11919
11962
  '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
11920
11963
  '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
11921
11964
  if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
11965
+ mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
11966
+ '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
11967
+ '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id);
11922
11968
  mapElement = mapElement.children[0];
11923
11969
  }
11924
11970
  if (isVisible && mapElement !== null) {
@@ -12060,6 +12106,9 @@ class Legend {
12060
12106
  '_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
12061
12107
  '_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id);
12062
12108
  if (!isNullOrUndefined(mapdata['shape']) && mapdata['shape'] === 'Balloon') {
12109
+ LegendInteractive = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
12110
+ '_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'] + '_Group', this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
12111
+ '_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'] + '_Group', this.maps.element.id);
12063
12112
  LegendInteractive = LegendInteractive.children[0];
12064
12113
  }
12065
12114
  if (isVisible && LegendInteractive !== null) {
@@ -12282,15 +12331,30 @@ class Legend {
12282
12331
  /**
12283
12332
  * To destroy the legend.
12284
12333
  *
12285
- * @param {Maps} maps - Specifies the instance of the maps
12286
12334
  * @returns {void}
12287
12335
  * @private
12288
12336
  */
12289
- destroy(maps) {
12290
- /**
12291
- * Destroy method performed here
12292
- */
12337
+ destroy() {
12338
+ this.legendCollection = [];
12339
+ this.legendRenderingCollections = [];
12340
+ this.translate = null;
12341
+ this.legendBorderRect = null;
12342
+ this.initialMapAreaRect = null;
12343
+ this.legendTotalRect = null;
12344
+ this.totalPages = [];
12345
+ this.legendItemRect = null;
12346
+ this.legendGroup = null;
12347
+ this.shapeHighlightCollection = [];
12348
+ this.legendHighlightCollection = [];
12349
+ this.shapePreviousColor = [];
12350
+ this.selectedNonLegendShapes = [];
12351
+ this.legendLinearGradient = null;
12352
+ this.currentLayer = null;
12353
+ this.defsElement = null;
12354
+ this.legendElement = [];
12355
+ this.oldShapeElement = null;
12293
12356
  this.removeEventListener();
12357
+ this.maps = null;
12294
12358
  }
12295
12359
  }
12296
12360
 
@@ -12507,15 +12571,13 @@ class Highlight {
12507
12571
  /**
12508
12572
  * To destroy the highlight.
12509
12573
  *
12510
- * @param {Maps} maps - Specifies the maps instance
12511
12574
  * @returns {void}
12512
12575
  * @private
12513
12576
  */
12514
- destroy(maps) {
12515
- /**
12516
- * Destroy method performed here
12517
- */
12577
+ destroy() {
12578
+ this.highlightSettings = null;
12518
12579
  this.removeEventListener();
12580
+ this.maps = null;
12519
12581
  }
12520
12582
  }
12521
12583
 
@@ -12811,15 +12873,13 @@ class Selection {
12811
12873
  /**
12812
12874
  * To destroy the selection.
12813
12875
  *
12814
- * @param {Maps} maps - Specifies the maps instance.
12815
12876
  * @returns {void}
12816
12877
  * @private
12817
12878
  */
12818
- destroy(maps) {
12819
- /**
12820
- * Destroy method performed here
12821
- */
12879
+ destroy() {
12880
+ this.selectionsettings = null;
12822
12881
  this.removeEventListener();
12882
+ this.maps = null;
12823
12883
  }
12824
12884
  }
12825
12885
 
@@ -13192,12 +13252,17 @@ class MapsTooltip {
13192
13252
  /**
13193
13253
  * To destroy the tooltip.
13194
13254
  *
13195
- * @param {Maps} maps Specifies the maps instance
13196
13255
  * @returns {void}
13197
13256
  * @private
13198
13257
  */
13199
- destroy(maps) {
13258
+ destroy() {
13259
+ if (!isNullOrUndefined(this.svgTooltip)) {
13260
+ this.svgTooltip.destroy();
13261
+ }
13262
+ this.svgTooltip = null;
13200
13263
  this.removeEventListener();
13264
+ //TODO: Calling the below code throws spec issue.
13265
+ //this.maps = null;
13201
13266
  }
13202
13267
  }
13203
13268
 
@@ -13210,7 +13275,6 @@ class Zoom {
13210
13275
  this.mouseEnter = false;
13211
13276
  this.isTouch = false;
13212
13277
  this.rectZoomingStart = false;
13213
- this.pinchRect = new Rect(0, 0, 0, 0);
13214
13278
  this.browserName = Browser.info.name;
13215
13279
  // eslint-disable-next-line @typescript-eslint/ban-types
13216
13280
  this.isPointer = Browser.isPointer;
@@ -13234,7 +13298,6 @@ class Zoom {
13234
13298
  this.selectionColor = this.maps.zoomSettings.selectionColor;
13235
13299
  this.fillColor = this.maps.zoomSettings.color;
13236
13300
  this.addEventListener();
13237
- this.groupElements = [];
13238
13301
  }
13239
13302
  /**
13240
13303
  * To perform zooming for maps
@@ -13274,6 +13337,7 @@ class Zoom {
13274
13337
  mapTotalHeight = availSize.height;
13275
13338
  }
13276
13339
  newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
13340
+ newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
13277
13341
  map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
13278
13342
  }
13279
13343
  else {
@@ -13291,7 +13355,7 @@ class Zoom {
13291
13355
  map.scale = map.mapScaleValue = map.previousScale;
13292
13356
  }
13293
13357
  else {
13294
- this.applyTransform();
13358
+ this.applyTransform(map);
13295
13359
  }
13296
13360
  }
13297
13361
  else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
@@ -13335,7 +13399,7 @@ class Zoom {
13335
13399
  // element1 = element1;
13336
13400
  // }
13337
13401
  // }
13338
- this.applyTransform();
13402
+ this.applyTransform(this.maps);
13339
13403
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
13340
13404
  document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
13341
13405
  }
@@ -13437,7 +13501,7 @@ class Zoom {
13437
13501
  }
13438
13502
  if (!isZoomCancelled) {
13439
13503
  map.mapScaleValue = zoomCalculationFactor;
13440
- this.applyTransform(true);
13504
+ this.applyTransform(map, true);
13441
13505
  this.maps.zoomNotApplied = false;
13442
13506
  this.zoomingRect = null;
13443
13507
  }
@@ -13486,6 +13550,7 @@ class Zoom {
13486
13550
  mapTotalHeight = availSize.height;
13487
13551
  }
13488
13552
  zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
13553
+ zoomCalculationFactor = zoomCalculationFactor > 1.05 ? 1 : zoomCalculationFactor;
13489
13554
  map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
13490
13555
  }
13491
13556
  else {
@@ -13524,7 +13589,7 @@ class Zoom {
13524
13589
  }
13525
13590
  }
13526
13591
  if (!isZoomCancelled) {
13527
- this.applyTransform();
13592
+ this.applyTransform(map);
13528
13593
  }
13529
13594
  }
13530
13595
  drawZoomRectangle() {
@@ -13571,17 +13636,17 @@ class Zoom {
13571
13636
  zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
13572
13637
  }
13573
13638
  }
13574
- applyTransform(animate$$1) {
13639
+ applyTransform(maps, animate$$1) {
13575
13640
  let layerIndex;
13576
13641
  this.templateCount = 0;
13577
13642
  let markerStyle;
13578
- const scale = this.maps.scale;
13579
- const x = this.maps.translatePoint.x;
13580
- const y = this.maps.translatePoint.y;
13643
+ const scale = maps.scale;
13644
+ const x = maps.translatePoint.x;
13645
+ const y = maps.translatePoint.y;
13581
13646
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13582
- this.maps.zoomShapeCollection = [];
13583
- if (document.getElementById(this.maps.element.id + '_mapsTooltip')) {
13584
- removeElement(this.maps.element.id + '_mapsTooltip');
13647
+ maps.zoomShapeCollection = [];
13648
+ if (document.getElementById(maps.element.id + '_mapsTooltip')) {
13649
+ removeElement(maps.element.id + '_mapsTooltip');
13585
13650
  }
13586
13651
  if (this.layerCollectionEle) {
13587
13652
  for (let i = 0; i < this.layerCollectionEle.childElementCount; i++) {
@@ -13589,29 +13654,29 @@ class Zoom {
13589
13654
  if (layerElement.tagName === 'g') {
13590
13655
  this.templateCount++;
13591
13656
  this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
13592
- this.currentLayer = this.maps.layersCollection[this.index];
13593
- const factor = this.maps.mapLayerPanel.calculateFactor(this.currentLayer);
13657
+ this.currentLayer = maps.layersCollection[this.index];
13658
+ const factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
13594
13659
  for (let j = 0; j < layerElement.childElementCount; j++) {
13595
13660
  let currentEle = layerElement.childNodes[j];
13596
13661
  if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
13597
13662
  && (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
13598
- if (this.maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
13663
+ if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
13599
13664
  currentEle.remove();
13600
13665
  if (layerElement.children.length > 0 && layerElement.children[0]) {
13601
- layerElement.insertBefore(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index), layerElement.children[1]);
13666
+ layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
13602
13667
  }
13603
13668
  else {
13604
- layerElement.appendChild(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index));
13669
+ layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
13605
13670
  }
13606
13671
  }
13607
13672
  else if (currentEle.id.indexOf('Legend') == -1) {
13608
- changeBorderWidth(currentEle, this.index, scale, this.maps);
13609
- this.maps.zoomTranslatePoint = this.maps.translatePoint;
13673
+ changeBorderWidth(currentEle, this.index, scale, maps);
13674
+ maps.zoomTranslatePoint = maps.translatePoint;
13610
13675
  this.animateTransform(currentEle, animate$$1, x, y, scale);
13611
13676
  }
13612
13677
  }
13613
13678
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
13614
- if (!this.isPanning) {
13679
+ if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
13615
13680
  this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
13616
13681
  }
13617
13682
  currentEle = layerElement.childNodes[j];
@@ -13630,11 +13695,11 @@ class Zoom {
13630
13695
  markerSelectionValues['latitude'] ||
13631
13696
  this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x]['longitude'] ===
13632
13697
  markerSelectionValues['longitude']) {
13633
- this.maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, this.maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
13698
+ maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
13634
13699
  }
13635
13700
  }
13636
- if ((this.currentLayer.animationDuration > 0 || (this.maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
13637
- if (this.maps.isTileMap) {
13701
+ if ((this.currentLayer.animationDuration > 0 || (maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
13702
+ if (maps.isTileMap) {
13638
13703
  const groupElement = document.querySelector('.GroupElement');
13639
13704
  if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
13640
13705
  groupElement.style.display = 'none';
@@ -13646,29 +13711,29 @@ class Zoom {
13646
13711
  }
13647
13712
  }
13648
13713
  }
13649
- if (this.isPanning && this.maps.markerModule.sameMarkerData.length > 0) {
13650
- clusterSeparate(this.maps.markerModule.sameMarkerData, this.maps, currentEle, true);
13714
+ if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
13715
+ clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
13651
13716
  }
13652
- else if (this.maps.markerModule.sameMarkerData.length > 0) {
13653
- this.maps.markerModule.sameMarkerData = [];
13654
- if (document.getElementById(this.maps.element.id + '_mapsTooltip')) {
13655
- removeElement(this.maps.element.id + '_mapsTooltip');
13717
+ else if (maps.markerModule.sameMarkerData.length > 0) {
13718
+ maps.markerModule.sameMarkerData = [];
13719
+ if (document.getElementById(maps.element.id + '_mapsTooltip')) {
13720
+ removeElement(maps.element.id + '_mapsTooltip');
13656
13721
  }
13657
13722
  }
13658
- if (document.getElementById(this.maps.element.id + '_mapsTooltip') && this.maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
13723
+ if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
13659
13724
  && !this.isPanning) {
13660
- const mapsTooltip = this.maps.mapsTooltipModule;
13725
+ const mapsTooltip = maps.mapsTooltipModule;
13661
13726
  const tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
13662
13727
  if (!isNullOrUndefined(tooltipElement)) {
13663
13728
  if (tooltipElement['style']['visibility'] === 'hidden') {
13664
- removeElement(this.maps.element.id + '_mapsTooltip');
13729
+ removeElement(maps.element.id + '_mapsTooltip');
13665
13730
  }
13666
13731
  else {
13667
13732
  let x = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[1]);
13668
13733
  let y = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[2]);
13669
- if (this.maps.isTileMap) {
13670
- x += +getElement(this.maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
13671
- y += +getElement(this.maps.element.id + '_tile_parent')['style']['top'].split('px')[0];
13734
+ if (maps.isTileMap) {
13735
+ x += +getElement(maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
13736
+ y += +getElement(maps.element.id + '_tile_parent')['style']['top'].split('px')[0];
13672
13737
  }
13673
13738
  mapsTooltip.svgTooltip.location.x = x;
13674
13739
  mapsTooltip.svgTooltip.location.y = y;
@@ -13686,9 +13751,9 @@ class Zoom {
13686
13751
  layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
13687
13752
  const bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
13688
13753
  const dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
13689
- for (let l = 0; l < this.maps.bubbleModule.bubbleCollection.length; l++) {
13754
+ for (let l = 0; l < maps.bubbleModule.bubbleCollection.length; l++) {
13690
13755
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13691
- const bubbleCollection = this.maps.bubbleModule.bubbleCollection[l];
13756
+ const bubbleCollection = maps.bubbleModule.bubbleCollection[l];
13692
13757
  if (bubbleCollection['LayerIndex'] === layerIndex && bubbleCollection['BubbleIndex'] === bubleIndex &&
13693
13758
  bubbleCollection['DataIndex'] === dataIndex) {
13694
13759
  const centerX = bubbleCollection['center']['x'];
@@ -13707,25 +13772,25 @@ class Zoom {
13707
13772
  }
13708
13773
  }
13709
13774
  }
13710
- else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(this.maps.layers[this.index])) {
13775
+ else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
13711
13776
  this.intersect = [];
13712
- this.maps.zoomLabelPositions = [];
13713
- this.maps.zoomLabelPositions = this.maps.dataLabelModule.dataLabelCollections;
13714
- let labelAnimate = !this.maps.isTileMap && animate$$1;
13777
+ maps.zoomLabelPositions = [];
13778
+ maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
13779
+ let labelAnimate = !maps.isTileMap && animate$$1;
13715
13780
  for (let k = 0; k < currentEle.childElementCount; k++) {
13716
13781
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
13717
13782
  const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
13718
13783
  this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
13719
- this.maps.zoomShapeCollection.push(this.zoomshapewidth);
13784
+ maps.zoomShapeCollection.push(this.zoomshapewidth);
13720
13785
  this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
13721
- const dataLabel = this.maps.layers[this.index].dataLabelSettings;
13786
+ const dataLabel = maps.layers[this.index].dataLabelSettings;
13722
13787
  const border = dataLabel.border;
13723
13788
  if (k > 0 && border['width'] > 1) {
13724
- if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1) {
13725
- const labelX = ((this.maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
13726
- const labelY = ((this.maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
13789
+ if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
13790
+ const labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
13791
+ const labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
13727
13792
  const zoomtext = currentEle.childNodes[k]['innerHTML'];
13728
- const style = this.maps.layers[this.index].dataLabelSettings.textStyle;
13793
+ const style = maps.layers[this.index].dataLabelSettings.textStyle;
13729
13794
  const zoomtextSize = measureText(zoomtext, style);
13730
13795
  const padding = 5;
13731
13796
  const rectElement = currentEle.childNodes[k - 1];
@@ -13740,11 +13805,11 @@ class Zoom {
13740
13805
  }
13741
13806
  }
13742
13807
  }
13743
- this.maps.arrangeTemplate();
13808
+ maps.arrangeTemplate();
13744
13809
  }
13745
13810
  if (!isNullOrUndefined(this.currentLayer)) {
13746
- if (!animate$$1 || this.currentLayer.animationDuration === 0 || this.maps.isTileMap) {
13747
- this.processTemplate(x, y, scale, this.maps);
13811
+ if (!animate$$1 || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
13812
+ this.processTemplate(x, y, scale, maps);
13748
13813
  }
13749
13814
  }
13750
13815
  }
@@ -14144,15 +14209,15 @@ class Zoom {
14144
14209
  if (!panArgs.cancel) {
14145
14210
  if (panningXDirection && panningYDirection) {
14146
14211
  map.translatePoint = new Point(x, y);
14147
- this.applyTransform();
14212
+ this.applyTransform(map);
14148
14213
  }
14149
14214
  else if (panningXDirection) {
14150
14215
  map.translatePoint = new Point(x, map.translatePoint.y);
14151
- this.applyTransform();
14216
+ this.applyTransform(map);
14152
14217
  }
14153
14218
  else if (panningYDirection) {
14154
14219
  map.translatePoint = new Point(map.translatePoint.x, y);
14155
- this.applyTransform();
14220
+ this.applyTransform(map);
14156
14221
  }
14157
14222
  }
14158
14223
  this.maps.zoomNotApplied = false;
@@ -14180,7 +14245,7 @@ class Zoom {
14180
14245
  };
14181
14246
  map.trigger(pan, panArgs);
14182
14247
  map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
14183
- this.applyTransform();
14248
+ this.applyTransform(map);
14184
14249
  }
14185
14250
  map.zoomTranslatePoint = map.translatePoint;
14186
14251
  this.mouseDownPoints = this.mouseMovePoints;
@@ -14192,7 +14257,7 @@ class Zoom {
14192
14257
  (this.distanceX / this.maps.scale)) : this.maps.translatePoint.x;
14193
14258
  this.maps.translatePoint.y = !isNullOrUndefined(this.distanceY) ? this.maps.translatePoint.y -
14194
14259
  (this.distanceY / this.maps.scale) : this.maps.translatePoint.y;
14195
- this.applyTransform(false);
14260
+ this.applyTransform(this.maps, false);
14196
14261
  }
14197
14262
  toolBarZooming(zoomFactor, type) {
14198
14263
  const map = this.maps;
@@ -14229,6 +14294,7 @@ class Zoom {
14229
14294
  mapHeight = size.height;
14230
14295
  }
14231
14296
  zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
14297
+ zoomFactor = zoomFactor > 1.05 ? 1 : zoomFactor;
14232
14298
  map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
14233
14299
  }
14234
14300
  else {
@@ -14248,7 +14314,7 @@ class Zoom {
14248
14314
  map.scale = map.previousScale;
14249
14315
  }
14250
14316
  else {
14251
- this.applyTransform(true);
14317
+ this.applyTransform(map, true);
14252
14318
  }
14253
14319
  }
14254
14320
  else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
@@ -14286,7 +14352,7 @@ class Zoom {
14286
14352
  const element1 = document.getElementById(this.maps.element.id + '_tiles');
14287
14353
  const animationDuration = this.maps.layersCollection[0].animationDuration;
14288
14354
  setTimeout(() => {
14289
- this.applyTransform(true);
14355
+ this.applyTransform(this.maps, true);
14290
14356
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
14291
14357
  document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
14292
14358
  }
@@ -14299,6 +14365,8 @@ class Zoom {
14299
14365
  }
14300
14366
  createZoomingToolbars() {
14301
14367
  const map = this.maps;
14368
+ let zoomInElements;
14369
+ let zoomOutElements;
14302
14370
  this.toolBarGroup = map.renderer.createGroup({
14303
14371
  id: map.element.id + '_Zooming_KitCollection',
14304
14372
  opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
@@ -14316,7 +14384,6 @@ class Zoom {
14316
14384
  const toolBarLength = map.zoomSettings.toolbars.length;
14317
14385
  const toolWidth = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (toolBarLength * kitWidth) + (toolBarLength * padding) : (kitWidth * 2);
14318
14386
  const toolHeight = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (kitHeight * 2) : (toolBarLength * kitHeight) + (toolBarLength * padding);
14319
- this.toolBarGroup.appendChild(map.renderer.drawRectangle(new RectOption(map.element.id + '_Zooming_Rect', 'transparent', { color: 'transparent', width: 1 }, 1, new Rect(0, 0, toolWidth, toolHeight), 0, 0)));
14320
14387
  const defElement = map.renderer.createDefs();
14321
14388
  defElement.innerHTML = shadowElement;
14322
14389
  this.toolBarGroup.appendChild(defElement);
@@ -14365,13 +14432,13 @@ class Zoom {
14365
14432
  case 'zoomin':
14366
14433
  direction = 'M 8, 0 L 8, 16 M 0, 8 L 16, 8';
14367
14434
  this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar + '_Path', fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
14368
- this.zoomInElements = this.currentToolbarEle;
14435
+ zoomInElements = this.currentToolbarEle;
14369
14436
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
14370
14437
  break;
14371
14438
  case 'zoomout':
14372
14439
  direction = 'M 0, 8 L 16, 8';
14373
14440
  this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar, fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
14374
- this.zoomOutElements = this.currentToolbarEle;
14441
+ zoomOutElements = this.currentToolbarEle;
14375
14442
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
14376
14443
  break;
14377
14444
  case 'pan': {
@@ -14868,15 +14935,30 @@ class Zoom {
14868
14935
  /**
14869
14936
  * To destroy the zoom.
14870
14937
  *
14871
- * @param {Maps} maps - Specifies the instance of the maps.
14872
14938
  * @returns {void}
14873
14939
  * @private
14874
14940
  */
14875
- destroy(maps) {
14941
+ destroy() {
14942
+ this.toolBarGroup = null;
14943
+ this.currentToolbarEle = null;
14944
+ this.zoomingRect = null;
14945
+ this.zoomElements = null;
14946
+ this.panElements = null;
14947
+ this.baseTranslatePoint = null;
14948
+ this.touchStartList = null;
14949
+ this.touchMoveList = null;
14950
+ this.previousTouchMoveList = null;
14951
+ this.mouseDownPoints = null;
14952
+ this.mouseMovePoints = null;
14953
+ this.startTouches = [];
14954
+ this.zoomshapewidth = null;
14955
+ this.intersect = [];
14956
+ this.mouseDownLatLong = null;
14957
+ this.mouseMoveLatLong = null;
14876
14958
  this.removeEventListener();
14877
- /**
14878
- * Destroy method performed here
14879
- */
14959
+ //TODO: Calling the below code throws spec issue.
14960
+ //this.maps = null;
14961
+ this.currentLayer = null;
14880
14962
  }
14881
14963
  }
14882
14964
 
@@ -14892,9 +14974,7 @@ class Print {
14892
14974
  *
14893
14975
  * @param {Maps} control - Specifies the instance of the map
14894
14976
  */
14895
- constructor(control) {
14896
- this.control = control;
14897
- }
14977
+ constructor(control) { }
14898
14978
  /**
14899
14979
  * To print the Maps
14900
14980
  *
@@ -14902,16 +14982,16 @@ class Print {
14902
14982
  * @returns {void}
14903
14983
  * @private
14904
14984
  */
14905
- print(elements) {
14906
- this.printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
14907
- this.printWindow.moveTo(0, 0);
14908
- this.printWindow.resizeTo(screen.availWidth, screen.availHeight);
14985
+ print(maps, elements) {
14986
+ let printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
14987
+ printWindow.moveTo(0, 0);
14988
+ printWindow.resizeTo(screen.availWidth, screen.availHeight);
14909
14989
  const argsData = {
14910
- cancel: false, htmlContent: this.getHTMLContent(elements), name: beforePrint
14990
+ cancel: false, htmlContent: this.getHTMLContent(maps, elements), name: beforePrint
14911
14991
  };
14912
- this.control.trigger('beforePrint', argsData, (beforePrintArgs) => {
14992
+ maps.trigger('beforePrint', argsData, (beforePrintArgs) => {
14913
14993
  if (!argsData.cancel) {
14914
- print(argsData.htmlContent, this.printWindow);
14994
+ print(argsData.htmlContent, printWindow);
14915
14995
  }
14916
14996
  });
14917
14997
  }
@@ -14922,20 +15002,19 @@ class Print {
14922
15002
  * @returns {Element} - Returns the div element
14923
15003
  * @private
14924
15004
  */
14925
- getHTMLContent(elements) {
14926
- const elementRect = getClientElement(this.control.element.id);
15005
+ getHTMLContent(maps, elements) {
14927
15006
  let div = createElement('div');
14928
- let divElement = this.control.element.cloneNode(true);
14929
- if (this.control.isTileMap) {
15007
+ let divElement = maps.element.cloneNode(true);
15008
+ if (maps.isTileMap) {
14930
15009
  for (let i = 0; i < divElement.childElementCount; i++) {
14931
- if (divElement.children[i].id === this.control.element.id + '_tile_parent') {
15010
+ if (divElement.children[i].id === maps.element.id + '_tile_parent') {
14932
15011
  divElement.children[i].style.removeProperty('height');
14933
15012
  divElement.children[i].style.removeProperty('width');
14934
15013
  divElement.children[i].style.removeProperty('top');
14935
15014
  divElement.children[i].style.removeProperty('left');
14936
15015
  divElement.children[i].style.removeProperty('right');
14937
15016
  divElement.children[i].style.removeProperty('overflow');
14938
- const svgElement = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
15017
+ const svgElement = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
14939
15018
  divElement.children[i].children[0].style.overflow = 'hidden';
14940
15019
  divElement.children[i].children[0].style.position = 'absolute';
14941
15020
  divElement.children[i].children[0].style.height = svgElement.style.height;
@@ -14975,15 +15054,10 @@ class Print {
14975
15054
  /**
14976
15055
  * To destroy the print.
14977
15056
  *
14978
- * @param {Maps} maps - Specifies the instance of the maps
14979
15057
  * @returns {void}
14980
15058
  * @private
14981
15059
  */
14982
- destroy(maps) {
14983
- /**
14984
- * Destroy method performed here
14985
- */
14986
- }
15060
+ destroy() { }
14987
15061
  }
14988
15062
 
14989
15063
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -14999,7 +15073,6 @@ class ImageExport {
14999
15073
  * @param {Maps} control - Specifies the instance of the map
15000
15074
  */
15001
15075
  constructor(control) {
15002
- this.control = control;
15003
15076
  }
15004
15077
  /**
15005
15078
  * To export the file as image/svg format
@@ -15010,28 +15083,28 @@ class ImageExport {
15010
15083
  * @returns {Promise<string>} - Returns the promise string.
15011
15084
  * @private
15012
15085
  */
15013
- export(type, fileName, allowDownload) {
15086
+ export(maps, type, fileName, allowDownload) {
15014
15087
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15015
15088
  const promise = new Promise((resolve, reject) => {
15016
15089
  const imageCanvasElement = createElement('canvas', {
15017
15090
  id: 'ej2-canvas',
15018
15091
  attrs: {
15019
- 'width': this.control.availableSize.width.toString(),
15020
- 'height': this.control.availableSize.height.toString()
15092
+ 'width': maps.availableSize.width.toString(),
15093
+ 'height': maps.availableSize.height.toString()
15021
15094
  }
15022
15095
  });
15023
15096
  const isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
15024
- const toolbarEle = document.getElementById(this.control.element.id + '_ToolBar');
15025
- const svgParent = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
15097
+ const toolbarEle = document.getElementById(maps.element.id + '_ToolBar');
15098
+ const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
15026
15099
  let svgDataElement;
15027
15100
  let tileSvg;
15028
- let svgObject = getElementByID(this.control.element.id + '_svg').cloneNode(true);
15029
- if (!this.control.isTileMap) {
15101
+ let svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
15102
+ if (!maps.isTileMap) {
15030
15103
  svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
15031
- this.control.svgObject.outerHTML + '</svg>';
15104
+ maps.svgObject.outerHTML + '</svg>';
15032
15105
  }
15033
15106
  else {
15034
- tileSvg = getElementByID(this.control.element.id + '_Tile_SVG').cloneNode(true);
15107
+ tileSvg = getElementByID(maps.element.id + '_Tile_SVG').cloneNode(true);
15035
15108
  svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
15036
15109
  svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
15037
15110
  }
@@ -15048,7 +15121,7 @@ class ImageExport {
15048
15121
  else {
15049
15122
  const image = new Image();
15050
15123
  const ctxt = imageCanvasElement.getContext('2d');
15051
- if (!this.control.isTileMap) {
15124
+ if (!maps.isTileMap) {
15052
15125
  image.onload = (() => {
15053
15126
  ctxt.drawImage(image, 0, 0);
15054
15127
  window.URL.revokeObjectURL(url);
@@ -15067,22 +15140,22 @@ class ImageExport {
15067
15140
  image.src = url;
15068
15141
  }
15069
15142
  else {
15070
- const svgParentElement = document.getElementById(this.control.element.id + '_MapAreaBorder');
15143
+ const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
15071
15144
  let top = parseFloat(svgParentElement.getAttribute('y'));
15072
15145
  let left = parseFloat(svgParentElement.getAttribute('x'));
15073
15146
  const imgxHttp = new XMLHttpRequest();
15074
- const imgTileLength = this.control.mapLayerPanel.tiles.length;
15147
+ const imgTileLength = maps.mapLayerPanel.tiles.length;
15075
15148
  for (let i = 0; i <= imgTileLength + 1; i++) {
15076
- const tile = document.getElementById(this.control.element.id + '_tile_' + (i - 1));
15149
+ const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
15077
15150
  const exportTileImg = new Image();
15078
15151
  exportTileImg.crossOrigin = 'Anonymous';
15079
- ctxt.fillStyle = this.control.background ? this.control.background : '#FFFFFF';
15080
- ctxt.fillRect(0, 0, this.control.availableSize.width, this.control.availableSize.height);
15081
- ctxt.font = this.control.titleSettings.textStyle.size + ' Arial';
15082
- let titleElement = document.getElementById(this.control.element.id + '_Map_title');
15152
+ ctxt.fillStyle = maps.background ? maps.background : '#FFFFFF';
15153
+ ctxt.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
15154
+ ctxt.font = maps.titleSettings.textStyle.size + ' Arial';
15155
+ let titleElement = document.getElementById(maps.element.id + '_Map_title');
15083
15156
  if (!isNullOrUndefined(titleElement)) {
15084
15157
  ctxt.fillStyle = titleElement.getAttribute('fill');
15085
- ctxt.fillText(this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
15158
+ ctxt.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
15086
15159
  }
15087
15160
  exportTileImg.onload = (() => {
15088
15161
  if (i === 0 || i === imgTileLength + 1) {
@@ -15096,7 +15169,6 @@ class ImageExport {
15096
15169
  }
15097
15170
  }
15098
15171
  else {
15099
- const tileParent = document.getElementById(this.control.element.id + '_tile_parent');
15100
15172
  ctxt.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left, parseFloat(tile.style.top) +
15101
15173
  top);
15102
15174
  }
@@ -15150,15 +15222,10 @@ class ImageExport {
15150
15222
  /**
15151
15223
  * To destroy the ImageExport.
15152
15224
  *
15153
- * @param {Maps} maps - Specifies the instance of the maps.
15154
15225
  * @returns {void}
15155
15226
  * @private
15156
15227
  */
15157
- destroy(maps) {
15158
- /**
15159
- * Destroy method performed here
15160
- */
15161
- }
15228
+ destroy() { }
15162
15229
  }
15163
15230
 
15164
15231
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -15173,9 +15240,7 @@ class PdfExport {
15173
15240
  *
15174
15241
  * @param {Maps} control Specifies the instance of the map
15175
15242
  */
15176
- constructor(control) {
15177
- this.control = control;
15178
- }
15243
+ constructor() { }
15179
15244
  /**
15180
15245
  * To export the file as image/svg format
15181
15246
  *
@@ -15186,24 +15251,24 @@ class PdfExport {
15186
15251
  * @returns {Promise<string>} - Returns the promise string
15187
15252
  * @private
15188
15253
  */
15189
- export(type, fileName, allowDownload, orientation) {
15254
+ export(maps, type, fileName, allowDownload, orientation) {
15190
15255
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15191
15256
  const promise = new Promise((resolve, reject) => {
15192
15257
  const canvasElement = createElement('canvas', {
15193
15258
  id: 'ej2-canvas',
15194
15259
  attrs: {
15195
- 'width': this.control.availableSize.width.toString(),
15196
- 'height': this.control.availableSize.height.toString()
15260
+ 'width': maps.availableSize.width.toString(),
15261
+ 'height': maps.availableSize.height.toString()
15197
15262
  }
15198
15263
  });
15199
15264
  orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;
15200
- const svgParent = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
15265
+ const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
15201
15266
  let svgData;
15202
- const exportElement = this.control.svgObject.cloneNode(true);
15267
+ const exportElement = maps.svgObject.cloneNode(true);
15203
15268
  const backgroundElement = exportElement.childNodes[0];
15204
15269
  const backgroundColor = backgroundElement.getAttribute('fill');
15205
- if ((this.control.theme === 'Tailwind' || this.control.theme === 'TailwindDark' || this.control.theme === 'Bootstrap5' || this.control.theme === 'Bootstrap5Dark'
15206
- || this.control.theme === 'Fluent' || this.control.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
15270
+ if ((maps.theme === 'Tailwind' || maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5' || maps.theme === 'Bootstrap5Dark'
15271
+ || maps.theme === 'Fluent' || maps.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
15207
15272
  exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
15208
15273
  }
15209
15274
  const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
@@ -15211,7 +15276,7 @@ class PdfExport {
15211
15276
  const pdfDocument = new PdfDocument();
15212
15277
  const image = new Image();
15213
15278
  const ctx = canvasElement.getContext('2d');
15214
- if (!this.control.isTileMap) {
15279
+ if (!maps.isTileMap) {
15215
15280
  image.onload = (() => {
15216
15281
  ctx.drawImage(image, 0, 0);
15217
15282
  window.URL.revokeObjectURL(url);
@@ -15219,7 +15284,7 @@ class PdfExport {
15219
15284
  let imageString = canvasElement.toDataURL('image/jpeg').replace('image/jpeg', 'image/octet-stream');
15220
15285
  pdfDocument.pageSettings.orientation = orientation;
15221
15286
  imageString = imageString.slice(imageString.indexOf(',') + 1);
15222
- pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (this.control.availableSize.width - 60), this.control.availableSize.height);
15287
+ pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
15223
15288
  if (allowDownload) {
15224
15289
  pdfDocument.save(fileName + '.pdf');
15225
15290
  pdfDocument.destroy();
@@ -15232,22 +15297,22 @@ class PdfExport {
15232
15297
  image.src = url;
15233
15298
  }
15234
15299
  else {
15235
- const svgParentElement = document.getElementById(this.control.element.id + '_MapAreaBorder');
15300
+ const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
15236
15301
  let top = parseFloat(svgParentElement.getAttribute('y'));
15237
15302
  let left = parseFloat(svgParentElement.getAttribute('x'));
15238
15303
  const xHttp = new XMLHttpRequest();
15239
- const tileLength = this.control.mapLayerPanel.tiles.length;
15304
+ const tileLength = maps.mapLayerPanel.tiles.length;
15240
15305
  for (let i = 0; i <= tileLength + 1; i++) {
15241
- const tile = document.getElementById(this.control.element.id + '_tile_' + (i - 1));
15306
+ const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
15242
15307
  const tileImg = new Image();
15243
15308
  tileImg.crossOrigin = 'Anonymous';
15244
- ctx.fillStyle = this.control.background ? this.control.background : '#FFFFFF';
15245
- ctx.fillRect(0, 0, this.control.availableSize.width, this.control.availableSize.height);
15246
- ctx.font = this.control.titleSettings.textStyle.size + ' Arial';
15247
- let titleElement = document.getElementById(this.control.element.id + '_Map_title');
15309
+ ctx.fillStyle = maps.background ? maps.background : '#FFFFFF';
15310
+ ctx.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
15311
+ ctx.font = maps.titleSettings.textStyle.size + ' Arial';
15312
+ let titleElement = document.getElementById(maps.element.id + '_Map_title');
15248
15313
  if (!isNullOrUndefined(titleElement)) {
15249
15314
  ctx.fillStyle = titleElement.getAttribute('fill');
15250
- ctx.fillText(this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
15315
+ ctx.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
15251
15316
  }
15252
15317
  tileImg.onload = (() => {
15253
15318
  if (i === 0 || i === tileLength + 1) {
@@ -15261,7 +15326,6 @@ class PdfExport {
15261
15326
  }
15262
15327
  }
15263
15328
  else {
15264
- const tileParent = document.getElementById(this.control.element.id + '_tile_parent');
15265
15329
  ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left, parseFloat(tile.style.top) + top);
15266
15330
  }
15267
15331
  ctx.drawImage(tileImg, 0, 0);
@@ -15271,7 +15335,7 @@ class PdfExport {
15271
15335
  let x = localStorage.getItem('saved-image-example');
15272
15336
  pdfDocument.pageSettings.orientation = orientation;
15273
15337
  x = x.slice(x.indexOf(',') + 1);
15274
- pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (this.control.availableSize.width - 60), this.control.availableSize.height);
15338
+ pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
15275
15339
  if (allowDownload) {
15276
15340
  pdfDocument.save(fileName + '.pdf');
15277
15341
  pdfDocument.destroy();
@@ -15288,7 +15352,7 @@ class PdfExport {
15288
15352
  }
15289
15353
  else {
15290
15354
  setTimeout(() => {
15291
- let tileSvg = document.getElementById(this.control.element.id + '_Tile_SVG');
15355
+ let tileSvg = document.getElementById(maps.element.id + '_Tile_SVG');
15292
15356
  tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
15293
15357
  }, 300);
15294
15358
  }
@@ -15312,17 +15376,12 @@ class PdfExport {
15312
15376
  return 'PdfExport';
15313
15377
  }
15314
15378
  /**
15315
- * To destroy the PdfExports.
15379
+ * To destroy the PdfExport.
15316
15380
  *
15317
- * @param {Maps} maps - Specifies the instance of the maps.
15318
15381
  * @returns {void}
15319
15382
  * @private
15320
15383
  */
15321
- destroy(maps) {
15322
- /**
15323
- * Destroy method performed here
15324
- */
15325
- }
15384
+ destroy() { }
15326
15385
  }
15327
15386
 
15328
15387
  /**