@syncfusion/ej2-maps 19.4.55 → 19.4.56-105067

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 (84) hide show
  1. package/.eslintrc.json +18 -3
  2. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
  3. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
  4. package/CHANGELOG.md +441 -430
  5. package/README.md +73 -73
  6. package/dist/ej2-maps.umd.min.js +1 -10
  7. package/dist/ej2-maps.umd.min.js.map +1 -1
  8. package/dist/es6/ej2-maps.es2015.js +1205 -644
  9. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  10. package/dist/es6/ej2-maps.es5.js +1243 -683
  11. package/dist/es6/ej2-maps.es5.js.map +1 -1
  12. package/dist/global/ej2-maps.min.js +1 -10
  13. package/dist/global/ej2-maps.min.js.map +1 -1
  14. package/dist/global/index.d.ts +0 -9
  15. package/dist/ts/maps/layers/bing-map.ts +50 -0
  16. package/dist/ts/maps/layers/bubble.ts +290 -0
  17. package/dist/ts/maps/layers/color-mapping.ts +226 -0
  18. package/dist/ts/maps/layers/data-label.ts +418 -0
  19. package/dist/ts/maps/layers/layer-panel.ts +1480 -0
  20. package/dist/ts/maps/layers/legend.ts +2236 -0
  21. package/dist/ts/maps/layers/marker.ts +453 -0
  22. package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
  23. package/dist/ts/maps/maps.ts +2886 -0
  24. package/dist/ts/maps/model/base.ts +1843 -0
  25. package/dist/ts/maps/model/constants.ts +200 -0
  26. package/dist/ts/maps/model/export-image.ts +178 -0
  27. package/dist/ts/maps/model/export-pdf.ts +170 -0
  28. package/dist/ts/maps/model/interface.ts +823 -0
  29. package/dist/ts/maps/model/print.ts +104 -0
  30. package/dist/ts/maps/model/theme.ts +554 -0
  31. package/dist/ts/maps/user-interaction/annotation.ts +127 -0
  32. package/dist/ts/maps/user-interaction/highlight.ts +233 -0
  33. package/dist/ts/maps/user-interaction/selection.ts +321 -0
  34. package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
  35. package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
  36. package/dist/ts/maps/utils/enum.ts +368 -0
  37. package/dist/ts/maps/utils/helper.ts +3421 -0
  38. package/helper/e2e/index.js +3 -3
  39. package/helper/e2e/maps-helper.js +13 -13
  40. package/license +9 -9
  41. package/package.json +85 -85
  42. package/src/maps/layers/bing-map.d.ts +4 -0
  43. package/src/maps/layers/bing-map.js +16 -3
  44. package/src/maps/layers/bubble.d.ts +1 -2
  45. package/src/maps/layers/bubble.js +7 -12
  46. package/src/maps/layers/data-label.d.ts +1 -4
  47. package/src/maps/layers/data-label.js +32 -35
  48. package/src/maps/layers/layer-panel.d.ts +18 -1
  49. package/src/maps/layers/layer-panel.js +226 -72
  50. package/src/maps/layers/legend.d.ts +5 -2
  51. package/src/maps/layers/legend.js +170 -61
  52. package/src/maps/layers/marker.d.ts +2 -4
  53. package/src/maps/layers/marker.js +49 -48
  54. package/src/maps/layers/navigation-selected-line.d.ts +1 -2
  55. package/src/maps/layers/navigation-selected-line.js +7 -13
  56. package/src/maps/maps-model.d.ts +259 -251
  57. package/src/maps/maps.d.ts +24 -3
  58. package/src/maps/maps.js +164 -97
  59. package/src/maps/model/base-model.d.ts +1025 -1021
  60. package/src/maps/model/base.d.ts +5 -1
  61. package/src/maps/model/base.js +24 -24
  62. package/src/maps/model/constants.d.ts +6 -0
  63. package/src/maps/model/constants.js +6 -0
  64. package/src/maps/model/export-image.d.ts +2 -4
  65. package/src/maps/model/export-image.js +34 -33
  66. package/src/maps/model/export-pdf.d.ts +4 -6
  67. package/src/maps/model/export-pdf.js +31 -32
  68. package/src/maps/model/interface.d.ts +34 -26
  69. package/src/maps/model/print.d.ts +2 -5
  70. package/src/maps/model/print.js +32 -18
  71. package/src/maps/model/theme.js +7 -4
  72. package/src/maps/user-interaction/annotation.d.ts +1 -2
  73. package/src/maps/user-interaction/annotation.js +3 -4
  74. package/src/maps/user-interaction/highlight.d.ts +1 -2
  75. package/src/maps/user-interaction/highlight.js +11 -10
  76. package/src/maps/user-interaction/selection.d.ts +1 -2
  77. package/src/maps/user-interaction/selection.js +42 -19
  78. package/src/maps/user-interaction/tooltip.d.ts +3 -5
  79. package/src/maps/user-interaction/tooltip.js +27 -14
  80. package/src/maps/user-interaction/zoom.d.ts +3 -8
  81. package/src/maps/user-interaction/zoom.js +282 -162
  82. package/src/maps/utils/enum.d.ts +5 -1
  83. package/src/maps/utils/helper.d.ts +9 -1
  84. package/src/maps/utils/helper.js +82 -33
@@ -735,6 +735,8 @@ function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCol
735
735
  const opacity = shapeCustom['opacity'];
736
736
  let rectOptions;
737
737
  const pathOptions = new PathOption(markerID, fill, borderWidth, borderColor, opacity, borderOpacity, dashArray, '');
738
+ size.width = typeof (size.width) === 'string' ? parseInt(size.width, 10) : size.width;
739
+ size.height = typeof (size.height) === 'string' ? parseInt(size.height, 10) : size.height;
738
740
  if (shape === 'Circle') {
739
741
  const radius = (size.width + size.height) / 4;
740
742
  const circleOptions = new CircleOption(markerID, fill, border, opacity, location.x, location.y, radius, dashArray);
@@ -952,8 +954,8 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
952
954
  shapeCustom['borderWidth'] = eventArg.border.width;
953
955
  shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters.opacity : eventArg.border.opacity;
954
956
  }
955
- tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : ((location.x + transPoint.x + eventArg.width) * maps.mapScaleValue);
956
- tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : ((location.y + transPoint.y + (eventArg.height / 2)) * maps.mapScaleValue);
957
+ tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
958
+ tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
957
959
  if (maps.isTileMap && !maps.zoomSettings.enable) {
958
960
  tempX = location.x;
959
961
  tempY = location.y;
@@ -1032,12 +1034,15 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1032
1034
  getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
1033
1035
  layerElement.appendChild(markerCollection);
1034
1036
  }
1035
- const markerCluster = document.getElementById(maps.element.id + '_LayerIndex_0_markerCluster');
1037
+ const markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
1036
1038
  if (!isNullOrUndefined(markerCluster)) {
1037
1039
  markerCluster.remove();
1038
1040
  }
1039
1041
  if (zoomCheck) {
1040
- 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
+ }
1041
1046
  }
1042
1047
  });
1043
1048
  }
@@ -1054,15 +1059,16 @@ function mergeSeparateCluster(sameMarkerData, maps, markerElement) {
1054
1059
  const markerIndex = sameMarkerData[0].markerIndex;
1055
1060
  const dataIndex = sameMarkerData[0].dataIndex;
1056
1061
  const markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
1062
+ const marker = maps.layers[layerIndex].markerSettings[markerIndex];
1057
1063
  const clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
1058
- const clusterEle = getElement(clusterId);
1064
+ const clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElement(clusterId + '_Group') : getElement(clusterId);
1059
1065
  const clusterEleLabel = getElement(clusterId + '_datalabel_' + clusterIndex);
1060
1066
  clusterEle.setAttribute('visibility', 'visible');
1061
1067
  clusterEleLabel.setAttribute('visibility', 'visible');
1062
1068
  let markerEle;
1063
1069
  const markerDataLength = sameMarkerData[0].data.length;
1064
1070
  for (let i = 0; i < markerDataLength; i++) {
1065
- 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']);
1066
1072
  markerEle['style']['visibility'] = 'hidden';
1067
1073
  }
1068
1074
  removeElement(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine');
@@ -1084,13 +1090,13 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1084
1090
  const getElementFunction = isDom ? getElement : markerElement.querySelector.bind(markerElement);
1085
1091
  const getQueryConnect = isDom ? '' : '#';
1086
1092
  const markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
1093
+ const marker = maps.layers[layerIndex].markerSettings[markerIndex];
1087
1094
  const clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
1088
- const clusterEle = getElementFunction(getQueryConnect + '' + clusterId);
1095
+ const clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + clusterId + '_Group') : getElementFunction(getQueryConnect + '' + clusterId);
1089
1096
  const clusterEleLabel = getElementFunction(getQueryConnect + '' + clusterId + '_datalabel_' + clusterIndex);
1090
1097
  clusterEle.setAttribute('visibility', 'hidden');
1091
1098
  clusterEleLabel.setAttribute('visibility', 'hidden');
1092
- const marker = maps.layers[layerIndex].markerSettings[markerIndex];
1093
- let markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
1099
+ let markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
1094
1100
  const height = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().height : marker.height;
1095
1101
  const width = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().width : marker.width;
1096
1102
  const centerX = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[0];
@@ -1126,7 +1132,7 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1126
1132
  const x1 = centerX + radius * Math.sin((Math.PI * 2 * newAngle) / 360);
1127
1133
  const y1 = centerY + radius * Math.cos((Math.PI * 2 * newAngle) / 360);
1128
1134
  path += start + 'L ' + (x1) + ' ' + y1 + ' ';
1129
- 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']);
1130
1136
  if (markerEle.parentElement.id.indexOf('Template_Group') > -1) {
1131
1137
  markerEle['style']['transform'] = '';
1132
1138
  markerEle['style']['left'] = maps.isTileMap ? x1 - (width / 2) + 'px' : (x1 - (width / 2) - 10) + 'px';
@@ -1147,7 +1153,12 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1147
1153
  markerElement = isDom ? getElementFunction(maps.element.id + '_Markers_Group') : markerElement;
1148
1154
  const groupEle = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine' });
1149
1155
  groupEle.appendChild(maps.renderer.drawPath(options));
1150
- 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
+ }
1151
1162
  }
1152
1163
  /**
1153
1164
  *
@@ -1174,6 +1185,7 @@ function marker(eventArgs, markerSettings, markerData, dataIndex, location, tran
1174
1185
  dashArray: markerSettings.dashArray, borderOpacity: isNullOrUndefined(eventArgs.border.opacity) ? markerSettings.opacity :
1175
1186
  eventArgs.border.opacity
1176
1187
  };
1188
+ removeElement(markerID);
1177
1189
  const ele = drawSymbols(eventArgs.shape, eventArgs.imageUrl, { x: 0, y: 0 }, markerID, shapeCustom, markerCollection, maps);
1178
1190
  const x = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x;
1179
1191
  const y = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y;
@@ -1204,7 +1216,7 @@ function marker(eventArgs, markerSettings, markerData, dataIndex, location, tran
1204
1216
  */
1205
1217
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1206
1218
  function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplate, location, transPoint, scale, offset, maps) {
1207
- templateFn = getTemplateFunction(eventArgs.template);
1219
+ templateFn = getTemplateFunction(eventArgs.template, maps);
1208
1220
  if (templateFn && (templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false).length)) {
1209
1221
  const templateElement = templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false);
1210
1222
  const markerElement = convertElement(templateElement, markerID, data, markerIndex, maps);
@@ -1240,8 +1252,10 @@ function maintainSelection(elementId, elementClass, element, className) {
1240
1252
  if (elementId) {
1241
1253
  for (let index = 0; index < elementId.length; index++) {
1242
1254
  if (element.getAttribute('id') === elementId[index]) {
1243
- if (isNullOrUndefined(getElement(elementClass.id)) || index === 0) {
1244
- document.body.appendChild(elementClass);
1255
+ if (index === 0 || element.tagName === 'g') {
1256
+ if (!isNullOrUndefined(elementClass) && !isNullOrUndefined(elementClass.id)) {
1257
+ document.body.appendChild(elementClass);
1258
+ }
1245
1259
  if (element.id.indexOf('_MarkerIndex_') > -1 && element.childElementCount > 0) {
1246
1260
  element.children[0].setAttribute('class', className);
1247
1261
  }
@@ -1549,7 +1563,7 @@ function drawBalloon(maps, options, size, location, type, element) {
1549
1563
  const y = size.height / 30;
1550
1564
  balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
1551
1565
  if (type === 'Marker') {
1552
- const g = maps.renderer.createGroup({ id: options.id });
1566
+ const g = maps.renderer.createGroup({ id: options.id + '_Group' });
1553
1567
  appendShape(balloon, g);
1554
1568
  pathElement = appendShape(g, element);
1555
1569
  }
@@ -1964,7 +1978,12 @@ function getTranslate(mapObject, layer, animate) {
1964
1978
  }
1965
1979
  else {
1966
1980
  if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
1981
+ if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
1982
+ mapWidth = size.width / 2;
1983
+ mapHeight = size.height;
1984
+ }
1967
1985
  scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
1986
+ scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
1968
1987
  mapWidth *= scaleFactor;
1969
1988
  mapHeight *= scaleFactor;
1970
1989
  const widthDiff = min['x'] !== 0 && mapObject.translateType === 'layers' ? availSize.width - size.width : 0;
@@ -2013,8 +2032,9 @@ function getTranslate(mapObject, layer, animate) {
2013
2032
  mapObject.zoomTranslatePoint.y = y;
2014
2033
  }
2015
2034
  else {
2016
- if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
2035
+ if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1 || mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
2017
2036
  scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
2037
+ scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
2018
2038
  mapWidth *= scaleFactor;
2019
2039
  x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
2020
2040
  mapHeight *= scaleFactor;
@@ -2171,6 +2191,8 @@ function getZoomTranslate(mapObject, layer, animate) {
2171
2191
  }
2172
2192
  }
2173
2193
  scaleFactor = (mapObject.enablePersistence) ? (mapObject.mapScaleValue === 0 ? 1 : mapObject.mapScaleValue) : scaleFactor;
2194
+ mapObject.widthBeforeRefresh = mapObject.availableSize.width;
2195
+ mapObject.heightBeforeRefresh = mapObject.availableSize.height;
2174
2196
  return { scale: animate ? 1 : scaleFactor, location: new Point(x, y) };
2175
2197
  }
2176
2198
  /**
@@ -2198,6 +2220,22 @@ function fixInitialScaleForTile(map) {
2198
2220
  function getElementByID(id) {
2199
2221
  return document.getElementById(id);
2200
2222
  }
2223
+ /**
2224
+ * Function to get clientElement from id.
2225
+ *
2226
+ * @param {string} id - Specifies the id
2227
+ * @returns {Element} - Returns the element
2228
+ * @private
2229
+ */
2230
+ function getClientElement(id) {
2231
+ const element = document.getElementById(id);
2232
+ if (!isNullOrUndefined(element)) {
2233
+ return element.getClientRects()[0];
2234
+ }
2235
+ else {
2236
+ return null;
2237
+ }
2238
+ }
2201
2239
  /**
2202
2240
  * To apply internalization
2203
2241
  *
@@ -2218,7 +2256,7 @@ function Internalize(maps, value) {
2218
2256
  * @private
2219
2257
  */
2220
2258
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2221
- function getTemplateFunction(template) {
2259
+ function getTemplateFunction(template, maps) {
2222
2260
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2223
2261
  let templateFn = null;
2224
2262
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2226,6 +2264,9 @@ function getTemplateFunction(template) {
2226
2264
  if (document.querySelectorAll(template).length) {
2227
2265
  templateFn = compile(document.querySelector(template).innerHTML.trim());
2228
2266
  }
2267
+ else if (maps.isVue || maps.isVue3) {
2268
+ templateFn = compile(template);
2269
+ }
2229
2270
  }
2230
2271
  catch (e) {
2231
2272
  templateFn = compile(template);
@@ -2628,6 +2669,7 @@ function createTooltip(id, text, top, left, fontSize) {
2628
2669
  'left:' + left.toString() + 'px;' +
2629
2670
  'color: #000000; ' +
2630
2671
  'background:' + '#FFFFFF' + ';' +
2672
+ 'z-index: 2;' +
2631
2673
  'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
2632
2674
  if (!tooltip) {
2633
2675
  tooltip = createElement('div', {
@@ -2816,6 +2858,7 @@ function changeBorderWidth(element, index, scale, maps) {
2816
2858
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2817
2859
  const borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
2818
2860
  const borderWidth = maps.layersCollection[index].shapeSettings.border.width;
2861
+ const circleRadius = maps.layersCollection[index].shapeSettings.circleRadius;
2819
2862
  if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
2820
2863
  value = checkShapeDataFields(
2821
2864
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2828,13 +2871,16 @@ function changeBorderWidth(element, index, scale, maps) {
2828
2871
  currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
2829
2872
  }
2830
2873
  }
2874
+ else {
2875
+ currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
2876
+ }
2831
2877
  }
2832
2878
  else {
2833
2879
  currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
2834
2880
  }
2835
2881
  childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
2836
- if (element.id.indexOf('_LineString') > -1 && isNullOrUndefined(currentStroke)) {
2837
- childNode.setAttribute('stroke-width', (1 / scale).toString());
2882
+ if (element.id.indexOf('_Point') > -1 || element.id.indexOf('_MultiPoint') > -1) {
2883
+ childNode.setAttribute('r', (circleRadius / scale).toString());
2838
2884
  }
2839
2885
  }
2840
2886
  }
@@ -3027,7 +3073,10 @@ function animate(element, delay, duration, process, end) {
3027
3073
  else {
3028
3074
  window.cancelAnimationFrame(clearAnimation);
3029
3075
  end.call(this, { element: element });
3030
- element.setAttribute('style', markerStyle);
3076
+ if (element.id.indexOf('Marker') > -1) {
3077
+ let markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
3078
+ markerElement.setAttribute('style', markerStyle);
3079
+ }
3031
3080
  }
3032
3081
  };
3033
3082
  clearAnimation = window.requestAnimationFrame(startAnimation);
@@ -3354,11 +3403,11 @@ function getShapeColor(theme) {
3354
3403
  themePalette = ['#5ECB9B', '#A860F1', '#EBA844', '#557EF7', '#E9599B',
3355
3404
  '#BFC529', '#3BC6CF', '#7A68EC', '#74B706', '#EA6266'];
3356
3405
  break;
3357
- case 'fluentui':
3406
+ case 'fluent':
3358
3407
  themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
3359
3408
  '#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
3360
3409
  break;
3361
- case 'fluentuidark':
3410
+ case 'fluentdark':
3362
3411
  themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
3363
3412
  '#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
3364
3413
  break;
@@ -3499,6 +3548,7 @@ function getThemeStyle(theme) {
3499
3548
  backgroundColor: color,
3500
3549
  areaBackgroundColor: color,
3501
3550
  titleFontColor: '#FFFFFF',
3551
+ titleFontSize: '14px',
3502
3552
  subTitleFontColor: '#FFFFFF',
3503
3553
  legendTitleFontColor: '#DADADA',
3504
3554
  legendTextColor: '#DADADA',
@@ -3518,6 +3568,7 @@ function getThemeStyle(theme) {
3518
3568
  backgroundColor: '#000000',
3519
3569
  areaBackgroundColor: '#000000',
3520
3570
  titleFontColor: '#FFFFFF',
3571
+ titleFontSize: '14px',
3521
3572
  subTitleFontColor: '#FFFFFF',
3522
3573
  legendTitleFontColor: '#FFFFFF',
3523
3574
  legendTextColor: '#FFFFFF',
@@ -3647,7 +3698,7 @@ function getThemeStyle(theme) {
3647
3698
  shapeFill: '#495057'
3648
3699
  };
3649
3700
  break;
3650
- case 'fluentui':
3701
+ case 'fluent':
3651
3702
  style = {
3652
3703
  backgroundColor: 'rgba(255,255,255, 0.0)',
3653
3704
  areaBackgroundColor: 'rgba(255,255,255, 0.0)',
@@ -3670,7 +3721,7 @@ function getThemeStyle(theme) {
3670
3721
  shapeFill: '#F3F2F1'
3671
3722
  };
3672
3723
  break;
3673
- case 'fluentuidark':
3724
+ case 'fluentdark':
3674
3725
  style = {
3675
3726
  backgroundColor: 'rgba(255,255,255, 0.0)',
3676
3727
  areaBackgroundColor: 'rgba(255,255,255, 0.0)',
@@ -3698,6 +3749,7 @@ function getThemeStyle(theme) {
3698
3749
  backgroundColor: '#FFFFFF',
3699
3750
  areaBackgroundColor: '#FFFFFF',
3700
3751
  titleFontColor: '#424242',
3752
+ titleFontSize: '14px',
3701
3753
  subTitleFontColor: '#424242',
3702
3754
  legendTitleFontColor: '#757575',
3703
3755
  legendTextColor: '#757575',
@@ -3716,12 +3768,12 @@ function getThemeStyle(theme) {
3716
3768
  return style;
3717
3769
  }
3718
3770
 
3719
- var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3720
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3721
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3722
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3723
- return c > 3 && r && Object.defineProperty(target, key, r), r;
3724
- };
3771
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3772
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3773
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3774
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3775
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3776
+ };
3725
3777
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
3726
3778
  /**
3727
3779
  * Maps base document
@@ -4116,7 +4168,7 @@ __decorate$1([
4116
4168
  class SubTitleSettings extends CommonTitleSettings {
4117
4169
  }
4118
4170
  __decorate$1([
4119
- Complex({ size: Theme.mapsSubTitleFont.size, fontWeight: null }, Font)
4171
+ Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
4120
4172
  ], SubTitleSettings.prototype, "textStyle", void 0);
4121
4173
  __decorate$1([
4122
4174
  Property('Center')
@@ -4127,7 +4179,7 @@ __decorate$1([
4127
4179
  class TitleSettings extends CommonTitleSettings {
4128
4180
  }
4129
4181
  __decorate$1([
4130
- Complex({ size: Theme.mapsTitleFont.size, fontWeight: null }, Font)
4182
+ Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
4131
4183
  ], TitleSettings.prototype, "textStyle", void 0);
4132
4184
  __decorate$1([
4133
4185
  Property('Center')
@@ -4256,7 +4308,7 @@ __decorate$1([
4256
4308
  Property('')
4257
4309
  ], LegendSettings.prototype, "height", void 0);
4258
4310
  __decorate$1([
4259
- Complex({}, Font)
4311
+ Complex({ fontFamily: null }, Font)
4260
4312
  ], LegendSettings.prototype, "textStyle", void 0);
4261
4313
  __decorate$1([
4262
4314
  Property(15)
@@ -4277,7 +4329,7 @@ __decorate$1([
4277
4329
  Complex({}, CommonTitleSettings)
4278
4330
  ], LegendSettings.prototype, "title", void 0);
4279
4331
  __decorate$1([
4280
- Complex(Theme.legendTitleFont, Font)
4332
+ Complex({ size: Theme.legendTitleFont.size, color: Theme.legendTitleFont.color, fontStyle: Theme.legendTitleFont.fontStyle, fontWeight: Theme.legendTitleFont.fontWeight, fontFamily: null }, Font)
4281
4333
  ], LegendSettings.prototype, "titleStyle", void 0);
4282
4334
  __decorate$1([
4283
4335
  Property('Bottom')
@@ -4520,7 +4572,7 @@ __decorate$1([
4520
4572
  Property('Geometry')
4521
4573
  ], LayerSettings.prototype, "layerType", void 0);
4522
4574
  __decorate$1([
4523
- Property('https://a.tile.openstreetmap.org/level/tileX/tileY.png')
4575
+ Property('')
4524
4576
  ], LayerSettings.prototype, "urlTemplate", void 0);
4525
4577
  __decorate$1([
4526
4578
  Property(true)
@@ -4599,101 +4651,102 @@ class Marker {
4599
4651
  this.trackElements = [];
4600
4652
  this.sameMarkerData = [];
4601
4653
  }
4602
- markerRender(layerElement, layerIndex, factor, type) {
4654
+ markerRender(maps, layerElement, layerIndex, factor, type) {
4603
4655
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4604
4656
  let templateFn;
4605
4657
  let markerCount = 0;
4606
4658
  let nullCount = 0;
4607
4659
  let markerTemplateCount = 0;
4608
- this.maps.translateType = 'marker';
4609
- const currentLayer = this.maps.layersCollection[layerIndex];
4610
- this.markerSVGObject = this.maps.renderer.createGroup({
4611
- 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',
4612
4664
  class: 'GroupElement',
4613
4665
  style: 'pointer-events: auto;'
4614
4666
  });
4615
4667
  const markerTemplateEle = createElement('div', {
4616
- id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
4617
- className: this.maps.element.id + '_template',
4668
+ id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
4669
+ className: maps.element.id + '_template',
4618
4670
  styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
4619
- 'top:' + this.maps.mapAreaRect.y + 'px;' +
4620
- 'left:' + this.maps.mapAreaRect.x + 'px;' +
4621
- 'height:' + this.maps.mapAreaRect.height + 'px;' +
4622
- '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;'
4623
4675
  });
4624
4676
  currentLayer.markerSettings.map((markerSettings, markerIndex) => {
4625
4677
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4626
4678
  const markerData = markerSettings.dataSource;
4627
4679
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4628
4680
  Array.prototype.forEach.call(markerData, (data, dataIndex) => {
4629
- this.maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : this.maps.markerNullCount;
4681
+ maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
4630
4682
  let eventArgs = {
4631
4683
  cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
4632
4684
  width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
4633
- template: markerSettings.template, data: data, maps: this.maps, marker: markerSettings,
4685
+ template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
4634
4686
  border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
4635
4687
  shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
4636
4688
  };
4637
- this.maps.trigger('markerRendering', eventArgs, (MarkerArgs) => {
4689
+ maps.trigger('markerRendering', eventArgs, (MarkerArgs) => {
4638
4690
  eventArgs = markerColorChoose(eventArgs, data);
4639
4691
  eventArgs = markerShapeChoose(eventArgs, data);
4640
4692
  const lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
4641
4693
  Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
4642
- parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : 0;
4694
+ parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
4643
4695
  const lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
4644
4696
  Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
4645
- parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : 0;
4697
+ parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
4646
4698
  const offset = markerSettings.offset;
4647
4699
  if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
4648
- const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
4700
+ const markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
4649
4701
  + markerIndex + '_dataIndex_' + dataIndex;
4650
- let location = (this.maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, this.maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, this.maps);
4651
- 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);
4652
4704
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4653
- 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() :
4654
- !isNullOrUndefined(this.maps.zoomModule) && this.maps.zoomSettings.zoomFactor > 1 ?
4655
- getZoomTranslate(this.maps, currentLayer, animate$$1) :
4656
- getTranslate(this.maps, currentLayer, animate$$1);
4657
- const scale = type === 'AddMarker' ? this.maps.scale : translate['scale'];
4658
- 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'];
4659
4711
  if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
4660
4712
  markerTemplateCount++;
4661
- 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);
4662
4714
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4663
- this.maps.renderReactTemplates();
4715
+ maps.renderReactTemplates();
4664
4716
  }
4665
4717
  else if (!eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
4666
4718
  markerCount++;
4667
- 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);
4668
4720
  }
4669
4721
  }
4670
4722
  nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
4671
4723
  markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
4672
4724
  markerCount += (eventArgs.cancel) ? 1 : 0;
4673
- this.maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
4674
- 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;
4675
4727
  if (this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
4676
4728
  layerElement.appendChild(this.markerSVGObject);
4677
4729
  if (currentLayer.markerClusterSettings.allowClustering) {
4678
- this.maps.svgObject.appendChild(this.markerSVGObject);
4679
- this.maps.element.appendChild(this.maps.svgObject);
4680
- if (currentLayer.layerType !== 'OSM' || !this.maps.zoomSettings.enable) {
4681
- clusterTemplate(currentLayer, this.markerSVGObject, this.maps, layerIndex, this.markerSVGObject, layerElement, true, false);
4730
+ maps.svgObject.appendChild(this.markerSVGObject);
4731
+ maps.element.appendChild(maps.svgObject);
4732
+ if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
4733
+ && maps.zoomSettings.enable) {
4734
+ layerElement.appendChild(this.markerSVGObject);
4682
4735
  }
4683
4736
  else {
4684
- layerElement.appendChild(this.markerSVGObject);
4737
+ clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
4685
4738
  }
4686
4739
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4687
- this.maps.renderReactTemplates();
4740
+ maps.renderReactTemplates();
4688
4741
  }
4689
4742
  }
4690
- if (markerTemplateEle.childElementCount === (markerData.length - markerCount - nullCount) && getElementByID(this.maps.element.id + '_Secondary_Element')) {
4691
- getElementByID(this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
4692
- 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) {
4693
4746
  if (currentLayer.markerClusterSettings.allowClustering) {
4694
- clusterTemplate(currentLayer, markerTemplateEle, this.maps, layerIndex, this.markerSVGObject, layerElement, false, false);
4747
+ clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, this.markerSVGObject, layerElement, false, false);
4695
4748
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4696
- this.maps.renderReactTemplates();
4749
+ maps.renderReactTemplates();
4697
4750
  }
4698
4751
  }
4699
4752
  }
@@ -4936,8 +4989,8 @@ class Marker {
4936
4989
  }
4937
4990
  if ((target.indexOf('_cluster_') > -1)) {
4938
4991
  let isClusterSame = false;
4939
- const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? target.split('_datalabel_')[0] : target);
4940
- const indexes = clusterElement.innerHTML.split(',').map(Number);
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);
4993
+ const indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].innerHTML.split(',').map(Number) : clusterElement.innerHTML.split(',').map(Number);
4941
4994
  collection = [];
4942
4995
  for (const i of indexes) {
4943
4996
  collection.push({ data: marker$$1.dataSource[i], index: i });
@@ -5005,14 +5058,14 @@ class Marker {
5005
5058
  /**
5006
5059
  * To destroy the layers.
5007
5060
  *
5008
- * @param {Maps} maps - Specifies the instance of the map
5009
5061
  * @returns {void}
5010
5062
  * @private
5011
5063
  */
5012
- destroy(maps) {
5013
- /**
5014
- * Destroy method performed here
5015
- */
5064
+ destroy() {
5065
+ this.maps = null;
5066
+ this.trackElements = [];
5067
+ this.markerSVGObject = null;
5068
+ this.sameMarkerData = [];
5016
5069
  }
5017
5070
  }
5018
5071
 
@@ -5037,6 +5090,12 @@ const loaded = 'loaded';
5037
5090
  * @private
5038
5091
  */
5039
5092
  const click = 'click';
5093
+ /**
5094
+ * Specifies the maps onclick event name.
5095
+ *
5096
+ * @private
5097
+ */
5098
+ const onclick = 'onclick';
5040
5099
  /**
5041
5100
  * Specifies the maps right click event name.
5042
5101
  *
@@ -5231,9 +5290,21 @@ class BingMap {
5231
5290
  }
5232
5291
  quadKey = quadKey + '' + digit;
5233
5292
  }
5234
- const subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
5235
- imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
5236
- return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
5293
+ if (!isNullOrUndefined(subDomains)) {
5294
+ const subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
5295
+ imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
5296
+ return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
5297
+ }
5298
+ else {
5299
+ return '';
5300
+ }
5301
+ }
5302
+ /**
5303
+ * @private
5304
+ */
5305
+ destroy() {
5306
+ this.maps = null;
5307
+ this.subDomains = [];
5237
5308
  }
5238
5309
  }
5239
5310
 
@@ -5502,8 +5573,7 @@ class LayerPanel {
5502
5573
  else {
5503
5574
  this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
5504
5575
  x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
5505
- width: areaRect.width, height: (areaRect.height < 0) ? 0 : !isNullOrUndefined(this.mapObject.legendModule) &&
5506
- this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
5576
+ width: areaRect.width, height: areaRect.height
5507
5577
  }));
5508
5578
  }
5509
5579
  this.layerGroup.appendChild(this.clipRectElement);
@@ -5514,6 +5584,14 @@ class LayerPanel {
5514
5584
  this.currentLayer = layer;
5515
5585
  this.processLayers(layer, index);
5516
5586
  });
5587
+ if (!isNullOrUndefined(this.mapObject.legendModule) && this.mapObject.legendSettings.position === 'Float') {
5588
+ if (this.mapObject.isTileMap) {
5589
+ this.layerGroup.appendChild(this.mapObject.legendModule.legendGroup);
5590
+ }
5591
+ else {
5592
+ this.mapObject.svgObject.appendChild(this.mapObject.legendModule.legendGroup);
5593
+ }
5594
+ }
5517
5595
  }
5518
5596
  /**
5519
5597
  * Tile rendering
@@ -5641,7 +5719,7 @@ class LayerPanel {
5641
5719
  panel.layerObject.appendChild(panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex));
5642
5720
  }
5643
5721
  if (panel.mapObject.markerModule) {
5644
- 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);
5645
5723
  }
5646
5724
  panel.translateLayerElements(panel.layerObject, layerIndex);
5647
5725
  panel.layerGroup.appendChild(panel.layerObject);
@@ -5672,9 +5750,21 @@ class LayerPanel {
5672
5750
  };
5673
5751
  this.mapObject.trigger('layerRendering', eventArgs, (observedArgs) => {
5674
5752
  if (!eventArgs.cancel && eventArgs.visible) {
5675
- if (layer.layerType !== 'Geometry') {
5753
+ if (layer.layerType === 'OSM') {
5754
+ layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
5755
+ }
5756
+ if (layer.layerType === 'Google') {
5757
+ layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
5758
+ }
5759
+ if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
5676
5760
  if (layer.layerType !== 'Bing' || this.bing) {
5677
- this.renderTileLayer(this, layer, layerIndex);
5761
+ if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
5762
+ const bing = new BingMap(this.mapObject);
5763
+ this.bingMapCalculation(layer, layerIndex, this, bing);
5764
+ }
5765
+ else {
5766
+ this.renderTileLayer(this, layer, layerIndex);
5767
+ }
5678
5768
  }
5679
5769
  else if (layer.key && layer.key.length > 1) {
5680
5770
  // eslint-disable-next-line @typescript-eslint/no-this-alias
@@ -5707,7 +5797,7 @@ class LayerPanel {
5707
5797
  proxy.renderTileLayer(proxy, layer, layerIndex, bing);
5708
5798
  this.mapObject.arrangeTemplate();
5709
5799
  if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
5710
- this.mapObject.zoomModule.applyTransform(true);
5800
+ this.mapObject.zoomModule.applyTransform(this.mapObject, true);
5711
5801
  }
5712
5802
  };
5713
5803
  ajax.send();
@@ -5743,6 +5833,17 @@ class LayerPanel {
5743
5833
  this.mapObject.baseMapBounds = null;
5744
5834
  }
5745
5835
  }
5836
+ bingMapCalculation(layer, layerIndex, proxy, bing) {
5837
+ bing.imageUrl = layer.urlTemplate;
5838
+ bing.subDomains = ['t0', 't1', 't2', 't3'];
5839
+ bing.maxZoom = '21';
5840
+ proxy.mapObject['bingMap'] = bing;
5841
+ proxy.renderTileLayer(proxy, layer, layerIndex, bing);
5842
+ this.mapObject.arrangeTemplate();
5843
+ if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
5844
+ this.mapObject.zoomModule.applyTransform(this.mapObject, true);
5845
+ }
5846
+ }
5746
5847
  bubbleCalculation(bubbleSettings, range) {
5747
5848
  if (bubbleSettings.dataSource != null && bubbleSettings != null) {
5748
5849
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5934,60 +6035,66 @@ class LayerPanel {
5934
6035
  }
5935
6036
  break;
5936
6037
  case 'LineString':
5937
- path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
5938
6038
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5939
- currentShapeData.map((lineData) => {
5940
- path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
6039
+ currentShapeData.map((lineData, index) => {
6040
+ if (index === 0) {
6041
+ path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
6042
+ }
6043
+ else {
6044
+ path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
6045
+ }
5941
6046
  });
5942
6047
  if (path.length > 3) {
5943
- pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
6048
+ pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
6049
+ eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
6050
+ pathEle = this.mapObject.renderer.drawPath(pathOptions);
6051
+ }
6052
+ break;
6053
+ case 'MultiLineString':
6054
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6055
+ currentShapeData.map((multilineData) => {
6056
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6057
+ multilineData.map((lineData, index) => {
6058
+ if (index === 0) {
6059
+ path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
6060
+ }
6061
+ else {
6062
+ path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
6063
+ }
6064
+ });
6065
+ });
6066
+ if (path.length > 3) {
6067
+ pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
6068
+ eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
5944
6069
  pathEle = this.mapObject.renderer.drawPath(pathOptions);
5945
6070
  }
5946
6071
  break;
5947
6072
  case 'Point':
5948
6073
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5949
6074
  const pointData = currentShapeData['point'];
5950
- const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / this.currentFactor;
5951
- circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, null);
6075
+ const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
6076
+ circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
5952
6077
  pathEle = this.mapObject.renderer.drawCircle(circleOptions);
5953
6078
  break;
6079
+ case 'MultiPoint':
6080
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6081
+ currentShapeData.map((multiPointData, index) => {
6082
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6083
+ const pointData = multiPointData['point'];
6084
+ const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
6085
+ circleOptions = new CircleOption((shapeID + "_multiLine_" + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
6086
+ pathEle = this.mapObject.renderer.drawCircle(circleOptions);
6087
+ this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
6088
+ });
6089
+ break;
5954
6090
  case 'Path':
5955
6091
  path = currentShapeData['point'];
5956
6092
  pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
5957
6093
  pathEle = this.mapObject.renderer.drawPath(pathOptions);
5958
6094
  break;
5959
6095
  }
5960
- if (!isNullOrUndefined(pathEle)) {
5961
- const property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
5962
- this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
5963
- let properties;
5964
- for (let j = 0; j < property.length; j++) {
5965
- if (!isNullOrUndefined(currentShapeData['property'])) {
5966
- properties = property[j];
5967
- break;
5968
- }
5969
- }
5970
- pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
5971
- (currentShapeData['property'][properties]) : ''));
5972
- pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i + 3).toString());
5973
- if (drawingType === 'LineString') {
5974
- pathEle.setAttribute('style', 'outline:none');
5975
- }
5976
- maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
5977
- if (this.mapObject.toggledShapeElementId) {
5978
- for (let j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
5979
- const styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
5980
- this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
5981
- if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
5982
- pathEle.setAttribute('fill', styleProperty.fill);
5983
- pathEle.setAttribute('stroke', styleProperty.border.color);
5984
- pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
5985
- pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
5986
- pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
5987
- }
5988
- }
5989
- }
5990
- groupElement.appendChild(pathEle);
6096
+ if (!isNullOrUndefined(pathEle) && drawingType !== 'MultiPoint') {
6097
+ this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
5991
6098
  }
5992
6099
  if (i === this.currentLayer.layerData.length - 1) {
5993
6100
  this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
@@ -6001,6 +6108,50 @@ class LayerPanel {
6001
6108
  this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
6002
6109
  }
6003
6110
  }
6111
+ /**
6112
+ * layer features as bubble, marker, datalabel, navigation line.
6113
+ *
6114
+ * @param {groupElement} Element - Specifies the element to append the group
6115
+ * @param {pathEle} Element - Specifies the svg element
6116
+ * @param {drawingType} string - Specifies the data type
6117
+ * @param {currentShapeData} any - Specifies the layer of shapedata.
6118
+ * @param {index} number - Specifies the tab index.
6119
+ * @returns {void}
6120
+ */
6121
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6122
+ pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, index) {
6123
+ const property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
6124
+ this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
6125
+ let properties;
6126
+ for (let j = 0; j < property.length; j++) {
6127
+ if (!isNullOrUndefined(currentShapeData['property'])) {
6128
+ properties = property[j];
6129
+ break;
6130
+ }
6131
+ }
6132
+ pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
6133
+ (currentShapeData['property'][properties]) : ''));
6134
+ pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
6135
+ pathEle.setAttribute('role', '');
6136
+ if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
6137
+ pathEle.setAttribute('style', 'outline:none');
6138
+ }
6139
+ maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
6140
+ if (this.mapObject.toggledShapeElementId) {
6141
+ for (let j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
6142
+ const styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
6143
+ this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
6144
+ if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
6145
+ pathEle.setAttribute('fill', styleProperty.fill);
6146
+ pathEle.setAttribute('stroke', styleProperty.border.color);
6147
+ pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
6148
+ pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
6149
+ pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
6150
+ }
6151
+ }
6152
+ }
6153
+ groupElement.appendChild(pathEle);
6154
+ }
6004
6155
  /**
6005
6156
  * layer features as bubble, marker, datalabel, navigation line.
6006
6157
  *
@@ -6056,7 +6207,7 @@ class LayerPanel {
6056
6207
  this.layerObject.appendChild(element);
6057
6208
  });
6058
6209
  if (this.mapObject.markerModule) {
6059
- 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)
6060
6211
  : this.currentFactor), null);
6061
6212
  }
6062
6213
  this.translateLayerElements(this.layerObject, layerIndex);
@@ -6182,7 +6333,8 @@ class LayerPanel {
6182
6333
  break;
6183
6334
  case 'linestring':
6184
6335
  const extraSpace = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6185
- this.currentLayer.shapeSettings.border.width : 1;
6336
+ (typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
6337
+ parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
6186
6338
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6187
6339
  coordinates.map((points, index) => {
6188
6340
  latitude = points[1];
@@ -6197,31 +6349,61 @@ class LayerPanel {
6197
6349
  newData['type'] = type;
6198
6350
  this.currentLayer.layerData.push(newData);
6199
6351
  break;
6200
- case 'point': {
6201
- let arrayCollections = false;
6202
- const extraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6203
- this.currentLayer.shapeSettings.border.width : 1) + (this.currentLayer.shapeSettings.circleRadius * 2);
6352
+ case 'multilinestring':
6353
+ const extraSpaces = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6354
+ (typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
6355
+ parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
6356
+ const multiLineData = [];
6204
6357
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6205
- coordinates.map((points, index) => {
6206
- if (Object.prototype.toString.call(points) === '[object Array]') {
6358
+ coordinates.map((multiPoints) => {
6359
+ newData = [];
6360
+ multiPoints.map((points) => {
6207
6361
  latitude = points[1];
6208
6362
  longitude = points[0];
6209
- arrayCollections = true;
6210
6363
  const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
6211
- this.currentLayer.layerData.push({
6212
- point: point, type: type, lat: latitude, lng: longitude, property: properties
6364
+ this.calculateBox(point, extraSpaces);
6365
+ newData.push({
6366
+ point: point, lat: latitude, lng: longitude
6213
6367
  });
6214
- }
6368
+ });
6369
+ multiLineData.push(newData);
6370
+ });
6371
+ multiLineData['property'] = properties;
6372
+ multiLineData['type'] = type;
6373
+ this.currentLayer.layerData.push(multiLineData);
6374
+ break;
6375
+ case 'point':
6376
+ const pointExtraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6377
+ (typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
6378
+ parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
6379
+ (this.currentLayer.shapeSettings.circleRadius * 2);
6380
+ latitude = coordinates[1];
6381
+ longitude = coordinates[0];
6382
+ const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
6383
+ this.calculateBox(point, pointExtraSpace);
6384
+ this.currentLayer.layerData.push({
6385
+ point: point, type: type, lat: latitude, lng: longitude, property: properties
6215
6386
  });
6216
- if (!arrayCollections) {
6217
- latitude = coordinates[1];
6218
- longitude = coordinates[0];
6387
+ break;
6388
+ case 'multipoint': {
6389
+ const extraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6390
+ (typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
6391
+ parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
6392
+ (this.currentLayer.shapeSettings.circleRadius * 2);
6393
+ newData = [];
6394
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6395
+ coordinates.map((points) => {
6396
+ latitude = points[1];
6397
+ longitude = points[0];
6219
6398
  const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
6220
6399
  this.calculateBox(point, extraSpace);
6221
- this.currentLayer.layerData.push({
6222
- point: point, type: type, lat: latitude, lng: longitude, property: properties
6400
+ newData.push({
6401
+ point: point, lat: latitude, lng: longitude
6223
6402
  });
6224
- }
6403
+ });
6404
+ newData['property'] = properties;
6405
+ newData['type'] = type;
6406
+ this.currentLayer.layerData.push(newData);
6225
6407
  break;
6226
6408
  }
6227
6409
  case 'path':
@@ -6233,12 +6415,12 @@ class LayerPanel {
6233
6415
  }
6234
6416
  calculateBox(point, extraSpace) {
6235
6417
  if (isNullOrUndefined(this.rectBounds)) {
6236
- this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
6418
+ this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace, y: point.y + extraSpace } };
6237
6419
  }
6238
6420
  else {
6239
- this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
6421
+ this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
6240
6422
  this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
6241
- this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
6423
+ this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x + extraSpace);
6242
6424
  this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
6243
6425
  }
6244
6426
  }
@@ -6256,6 +6438,10 @@ class LayerPanel {
6256
6438
  const end = convertGeoToPoint(bounds.latitude.max, bounds.longitude.max, null, layer, this.mapObject);
6257
6439
  mapHeight = end.y - start.y;
6258
6440
  mapWidth = end.x - start.x;
6441
+ if (mapHeight === 0 || mapWidth === 0) {
6442
+ mapWidth = mapSize.width / 2;
6443
+ mapHeight = mapSize.height;
6444
+ }
6259
6445
  }
6260
6446
  else {
6261
6447
  mapHeight = mapWidth = 500;
@@ -6349,15 +6535,28 @@ class LayerPanel {
6349
6535
  this.calculateRectBox(point[0]);
6350
6536
  });
6351
6537
  break;
6538
+ case 'multilinestring':
6539
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6540
+ coordinates.map((multiPoint, index) => {
6541
+ multiPoint.map((point, index) => {
6542
+ this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
6543
+ });
6544
+ });
6545
+ break;
6352
6546
  case 'linestring':
6353
6547
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6354
6548
  coordinates.map((point, index) => {
6355
- this.calculateRectBox(point, 'LineString', index === 0 ? true : false);
6549
+ this.calculateRectBox(point, 'linestring', index === 0 ? true : false);
6356
6550
  });
6357
6551
  break;
6358
6552
  case 'point':
6359
6553
  this.calculateRectBox(coordinates, 'point');
6360
6554
  break;
6555
+ case 'multipoint':
6556
+ coordinates.map((point, index) => {
6557
+ this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
6558
+ });
6559
+ break;
6361
6560
  }
6362
6561
  }
6363
6562
  });
@@ -6394,7 +6593,7 @@ class LayerPanel {
6394
6593
  }
6395
6594
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6396
6595
  calculateRectBox(coordinates, type, isFirstItem) {
6397
- if (type !== 'LineString' && type !== 'point') {
6596
+ if ((type !== 'linestring' && type !== 'multilinestring') && (type !== 'point' && type !== 'multipoint')) {
6398
6597
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6399
6598
  Array.prototype.forEach.call(coordinates, (currentCoords) => {
6400
6599
  if (isNullOrUndefined(this.mapObject.baseMapBounds)) {
@@ -6463,7 +6662,7 @@ class LayerPanel {
6463
6662
  const tile = new Tile(tileI % ycount, j);
6464
6663
  tile.left = x;
6465
6664
  tile.top = y;
6466
- if (baseLayer.layerType === 'Bing') {
6665
+ if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
6467
6666
  const key = baseLayer.key;
6468
6667
  tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
6469
6668
  }
@@ -6491,10 +6690,12 @@ class LayerPanel {
6491
6690
  if (!(layer.type === 'SubLayer' && layer.visible)) {
6492
6691
  continue;
6493
6692
  }
6494
- if (layer.layerType === 'OSM' || layer.layerType === 'Bing') {
6693
+ if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
6694
+ isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
6495
6695
  for (const baseTile of proxTiles) {
6496
6696
  const subtile = extend({}, baseTile, {}, true);
6497
6697
  if (layer.layerType === 'Bing') {
6698
+ bing = new BingMap(this.mapObject);
6498
6699
  subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
6499
6700
  }
6500
6701
  else {
@@ -6539,7 +6740,7 @@ class LayerPanel {
6539
6740
  else {
6540
6741
  if (type !== 'Pan' && element1 && element) {
6541
6742
  element1.appendChild(element.children[0]);
6542
- if (!isNullOrUndefined(document.getElementById(this.mapObject.element.id + '_animated_tiles'))) {
6743
+ if (!this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(this.mapObject.element.id + '_animated_tiles'))) {
6543
6744
  document.getElementById(this.mapObject.element.id + '_animated_tiles').id =
6544
6745
  this.mapObject.element.id + '_animated_tiles_old';
6545
6746
  }
@@ -6553,7 +6754,10 @@ class LayerPanel {
6553
6754
  let id = 0;
6554
6755
  for (const tile of this.tiles) {
6555
6756
  const imgElement = createElement('img');
6757
+ imgElement.setAttribute('height', '256px');
6758
+ imgElement.setAttribute('width', '256px');
6556
6759
  imgElement.setAttribute('src', tile.src);
6760
+ imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
6557
6761
  const mapId = this.mapObject.element.id;
6558
6762
  imgElement.onload = () => {
6559
6763
  if (document.getElementById(mapId + '_tile_' + id) && type === 'Pan') {
@@ -6661,7 +6865,7 @@ class LayerPanel {
6661
6865
  '&zoom=' + zoom + '&center=' + center + '&maptype=' + mapType + '&key=' + apikey;
6662
6866
  document.getElementById(this.mapObject.element.id + '_tile_parent').innerHTML
6663
6867
  = '<div id="' + this.mapObject.element.id + '_StaticGoogleMap"' + 'style="position:absolute; left:' + eleWidth + 'px; top:'
6664
- + eleHeight + 'px"><img src="' + staticMapString + '"></div>';
6868
+ + eleHeight + 'px"><img src="' + staticMapString + '"' + 'alt="' + this.mapObject.getLocalizedLabel('ImageNotFound') + '"></div>';
6665
6869
  }
6666
6870
  /**
6667
6871
  * To find the tile translate point
@@ -6719,6 +6923,27 @@ class LayerPanel {
6719
6923
  this.mapObject.previousTileHeight = factorY;
6720
6924
  return new Point(x, y);
6721
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
+ }
6722
6947
  }
6723
6948
 
6724
6949
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -6771,7 +6996,7 @@ class Annotations {
6771
6996
  if (argsData.cancel) {
6772
6997
  return;
6773
6998
  }
6774
- templateFn = getTemplateFunction(argsData.content);
6999
+ templateFn = getTemplateFunction(argsData.content, this.map);
6775
7000
  if (templateFn && templateFn(this.map, this.map, argsData.content, this.map.element.id + '_ContentTemplate_' + annotationIndex).length) {
6776
7001
  templateElement = Array.prototype.slice.call(templateFn(this.map, this.map, argsData.content, this.map.element.id + '_ContentTemplate_' + annotationIndex));
6777
7002
  const length = templateElement.length;
@@ -6831,21 +7056,20 @@ class Annotations {
6831
7056
  /**
6832
7057
  * To destroy the annotation.
6833
7058
  *
6834
- * @param {Maps} map - Specifies the instance of the maps
6835
7059
  * @returns {void}
6836
7060
  * @private
6837
7061
  */
6838
- destroy(map) {
6839
- // Destroy method performed here
7062
+ destroy() {
7063
+ this.map = null;
6840
7064
  }
6841
7065
  }
6842
7066
 
6843
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
6844
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6845
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6846
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6847
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6848
- };
7067
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
7068
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7069
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7070
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7071
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7072
+ };
6849
7073
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
6850
7074
  /* eslint-disable @typescript-eslint/no-unused-vars */
6851
7075
  /* eslint-disable radix */
@@ -6883,6 +7107,10 @@ let Maps = class Maps extends Component {
6883
7107
  * Resize the map
6884
7108
  */
6885
7109
  this.isResize = false;
7110
+ /**
7111
+ * @private
7112
+ */
7113
+ this.isReset = false;
6886
7114
  /** @private */
6887
7115
  this.baseSize = new Size(0, 0);
6888
7116
  /** @public */
@@ -7034,6 +7262,7 @@ let Maps = class Maps extends Component {
7034
7262
  this.renderArea();
7035
7263
  this.processRequestJsonData();
7036
7264
  this.renderComplete();
7265
+ this.isAddLayer = !this.isTileMap ? false : this.isAddLayer;
7037
7266
  }
7038
7267
  /**
7039
7268
  * To Initialize the control rendering.
@@ -7166,16 +7395,7 @@ let Maps = class Maps extends Component {
7166
7395
  }
7167
7396
  renderMap() {
7168
7397
  if (this.legendModule && this.legendSettings.visible) {
7169
- if (!this.isTileMap) {
7170
- this.legendModule.renderLegend();
7171
- }
7172
- else {
7173
- const layerCount = this.layersCollection.length - 1;
7174
- if (!this.layersCollection[layerCount].isBaseLayer) {
7175
- this.isTileMapSubLayer = true;
7176
- this.legendModule.renderLegend();
7177
- }
7178
- }
7398
+ this.legendModule.renderLegend();
7179
7399
  }
7180
7400
  this.createTile();
7181
7401
  if (this.zoomSettings.enable && this.zoomModule) {
@@ -7186,7 +7406,9 @@ let Maps = class Maps extends Component {
7186
7406
  this.dataLabelShape = [];
7187
7407
  }
7188
7408
  this.mapLayerPanel.measureLayerPanel();
7189
- this.element.appendChild(this.svgObject);
7409
+ if (!isNullOrUndefined(this.svgObject)) {
7410
+ this.element.appendChild(this.svgObject);
7411
+ }
7190
7412
  const position = this.getExtraPosition();
7191
7413
  for (let i = 0; i < this.layers.length; i++) {
7192
7414
  if (position.x !== 0 || position.y !== 0) {
@@ -7209,12 +7431,14 @@ let Maps = class Maps extends Component {
7209
7431
  this.checkInitialRender = false;
7210
7432
  }
7211
7433
  }
7212
- for (let k = 0; k < this.layers[i].markerSettings.length; k++) {
7213
- if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
7214
- && this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
7215
- const markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
7216
- for (let j = 0; j < markerSelectionValues.length; j++) {
7217
- this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
7434
+ if (!this.isResize) {
7435
+ for (let k = 0; k < this.layers[i].markerSettings.length; k++) {
7436
+ if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
7437
+ && this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
7438
+ const markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
7439
+ for (let j = 0; j < markerSelectionValues.length; j++) {
7440
+ this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
7441
+ }
7218
7442
  }
7219
7443
  }
7220
7444
  }
@@ -7256,12 +7480,16 @@ let Maps = class Maps extends Component {
7256
7480
  bottom = svg.bottom - tile.bottom - element.offsetTop;
7257
7481
  top = parseFloat(tileElement.style.top) + element.offsetTop;
7258
7482
  }
7259
- top = (bottom <= 11) ? top : (top * 2);
7260
- left = (bottom <= 11) ? left : (left * 2);
7483
+ top = (bottom <= 11) ? top : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top * 2);
7484
+ left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
7261
7485
  tileElement.style.top = top + 'px';
7262
7486
  tileElement.style.left = left + 'px';
7263
7487
  tileElement1.style.top = top + 'px';
7264
7488
  tileElement1.style.left = left + 'px';
7489
+ if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
7490
+ tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
7491
+ tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
7492
+ }
7265
7493
  }
7266
7494
  this.arrangeTemplate();
7267
7495
  if (this.annotationsModule) {
@@ -7292,7 +7520,8 @@ let Maps = class Maps extends Component {
7292
7520
  markerSelection(selectionSettings, map, targetElement, data) {
7293
7521
  const border = {
7294
7522
  color: selectionSettings.border.color,
7295
- width: selectionSettings.border.width / map.scale
7523
+ width: selectionSettings.border.width / map.scale,
7524
+ opacity: selectionSettings.border.opacity
7296
7525
  };
7297
7526
  const markerSelectionProperties = {
7298
7527
  opacity: selectionSettings.opacity,
@@ -7312,9 +7541,11 @@ let Maps = class Maps extends Component {
7312
7541
  if (this.selectedMarkerElementId.length === 0 || selectionSettings.enableMultiSelect) {
7313
7542
  if (targetElement.tagName === 'g') {
7314
7543
  targetElement.children[0].setAttribute('class', 'MarkerselectionMapStyle');
7544
+ this.selectedMarkerElementId.push(targetElement.children[0].id);
7315
7545
  }
7316
7546
  else {
7317
7547
  targetElement.setAttribute('class', 'MarkerselectionMapStyle');
7548
+ this.selectedMarkerElementId.push(targetElement.id);
7318
7549
  }
7319
7550
  }
7320
7551
  }
@@ -7366,6 +7597,7 @@ let Maps = class Maps extends Component {
7366
7597
  */
7367
7598
  addTabIndex() {
7368
7599
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
7600
+ this.element.setAttribute('role', '');
7369
7601
  this.element.setAttribute('tabindex', this.tabIndex.toString());
7370
7602
  }
7371
7603
  // private setSecondaryElementPosition(): void {
@@ -7384,12 +7616,21 @@ let Maps = class Maps extends Component {
7384
7616
  this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
7385
7617
  }
7386
7618
  if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
7387
- const tileRect = getElementByID(this.element.id + '_tile_parent').getBoundingClientRect();
7388
- const tileSvgRect = getElementByID(this.element.id + '_Tile_SVG').getBoundingClientRect();
7619
+ let tileElement = getElementByID(this.element.id + '_tile_parent');
7620
+ let tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
7621
+ const tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
7622
+ const tileRect = tileElement.getBoundingClientRect();
7623
+ const tileSvgRect = tileSvgElement.getBoundingClientRect();
7389
7624
  left = (tileRect.left - tileSvgRect.left);
7390
7625
  top = (tileRect.top - tileSvgRect.top);
7391
- getElementByID(this.element.id + '_Tile_SVG_Parent').style.left = left + 'px';
7392
- getElementByID(this.element.id + '_Tile_SVG_Parent').style.top = top + 'px';
7626
+ tileSvgParentElement.style.left = left + 'px';
7627
+ tileSvgParentElement.style.top = top + 'px';
7628
+ if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
7629
+ tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
7630
+ tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
7631
+ tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
7632
+ tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
7633
+ }
7393
7634
  const markerTemplateElements = document.getElementsByClassName('template');
7394
7635
  if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
7395
7636
  for (let i = 0; i < markerTemplateElements.length; i++) {
@@ -7407,7 +7648,7 @@ let Maps = class Maps extends Component {
7407
7648
  if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
7408
7649
  for (let i = 0; i < elements.childNodes.length; i++) {
7409
7650
  const childElement = elements.childNodes[i];
7410
- if (childElement.tagName === 'g') {
7651
+ if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
7411
7652
  const layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
7412
7653
  for (let j = 0; j < childElement.childNodes.length; j++) {
7413
7654
  const childNode = childElement.childNodes[j];
@@ -7421,7 +7662,7 @@ let Maps = class Maps extends Component {
7421
7662
  }
7422
7663
  }
7423
7664
  if (this.zoomModule && (this.previousScale !== this.scale)) {
7424
- this.zoomModule.applyTransform(true);
7665
+ this.zoomModule.applyTransform(this, true);
7425
7666
  }
7426
7667
  }
7427
7668
  }
@@ -7444,7 +7685,7 @@ let Maps = class Maps extends Component {
7444
7685
  }
7445
7686
  const templateElements = document.getElementsByClassName(this.element.id + '_template');
7446
7687
  if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
7447
- getElementByID(this.element.id + '_Layer_Collections') && this.layers[this.layers.length - 1].layerType !== 'OSM') {
7688
+ getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
7448
7689
  for (let i = 0; i < templateElements.length; i++) {
7449
7690
  let offSetLetValue = 0;
7450
7691
  let offSetTopValue = 0;
@@ -7479,10 +7720,7 @@ let Maps = class Maps extends Component {
7479
7720
  const mainLayer = this.layersCollection[0];
7480
7721
  const padding = 0;
7481
7722
  if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
7482
- mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
7483
- if (mainLayer.layerType === 'Google') {
7484
- mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
7485
- }
7723
+ mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
7486
7724
  removeElement(this.element.id + '_tile_parent');
7487
7725
  removeElement(this.element.id + '_tiles');
7488
7726
  removeElement('animated_tiles');
@@ -7529,7 +7767,7 @@ let Maps = class Maps extends Component {
7529
7767
  const baseLayer = mainLayers[i];
7530
7768
  if (baseLayer.visible && baseIndex === i) {
7531
7769
  baseLayer.isBaseLayer = true;
7532
- this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
7770
+ this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
7533
7771
  this.layersCollection.push(baseLayer);
7534
7772
  break;
7535
7773
  }
@@ -7576,12 +7814,19 @@ let Maps = class Maps extends Component {
7576
7814
  * @private
7577
7815
  */
7578
7816
  renderTitle(title, type, bounds, groupEle) {
7579
- const style = title.textStyle;
7817
+ const style = {
7818
+ size: title.textStyle.size,
7819
+ color: title.textStyle.color,
7820
+ fontFamily: title.textStyle.fontFamily,
7821
+ fontWeight: title.textStyle.fontWeight,
7822
+ fontStyle: title.textStyle.fontStyle,
7823
+ opacity: title.textStyle.opacity
7824
+ };
7580
7825
  let height;
7581
7826
  const width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
7582
- style.fontFamily = this.themeStyle.fontFamily || style.fontFamily;
7827
+ style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
7583
7828
  style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
7584
- style.size = this.themeStyle.titleFontSize || style.size;
7829
+ style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
7585
7830
  if (title.text) {
7586
7831
  if (isNullOrUndefined(groupEle)) {
7587
7832
  groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
@@ -7594,6 +7839,7 @@ let Maps = class Maps extends Component {
7594
7839
  const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
7595
7840
  const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
7596
7841
  element.setAttribute('aria-label', this.description || title.text);
7842
+ element.setAttribute('role', '');
7597
7843
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
7598
7844
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
7599
7845
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -7751,6 +7997,7 @@ let Maps = class Maps extends Component {
7751
7997
  const id = event.target['id'];
7752
7998
  event.preventDefault();
7753
7999
  if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
8000
+ this.mapAreaRect = this.legendModule.initialMapAreaRect;
7754
8001
  this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
7755
8002
  (this.legendModule.currentPage + 1);
7756
8003
  this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
@@ -7814,24 +8061,35 @@ let Maps = class Maps extends Component {
7814
8061
  latitude: latitude, longitude: longitude,
7815
8062
  isShapeSelected: this.SelectedElement(targetEle)
7816
8063
  };
7817
- this.trigger('click', eventArgs, (mouseArgs) => {
7818
- if (targetEle.id.indexOf('shapeIndex') > -1) {
7819
- this.mergeCluster();
7820
- if (getElement(this.element.id + '_mapsTooltip') &&
7821
- this.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
7822
- removeElement(this.element.id + '_mapsTooltip');
7823
- }
7824
- }
7825
- if (this.markerModule) {
7826
- this.markerModule.markerClusterClick(e);
7827
- }
7828
- if (!eventArgs.cancel) {
7829
- this.notify(click, targetEle);
7830
- }
7831
- if (!eventArgs.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
7832
- this.triggerShapeSelection(targetEle);
7833
- }
7834
- });
8064
+ if (this.onclick) {
8065
+ eventArgs.name = onclick;
8066
+ this.trigger('onclick', eventArgs, (mouseArgs) => {
8067
+ this.clickHandler(e, eventArgs, targetEle);
8068
+ });
8069
+ }
8070
+ else {
8071
+ this.trigger('click', eventArgs, (mouseArgs) => {
8072
+ this.clickHandler(e, eventArgs, targetEle);
8073
+ });
8074
+ }
8075
+ }
8076
+ }
8077
+ clickHandler(e, eventArgs, targetEle) {
8078
+ if (targetEle.id.indexOf('shapeIndex') > -1) {
8079
+ this.mergeCluster();
8080
+ if (getElement(this.element.id + '_mapsTooltip') &&
8081
+ this.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
8082
+ removeElement(this.element.id + '_mapsTooltip');
8083
+ }
8084
+ }
8085
+ if (this.markerModule) {
8086
+ this.markerModule.markerClusterClick(e);
8087
+ }
8088
+ if (!eventArgs.cancel) {
8089
+ this.notify(click, targetEle);
8090
+ }
8091
+ if (!eventArgs.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
8092
+ this.triggerShapeSelection(targetEle);
7835
8093
  }
7836
8094
  }
7837
8095
  triggerShapeSelection(targetEle) {
@@ -7931,13 +8189,6 @@ let Maps = class Maps extends Component {
7931
8189
  latitude = latLongValue.latitude;
7932
8190
  longitude = latLongValue.longitude;
7933
8191
  }
7934
- const eventArgs = {
7935
- cancel: false, name: click, target: targetId, x: e.clientX, y: e.clientY,
7936
- latitude: latitude, longitude: longitude, isShapeSelected: this.SelectedElement(targetEle)
7937
- };
7938
- // eslint-disable-next-line @typescript-eslint/no-empty-function
7939
- this.trigger('click', eventArgs, (mouseArgs) => {
7940
- });
7941
8192
  }
7942
8193
  this.titleTooltip(e, pageX, pageY, true);
7943
8194
  if (!isNullOrUndefined(this.legendModule)) {
@@ -7945,7 +8196,7 @@ let Maps = class Maps extends Component {
7945
8196
  }
7946
8197
  }
7947
8198
  this.notify(Browser.touchEndEvent, e);
7948
- if (e.cancelable) {
8199
+ if (e.cancelable && !this.isTouch) {
7949
8200
  e.preventDefault();
7950
8201
  }
7951
8202
  return false;
@@ -8099,14 +8350,14 @@ let Maps = class Maps extends Component {
8099
8350
  removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
8100
8351
  }
8101
8352
  if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
8102
- showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
8353
+ showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size || this.themeStyle.titleFontSize, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
8103
8354
  }
8104
8355
  else {
8105
8356
  removeElement(this.element.id + '_EJ2_Title_Tooltip');
8106
8357
  }
8107
8358
  }
8108
8359
  /*
8109
-
8360
+
8110
8361
  /**
8111
8362
  * This method is used to perform operations while resizing the window.
8112
8363
  *
@@ -8133,6 +8384,7 @@ let Maps = class Maps extends Component {
8133
8384
  this.refreshing = true;
8134
8385
  this.wireEVents();
8135
8386
  this.render();
8387
+ this.refreshing = false;
8136
8388
  }, 500);
8137
8389
  }
8138
8390
  }
@@ -8163,7 +8415,7 @@ let Maps = class Maps extends Component {
8163
8415
  this.scale = zoomFactor;
8164
8416
  this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
8165
8417
  this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
8166
- this.zoomModule.applyTransform();
8418
+ this.zoomModule.applyTransform(this);
8167
8419
  }
8168
8420
  else {
8169
8421
  position = { x: size.width / 2, y: size.height / 2 };
@@ -8209,8 +8461,10 @@ let Maps = class Maps extends Component {
8209
8461
  * @param {Object} layer - Specifies the layer for the maps.
8210
8462
  */
8211
8463
  addLayer(layer) {
8212
- this.layers.push(new LayerSettings(this.layers[0], 'layers', layer));
8213
- this.refresh();
8464
+ let mapsLayer = this.layers;
8465
+ mapsLayer.push(layer);
8466
+ this.isAddLayer = true;
8467
+ this.layers = mapsLayer;
8214
8468
  }
8215
8469
  /**
8216
8470
  * This method is used to remove a layer from map.
@@ -8219,8 +8473,9 @@ let Maps = class Maps extends Component {
8219
8473
  * @returns {void}
8220
8474
  */
8221
8475
  removeLayer(index) {
8222
- this.layers.splice(index, 1);
8223
- this.refresh();
8476
+ let mapsLayer = this.layers;
8477
+ mapsLayer.splice(index, 1);
8478
+ this.layers = mapsLayer;
8224
8479
  }
8225
8480
  /**
8226
8481
  * This method is used to add markers dynamically in the maps.
@@ -8238,7 +8493,7 @@ let Maps = class Maps extends Component {
8238
8493
  this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
8239
8494
  }
8240
8495
  const markerModule = new Marker(this);
8241
- markerModule.markerRender(layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
8496
+ markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
8242
8497
  this.arrangeTemplate();
8243
8498
  }
8244
8499
  }
@@ -8444,7 +8699,8 @@ let Maps = class Maps extends Component {
8444
8699
  Zoom: 'Zoom',
8445
8700
  ZoomOut: 'Zoom out',
8446
8701
  Pan: 'Pan',
8447
- Reset: 'Reset'
8702
+ Reset: 'Reset',
8703
+ ImageNotFound: 'Image Not Found'
8448
8704
  };
8449
8705
  }
8450
8706
  /**
@@ -8452,6 +8708,7 @@ let Maps = class Maps extends Component {
8452
8708
  */
8453
8709
  destroy() {
8454
8710
  this.unWireEVents();
8711
+ super.destroy();
8455
8712
  this.shapeSelectionItem = [];
8456
8713
  this.toggledShapeElementId = [];
8457
8714
  this.toggledLegendId = [];
@@ -8466,11 +8723,14 @@ let Maps = class Maps extends Component {
8466
8723
  this.zoomLabelPositions = [];
8467
8724
  this.mouseDownEvent = { x: null, y: null };
8468
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);
8469
8730
  if (document.getElementById('mapsmeasuretext')) {
8470
8731
  document.getElementById('mapsmeasuretext').remove();
8471
8732
  }
8472
8733
  this.removeSvg();
8473
- super.destroy();
8474
8734
  }
8475
8735
  /**
8476
8736
  * Gets component name
@@ -8503,6 +8763,7 @@ let Maps = class Maps extends Component {
8503
8763
  onPropertyChanged(newProp, oldProp) {
8504
8764
  let render = false;
8505
8765
  let isMarker = false;
8766
+ let isLayer = false;
8506
8767
  let isStaticMapType = false;
8507
8768
  let layerEle;
8508
8769
  if (newProp['layers']) {
@@ -8522,12 +8783,17 @@ let Maps = class Maps extends Component {
8522
8783
  case 'legendSettings':
8523
8784
  case 'baseLayerIndex':
8524
8785
  if (prop === 'layers') {
8786
+ isLayer = true;
8525
8787
  const layerPropLength = Object.keys(newProp.layers).length;
8526
8788
  for (let x = 0; x < layerPropLength; x++) {
8527
8789
  if (!isNullOrUndefined(newProp.layers[x])) {
8528
8790
  const collection = Object.keys(newProp.layers[x]);
8529
8791
  for (const collectionProp of collection) {
8530
- if (collectionProp === 'markerSettings') {
8792
+ if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
8793
+ && !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
8794
+ this.isReset = true;
8795
+ }
8796
+ else if (collectionProp === 'markerSettings') {
8531
8797
  isMarker = true;
8532
8798
  }
8533
8799
  else if (collectionProp === 'staticMapType') {
@@ -8541,7 +8807,7 @@ let Maps = class Maps extends Component {
8541
8807
  break;
8542
8808
  case 'zoomSettings':
8543
8809
  if (!isNullOrUndefined(oldProp.zoomSettings)) {
8544
- if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor) {
8810
+ if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor && !isLayer) {
8545
8811
  render = false;
8546
8812
  }
8547
8813
  else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
@@ -8776,7 +9042,7 @@ let Maps = class Maps extends Component {
8776
9042
  */
8777
9043
  print(id) {
8778
9044
  if ((this.allowPrint) && (this.printModule)) {
8779
- this.printModule.print(id);
9045
+ this.printModule.print(this, id);
8780
9046
  }
8781
9047
  }
8782
9048
  /**
@@ -8794,16 +9060,38 @@ let Maps = class Maps extends Component {
8794
9060
  }
8795
9061
  if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
8796
9062
  return new Promise((resolve, reject) => {
8797
- resolve(this.imageExportModule.export(type, fileName, allowDownload));
9063
+ resolve(this.imageExportModule.export(this, type, fileName, allowDownload));
8798
9064
  });
8799
9065
  }
8800
9066
  else if ((this.allowPdfExport) && (this.pdfExportModule)) {
8801
9067
  return new Promise((resolve, reject) => {
8802
- resolve(this.pdfExportModule.export(type, fileName, allowDownload, orientation));
9068
+ resolve(this.pdfExportModule.export(this, type, fileName, allowDownload, orientation));
8803
9069
  });
8804
9070
  }
8805
9071
  return null;
8806
9072
  }
9073
+ /**
9074
+ * This method is used to get the Bing maps URL.
9075
+ *
9076
+ * @param {string} url - Specifies the URL of the maps.
9077
+ * @returns {Promise<string>} - Returns the processed Bing URL as Promise.
9078
+ */
9079
+ getBingUrlTemplate(url) {
9080
+ const promise = new Promise((resolve, reject) => {
9081
+ const ajax = new Ajax({
9082
+ url: url
9083
+ });
9084
+ ajax.onSuccess = (json) => {
9085
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9086
+ const jsonObject = JSON.parse(json);
9087
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9088
+ const resource = jsonObject['resourceSets'][0]['resources'][0];
9089
+ resolve(resource['imageUrl']);
9090
+ };
9091
+ ajax.send();
9092
+ });
9093
+ return promise;
9094
+ }
8807
9095
  /**
8808
9096
  * To find visibility of layers and markers for required modules load.
8809
9097
  *
@@ -9004,6 +9292,9 @@ __decorate([
9004
9292
  __decorate([
9005
9293
  Event()
9006
9294
  ], Maps.prototype, "click", void 0);
9295
+ __decorate([
9296
+ Event()
9297
+ ], Maps.prototype, "onclick", void 0);
9007
9298
  __decorate([
9008
9299
  Event()
9009
9300
  ], Maps.prototype, "doubleClick", void 0);
@@ -9147,12 +9438,8 @@ class Bubble {
9147
9438
  isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
9148
9439
  const shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
9149
9440
  ? shape[shapePath].toLowerCase() : shape[shapePath];
9150
- if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
9151
- if (layerData[i]['type'] === 'Point') {
9152
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9153
- shapePoints.push(this.getPoints(layerData[i], []));
9154
- }
9155
- else if (!layerData[i]['_isMultiPolygon']) {
9441
+ if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
9442
+ if (!layerData[i]['_isMultiPolygon']) {
9156
9443
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9157
9444
  shapePoints.push(this.getPoints(layerData[i], []));
9158
9445
  currentLength = shapePoints[shapePoints.length - 1].length;
@@ -9236,7 +9523,7 @@ class Bubble {
9236
9523
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9237
9524
  let translate;
9238
9525
  const animate$$1 = layer.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
9239
- if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule)) {
9526
+ if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule) && !this.maps.isTileMap) {
9240
9527
  translate = getZoomTranslate(this.maps, layer, animate$$1);
9241
9528
  }
9242
9529
  else {
@@ -9353,14 +9640,13 @@ class Bubble {
9353
9640
  /**
9354
9641
  * To destroy the bubble.
9355
9642
  *
9356
- * @param {Maps} maps - Specifies the instance of the maps.
9357
9643
  * @returns {void}
9358
9644
  * @private
9359
9645
  */
9360
- destroy(maps) {
9361
- /**
9362
- * Destroy method performed here
9363
- */
9646
+ destroy() {
9647
+ this.bubbleCollection = [];
9648
+ //TODO: Calling the below code throws spec issue.
9649
+ //this.maps = null;
9364
9650
  }
9365
9651
  }
9366
9652
 
@@ -9457,7 +9743,7 @@ class DataLabel {
9457
9743
  let shapeWidth;
9458
9744
  const scaleZoomValue = !isNullOrUndefined(this.maps.scale) ? Math.floor(this.maps.scale) : 1;
9459
9745
  const zoomLabelsPosition = this.maps.zoomSettings.enable ? !isNullOrUndefined(this.maps.zoomShapeCollection) &&
9460
- this.maps.zoomShapeCollection.length > 0 : this.maps.zoomSettings.enable;
9746
+ this.maps.zoomShapeCollection.length > 0 && !this.maps.isAddLayer : this.maps.zoomSettings.enable;
9461
9747
  this.maps.translateType = 'labels';
9462
9748
  for (let j = 0; j < properties.length; j++) {
9463
9749
  if (shapeProperties[properties[j]]) {
@@ -9475,7 +9761,7 @@ class DataLabel {
9475
9761
  layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
9476
9762
  if (!isNullOrUndefined(shapes['property'])) {
9477
9763
  shapePoint = [[]];
9478
- if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
9764
+ if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
9479
9765
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9480
9766
  shapePoint.push(this.getPoint(layerData[index], []));
9481
9767
  currentLength = shapePoint[shapePoint.length - 1].length;
@@ -9484,21 +9770,9 @@ class DataLabel {
9484
9770
  midIndex = shapePoint.length - 1;
9485
9771
  }
9486
9772
  }
9487
- else {
9773
+ else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
9488
9774
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9489
9775
  const layer = layerData[index];
9490
- if (layer['type'] === 'Point') {
9491
- isPoint = true;
9492
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9493
- const layerPoints = [];
9494
- layerPoints.push(this.getPoint(layerData, []));
9495
- shapePoint = layerPoints;
9496
- currentLength = shapePoint[shapePoint.length - 1].length;
9497
- if (pointsLength < currentLength) {
9498
- pointsLength = currentLength;
9499
- midIndex = shapePoint.length - 1;
9500
- }
9501
- }
9502
9776
  for (let j = 0; j < layer.length; j++) {
9503
9777
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9504
9778
  shapePoint.push(this.getPoint(layer[j], []));
@@ -9568,7 +9842,7 @@ class DataLabel {
9568
9842
  const eventargs = {
9569
9843
  name: dataLabelRendering, maps: this.maps, cancel: false, border: { color: dataLabel.border.color,
9570
9844
  width: dataLabel.border.width, opacity: dataLabel.border.opacity }, datalabel: dataLabel,
9571
- fill: dataLabel.fill, template: dataLabel.template, text: text
9845
+ fill: dataLabel.fill, template: dataLabel.template, text: text, offsetX: 0, offsetY: 0
9572
9846
  };
9573
9847
  this.maps.trigger('dataLabelRendering', eventargs, (labelArgs) => {
9574
9848
  if (eventargs.cancel) {
@@ -9613,13 +9887,13 @@ class DataLabel {
9613
9887
  this.value[index] = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
9614
9888
  let labelElement;
9615
9889
  if (eventargs.template !== '') {
9616
- templateFn = getTemplateFunction(eventargs.template);
9890
+ templateFn = getTemplateFunction(eventargs.template, this.maps);
9617
9891
  const templateElement = templateFn ? templateFn(!isNullOrUndefined(datasrcObj) ?
9618
9892
  datasrcObj : shapeData['properties'], this.maps, eventargs.template, this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
9619
9893
  templateElement.innerHTML = !templateFn ? eventargs.template : '';
9620
9894
  labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, this.maps);
9621
- labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + 'px';
9622
- 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';
9623
9897
  labelTemplateElement.appendChild(labelElement);
9624
9898
  }
9625
9899
  else {
@@ -9707,26 +9981,26 @@ class DataLabel {
9707
9981
  y = ((location['y'] + transPoint['y']) * scale) - textSize['height'] / 2;
9708
9982
  }
9709
9983
  border.opacity = isNullOrUndefined(border.opacity) ? opacity : border.opacity;
9710
- 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);
9711
9985
  const rect = this.maps.renderer.drawRectangle(rectOptions);
9712
9986
  group.appendChild(rect);
9713
9987
  }
9714
9988
  }
9715
9989
  element = renderTextElement(options, style, style.color || this.maps.themeStyle.dataLabelFontColor, group);
9716
9990
  if (zoomLabelsPosition && scaleZoomValue > 1 && !this.maps.zoomNotApplied) {
9717
- element.setAttribute('transform', 'translate( ' + ((location['x'])) + ' '
9718
- + (((location['y']))) + ' )');
9991
+ element.setAttribute('transform', 'translate( ' + ((location['x'] + labelArgs.offsetX)) + ' '
9992
+ + (((location['y'] + labelArgs.offsetY))) + ' )');
9719
9993
  location['x'] = locationX;
9720
9994
  location['y'] = locationY;
9721
9995
  }
9722
9996
  else {
9723
- element.setAttribute('transform', 'translate( ' + ((location['x'] + transPoint.x) * scale) + ' '
9724
- + (((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) + ' )');
9725
9999
  }
9726
10000
  group.appendChild(element);
9727
10001
  }
9728
10002
  this.dataLabelCollections.push({
9729
- location: { x: location['x'], y: location['y'] },
10003
+ location: { x: location['x'] + labelArgs.offsetX, y: location['y'] + labelArgs.offsetY },
9730
10004
  element: isNullOrUndefined(labelElement) ? element : labelElement,
9731
10005
  layerIndex: layerIndex,
9732
10006
  shapeIndex: sublayerIndexLabel ? oldIndex : index,
@@ -9743,10 +10017,21 @@ class DataLabel {
9743
10017
  }
9744
10018
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9745
10019
  getPoint(shapes, points) {
9746
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9747
- shapes.map((current, index) => {
9748
- points.push(new Point(current['point']['x'], current['point']['y']));
9749
- });
10020
+ if (shapes['type'] === 'MultiLineString') {
10021
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10022
+ shapes.map((current) => {
10023
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10024
+ current.map((shape) => {
10025
+ points.push(new Point(shape['point']['x'], shape['point']['y']));
10026
+ });
10027
+ });
10028
+ }
10029
+ else {
10030
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10031
+ shapes.map((current, index) => {
10032
+ points.push(new Point(current['point']['x'], current['point']['y']));
10033
+ });
10034
+ }
9750
10035
  return points;
9751
10036
  }
9752
10037
  /**
@@ -9758,16 +10043,14 @@ class DataLabel {
9758
10043
  return 'DataLabel';
9759
10044
  }
9760
10045
  /**
9761
- * To destroy the layers.
9762
10046
  *
9763
- * @param {Maps} maps - Specifies the instance of the maps.
9764
10047
  * @returns {void}
9765
10048
  * @private
9766
10049
  */
9767
- destroy(maps) {
9768
- /**
9769
- * Destroy method performed here
9770
- */
10050
+ destroy() {
10051
+ this.dataLabelCollections = [];
10052
+ this.value = null;
10053
+ this.maps = null;
9771
10054
  }
9772
10055
  }
9773
10056
 
@@ -9918,14 +10201,11 @@ class NavigationLine {
9918
10201
  /**
9919
10202
  * To destroy the layers.
9920
10203
  *
9921
- * @param {Maps} maps - Specifies the instance of the map
9922
10204
  * @returns {void}
9923
10205
  * @private
9924
10206
  */
9925
- destroy(maps) {
9926
- /**
9927
- * Destroy method performed here
9928
- */
10207
+ destroy() {
10208
+ this.maps = null;
9929
10209
  }
9930
10210
  }
9931
10211
 
@@ -9938,6 +10218,10 @@ class Legend {
9938
10218
  * @private
9939
10219
  */
9940
10220
  this.legendBorderRect = new Rect(0, 0, 0, 0);
10221
+ /**
10222
+ * @private
10223
+ */
10224
+ this.initialMapAreaRect = new Rect(0, 0, 0, 0);
9941
10225
  /**
9942
10226
  * @private
9943
10227
  */
@@ -9996,6 +10280,7 @@ class Legend {
9996
10280
  this.heightIncrement = 0;
9997
10281
  this.defsElement = this.maps.renderer.createDefs();
9998
10282
  this.maps.svgObject.appendChild(this.defsElement);
10283
+ this.initialMapAreaRect = this.maps.mapAreaRect;
9999
10284
  this.calculateLegendBounds();
10000
10285
  this.drawLegend();
10001
10286
  }
@@ -10033,9 +10318,9 @@ class Legend {
10033
10318
  }
10034
10319
  }
10035
10320
  }
10036
- else {
10037
- this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
10038
- }
10321
+ }
10322
+ if (legend.type === 'Markers') {
10323
+ this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
10039
10324
  }
10040
10325
  });
10041
10326
  if (this.legendCollection.length > 0) {
@@ -10226,8 +10511,9 @@ class Legend {
10226
10511
  }
10227
10512
  }
10228
10513
  else {
10514
+ let padding = 10;
10229
10515
  shapeX = shapeLocation[j - 1].x;
10230
- shapeY = prevPositionY + topPadding + (shapeHeight / 2);
10516
+ shapeY = prevPositionY + padding + (shapeHeight / 2);
10231
10517
  }
10232
10518
  }
10233
10519
  }
@@ -10330,7 +10616,14 @@ class Legend {
10330
10616
  const legend = map.legendSettings;
10331
10617
  const render = map.renderer;
10332
10618
  let textOptions;
10333
- const textFont = legend.textStyle;
10619
+ const textFont = {
10620
+ size: legend.textStyle.size,
10621
+ color: legend.textStyle.color,
10622
+ fontFamily: legend.textStyle.fontFamily,
10623
+ fontWeight: legend.textStyle.fontWeight,
10624
+ fontStyle: legend.textStyle.fontStyle,
10625
+ opacity: legend.textStyle.opacity
10626
+ };
10334
10627
  this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
10335
10628
  if (legend.mode === 'Interactive') {
10336
10629
  for (let i = 0; i < this.legendRenderingCollections.length; i++) {
@@ -10346,7 +10639,7 @@ class Legend {
10346
10639
  textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
10347
10640
  const rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
10348
10641
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
10349
- textFont.fontFamily = map.themeStyle.fontFamily || textFont.fontFamily;
10642
+ textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
10350
10643
  textFont.size = map.themeStyle.legendFontSize || textFont.size;
10351
10644
  renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
10352
10645
  this.legendGroup.appendChild(render.drawRectangle(rectOptions));
@@ -10401,7 +10694,7 @@ class Legend {
10401
10694
  };
10402
10695
  legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
10403
10696
  this.maps.themeStyle.legendTextColor;
10404
- legendTextStyle.fontFamily = map.themeStyle.fontFamily || legendTextStyle.fontFamily;
10697
+ legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
10405
10698
  legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
10406
10699
  if (i === 0) {
10407
10700
  this.renderLegendBorder();
@@ -10477,7 +10770,9 @@ class Legend {
10477
10770
  'opacity': 1,
10478
10771
  'dominant-baseline': ''
10479
10772
  };
10480
- pagingGroup.appendChild(render.createText(pageTextOptions, pagingText));
10773
+ let pagingTextElement = render.createText(pageTextOptions, pagingText);
10774
+ pagingTextElement.setAttribute('style', 'user-select: none;');
10775
+ pagingGroup.appendChild(pagingTextElement);
10481
10776
  this.legendGroup.appendChild(pagingGroup);
10482
10777
  }
10483
10778
  this.legendToggle();
@@ -10489,6 +10784,7 @@ class Legend {
10489
10784
  let shapeIndex;
10490
10785
  let layerIndex;
10491
10786
  let dataIndex;
10787
+ let pointIndex;
10492
10788
  const legend = this.maps.legendSettings;
10493
10789
  const textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
10494
10790
  document.getElementById(targetElement.id + '_Text');
@@ -10576,12 +10872,20 @@ class Legend {
10576
10872
  }
10577
10873
  if (enable) {
10578
10874
  for (let j = 0; j < data.length; j++) {
10875
+ let shapeElement;
10579
10876
  shapeIndex = data[j]['shapeIndex'];
10580
10877
  layerIndex = data[j]['layerIndex'];
10581
10878
  dataIndex = data[j]['dataIndex'];
10582
- const shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
10583
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
10584
- if (shapeEle !== null) {
10879
+ pointIndex = data[j]['pointIndex'];
10880
+ if (pointIndex === -1) {
10881
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
10882
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
10883
+ }
10884
+ else {
10885
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
10886
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
10887
+ }
10888
+ if (shapeElement !== null) {
10585
10889
  let shapeMatch = true;
10586
10890
  if (this.maps.legendSelectionCollection !== null) {
10587
10891
  for (let i = 0; i < this.maps.legendSelectionCollection.length; i++) {
@@ -10598,13 +10902,13 @@ class Legend {
10598
10902
  }
10599
10903
  length = this.legendHighlightCollection.length;
10600
10904
  const legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
10601
- this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeEle);
10905
+ this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10602
10906
  const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
10603
- const shapeOldFillColor = shapeEle.getAttribute('fill');
10907
+ const shapeOldFillColor = shapeElement.getAttribute('fill');
10604
10908
  this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
10605
10909
  const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
10606
10910
  this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
10607
- this.setColor(shapeEle, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10911
+ this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10608
10912
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10609
10913
  }
10610
10914
  else if (value === 'selection') {
@@ -10627,12 +10931,12 @@ class Legend {
10627
10931
  }
10628
10932
  selectLength = this.maps.legendSelectionCollection.length;
10629
10933
  const legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
10630
- this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeEle);
10934
+ this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10631
10935
  this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
10632
10936
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10633
- this.setColor(shapeEle, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10634
- if (this.maps.selectedElementId.indexOf(shapeEle.getAttribute('id')) === -1) {
10635
- this.maps.selectedElementId.push(shapeEle.getAttribute('id'));
10937
+ this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10938
+ if (this.maps.selectedElementId.indexOf(shapeElement.getAttribute('id')) === -1) {
10939
+ this.maps.selectedElementId.push(shapeElement.getAttribute('id'));
10636
10940
  }
10637
10941
  if (j === data.length - 1) {
10638
10942
  this.maps.legendSelection = false;
@@ -10647,14 +10951,15 @@ class Legend {
10647
10951
  }
10648
10952
  }
10649
10953
  setColor(element, fill, opacity, borderColor, borderWidth, type) {
10954
+ const isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
10650
10955
  if (type === 'selection') {
10651
- maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
10652
- element.setAttribute('class', 'ShapeselectionMapStyle');
10956
+ maintainStyleClass((isLineStringShape ? 'LineselectionMap' : 'ShapeselectionMap'), (isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle'), (isLineStringShape ? 'transparent' : fill), opacity, (isLineStringShape ? fill : borderColor), borderWidth, this.maps);
10957
+ element.setAttribute('class', isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle');
10653
10958
  }
10654
10959
  else {
10655
- element.setAttribute('fill', fill);
10960
+ element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
10656
10961
  element.setAttribute('fill-opacity', opacity);
10657
- element.setAttribute('stroke', borderColor);
10962
+ element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
10658
10963
  element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
10659
10964
  }
10660
10965
  }
@@ -10697,7 +11002,8 @@ class Legend {
10697
11002
  const dataCount = shapeElements.length;
10698
11003
  for (let j = 0; j < dataCount; j++) {
10699
11004
  const shapeElement = getElement(shapeElements[j]);
10700
- if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11005
+ if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
11006
+ shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
10701
11007
  removeClass(shapeElement);
10702
11008
  const selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
10703
11009
  if (selectedElementIdIndex !== -1) {
@@ -10775,12 +11081,14 @@ class Legend {
10775
11081
  this.maps.legendSelectionClass = module;
10776
11082
  }
10777
11083
  else {
10778
- if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11084
+ if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11085
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
10779
11086
  if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
10780
11087
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
10781
11088
  }
10782
11089
  else {
10783
- if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11090
+ if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11091
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
10784
11092
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
10785
11093
  }
10786
11094
  }
@@ -10867,7 +11175,8 @@ class Legend {
10867
11175
  }
10868
11176
  }
10869
11177
  }
10870
- if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle')) {
11178
+ if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11179
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
10871
11180
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10872
11181
  const element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
10873
11182
  let multiSelection = 0;
@@ -10958,7 +11267,7 @@ class Legend {
10958
11267
  }
10959
11268
  for (let j = 0; j < this.maps.selectedLegendElementId.length; j++) {
10960
11269
  const idIndex = this.maps.legendSettings.mode === 'Interactive' ?
10961
- 'container_Legend_Index_' : 'container_Legend_Shape_Index_';
11270
+ this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
10962
11271
  const selectedElement = idIndex + this.maps.selectedLegendElementId[j];
10963
11272
  const legendElement = document.getElementById(selectedElement);
10964
11273
  if (!isNullOrUndefined(legendElement)) {
@@ -11010,6 +11319,7 @@ class Legend {
11010
11319
  let shapeIndex;
11011
11320
  let layerIndex;
11012
11321
  let dataIndex;
11322
+ let pointIndex;
11013
11323
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11014
11324
  const collection = this.maps.legendModule.legendCollection;
11015
11325
  const legend = this.maps.legendSettings;
@@ -11022,15 +11332,23 @@ class Legend {
11022
11332
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11023
11333
  const currentElement = { Elements: [] };
11024
11334
  for (let j = 0; j < data.length; j++) {
11335
+ let shapeElement;
11025
11336
  shapeIndex = data[j]['shapeIndex'];
11026
11337
  layerIndex = data[j]['layerIndex'];
11027
11338
  dataIndex = data[j]['dataIndex'];
11028
- const shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11029
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11030
- if (targetElement === shapeEle) {
11339
+ pointIndex = data[j]['pointIndex'];
11340
+ if (pointIndex === -1) {
11341
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11342
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11343
+ }
11344
+ else {
11345
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11346
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
11347
+ }
11348
+ if (targetElement === shapeElement) {
11031
11349
  process = true;
11032
11350
  }
11033
- elements.push(shapeEle);
11351
+ elements.push(shapeElement);
11034
11352
  }
11035
11353
  if (process) {
11036
11354
  if (isNullOrUndefined(currentElement['LegendEle'])) {
@@ -11048,16 +11366,25 @@ class Legend {
11048
11366
  let shapeIndex;
11049
11367
  let layerIndex;
11050
11368
  let dataIndex;
11369
+ let pointIndex;
11051
11370
  const idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
11052
11371
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11053
11372
  const data = this.maps.legendModule.legendCollection[idIndex]['data'];
11054
11373
  const legendShapeElements = [];
11055
11374
  for (let i = 0; i < data.length; i++) {
11375
+ let shapeElement;
11056
11376
  shapeIndex = data[i]['shapeIndex'];
11057
11377
  layerIndex = data[i]['layerIndex'];
11058
11378
  dataIndex = data[i]['dataIndex'];
11059
- const shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11060
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11379
+ pointIndex = data[i]['pointIndex'];
11380
+ if (pointIndex === -1) {
11381
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11382
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11383
+ }
11384
+ else {
11385
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11386
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
11387
+ }
11061
11388
  if (!isNullOrUndefined(shapeElement)) {
11062
11389
  legendShapeElements.push(shapeElement.id);
11063
11390
  }
@@ -11125,9 +11452,11 @@ class Legend {
11125
11452
  const renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
11126
11453
  this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
11127
11454
  this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
11128
- this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-(this.legendBorderRect.x))) + ' ' +
11455
+ this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
11129
11456
  (this.translate.y + (-(this.legendBorderRect.y))) + ' )');
11130
- map.svgObject.appendChild(this.legendGroup);
11457
+ if (legend.position !== 'Float') {
11458
+ map.svgObject.appendChild(this.legendGroup);
11459
+ }
11131
11460
  if (legendTitle) {
11132
11461
  textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
11133
11462
  textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
@@ -11139,7 +11468,16 @@ class Legend {
11139
11468
  this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
11140
11469
  (this.currentPage + 1);
11141
11470
  this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
11471
+ this.maps.mapAreaRect = this.initialMapAreaRect;
11142
11472
  this.drawLegendItem(this.currentPage);
11473
+ if (!isNullOrUndefined(this.maps.legendModule) && this.maps.legendSettings.position === 'Float') {
11474
+ if (this.maps.isTileMap) {
11475
+ this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.legendModule.legendGroup);
11476
+ }
11477
+ else {
11478
+ this.maps.svgObject.appendChild(this.maps.legendModule.legendGroup);
11479
+ }
11480
+ }
11143
11481
  if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
11144
11482
  querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
11145
11483
  }
@@ -11157,53 +11495,60 @@ class Legend {
11157
11495
  const areaWidth = totalRect.width;
11158
11496
  const totalWidth = map.availableSize.width;
11159
11497
  const totalHeight = map.availableSize.height;
11498
+ const locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
11499
+ const locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
11160
11500
  if (legend.position === 'Float') {
11161
- this.translate = legend.location;
11501
+ this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) : new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
11502
+ this.legendTotalRect = map.mapAreaRect;
11162
11503
  }
11163
11504
  else {
11164
11505
  switch (legend.position) {
11165
11506
  case 'Top':
11166
11507
  case 'Bottom':
11167
- totalRect.height = (areaHeight - height);
11508
+ totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
11168
11509
  x = (totalWidth / 2) - (width / 2);
11169
11510
  y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
11170
- totalRect.y = (legend.position === 'Top') ? areaY + height + spacing : areaY;
11511
+ totalRect.y = (legend.position === 'Top') ? areaY + height + (map.isTileMap ? (spacing / 2) : spacing) : areaY - (spacing / 2);
11171
11512
  break;
11172
11513
  case 'Left':
11173
11514
  case 'Right':
11174
- totalRect.width = (areaWidth - width);
11175
- x = (legend.position === 'Left') ? areaX : (areaX + totalRect.width) - spacing;
11515
+ totalRect.width = (areaWidth - width - map.mapAreaRect.x);
11516
+ x = (legend.position === 'Left') ? areaX + (spacing / 2) : (areaX + totalRect.width + spacing);
11176
11517
  y = (totalHeight / 2) - (height / 2);
11177
- totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
11518
+ totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
11178
11519
  break;
11179
11520
  }
11180
11521
  switch (legend.alignment) {
11181
11522
  case 'Near':
11182
11523
  if (legend.position === 'Top' || legend.position === 'Bottom') {
11183
- x = totalRect.x;
11524
+ x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
11184
11525
  }
11185
11526
  else {
11186
- y = totalRect.y;
11527
+ y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
11187
11528
  }
11188
11529
  break;
11189
11530
  case 'Far':
11190
11531
  if (legend.position === 'Top' || legend.position === 'Bottom') {
11191
- x = (totalWidth - width) - spacing;
11532
+ x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
11192
11533
  }
11193
11534
  else {
11194
- y = totalHeight - height;
11535
+ y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
11195
11536
  }
11196
11537
  break;
11197
11538
  }
11198
11539
  if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
11199
- this.legendTotalRect = map.totalRect = totalRect;
11540
+ this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
11200
11541
  }
11201
11542
  else {
11543
+ map.totalRect = null;
11202
11544
  if ((legend.height || legend.width) && legend.mode === 'Interactive') {
11203
11545
  map.totalRect = totalRect;
11204
11546
  }
11205
11547
  this.legendTotalRect = map.mapAreaRect = totalRect;
11206
11548
  }
11549
+ if (legend.position === 'Left') {
11550
+ map.mapAreaRect.width = totalRect.width;
11551
+ }
11207
11552
  this.translate = new Point(x, y);
11208
11553
  }
11209
11554
  }
@@ -11220,7 +11565,7 @@ class Legend {
11220
11565
  data[this.maps.legendSettings.showLegendPath];
11221
11566
  if (marker$$1.visible && showLegend && (!isNullOrUndefined(data['latitude'])) && (!isNullOrUndefined(data['longitude']))) {
11222
11567
  if (marker$$1.template) {
11223
- templateFn = getTemplateFunction(marker$$1.template);
11568
+ templateFn = getTemplateFunction(marker$$1.template, this.maps);
11224
11569
  const templateElement = templateFn(this.maps);
11225
11570
  const markerEle = isNullOrUndefined(templateElement.childElementCount) ? templateElement[0] :
11226
11571
  templateElement;
@@ -11324,6 +11669,13 @@ class Legend {
11324
11669
  borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
11325
11670
  });
11326
11671
  }
11672
+ else {
11673
+ for (let i = 0; i < this.legendCollection.length; i++) {
11674
+ if (this.legendCollection[i]['text'] === legendText && this.legendCollection[i]['fill'] === legendFill) {
11675
+ this.legendCollection[i].data.push(newColllection[0]);
11676
+ }
11677
+ }
11678
+ }
11327
11679
  }
11328
11680
  }
11329
11681
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -11518,15 +11870,16 @@ class Legend {
11518
11870
  const width = 10;
11519
11871
  const direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
11520
11872
  ? 'Horizontal' : 'Vertical' : legend.orientation;
11873
+ rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
11521
11874
  if (direction === 'Horizontal') {
11522
11875
  if (!legend.invertedPointer) {
11523
- locX = rect.x + (rect.width / 2);
11876
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11524
11877
  locY = rect.y;
11525
11878
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
11526
11879
  ' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
11527
11880
  }
11528
11881
  else {
11529
- locX = rect.x + (rect.width / 2);
11882
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11530
11883
  locY = rect.y + (rect.height);
11531
11884
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
11532
11885
  ' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
@@ -11534,20 +11887,25 @@ class Legend {
11534
11887
  }
11535
11888
  else {
11536
11889
  if (!legend.invertedPointer) {
11537
- locX = rect.x + (rect.width);
11890
+ locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11538
11891
  locY = rect.y + (rect.height / 2);
11539
11892
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
11540
11893
  ' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
11541
11894
  }
11542
11895
  else {
11543
- locX = rect.x;
11896
+ locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11544
11897
  locY = rect.y + (rect.height / 2);
11545
11898
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
11546
11899
  ' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
11547
11900
  }
11548
11901
  }
11549
11902
  const pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
11550
- this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
11903
+ if (legend.position === 'Float' && this.maps.isTileMap) {
11904
+ this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.renderer.drawPath(pathOptions));
11905
+ }
11906
+ else {
11907
+ this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
11908
+ }
11551
11909
  }
11552
11910
  wireEvents(element) {
11553
11911
  EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
@@ -11604,6 +11962,9 @@ class Legend {
11604
11962
  '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
11605
11963
  '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
11606
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);
11607
11968
  mapElement = mapElement.children[0];
11608
11969
  }
11609
11970
  if (isVisible && mapElement !== null) {
@@ -11745,6 +12106,9 @@ class Legend {
11745
12106
  '_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
11746
12107
  '_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id);
11747
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);
11748
12112
  LegendInteractive = LegendInteractive.children[0];
11749
12113
  }
11750
12114
  if (isVisible && LegendInteractive !== null) {
@@ -11908,10 +12272,20 @@ class Legend {
11908
12272
  const shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
11909
12273
  && isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
11910
12274
  if (shapeDataValueCase === dataPathValueCase) {
11911
- legendData.push({
11912
- layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
11913
- name: data[dataPath], value: value
11914
- });
12275
+ if (shapeData['geometry']['type'] != 'MultiPoint') {
12276
+ legendData.push({
12277
+ layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
12278
+ name: data[dataPath], value: value, pointIndex: -1
12279
+ });
12280
+ }
12281
+ else {
12282
+ for (let j = 0; j < shapeData['geometry'].coordinates.length; j++) {
12283
+ legendData.push({
12284
+ layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
12285
+ name: data[dataPath], value: value, pointIndex: j
12286
+ });
12287
+ }
12288
+ }
11915
12289
  }
11916
12290
  }
11917
12291
  }
@@ -11957,15 +12331,30 @@ class Legend {
11957
12331
  /**
11958
12332
  * To destroy the legend.
11959
12333
  *
11960
- * @param {Maps} maps - Specifies the instance of the maps
11961
12334
  * @returns {void}
11962
12335
  * @private
11963
12336
  */
11964
- destroy(maps) {
11965
- /**
11966
- * Destroy method performed here
11967
- */
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;
11968
12356
  this.removeEventListener();
12357
+ this.maps = null;
11969
12358
  }
11970
12359
  }
11971
12360
 
@@ -12022,7 +12411,8 @@ class Highlight {
12022
12411
  targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
12023
12412
  targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
12024
12413
  targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
12025
- targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle') {
12414
+ targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
12415
+ targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
12026
12416
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
12027
12417
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12028
12418
  let shapeData;
@@ -12032,8 +12422,9 @@ class Highlight {
12032
12422
  let dataIndex;
12033
12423
  if (targetEle.id.indexOf('shapeIndex') > -1) {
12034
12424
  shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
12035
- shapeData = this.maps.layers[layerIndex].shapeData['features'] ?
12036
- this.maps.layers[layerIndex].shapeData['features'][shapeIn]['properties'] : null;
12425
+ shapeData = this.maps.layers[layerIndex].shapeData['features'] &&
12426
+ !isNullOrUndefined(this.maps.layersCollection[layerIndex].layerData[shapeIn]) ?
12427
+ this.maps.layersCollection[layerIndex].layerData[shapeIn]['property'] : null;
12037
12428
  dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
12038
12429
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
12039
12430
  this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
@@ -12105,7 +12496,8 @@ class Highlight {
12105
12496
  */
12106
12497
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12107
12498
  handleHighlight(targetElement, layerIndex, data, shapeData) {
12108
- if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule) {
12499
+ if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
12500
+ && this.maps.legendSettings.type === 'Layers') {
12109
12501
  this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
12110
12502
  }
12111
12503
  const selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
@@ -12123,7 +12515,7 @@ class Highlight {
12123
12515
  isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
12124
12516
  }
12125
12517
  const border = {
12126
- color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.border.color || this.highlightSettings.fill),
12518
+ color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
12127
12519
  width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
12128
12520
  opacity: this.highlightSettings.border.opacity
12129
12521
  };
@@ -12179,15 +12571,13 @@ class Highlight {
12179
12571
  /**
12180
12572
  * To destroy the highlight.
12181
12573
  *
12182
- * @param {Maps} maps - Specifies the maps instance
12183
12574
  * @returns {void}
12184
12575
  * @private
12185
12576
  */
12186
- destroy(maps) {
12187
- /**
12188
- * Destroy method performed here
12189
- */
12577
+ destroy() {
12578
+ this.highlightSettings = null;
12190
12579
  this.removeEventListener();
12580
+ this.maps = null;
12191
12581
  }
12192
12582
  }
12193
12583
 
@@ -12207,7 +12597,6 @@ class Selection {
12207
12597
  addEventListener() {
12208
12598
  if (!this.maps.isDestroyed) {
12209
12599
  this.maps.on(click, this.mouseClick, this);
12210
- this.maps.on(Browser.touchEndEvent, this.mouseClick, this);
12211
12600
  }
12212
12601
  }
12213
12602
  /**
@@ -12220,7 +12609,6 @@ class Selection {
12220
12609
  return;
12221
12610
  }
12222
12611
  this.maps.off(click, this.mouseClick);
12223
- this.maps.off(Browser.touchEndEvent, this.mouseClick);
12224
12612
  }
12225
12613
  mouseClick(targetElement) {
12226
12614
  if (!isNullOrUndefined(targetElement['type']) && targetElement['type'].indexOf('touch') !== -1 &&
@@ -12238,8 +12626,12 @@ class Selection {
12238
12626
  const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
12239
12627
  if (targetElement.id.indexOf('shapeIndex') > -1) {
12240
12628
  shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
12241
- shapeData = this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
12242
- this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
12629
+ shapeData = !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['features'])
12630
+ && this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
12631
+ this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] :
12632
+ !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['geometries'])
12633
+ && this.maps.layers[layerIndex].shapeData['geometries']['length'] > shapeIndex ?
12634
+ this.maps.layers[layerIndex].shapeData['geometries'][shapeIndex]['properties'] : null;
12243
12635
  dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
12244
12636
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
12245
12637
  this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
@@ -12319,15 +12711,17 @@ class Selection {
12319
12711
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12320
12712
  selectMap(targetElement, shapeData, data) {
12321
12713
  const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
12714
+ const isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
12322
12715
  const selectionsettings = this.selectionsettings;
12323
12716
  const border = {
12324
- color: (targetElement.parentElement.id.indexOf('LineString') === -1) ? this.selectionsettings.border.color : (this.selectionsettings.border.color || this.selectionsettings.fill),
12325
- width: (targetElement.parentElement.id.indexOf('LineString') === -1) ? (this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)) : (this.selectionsettings.border.width / this.maps.scale),
12717
+ color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) : this.selectionsettings.border.color,
12718
+ width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
12719
+ (this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
12326
12720
  opacity: this.selectionsettings.border.opacity
12327
12721
  };
12328
12722
  const eventArgs = {
12329
12723
  opacity: this.selectionsettings.opacity,
12330
- fill: (targetElement.parentElement.id.indexOf('LineString') === -1) ? (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none') : 'transparent',
12724
+ fill: isLineStringShape ? 'transparent' : (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none'),
12331
12725
  border: border,
12332
12726
  name: itemSelection,
12333
12727
  target: targetElement.id,
@@ -12339,7 +12733,8 @@ class Selection {
12339
12733
  this.maps.trigger('itemSelection', eventArgs, (observedArgs) => {
12340
12734
  eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ? this.selectionsettings.opacity : this.selectionsettings.border.opacity;
12341
12735
  if (!eventArgs.cancel) {
12342
- if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle') {
12736
+ if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
12737
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle') {
12343
12738
  removeClass(targetElement);
12344
12739
  this.removedSelectionList(targetElement);
12345
12740
  for (let m = 0; m < this.maps.shapeSelectionItem.length; m++) {
@@ -12358,14 +12753,23 @@ class Selection {
12358
12753
  else {
12359
12754
  const layetElement = getElementByID(this.maps.element.id + '_Layer_Collections');
12360
12755
  if (!this.selectionsettings.enableMultiSelect &&
12361
- layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0) {
12362
- const eleCount = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length;
12756
+ (layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0 ||
12757
+ layetElement.getElementsByClassName('LineselectionMapStyle').length > 0)) {
12758
+ let eleCount = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length;
12363
12759
  let ele;
12364
12760
  for (let k = 0; k < eleCount; k++) {
12365
12761
  ele = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle')[0];
12366
12762
  removeClass(ele);
12367
12763
  this.removedSelectionList(ele);
12368
12764
  }
12765
+ if (layetElement.getElementsByClassName('LineselectionMapStyle').length > 0) {
12766
+ eleCount = layetElement.getElementsByClassName('LineselectionMapStyle').length;
12767
+ for (let k = 0; k < eleCount; k++) {
12768
+ ele = layetElement.getElementsByClassName('LineselectionMapStyle')[0];
12769
+ removeClass(ele);
12770
+ this.removedSelectionList(ele);
12771
+ }
12772
+ }
12369
12773
  if (this.selectionType === 'Shape') {
12370
12774
  this.maps.shapeSelectionItem = [];
12371
12775
  const selectionLength = this.maps.selectedElementId.length;
@@ -12383,13 +12787,24 @@ class Selection {
12383
12787
  ele.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
12384
12788
  }
12385
12789
  }
12386
- if (!getElement(this.selectionType + 'selectionMap')) {
12387
- document.body.appendChild(createStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs));
12790
+ if (!isLineStringShape) {
12791
+ if (!getElement(this.selectionType + 'selectionMap')) {
12792
+ document.body.appendChild(createStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs));
12793
+ }
12794
+ else {
12795
+ customizeStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs);
12796
+ }
12797
+ targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
12388
12798
  }
12389
12799
  else {
12390
- customizeStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs);
12800
+ if (!getElement('LineselectionMap')) {
12801
+ document.body.appendChild(createStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs));
12802
+ }
12803
+ else {
12804
+ customizeStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs);
12805
+ }
12806
+ targetElement.setAttribute('class', 'LineselectionMapStyle');
12391
12807
  }
12392
- targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
12393
12808
  if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
12394
12809
  this.maps.shapeSelectionClass = getElement(this.selectionType + 'selectionMap');
12395
12810
  this.maps.selectedElementId.push(targetElement.getAttribute('id'));
@@ -12458,15 +12873,13 @@ class Selection {
12458
12873
  /**
12459
12874
  * To destroy the selection.
12460
12875
  *
12461
- * @param {Maps} maps - Specifies the maps instance.
12462
12876
  * @returns {void}
12463
12877
  * @private
12464
12878
  */
12465
- destroy(maps) {
12466
- /**
12467
- * Destroy method performed here
12468
- */
12879
+ destroy() {
12880
+ this.selectionsettings = null;
12469
12881
  this.removeEventListener();
12882
+ this.maps = null;
12470
12883
  }
12471
12884
  }
12472
12885
 
@@ -12649,7 +13062,7 @@ class MapsTooltip {
12649
13062
  options: tooltipOption,
12650
13063
  fill: option.fill,
12651
13064
  maps: this.maps,
12652
- element: target, eventArgs: e
13065
+ element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
12653
13066
  };
12654
13067
  this.maps.trigger(tooltipRender, tooltipArgs, (args) => {
12655
13068
  if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
@@ -12667,7 +13080,7 @@ class MapsTooltip {
12667
13080
  header: '',
12668
13081
  data: option['data'],
12669
13082
  template: option['template'],
12670
- content: [currentData.toString()],
13083
+ content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
12671
13084
  shapes: [],
12672
13085
  location: option['location'],
12673
13086
  palette: [markerFill],
@@ -12683,7 +13096,7 @@ class MapsTooltip {
12683
13096
  header: '',
12684
13097
  data: tooltipArgs.options['data'],
12685
13098
  template: tooltipArgs.options['template'],
12686
- content: [currentData.toString()],
13099
+ content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
12687
13100
  shapes: [],
12688
13101
  location: tooltipArgs.options['location'],
12689
13102
  palette: [markerFill],
@@ -12693,6 +13106,10 @@ class MapsTooltip {
12693
13106
  fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor
12694
13107
  });
12695
13108
  }
13109
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13110
+ if (this.maps.isVue || this.maps.isVue3) {
13111
+ this.svgTooltip.controlInstance = this.maps;
13112
+ }
12696
13113
  this.svgTooltip.opacity = this.maps.themeStyle.tooltipFillOpacity || this.svgTooltip.opacity;
12697
13114
  this.svgTooltip.appendTo(tooltipEle);
12698
13115
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -12706,9 +13123,7 @@ class MapsTooltip {
12706
13123
  }
12707
13124
  }
12708
13125
  else {
12709
- this.removeTooltip();
12710
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12711
- this.maps.clearTemplate();
13126
+ this.clearTooltip();
12712
13127
  }
12713
13128
  });
12714
13129
  if (this.svgTooltip) {
@@ -12723,9 +13138,7 @@ class MapsTooltip {
12723
13138
  });
12724
13139
  }
12725
13140
  else {
12726
- this.removeTooltip();
12727
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12728
- this.maps.clearTemplate();
13141
+ this.clearTooltip();
12729
13142
  }
12730
13143
  }
12731
13144
  else {
@@ -12735,9 +13148,7 @@ class MapsTooltip {
12735
13148
  this.maps.notify(click, this);
12736
13149
  }
12737
13150
  else {
12738
- this.removeTooltip();
12739
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12740
- this.maps.clearTemplate();
13151
+ this.clearTooltip();
12741
13152
  }
12742
13153
  }
12743
13154
  }
@@ -12781,8 +13192,18 @@ class MapsTooltip {
12781
13192
  }
12782
13193
  }
12783
13194
  removeTooltip() {
13195
+ let isTooltipRemoved = false;
12784
13196
  if (document.getElementsByClassName('EJ2-maps-Tooltip').length > 0) {
12785
13197
  remove(document.getElementsByClassName('EJ2-maps-Tooltip')[0]);
13198
+ isTooltipRemoved = true;
13199
+ }
13200
+ return isTooltipRemoved;
13201
+ }
13202
+ clearTooltip() {
13203
+ const isTooltipRemoved = this.removeTooltip();
13204
+ if (isTooltipRemoved) {
13205
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13206
+ this.maps.clearTemplate();
12786
13207
  }
12787
13208
  }
12788
13209
  // eslint-disable-next-line valid-jsdoc
@@ -12831,12 +13252,17 @@ class MapsTooltip {
12831
13252
  /**
12832
13253
  * To destroy the tooltip.
12833
13254
  *
12834
- * @param {Maps} maps Specifies the maps instance
12835
13255
  * @returns {void}
12836
13256
  * @private
12837
13257
  */
12838
- destroy(maps) {
13258
+ destroy() {
13259
+ if (!isNullOrUndefined(this.svgTooltip)) {
13260
+ this.svgTooltip.destroy();
13261
+ }
13262
+ this.svgTooltip = null;
12839
13263
  this.removeEventListener();
13264
+ //TODO: Calling the below code throws spec issue.
13265
+ //this.maps = null;
12840
13266
  }
12841
13267
  }
12842
13268
 
@@ -12849,7 +13275,6 @@ class Zoom {
12849
13275
  this.mouseEnter = false;
12850
13276
  this.isTouch = false;
12851
13277
  this.rectZoomingStart = false;
12852
- this.pinchRect = new Rect(0, 0, 0, 0);
12853
13278
  this.browserName = Browser.info.name;
12854
13279
  // eslint-disable-next-line @typescript-eslint/ban-types
12855
13280
  this.isPointer = Browser.isPointer;
@@ -12858,8 +13283,6 @@ class Zoom {
12858
13283
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12859
13284
  this.startTouches = [];
12860
13285
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12861
- this.shapeZoomLocation = [];
12862
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12863
13286
  this.intersect = [];
12864
13287
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12865
13288
  this.mouseDownLatLong = { x: 0, y: 0 };
@@ -12875,7 +13298,6 @@ class Zoom {
12875
13298
  this.selectionColor = this.maps.zoomSettings.selectionColor;
12876
13299
  this.fillColor = this.maps.zoomSettings.color;
12877
13300
  this.addEventListener();
12878
- this.groupElements = [];
12879
13301
  }
12880
13302
  /**
12881
13303
  * To perform zooming for maps
@@ -12898,24 +13320,43 @@ class Zoom {
12898
13320
  const minZoom = map.zoomSettings.minZoom;
12899
13321
  newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
12900
13322
  const prevTilePoint = map.tileTranslatePoint;
12901
- if ((!map.isTileMap) && (type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)) {
13323
+ if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
13324
+ || map.isReset)) {
12902
13325
  const availSize = map.mapAreaRect;
12903
13326
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12904
13327
  const minBounds = map.baseMapRectBounds['min'];
12905
13328
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12906
13329
  const maxBounds = map.baseMapRectBounds['max'];
12907
- const mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
12908
- const mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
12909
- const point = map.translatePoint;
12910
- let translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
12911
- let translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
12912
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
12913
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
12914
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
12915
- map.translatePoint = new Point(translatePointX, translatePointY);
13330
+ let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
13331
+ let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
13332
+ let translatePointX;
13333
+ let translatePointY;
13334
+ if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
13335
+ if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
13336
+ mapTotalWidth = availSize.width / 2;
13337
+ mapTotalHeight = availSize.height;
13338
+ }
13339
+ newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
13340
+ newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
13341
+ map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
13342
+ }
13343
+ else {
13344
+ const point = map.translatePoint;
13345
+ translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
13346
+ translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
13347
+ const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
13348
+ translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
13349
+ translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
13350
+ map.translatePoint = new Point(translatePointX, translatePointY);
13351
+ }
12916
13352
  map.scale = newZoomFactor;
12917
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
12918
- this.applyTransform();
13353
+ if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
13354
+ map.translatePoint = map.previousPoint;
13355
+ map.scale = map.mapScaleValue = map.previousScale;
13356
+ }
13357
+ else {
13358
+ this.applyTransform(map);
13359
+ }
12919
13360
  }
12920
13361
  else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
12921
13362
  this.getTileTranslatePosition(prevLevel, newZoomFactor, position, type);
@@ -12932,34 +13373,49 @@ class Zoom {
12932
13373
  }
12933
13374
  map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
12934
13375
  map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
12935
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
12936
- if (document.querySelector('.GroupElement')) {
12937
- document.querySelector('.GroupElement').style.display = 'none';
13376
+ if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
13377
+ map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
13378
+ map.scale = map.previousScale;
13379
+ map.tileZoomLevel = prevLevel;
13380
+ map.zoomSettings.zoomFactor = map.previousScale;
12938
13381
  }
12939
- if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
12940
- document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
12941
- }
12942
- this.markerLineAnimation(map);
12943
- map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
12944
- const element1 = document.getElementById(this.maps.element.id + '_tiles');
12945
- const animationDuration = this.maps.layersCollection[0].animationDuration;
12946
- setTimeout(() => {
12947
- // if (type === 'ZoomOut') {
12948
- // element1.removeChild(element1.children[element1.childElementCount - 1]);
12949
- // if (element1.childElementCount) {
12950
- // element1.removeChild(element1.children[element1.childElementCount - 1]);
12951
- // } else {
12952
- // element1 = element1;
12953
- // }
12954
- // }
12955
- this.applyTransform();
13382
+ else {
13383
+ if (document.querySelector('.GroupElement')) {
13384
+ document.querySelector('.GroupElement').style.display = 'none';
13385
+ }
12956
13386
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
12957
- document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
13387
+ document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
12958
13388
  }
12959
- }, animationDuration);
13389
+ this.markerLineAnimation(map);
13390
+ map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
13391
+ const element1 = document.getElementById(this.maps.element.id + '_tiles');
13392
+ const animationDuration = this.maps.layersCollection[0].animationDuration;
13393
+ setTimeout(() => {
13394
+ // if (type === 'ZoomOut') {
13395
+ // element1.removeChild(element1.children[element1.childElementCount - 1]);
13396
+ // if (element1.childElementCount) {
13397
+ // element1.removeChild(element1.children[element1.childElementCount - 1]);
13398
+ // } else {
13399
+ // element1 = element1;
13400
+ // }
13401
+ // }
13402
+ this.applyTransform(this.maps);
13403
+ if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
13404
+ document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
13405
+ }
13406
+ }, animationDuration);
13407
+ }
12960
13408
  }
12961
13409
  this.maps.zoomNotApplied = false;
12962
13410
  }
13411
+ calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
13412
+ mapTotalWidth *= newZoomFactor;
13413
+ mapTotalHeight *= newZoomFactor;
13414
+ let widthDiff = minBounds['x'] !== 0 && map.translateType === 'layers' ? map.availableSize.width - availSize.width : 0;
13415
+ var translatePointX = availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2))) - widthDiff;
13416
+ var translatePointY = availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)));
13417
+ return new Point(translatePointX, translatePointY);
13418
+ }
12963
13419
  triggerZoomEvent(prevTilePoint, prevLevel, type) {
12964
13420
  const map = this.maps;
12965
13421
  let zoomArgs;
@@ -12978,6 +13434,7 @@ class Zoom {
12978
13434
  };
12979
13435
  }
12980
13436
  map.trigger('zoom', zoomArgs);
13437
+ return zoomArgs.cancel;
12981
13438
  }
12982
13439
  getTileTranslatePosition(prevLevel, currentLevel, position, type) {
12983
13440
  const map = this.maps;
@@ -13003,6 +13460,7 @@ class Zoom {
13003
13460
  const zoomRect = this.zoomingRect;
13004
13461
  const maxZoom = map.zoomSettings.maxZoom;
13005
13462
  const minZoom = map.zoomSettings.minZoom;
13463
+ let isZoomCancelled;
13006
13464
  if (zoomRect.height > 0 && zoomRect.width > 0) {
13007
13465
  const x = this.zoomingRect.x + (this.zoomingRect.width / 2);
13008
13466
  const y = this.zoomingRect.y + (this.zoomingRect.height / 2);
@@ -13015,7 +13473,11 @@ class Zoom {
13015
13473
  const translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomCalculationFactor)) / (size.height / y));
13016
13474
  map.translatePoint = new Point(translatePointX, translatePointY);
13017
13475
  map.scale = zoomCalculationFactor;
13018
- this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13476
+ isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13477
+ if (isZoomCancelled) {
13478
+ map.translatePoint = map.previousPoint;
13479
+ map.scale = map.previousScale;
13480
+ }
13019
13481
  }
13020
13482
  else {
13021
13483
  zoomCalculationFactor = prevLevel + (Math.round(prevLevel + (((size.width / zoomRect.width) + (size.height / zoomRect.height)) / 2)));
@@ -13028,13 +13490,21 @@ class Zoom {
13028
13490
  map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, zoomCalculationFactor))) /
13029
13491
  (Math.pow(2, zoomCalculationFactor));
13030
13492
  map.scale = (Math.pow(2, zoomCalculationFactor));
13031
- this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13032
- map.mapLayerPanel.generateTiles(zoomCalculationFactor, map.tileTranslatePoint);
13493
+ isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13494
+ if (isZoomCancelled) {
13495
+ map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
13496
+ map.scale = map.tileZoomLevel = map.zoomSettings.zoomFactor = prevLevel;
13497
+ }
13498
+ else {
13499
+ map.mapLayerPanel.generateTiles(zoomCalculationFactor, map.tileTranslatePoint);
13500
+ }
13501
+ }
13502
+ if (!isZoomCancelled) {
13503
+ map.mapScaleValue = zoomCalculationFactor;
13504
+ this.applyTransform(map, true);
13505
+ this.maps.zoomNotApplied = false;
13506
+ this.zoomingRect = null;
13033
13507
  }
13034
- map.mapScaleValue = zoomCalculationFactor;
13035
- this.applyTransform(true);
13036
- this.maps.zoomNotApplied = false;
13037
- this.zoomingRect = null;
13038
13508
  }
13039
13509
  }
13040
13510
  setInteraction(newInteraction) {
@@ -13062,23 +13532,41 @@ class Zoom {
13062
13532
  this.lastScale = scale;
13063
13533
  this.pinchFactor *= newScale;
13064
13534
  this.pinchFactor = Math.min(this.maps.zoomSettings.maxZoom, Math.max(this.pinchFactor, this.maps.zoomSettings.minZoom));
13065
- const zoomCalculationFactor = this.pinchFactor;
13535
+ let zoomCalculationFactor = this.pinchFactor;
13536
+ let isZoomCancelled;
13066
13537
  if (!map.isTileMap) {
13067
13538
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13068
13539
  const minBounds = map.baseMapRectBounds['min'];
13069
13540
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13070
13541
  const maxBounds = map.baseMapRectBounds['max'];
13071
- const mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
13072
- const mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
13542
+ let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
13543
+ let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
13073
13544
  const translatePoint = map.translatePoint;
13074
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
13075
- let translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
13076
- let translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
13077
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
13078
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
13079
- map.translatePoint = new Point(translatePointX, translatePointY);
13545
+ let translatePointX;
13546
+ let translatePointY;
13547
+ if (zoomCalculationFactor < 1.2 && map.projectionType !== 'Eckert5') {
13548
+ if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
13549
+ mapTotalWidth = availSize.width / 2;
13550
+ mapTotalHeight = availSize.height;
13551
+ }
13552
+ zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
13553
+ zoomCalculationFactor = zoomCalculationFactor > 1.05 ? 1 : zoomCalculationFactor;
13554
+ map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
13555
+ }
13556
+ else {
13557
+ const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
13558
+ translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
13559
+ translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
13560
+ translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
13561
+ translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
13562
+ map.translatePoint = new Point(translatePointX, translatePointY);
13563
+ }
13080
13564
  map.scale = zoomCalculationFactor;
13081
- this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13565
+ isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13566
+ if (isZoomCancelled) {
13567
+ map.translatePoint = map.previousPoint;
13568
+ map.scale = map.previousScale;
13569
+ }
13082
13570
  }
13083
13571
  else {
13084
13572
  const newTileFactor = zoomCalculationFactor;
@@ -13089,10 +13577,20 @@ class Zoom {
13089
13577
  map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, newTileFactor))) /
13090
13578
  (Math.pow(2, newTileFactor));
13091
13579
  map.scale = (Math.pow(2, newTileFactor));
13092
- this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13093
- map.mapLayerPanel.generateTiles(newTileFactor, map.tileTranslatePoint);
13580
+ isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13581
+ if (isZoomCancelled) {
13582
+ map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
13583
+ map.scale = map.previousScale;
13584
+ map.tileZoomLevel = prevLevel;
13585
+ map.zoomSettings.zoomFactor = map.previousScale;
13586
+ }
13587
+ else {
13588
+ map.mapLayerPanel.generateTiles(newTileFactor, map.tileTranslatePoint);
13589
+ }
13590
+ }
13591
+ if (!isZoomCancelled) {
13592
+ this.applyTransform(map);
13094
13593
  }
13095
- this.applyTransform();
13096
13594
  }
13097
13595
  drawZoomRectangle() {
13098
13596
  const map = this.maps;
@@ -13138,17 +13636,17 @@ class Zoom {
13138
13636
  zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
13139
13637
  }
13140
13638
  }
13141
- applyTransform(animate$$1) {
13639
+ applyTransform(maps, animate$$1) {
13142
13640
  let layerIndex;
13143
13641
  this.templateCount = 0;
13144
13642
  let markerStyle;
13145
- const scale = this.maps.scale;
13146
- const x = this.maps.translatePoint.x;
13147
- const y = this.maps.translatePoint.y;
13643
+ const scale = maps.scale;
13644
+ const x = maps.translatePoint.x;
13645
+ const y = maps.translatePoint.y;
13148
13646
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13149
- this.maps.zoomShapeCollection = [];
13150
- if (document.getElementById(this.maps.element.id + '_mapsTooltip')) {
13151
- removeElement(this.maps.element.id + '_mapsTooltip');
13647
+ maps.zoomShapeCollection = [];
13648
+ if (document.getElementById(maps.element.id + '_mapsTooltip')) {
13649
+ removeElement(maps.element.id + '_mapsTooltip');
13152
13650
  }
13153
13651
  if (this.layerCollectionEle) {
13154
13652
  for (let i = 0; i < this.layerCollectionEle.childElementCount; i++) {
@@ -13156,30 +13654,29 @@ class Zoom {
13156
13654
  if (layerElement.tagName === 'g') {
13157
13655
  this.templateCount++;
13158
13656
  this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
13159
- this.currentLayer = this.maps.layersCollection[this.index];
13160
- const factor = this.maps.mapLayerPanel.calculateFactor(this.currentLayer);
13657
+ this.currentLayer = maps.layersCollection[this.index];
13658
+ const factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
13161
13659
  for (let j = 0; j < layerElement.childElementCount; j++) {
13162
13660
  let currentEle = layerElement.childNodes[j];
13163
13661
  if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
13164
13662
  && (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
13165
- if (this.maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
13663
+ if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
13166
13664
  currentEle.remove();
13167
13665
  if (layerElement.children.length > 0 && layerElement.children[0]) {
13168
- layerElement.insertBefore(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index), layerElement.children[0]);
13666
+ layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
13169
13667
  }
13170
13668
  else {
13171
- 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));
13172
13670
  }
13173
13671
  }
13174
- else {
13175
- changeBorderWidth(currentEle, this.index, scale, this.maps);
13176
- this.maps.zoomTranslatePoint = this.maps.translatePoint;
13672
+ else if (currentEle.id.indexOf('Legend') == -1) {
13673
+ changeBorderWidth(currentEle, this.index, scale, maps);
13674
+ maps.zoomTranslatePoint = maps.translatePoint;
13177
13675
  this.animateTransform(currentEle, animate$$1, x, y, scale);
13178
- this.shapeZoomLocation = currentEle.childNodes;
13179
13676
  }
13180
13677
  }
13181
13678
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
13182
- if (!this.isPanning) {
13679
+ if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
13183
13680
  this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
13184
13681
  }
13185
13682
  currentEle = layerElement.childNodes[j];
@@ -13198,11 +13695,11 @@ class Zoom {
13198
13695
  markerSelectionValues['latitude'] ||
13199
13696
  this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x]['longitude'] ===
13200
13697
  markerSelectionValues['longitude']) {
13201
- 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]);
13202
13699
  }
13203
13700
  }
13204
- if ((this.currentLayer.animationDuration > 0 || (this.maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
13205
- 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) {
13206
13703
  const groupElement = document.querySelector('.GroupElement');
13207
13704
  if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
13208
13705
  groupElement.style.display = 'none';
@@ -13214,29 +13711,29 @@ class Zoom {
13214
13711
  }
13215
13712
  }
13216
13713
  }
13217
- if (this.isPanning && this.maps.markerModule.sameMarkerData.length > 0) {
13218
- 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);
13219
13716
  }
13220
- else if (this.maps.markerModule.sameMarkerData.length > 0) {
13221
- this.maps.markerModule.sameMarkerData = [];
13222
- if (document.getElementById(this.maps.element.id + '_mapsTooltip')) {
13223
- 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');
13224
13721
  }
13225
13722
  }
13226
- 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_')
13227
13724
  && !this.isPanning) {
13228
- const mapsTooltip = this.maps.mapsTooltipModule;
13725
+ const mapsTooltip = maps.mapsTooltipModule;
13229
13726
  const tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
13230
13727
  if (!isNullOrUndefined(tooltipElement)) {
13231
13728
  if (tooltipElement['style']['visibility'] === 'hidden') {
13232
- removeElement(this.maps.element.id + '_mapsTooltip');
13729
+ removeElement(maps.element.id + '_mapsTooltip');
13233
13730
  }
13234
13731
  else {
13235
13732
  let x = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[1]);
13236
13733
  let y = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[2]);
13237
- if (this.maps.isTileMap) {
13238
- x += +getElement(this.maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
13239
- 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];
13240
13737
  }
13241
13738
  mapsTooltip.svgTooltip.location.x = x;
13242
13739
  mapsTooltip.svgTooltip.location.y = y;
@@ -13254,9 +13751,9 @@ class Zoom {
13254
13751
  layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
13255
13752
  const bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
13256
13753
  const dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
13257
- for (let l = 0; l < this.maps.bubbleModule.bubbleCollection.length; l++) {
13754
+ for (let l = 0; l < maps.bubbleModule.bubbleCollection.length; l++) {
13258
13755
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13259
- const bubbleCollection = this.maps.bubbleModule.bubbleCollection[l];
13756
+ const bubbleCollection = maps.bubbleModule.bubbleCollection[l];
13260
13757
  if (bubbleCollection['LayerIndex'] === layerIndex && bubbleCollection['BubbleIndex'] === bubleIndex &&
13261
13758
  bubbleCollection['DataIndex'] === dataIndex) {
13262
13759
  const centerX = bubbleCollection['center']['x'];
@@ -13275,24 +13772,25 @@ class Zoom {
13275
13772
  }
13276
13773
  }
13277
13774
  }
13278
- else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1) {
13775
+ else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
13279
13776
  this.intersect = [];
13280
- this.maps.zoomLabelPositions = [];
13281
- this.maps.zoomLabelPositions = this.maps.dataLabelModule.dataLabelCollections;
13777
+ maps.zoomLabelPositions = [];
13778
+ maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
13779
+ let labelAnimate = !maps.isTileMap && animate$$1;
13282
13780
  for (let k = 0; k < currentEle.childElementCount; k++) {
13283
13781
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
13284
13782
  const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
13285
- this.zoomshapewidth = this.shapeZoomLocation[labelIndex].getBoundingClientRect();
13286
- this.maps.zoomShapeCollection.push(this.zoomshapewidth);
13287
- this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', animate$$1);
13288
- const dataLabel = this.maps.layers[this.index].dataLabelSettings;
13783
+ this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
13784
+ maps.zoomShapeCollection.push(this.zoomshapewidth);
13785
+ this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
13786
+ const dataLabel = maps.layers[this.index].dataLabelSettings;
13289
13787
  const border = dataLabel.border;
13290
13788
  if (k > 0 && border['width'] > 1) {
13291
- if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1) {
13292
- const labelX = ((this.maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
13293
- 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);
13294
13792
  const zoomtext = currentEle.childNodes[k]['innerHTML'];
13295
- const style = this.maps.layers[this.index].dataLabelSettings.textStyle;
13793
+ const style = maps.layers[this.index].dataLabelSettings.textStyle;
13296
13794
  const zoomtextSize = measureText(zoomtext, style);
13297
13795
  const padding = 5;
13298
13796
  const rectElement = currentEle.childNodes[k - 1];
@@ -13307,11 +13805,11 @@ class Zoom {
13307
13805
  }
13308
13806
  }
13309
13807
  }
13310
- this.maps.arrangeTemplate();
13808
+ maps.arrangeTemplate();
13311
13809
  }
13312
13810
  if (!isNullOrUndefined(this.currentLayer)) {
13313
- if (!animate$$1 || this.currentLayer.animationDuration === 0 || this.maps.isTileMap) {
13314
- this.processTemplate(x, y, scale, this.maps);
13811
+ if (!animate$$1 || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
13812
+ this.processTemplate(x, y, scale, maps);
13315
13813
  }
13316
13814
  }
13317
13815
  }
@@ -13369,10 +13867,10 @@ class Zoom {
13369
13867
  }
13370
13868
  const lati = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
13371
13869
  Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
13372
- parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : 0;
13870
+ parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : null;
13373
13871
  const long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
13374
13872
  Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
13375
- parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : 0;
13873
+ parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : null;
13376
13874
  const offset = markerSettings.offset;
13377
13875
  if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
13378
13876
  const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
@@ -13392,10 +13890,10 @@ class Zoom {
13392
13890
  nullCount += (!isNaN(lati) && !isNaN(long)) ? 0 : 1;
13393
13891
  markerTemplateCounts += (eventArgs.cancel) ? 1 : 0;
13394
13892
  markerCounts += (eventArgs.cancel) ? 1 : 0;
13395
- this.maps.markerNullCount = (!isNullOrUndefined(lati) || !isNullOrUndefined(long))
13396
- ? this.maps.markerNullCount : this.maps.markerNullCount + 1;
13893
+ this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
13894
+ ? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
13397
13895
  const markerDataLength = markerDatas.length - this.maps.markerNullCount;
13398
- if (markerSVGObject.childElementCount === (markerDatas.length - markerTemplateCounts - nullCount) && (type !== 'Template')) {
13896
+ if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
13399
13897
  layerElement.appendChild(markerSVGObject);
13400
13898
  if (currentLayers.markerClusterSettings.allowClustering) {
13401
13899
  this.maps.svgObject.appendChild(markerSVGObject);
@@ -13403,7 +13901,7 @@ class Zoom {
13403
13901
  clusterTemplate(currentLayers, markerSVGObject, this.maps, layerIndex, markerSVGObject, layerElement, true, true);
13404
13902
  }
13405
13903
  }
13406
- if (markerTemplateElements.childElementCount === (markerDatas.length - markerCounts - nullCount) && getElementByID(this.maps.element.id + '_Secondary_Element')) {
13904
+ if (markerTemplateElements.childElementCount === (markerDataLength - markerCounts - nullCount) && getElementByID(this.maps.element.id + '_Secondary_Element')) {
13407
13905
  getElementByID(this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
13408
13906
  if (scale >= 1) {
13409
13907
  if (currentLayers.markerClusterSettings.allowClustering) {
@@ -13498,7 +13996,7 @@ class Zoom {
13498
13996
  }
13499
13997
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
13500
13998
  if (scale > 1) {
13501
- text = (this.zoomshapewidth['width'] >= zoomtextSize['width']) ? zoomtext : '';
13999
+ text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
13502
14000
  element.innerHTML = text;
13503
14001
  }
13504
14002
  else {
@@ -13508,7 +14006,7 @@ class Zoom {
13508
14006
  }
13509
14007
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
13510
14008
  if (scale > 1) {
13511
- zoomtrimLabel = textTrim(this.zoomshapewidth['width'], zoomtext, style);
14009
+ zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
13512
14010
  text = zoomtrimLabel;
13513
14011
  element.innerHTML = text;
13514
14012
  }
@@ -13546,7 +14044,7 @@ class Zoom {
13546
14044
  || textLocations['heightTop'] > this.intersect[j]['heightBottom']) {
13547
14045
  trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
13548
14046
  if (scale > 1) {
13549
- trimmedLable = textTrim(this.zoomshapewidth['width'], trimmedLable, style);
14047
+ trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
13550
14048
  }
13551
14049
  element.innerHTML = trimmedLable;
13552
14050
  }
@@ -13572,11 +14070,11 @@ class Zoom {
13572
14070
  }
13573
14071
  this.intersect.push(textLocations);
13574
14072
  if (isNullOrUndefined(trimmedLable)) {
13575
- trimmedLable = textTrim(this.zoomshapewidth['width'], zoomtext, style);
14073
+ trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
13576
14074
  element.innerHTML = trimmedLable;
13577
14075
  }
13578
14076
  }
13579
- else {
14077
+ if (animate$$1 || duration > 0) {
13580
14078
  smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
13581
14079
  }
13582
14080
  }
@@ -13697,7 +14195,7 @@ class Zoom {
13697
14195
  const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
13698
14196
  const elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
13699
14197
  const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
13700
- ((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
14198
+ ((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
13701
14199
  const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
13702
14200
  ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
13703
14201
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13711,15 +14209,15 @@ class Zoom {
13711
14209
  if (!panArgs.cancel) {
13712
14210
  if (panningXDirection && panningYDirection) {
13713
14211
  map.translatePoint = new Point(x, y);
13714
- this.applyTransform();
14212
+ this.applyTransform(map);
13715
14213
  }
13716
14214
  else if (panningXDirection) {
13717
14215
  map.translatePoint = new Point(x, map.translatePoint.y);
13718
- this.applyTransform();
14216
+ this.applyTransform(map);
13719
14217
  }
13720
14218
  else if (panningYDirection) {
13721
14219
  map.translatePoint = new Point(map.translatePoint.x, y);
13722
- this.applyTransform();
14220
+ this.applyTransform(map);
13723
14221
  }
13724
14222
  }
13725
14223
  this.maps.zoomNotApplied = false;
@@ -13747,7 +14245,7 @@ class Zoom {
13747
14245
  };
13748
14246
  map.trigger(pan, panArgs);
13749
14247
  map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
13750
- this.applyTransform();
14248
+ this.applyTransform(map);
13751
14249
  }
13752
14250
  map.zoomTranslatePoint = map.translatePoint;
13753
14251
  this.mouseDownPoints = this.mouseMovePoints;
@@ -13759,7 +14257,7 @@ class Zoom {
13759
14257
  (this.distanceX / this.maps.scale)) : this.maps.translatePoint.x;
13760
14258
  this.maps.translatePoint.y = !isNullOrUndefined(this.distanceY) ? this.maps.translatePoint.y -
13761
14259
  (this.distanceY / this.maps.scale) : this.maps.translatePoint.y;
13762
- this.applyTransform(false);
14260
+ this.applyTransform(this.maps, false);
13763
14261
  }
13764
14262
  toolBarZooming(zoomFactor, type) {
13765
14263
  const map = this.maps;
@@ -13786,20 +14284,38 @@ class Zoom {
13786
14284
  const min = map.baseMapRectBounds['min'];
13787
14285
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13788
14286
  const max = map.baseMapRectBounds['max'];
13789
- const mapWidth = Math.abs(max['x'] - min['x']);
13790
- const mapHeight = Math.abs(min['y'] - max['y']);
13791
- let translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
13792
- let translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
13793
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
13794
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
13795
- : translatePointX;
13796
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
13797
- : translatePointY;
13798
- map.translatePoint = new Point(translatePointX, translatePointY);
14287
+ let mapWidth = Math.abs(max['x'] - min['x']);
14288
+ let mapHeight = Math.abs(min['y'] - max['y']);
14289
+ let translatePointX;
14290
+ let translatePointY;
14291
+ if (zoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
14292
+ if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
14293
+ mapWidth = size.width / 2;
14294
+ mapHeight = size.height;
14295
+ }
14296
+ zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
14297
+ zoomFactor = zoomFactor > 1.05 ? 1 : zoomFactor;
14298
+ map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
14299
+ }
14300
+ else {
14301
+ translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
14302
+ translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
14303
+ const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
14304
+ translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
14305
+ : translatePointX;
14306
+ translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
14307
+ : translatePointY;
14308
+ map.translatePoint = new Point(translatePointX, translatePointY);
14309
+ }
13799
14310
  map.zoomTranslatePoint = map.translatePoint;
13800
14311
  map.scale = zoomFactor;
13801
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
13802
- this.applyTransform(true);
14312
+ if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
14313
+ map.translatePoint = map.zoomTranslatePoint = map.previousPoint;
14314
+ map.scale = map.previousScale;
14315
+ }
14316
+ else {
14317
+ this.applyTransform(map, true);
14318
+ }
13803
14319
  }
13804
14320
  else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
13805
14321
  let tileZoomFactor = prevLevel < minZoom && !map.isReset ? minZoom : zoomFactor;
@@ -13816,34 +14332,44 @@ class Zoom {
13816
14332
  map.tileTranslatePoint.y = map.initialTileTranslate.y;
13817
14333
  tileZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
13818
14334
  }
13819
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
13820
- map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
13821
- map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
13822
- if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
13823
- document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
13824
- }
13825
- if (document.querySelector('.GroupElement')) {
13826
- document.querySelector('.GroupElement').style.display = 'none';
14335
+ if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
14336
+ map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
14337
+ map.scale = map.previousScale;
14338
+ map.tileZoomLevel = prevLevel;
14339
+ map.zoomSettings.zoomFactor = map.previousScale;
13827
14340
  }
13828
- this.markerLineAnimation(map);
13829
- map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
13830
- const element1 = document.getElementById(this.maps.element.id + '_tiles');
13831
- const animationDuration = this.maps.layersCollection[0].animationDuration;
13832
- setTimeout(() => {
13833
- this.applyTransform(true);
14341
+ else {
14342
+ map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
14343
+ map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
13834
14344
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
13835
- document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
14345
+ document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
13836
14346
  }
13837
- }, animationDuration);
14347
+ if (document.querySelector('.GroupElement')) {
14348
+ document.querySelector('.GroupElement').style.display = 'none';
14349
+ }
14350
+ this.markerLineAnimation(map);
14351
+ map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
14352
+ const element1 = document.getElementById(this.maps.element.id + '_tiles');
14353
+ const animationDuration = this.maps.layersCollection[0].animationDuration;
14354
+ setTimeout(() => {
14355
+ this.applyTransform(this.maps, true);
14356
+ if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
14357
+ document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
14358
+ }
14359
+ this.maps.isAddLayer = false;
14360
+ }, animationDuration);
14361
+ }
13838
14362
  }
13839
14363
  this.maps.zoomNotApplied = false;
13840
14364
  }
13841
14365
  }
13842
14366
  createZoomingToolbars() {
13843
14367
  const map = this.maps;
14368
+ let zoomInElements;
14369
+ let zoomOutElements;
13844
14370
  this.toolBarGroup = map.renderer.createGroup({
13845
14371
  id: map.element.id + '_Zooming_KitCollection',
13846
- opacity: map.theme.toLowerCase() === 'fluentuidark' ? 0.6 : 0.3
14372
+ opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
13847
14373
  });
13848
14374
  const kitHeight = 16;
13849
14375
  const kitWidth = 16;
@@ -13858,7 +14384,6 @@ class Zoom {
13858
14384
  const toolBarLength = map.zoomSettings.toolbars.length;
13859
14385
  const toolWidth = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (toolBarLength * kitWidth) + (toolBarLength * padding) : (kitWidth * 2);
13860
14386
  const toolHeight = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (kitHeight * 2) : (toolBarLength * kitHeight) + (toolBarLength * padding);
13861
- 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)));
13862
14387
  const defElement = map.renderer.createDefs();
13863
14388
  defElement.innerHTML = shadowElement;
13864
14389
  this.toolBarGroup.appendChild(defElement);
@@ -13907,13 +14432,13 @@ class Zoom {
13907
14432
  case 'zoomin':
13908
14433
  direction = 'M 8, 0 L 8, 16 M 0, 8 L 16, 8';
13909
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)));
13910
- this.zoomInElements = this.currentToolbarEle;
14435
+ zoomInElements = this.currentToolbarEle;
13911
14436
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
13912
14437
  break;
13913
14438
  case 'zoomout':
13914
14439
  direction = 'M 0, 8 L 16, 8';
13915
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)));
13916
- this.zoomOutElements = this.currentToolbarEle;
14441
+ zoomOutElements = this.currentToolbarEle;
13917
14442
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
13918
14443
  break;
13919
14444
  case 'pan': {
@@ -14098,7 +14623,12 @@ class Zoom {
14098
14623
  x = (size.width / 2) - (toolBarSize.width / 2);
14099
14624
  break;
14100
14625
  case 'Far':
14101
- x = (size.width - toolBarSize.width) - padding;
14626
+ if (!isNullOrUndefined(map.legendModule) && map.legendSettings.position === 'Left') {
14627
+ x = size.width + size.x - toolBarSize.width - padding;
14628
+ }
14629
+ else {
14630
+ x = (size.width - toolBarSize.width) - padding;
14631
+ }
14102
14632
  break;
14103
14633
  }
14104
14634
  let extraPosition = map.getExtraPosition();
@@ -14154,6 +14684,7 @@ class Zoom {
14154
14684
  }
14155
14685
  else {
14156
14686
  map.mapScaleValue = value - delta;
14687
+ map.isReset = (map.mapScaleValue < 1) ? true : false;
14157
14688
  map.staticMapZoom = map.tileZoomLevel;
14158
14689
  if (map.mapScaleValue === 1) {
14159
14690
  map.markerCenterLatitude = null;
@@ -14247,14 +14778,14 @@ class Zoom {
14247
14778
  if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
14248
14779
  if (!this.maps.zoomSettings.enablePanning) {
14249
14780
  if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
14250
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
14251
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
14781
+ getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
14782
+ getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
14252
14783
  }
14253
14784
  }
14254
14785
  }
14255
14786
  }
14256
14787
  else {
14257
- getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
14788
+ getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
14258
14789
  if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
14259
14790
  getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
14260
14791
  getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
@@ -14404,15 +14935,30 @@ class Zoom {
14404
14935
  /**
14405
14936
  * To destroy the zoom.
14406
14937
  *
14407
- * @param {Maps} maps - Specifies the instance of the maps.
14408
14938
  * @returns {void}
14409
14939
  * @private
14410
14940
  */
14411
- 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;
14412
14958
  this.removeEventListener();
14413
- /**
14414
- * Destroy method performed here
14415
- */
14959
+ //TODO: Calling the below code throws spec issue.
14960
+ //this.maps = null;
14961
+ this.currentLayer = null;
14416
14962
  }
14417
14963
  }
14418
14964
 
@@ -14428,9 +14974,7 @@ class Print {
14428
14974
  *
14429
14975
  * @param {Maps} control - Specifies the instance of the map
14430
14976
  */
14431
- constructor(control) {
14432
- this.control = control;
14433
- }
14977
+ constructor(control) { }
14434
14978
  /**
14435
14979
  * To print the Maps
14436
14980
  *
@@ -14438,16 +14982,16 @@ class Print {
14438
14982
  * @returns {void}
14439
14983
  * @private
14440
14984
  */
14441
- print(elements) {
14442
- this.printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
14443
- this.printWindow.moveTo(0, 0);
14444
- 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);
14445
14989
  const argsData = {
14446
- cancel: false, htmlContent: this.getHTMLContent(elements), name: beforePrint
14990
+ cancel: false, htmlContent: this.getHTMLContent(maps, elements), name: beforePrint
14447
14991
  };
14448
- this.control.trigger('beforePrint', argsData, (beforePrintArgs) => {
14992
+ maps.trigger('beforePrint', argsData, (beforePrintArgs) => {
14449
14993
  if (!argsData.cancel) {
14450
- print(argsData.htmlContent, this.printWindow);
14994
+ print(argsData.htmlContent, printWindow);
14451
14995
  }
14452
14996
  });
14453
14997
  }
@@ -14458,8 +15002,29 @@ class Print {
14458
15002
  * @returns {Element} - Returns the div element
14459
15003
  * @private
14460
15004
  */
14461
- getHTMLContent(elements) {
14462
- const div = createElement('div');
15005
+ getHTMLContent(maps, elements) {
15006
+ let div = createElement('div');
15007
+ let divElement = maps.element.cloneNode(true);
15008
+ if (maps.isTileMap) {
15009
+ for (let i = 0; i < divElement.childElementCount; i++) {
15010
+ if (divElement.children[i].id === maps.element.id + '_tile_parent') {
15011
+ divElement.children[i].style.removeProperty('height');
15012
+ divElement.children[i].style.removeProperty('width');
15013
+ divElement.children[i].style.removeProperty('top');
15014
+ divElement.children[i].style.removeProperty('left');
15015
+ divElement.children[i].style.removeProperty('right');
15016
+ divElement.children[i].style.removeProperty('overflow');
15017
+ const svgElement = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
15018
+ divElement.children[i].children[0].style.overflow = 'hidden';
15019
+ divElement.children[i].children[0].style.position = 'absolute';
15020
+ divElement.children[i].children[0].style.height = svgElement.style.height;
15021
+ divElement.children[i].children[0].style.width = svgElement.style.width;
15022
+ divElement.children[i].children[0].style.left = svgElement.style.left;
15023
+ divElement.children[i].children[0].style.top = svgElement.style.top;
15024
+ break;
15025
+ }
15026
+ }
15027
+ }
14463
15028
  if (elements) {
14464
15029
  if (elements instanceof Array) {
14465
15030
  Array.prototype.forEach.call(elements, (value) => {
@@ -14474,7 +15039,7 @@ class Print {
14474
15039
  }
14475
15040
  }
14476
15041
  else {
14477
- div.appendChild(this.control.element.cloneNode(true));
15042
+ div.appendChild(divElement);
14478
15043
  }
14479
15044
  return div;
14480
15045
  }
@@ -14489,15 +15054,10 @@ class Print {
14489
15054
  /**
14490
15055
  * To destroy the print.
14491
15056
  *
14492
- * @param {Maps} maps - Specifies the instance of the maps
14493
15057
  * @returns {void}
14494
15058
  * @private
14495
15059
  */
14496
- destroy(maps) {
14497
- /**
14498
- * Destroy method performed here
14499
- */
14500
- }
15060
+ destroy() { }
14501
15061
  }
14502
15062
 
14503
15063
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -14513,7 +15073,6 @@ class ImageExport {
14513
15073
  * @param {Maps} control - Specifies the instance of the map
14514
15074
  */
14515
15075
  constructor(control) {
14516
- this.control = control;
14517
15076
  }
14518
15077
  /**
14519
15078
  * To export the file as image/svg format
@@ -14524,31 +15083,33 @@ class ImageExport {
14524
15083
  * @returns {Promise<string>} - Returns the promise string.
14525
15084
  * @private
14526
15085
  */
14527
- export(type, fileName, allowDownload) {
15086
+ export(maps, type, fileName, allowDownload) {
14528
15087
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14529
15088
  const promise = new Promise((resolve, reject) => {
14530
15089
  const imageCanvasElement = createElement('canvas', {
14531
15090
  id: 'ej2-canvas',
14532
15091
  attrs: {
14533
- 'width': this.control.availableSize.width.toString(),
14534
- 'height': this.control.availableSize.height.toString()
15092
+ 'width': maps.availableSize.width.toString(),
15093
+ 'height': maps.availableSize.height.toString()
14535
15094
  }
14536
15095
  });
14537
15096
  const isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
14538
- const toolbarEle = document.getElementById(this.control.element.id + '_ToolBar');
14539
- 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');
14540
15099
  let svgDataElement;
14541
- if (!this.control.isTileMap) {
15100
+ let tileSvg;
15101
+ let svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
15102
+ if (!maps.isTileMap) {
14542
15103
  svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
14543
- this.control.svgObject.outerHTML + '</svg>';
15104
+ maps.svgObject.outerHTML + '</svg>';
14544
15105
  }
14545
15106
  else {
14546
- const tileSvg = document.getElementById(this.control.element.id + '_Tile_SVG');
15107
+ tileSvg = getElementByID(maps.element.id + '_Tile_SVG').cloneNode(true);
14547
15108
  svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
14548
- this.control.svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
15109
+ svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
14549
15110
  }
14550
15111
  const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgDataElement] :
14551
- [(new XMLSerializer()).serializeToString(this.control.svgObject)], { type: 'image/svg+xml' }));
15112
+ [(new XMLSerializer()).serializeToString(svgObject)], { type: 'image/svg+xml' }));
14552
15113
  if (type === 'SVG') {
14553
15114
  if (allowDownload) {
14554
15115
  triggerDownload(fileName, type, url, isDownload);
@@ -14560,7 +15121,7 @@ class ImageExport {
14560
15121
  else {
14561
15122
  const image = new Image();
14562
15123
  const ctxt = imageCanvasElement.getContext('2d');
14563
- if (!this.control.isTileMap) {
15124
+ if (!maps.isTileMap) {
14564
15125
  image.onload = (() => {
14565
15126
  ctxt.drawImage(image, 0, 0);
14566
15127
  window.URL.revokeObjectURL(url);
@@ -14579,31 +15140,37 @@ class ImageExport {
14579
15140
  image.src = url;
14580
15141
  }
14581
15142
  else {
15143
+ const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
15144
+ let top = parseFloat(svgParentElement.getAttribute('y'));
15145
+ let left = parseFloat(svgParentElement.getAttribute('x'));
14582
15146
  const imgxHttp = new XMLHttpRequest();
14583
- const imgTileLength = this.control.mapLayerPanel.tiles.length;
15147
+ const imgTileLength = maps.mapLayerPanel.tiles.length;
14584
15148
  for (let i = 0; i <= imgTileLength + 1; i++) {
14585
- const tile = document.getElementById(this.control.element.id + '_tile_' + (i - 1));
15149
+ const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
14586
15150
  const exportTileImg = new Image();
14587
15151
  exportTileImg.crossOrigin = 'Anonymous';
14588
- ctxt.fillStyle = this.control.background ? this.control.background : '#FFFFFF';
14589
- ctxt.fillRect(0, 0, this.control.availableSize.width, this.control.availableSize.height);
14590
- ctxt.font = this.control.titleSettings.textStyle.size + ' Arial';
14591
- ctxt.fillStyle = document.getElementById(this.control.element.id + '_Map_title').getAttribute('fill');
14592
- ctxt.fillText(this.control.titleSettings.text, parseFloat(document.getElementById(this.control.element.id + '_Map_title').getAttribute('x')), parseFloat(document.getElementById(this.control.element.id + '_Map_title').getAttribute('y')));
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');
15156
+ if (!isNullOrUndefined(titleElement)) {
15157
+ ctxt.fillStyle = titleElement.getAttribute('fill');
15158
+ ctxt.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
15159
+ }
14593
15160
  exportTileImg.onload = (() => {
14594
15161
  if (i === 0 || i === imgTileLength + 1) {
14595
15162
  if (i === 0) {
14596
15163
  ctxt.setTransform(1, 0, 0, 1, 0, 0);
14597
- ctxt.rect(0, parseFloat(svgParent.style.top), parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
15164
+ ctxt.rect(0, top, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
14598
15165
  ctxt.clip();
14599
15166
  }
14600
15167
  else {
14601
- ctxt.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), parseFloat(svgParent.style.top));
15168
+ ctxt.setTransform(1, 0, 0, 1, left, top);
14602
15169
  }
14603
15170
  }
14604
15171
  else {
14605
- ctxt.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + 10, parseFloat(tile.style.top) +
14606
- (parseFloat(document.getElementById(this.control.element.id + '_tile_parent').style.top)));
15172
+ ctxt.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left, parseFloat(tile.style.top) +
15173
+ top);
14607
15174
  }
14608
15175
  ctxt.drawImage(exportTileImg, 0, 0);
14609
15176
  if (i === imgTileLength + 1) {
@@ -14629,7 +15196,7 @@ class ImageExport {
14629
15196
  }
14630
15197
  else {
14631
15198
  setTimeout(() => {
14632
- exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(document.getElementById(this.control.element.id + '_Tile_SVG'))], { type: 'image/svg+xml' }));
15199
+ exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
14633
15200
  }, 300);
14634
15201
  }
14635
15202
  }
@@ -14655,15 +15222,10 @@ class ImageExport {
14655
15222
  /**
14656
15223
  * To destroy the ImageExport.
14657
15224
  *
14658
- * @param {Maps} maps - Specifies the instance of the maps.
14659
15225
  * @returns {void}
14660
15226
  * @private
14661
15227
  */
14662
- destroy(maps) {
14663
- /**
14664
- * Destroy method performed here
14665
- */
14666
- }
15228
+ destroy() { }
14667
15229
  }
14668
15230
 
14669
15231
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -14678,9 +15240,7 @@ class PdfExport {
14678
15240
  *
14679
15241
  * @param {Maps} control Specifies the instance of the map
14680
15242
  */
14681
- constructor(control) {
14682
- this.control = control;
14683
- }
15243
+ constructor() { }
14684
15244
  /**
14685
15245
  * To export the file as image/svg format
14686
15246
  *
@@ -14691,24 +15251,24 @@ class PdfExport {
14691
15251
  * @returns {Promise<string>} - Returns the promise string
14692
15252
  * @private
14693
15253
  */
14694
- export(type, fileName, allowDownload, orientation) {
15254
+ export(maps, type, fileName, allowDownload, orientation) {
14695
15255
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14696
15256
  const promise = new Promise((resolve, reject) => {
14697
15257
  const canvasElement = createElement('canvas', {
14698
15258
  id: 'ej2-canvas',
14699
15259
  attrs: {
14700
- 'width': this.control.availableSize.width.toString(),
14701
- 'height': this.control.availableSize.height.toString()
15260
+ 'width': maps.availableSize.width.toString(),
15261
+ 'height': maps.availableSize.height.toString()
14702
15262
  }
14703
15263
  });
14704
15264
  orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;
14705
- const svgParent = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
15265
+ const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
14706
15266
  let svgData;
14707
- const exportElement = this.control.svgObject.cloneNode(true);
15267
+ const exportElement = maps.svgObject.cloneNode(true);
14708
15268
  const backgroundElement = exportElement.childNodes[0];
14709
15269
  const backgroundColor = backgroundElement.getAttribute('fill');
14710
- if ((this.control.theme === 'Tailwind' || this.control.theme === 'TailwindDark' || this.control.theme === 'Bootstrap5' || this.control.theme === 'Bootstrap5Dark')
14711
- && (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')) {
14712
15272
  exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
14713
15273
  }
14714
15274
  const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
@@ -14716,7 +15276,7 @@ class PdfExport {
14716
15276
  const pdfDocument = new PdfDocument();
14717
15277
  const image = new Image();
14718
15278
  const ctx = canvasElement.getContext('2d');
14719
- if (!this.control.isTileMap) {
15279
+ if (!maps.isTileMap) {
14720
15280
  image.onload = (() => {
14721
15281
  ctx.drawImage(image, 0, 0);
14722
15282
  window.URL.revokeObjectURL(url);
@@ -14724,7 +15284,7 @@ class PdfExport {
14724
15284
  let imageString = canvasElement.toDataURL('image/jpeg').replace('image/jpeg', 'image/octet-stream');
14725
15285
  pdfDocument.pageSettings.orientation = orientation;
14726
15286
  imageString = imageString.slice(imageString.indexOf(',') + 1);
14727
- 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);
14728
15288
  if (allowDownload) {
14729
15289
  pdfDocument.save(fileName + '.pdf');
14730
15290
  pdfDocument.destroy();
@@ -14737,31 +15297,36 @@ class PdfExport {
14737
15297
  image.src = url;
14738
15298
  }
14739
15299
  else {
15300
+ const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
15301
+ let top = parseFloat(svgParentElement.getAttribute('y'));
15302
+ let left = parseFloat(svgParentElement.getAttribute('x'));
14740
15303
  const xHttp = new XMLHttpRequest();
14741
- const tileLength = this.control.mapLayerPanel.tiles.length;
15304
+ const tileLength = maps.mapLayerPanel.tiles.length;
14742
15305
  for (let i = 0; i <= tileLength + 1; i++) {
14743
- const tile = document.getElementById(this.control.element.id + '_tile_' + (i - 1));
15306
+ const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
14744
15307
  const tileImg = new Image();
14745
15308
  tileImg.crossOrigin = 'Anonymous';
14746
- ctx.fillStyle = this.control.background ? this.control.background : '#FFFFFF';
14747
- ctx.fillRect(0, 0, this.control.availableSize.width, this.control.availableSize.height);
14748
- ctx.font = this.control.titleSettings.textStyle.size + ' Arial';
14749
- ctx.fillStyle = document.getElementById(this.control.element.id + '_Map_title').getAttribute('fill');
14750
- ctx.fillText(this.control.titleSettings.text, parseFloat(document.getElementById(this.control.element.id + '_Map_title').getAttribute('x')), parseFloat(document.getElementById(this.control.element.id + '_Map_title').getAttribute('y')));
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');
15313
+ if (!isNullOrUndefined(titleElement)) {
15314
+ ctx.fillStyle = titleElement.getAttribute('fill');
15315
+ ctx.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
15316
+ }
14751
15317
  tileImg.onload = (() => {
14752
15318
  if (i === 0 || i === tileLength + 1) {
14753
15319
  if (i === 0) {
14754
15320
  ctx.setTransform(1, 0, 0, 1, 0, 0);
14755
- ctx.rect(0, parseFloat(svgParent.style.top), parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
15321
+ ctx.rect(0, top, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
14756
15322
  ctx.clip();
14757
15323
  }
14758
15324
  else {
14759
- ctx.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), parseFloat(svgParent.style.top));
15325
+ ctx.setTransform(1, 0, 0, 1, left, top);
14760
15326
  }
14761
15327
  }
14762
15328
  else {
14763
- ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + 10, parseFloat(tile.style.top) +
14764
- (parseFloat(document.getElementById(this.control.element.id + '_tile_parent').style.top)));
15329
+ ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left, parseFloat(tile.style.top) + top);
14765
15330
  }
14766
15331
  ctx.drawImage(tileImg, 0, 0);
14767
15332
  if (i === tileLength + 1) {
@@ -14770,7 +15335,7 @@ class PdfExport {
14770
15335
  let x = localStorage.getItem('saved-image-example');
14771
15336
  pdfDocument.pageSettings.orientation = orientation;
14772
15337
  x = x.slice(x.indexOf(',') + 1);
14773
- 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);
14774
15339
  if (allowDownload) {
14775
15340
  pdfDocument.save(fileName + '.pdf');
14776
15341
  pdfDocument.destroy();
@@ -14787,7 +15352,8 @@ class PdfExport {
14787
15352
  }
14788
15353
  else {
14789
15354
  setTimeout(() => {
14790
- tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(document.getElementById(this.control.element.id + '_Tile_SVG'))], { type: 'image/svg+xml' }));
15355
+ let tileSvg = document.getElementById(maps.element.id + '_Tile_SVG');
15356
+ tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
14791
15357
  }, 300);
14792
15358
  }
14793
15359
  }
@@ -14810,17 +15376,12 @@ class PdfExport {
14810
15376
  return 'PdfExport';
14811
15377
  }
14812
15378
  /**
14813
- * To destroy the PdfExports.
15379
+ * To destroy the PdfExport.
14814
15380
  *
14815
- * @param {Maps} maps - Specifies the instance of the maps.
14816
15381
  * @returns {void}
14817
15382
  * @private
14818
15383
  */
14819
- destroy(maps) {
14820
- /**
14821
- * Destroy method performed here
14822
- */
14823
- }
15384
+ destroy() { }
14824
15385
  }
14825
15386
 
14826
15387
  /**
@@ -14831,5 +15392,5 @@ class PdfExport {
14831
15392
  * exporting all modules from maps index
14832
15393
  */
14833
15394
 
14834
- export { Maps, load, loaded, click, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, 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, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
15395
+ export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, 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, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
14835
15396
  //# sourceMappingURL=ej2-maps.es2015.js.map