@syncfusion/ej2-maps 19.4.53 → 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 -422
  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 +1220 -653
  9. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  10. package/dist/es6/ej2-maps.es5.js +1258 -692
  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 +25 -3
  58. package/src/maps/maps.js +179 -106
  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
+ }
6046
+ });
6047
+ if (path.length > 3) {
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
+ });
5941
6065
  });
5942
6066
  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);
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);
6215
6370
  });
6216
- if (!arrayCollections) {
6217
- latitude = coordinates[1];
6218
- longitude = coordinates[0];
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
6386
+ });
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,33 +8061,47 @@ 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
- const layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
7833
- const shapeSelectedEventArgs = triggerShapeEvent(targetId, this.layers[layerIndex].selectionSettings, this, shapeSelected);
7834
- if (!shapeSelectedEventArgs.cancel && this.selectionModule && !isNullOrUndefined(this.shapeSelected)) {
7835
- customizeStyle(this.selectionModule.selectionType + 'selectionMap', this.selectionModule.selectionType + 'selectionMapStyle', shapeSelectedEventArgs);
7836
- }
7837
- else if (shapeSelectedEventArgs.cancel && this.selectionModule
7838
- && isNullOrUndefined(shapeSelectedEventArgs['data'])) {
7839
- removeClass(targetEle);
7840
- this.selectionModule.removedSelectionList(targetEle);
7841
- }
7842
- }
7843
- });
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);
8093
+ }
8094
+ }
8095
+ triggerShapeSelection(targetEle) {
8096
+ const layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
8097
+ const shapeSelectedEventArgs = triggerShapeEvent(targetEle.id, this.layers[layerIndex].selectionSettings, this, shapeSelected);
8098
+ if (!shapeSelectedEventArgs.cancel && this.selectionModule && !isNullOrUndefined(this.shapeSelected)) {
8099
+ customizeStyle(this.selectionModule.selectionType + 'selectionMap', this.selectionModule.selectionType + 'selectionMapStyle', shapeSelectedEventArgs);
8100
+ }
8101
+ else if (shapeSelectedEventArgs.cancel && this.selectionModule
8102
+ && isNullOrUndefined(shapeSelectedEventArgs['data'])) {
8103
+ removeClass(targetEle);
8104
+ this.selectionModule.removedSelectionList(targetEle);
7844
8105
  }
7845
8106
  }
7846
8107
  getClickLocation(targetId, pageX, pageY, targetElement, x, y) {
@@ -7928,13 +8189,6 @@ let Maps = class Maps extends Component {
7928
8189
  latitude = latLongValue.latitude;
7929
8190
  longitude = latLongValue.longitude;
7930
8191
  }
7931
- const eventArgs = {
7932
- cancel: false, name: click, target: targetId, x: e.clientX, y: e.clientY,
7933
- latitude: latitude, longitude: longitude, isShapeSelected: this.SelectedElement(targetEle)
7934
- };
7935
- // eslint-disable-next-line @typescript-eslint/no-empty-function
7936
- this.trigger('click', eventArgs, (mouseArgs) => {
7937
- });
7938
8192
  }
7939
8193
  this.titleTooltip(e, pageX, pageY, true);
7940
8194
  if (!isNullOrUndefined(this.legendModule)) {
@@ -7942,7 +8196,7 @@ let Maps = class Maps extends Component {
7942
8196
  }
7943
8197
  }
7944
8198
  this.notify(Browser.touchEndEvent, e);
7945
- if (e.cancelable) {
8199
+ if (e.cancelable && !this.isTouch) {
7946
8200
  e.preventDefault();
7947
8201
  }
7948
8202
  return false;
@@ -7964,6 +8218,9 @@ let Maps = class Maps extends Component {
7964
8218
  const markerModule = this.markerModule;
7965
8219
  if (element.id.indexOf('shapeIndex') > -1 || element.id.indexOf('Tile') > -1) {
7966
8220
  this.mergeCluster();
8221
+ if (element.id.indexOf('shapeIndex') > -1) {
8222
+ this.triggerShapeSelection(element);
8223
+ }
7967
8224
  }
7968
8225
  if (markerModule) {
7969
8226
  markerModule.markerClick(e);
@@ -8093,14 +8350,14 @@ let Maps = class Maps extends Component {
8093
8350
  removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
8094
8351
  }
8095
8352
  if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
8096
- 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);
8097
8354
  }
8098
8355
  else {
8099
8356
  removeElement(this.element.id + '_EJ2_Title_Tooltip');
8100
8357
  }
8101
8358
  }
8102
8359
  /*
8103
-
8360
+
8104
8361
  /**
8105
8362
  * This method is used to perform operations while resizing the window.
8106
8363
  *
@@ -8127,6 +8384,7 @@ let Maps = class Maps extends Component {
8127
8384
  this.refreshing = true;
8128
8385
  this.wireEVents();
8129
8386
  this.render();
8387
+ this.refreshing = false;
8130
8388
  }, 500);
8131
8389
  }
8132
8390
  }
@@ -8157,7 +8415,7 @@ let Maps = class Maps extends Component {
8157
8415
  this.scale = zoomFactor;
8158
8416
  this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
8159
8417
  this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
8160
- this.zoomModule.applyTransform();
8418
+ this.zoomModule.applyTransform(this);
8161
8419
  }
8162
8420
  else {
8163
8421
  position = { x: size.width / 2, y: size.height / 2 };
@@ -8203,8 +8461,10 @@ let Maps = class Maps extends Component {
8203
8461
  * @param {Object} layer - Specifies the layer for the maps.
8204
8462
  */
8205
8463
  addLayer(layer) {
8206
- this.layers.push(new LayerSettings(this.layers[0], 'layers', layer));
8207
- this.refresh();
8464
+ let mapsLayer = this.layers;
8465
+ mapsLayer.push(layer);
8466
+ this.isAddLayer = true;
8467
+ this.layers = mapsLayer;
8208
8468
  }
8209
8469
  /**
8210
8470
  * This method is used to remove a layer from map.
@@ -8213,8 +8473,9 @@ let Maps = class Maps extends Component {
8213
8473
  * @returns {void}
8214
8474
  */
8215
8475
  removeLayer(index) {
8216
- this.layers.splice(index, 1);
8217
- this.refresh();
8476
+ let mapsLayer = this.layers;
8477
+ mapsLayer.splice(index, 1);
8478
+ this.layers = mapsLayer;
8218
8479
  }
8219
8480
  /**
8220
8481
  * This method is used to add markers dynamically in the maps.
@@ -8232,7 +8493,7 @@ let Maps = class Maps extends Component {
8232
8493
  this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
8233
8494
  }
8234
8495
  const markerModule = new Marker(this);
8235
- markerModule.markerRender(layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
8496
+ markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
8236
8497
  this.arrangeTemplate();
8237
8498
  }
8238
8499
  }
@@ -8438,7 +8699,8 @@ let Maps = class Maps extends Component {
8438
8699
  Zoom: 'Zoom',
8439
8700
  ZoomOut: 'Zoom out',
8440
8701
  Pan: 'Pan',
8441
- Reset: 'Reset'
8702
+ Reset: 'Reset',
8703
+ ImageNotFound: 'Image Not Found'
8442
8704
  };
8443
8705
  }
8444
8706
  /**
@@ -8446,6 +8708,7 @@ let Maps = class Maps extends Component {
8446
8708
  */
8447
8709
  destroy() {
8448
8710
  this.unWireEVents();
8711
+ super.destroy();
8449
8712
  this.shapeSelectionItem = [];
8450
8713
  this.toggledShapeElementId = [];
8451
8714
  this.toggledLegendId = [];
@@ -8460,11 +8723,14 @@ let Maps = class Maps extends Component {
8460
8723
  this.zoomLabelPositions = [];
8461
8724
  this.mouseDownEvent = { x: null, y: null };
8462
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);
8463
8730
  if (document.getElementById('mapsmeasuretext')) {
8464
8731
  document.getElementById('mapsmeasuretext').remove();
8465
8732
  }
8466
8733
  this.removeSvg();
8467
- super.destroy();
8468
8734
  }
8469
8735
  /**
8470
8736
  * Gets component name
@@ -8497,6 +8763,7 @@ let Maps = class Maps extends Component {
8497
8763
  onPropertyChanged(newProp, oldProp) {
8498
8764
  let render = false;
8499
8765
  let isMarker = false;
8766
+ let isLayer = false;
8500
8767
  let isStaticMapType = false;
8501
8768
  let layerEle;
8502
8769
  if (newProp['layers']) {
@@ -8516,12 +8783,17 @@ let Maps = class Maps extends Component {
8516
8783
  case 'legendSettings':
8517
8784
  case 'baseLayerIndex':
8518
8785
  if (prop === 'layers') {
8786
+ isLayer = true;
8519
8787
  const layerPropLength = Object.keys(newProp.layers).length;
8520
8788
  for (let x = 0; x < layerPropLength; x++) {
8521
8789
  if (!isNullOrUndefined(newProp.layers[x])) {
8522
8790
  const collection = Object.keys(newProp.layers[x]);
8523
8791
  for (const collectionProp of collection) {
8524
- 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') {
8525
8797
  isMarker = true;
8526
8798
  }
8527
8799
  else if (collectionProp === 'staticMapType') {
@@ -8535,7 +8807,7 @@ let Maps = class Maps extends Component {
8535
8807
  break;
8536
8808
  case 'zoomSettings':
8537
8809
  if (!isNullOrUndefined(oldProp.zoomSettings)) {
8538
- if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor) {
8810
+ if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor && !isLayer) {
8539
8811
  render = false;
8540
8812
  }
8541
8813
  else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
@@ -8770,7 +9042,7 @@ let Maps = class Maps extends Component {
8770
9042
  */
8771
9043
  print(id) {
8772
9044
  if ((this.allowPrint) && (this.printModule)) {
8773
- this.printModule.print(id);
9045
+ this.printModule.print(this, id);
8774
9046
  }
8775
9047
  }
8776
9048
  /**
@@ -8788,16 +9060,38 @@ let Maps = class Maps extends Component {
8788
9060
  }
8789
9061
  if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
8790
9062
  return new Promise((resolve, reject) => {
8791
- resolve(this.imageExportModule.export(type, fileName, allowDownload));
9063
+ resolve(this.imageExportModule.export(this, type, fileName, allowDownload));
8792
9064
  });
8793
9065
  }
8794
9066
  else if ((this.allowPdfExport) && (this.pdfExportModule)) {
8795
9067
  return new Promise((resolve, reject) => {
8796
- resolve(this.pdfExportModule.export(type, fileName, allowDownload, orientation));
9068
+ resolve(this.pdfExportModule.export(this, type, fileName, allowDownload, orientation));
8797
9069
  });
8798
9070
  }
8799
9071
  return null;
8800
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
+ }
8801
9095
  /**
8802
9096
  * To find visibility of layers and markers for required modules load.
8803
9097
  *
@@ -8998,6 +9292,9 @@ __decorate([
8998
9292
  __decorate([
8999
9293
  Event()
9000
9294
  ], Maps.prototype, "click", void 0);
9295
+ __decorate([
9296
+ Event()
9297
+ ], Maps.prototype, "onclick", void 0);
9001
9298
  __decorate([
9002
9299
  Event()
9003
9300
  ], Maps.prototype, "doubleClick", void 0);
@@ -9141,12 +9438,8 @@ class Bubble {
9141
9438
  isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
9142
9439
  const shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
9143
9440
  ? shape[shapePath].toLowerCase() : shape[shapePath];
9144
- if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
9145
- if (layerData[i]['type'] === 'Point') {
9146
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9147
- shapePoints.push(this.getPoints(layerData[i], []));
9148
- }
9149
- 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']) {
9150
9443
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9151
9444
  shapePoints.push(this.getPoints(layerData[i], []));
9152
9445
  currentLength = shapePoints[shapePoints.length - 1].length;
@@ -9230,7 +9523,7 @@ class Bubble {
9230
9523
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9231
9524
  let translate;
9232
9525
  const animate$$1 = layer.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
9233
- if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule)) {
9526
+ if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule) && !this.maps.isTileMap) {
9234
9527
  translate = getZoomTranslate(this.maps, layer, animate$$1);
9235
9528
  }
9236
9529
  else {
@@ -9347,14 +9640,13 @@ class Bubble {
9347
9640
  /**
9348
9641
  * To destroy the bubble.
9349
9642
  *
9350
- * @param {Maps} maps - Specifies the instance of the maps.
9351
9643
  * @returns {void}
9352
9644
  * @private
9353
9645
  */
9354
- destroy(maps) {
9355
- /**
9356
- * Destroy method performed here
9357
- */
9646
+ destroy() {
9647
+ this.bubbleCollection = [];
9648
+ //TODO: Calling the below code throws spec issue.
9649
+ //this.maps = null;
9358
9650
  }
9359
9651
  }
9360
9652
 
@@ -9451,7 +9743,7 @@ class DataLabel {
9451
9743
  let shapeWidth;
9452
9744
  const scaleZoomValue = !isNullOrUndefined(this.maps.scale) ? Math.floor(this.maps.scale) : 1;
9453
9745
  const zoomLabelsPosition = this.maps.zoomSettings.enable ? !isNullOrUndefined(this.maps.zoomShapeCollection) &&
9454
- this.maps.zoomShapeCollection.length > 0 : this.maps.zoomSettings.enable;
9746
+ this.maps.zoomShapeCollection.length > 0 && !this.maps.isAddLayer : this.maps.zoomSettings.enable;
9455
9747
  this.maps.translateType = 'labels';
9456
9748
  for (let j = 0; j < properties.length; j++) {
9457
9749
  if (shapeProperties[properties[j]]) {
@@ -9469,7 +9761,7 @@ class DataLabel {
9469
9761
  layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
9470
9762
  if (!isNullOrUndefined(shapes['property'])) {
9471
9763
  shapePoint = [[]];
9472
- if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
9764
+ if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
9473
9765
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9474
9766
  shapePoint.push(this.getPoint(layerData[index], []));
9475
9767
  currentLength = shapePoint[shapePoint.length - 1].length;
@@ -9478,21 +9770,9 @@ class DataLabel {
9478
9770
  midIndex = shapePoint.length - 1;
9479
9771
  }
9480
9772
  }
9481
- else {
9773
+ else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
9482
9774
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9483
9775
  const layer = layerData[index];
9484
- if (layer['type'] === 'Point') {
9485
- isPoint = true;
9486
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9487
- const layerPoints = [];
9488
- layerPoints.push(this.getPoint(layerData, []));
9489
- shapePoint = layerPoints;
9490
- currentLength = shapePoint[shapePoint.length - 1].length;
9491
- if (pointsLength < currentLength) {
9492
- pointsLength = currentLength;
9493
- midIndex = shapePoint.length - 1;
9494
- }
9495
- }
9496
9776
  for (let j = 0; j < layer.length; j++) {
9497
9777
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9498
9778
  shapePoint.push(this.getPoint(layer[j], []));
@@ -9562,7 +9842,7 @@ class DataLabel {
9562
9842
  const eventargs = {
9563
9843
  name: dataLabelRendering, maps: this.maps, cancel: false, border: { color: dataLabel.border.color,
9564
9844
  width: dataLabel.border.width, opacity: dataLabel.border.opacity }, datalabel: dataLabel,
9565
- fill: dataLabel.fill, template: dataLabel.template, text: text
9845
+ fill: dataLabel.fill, template: dataLabel.template, text: text, offsetX: 0, offsetY: 0
9566
9846
  };
9567
9847
  this.maps.trigger('dataLabelRendering', eventargs, (labelArgs) => {
9568
9848
  if (eventargs.cancel) {
@@ -9607,13 +9887,13 @@ class DataLabel {
9607
9887
  this.value[index] = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
9608
9888
  let labelElement;
9609
9889
  if (eventargs.template !== '') {
9610
- templateFn = getTemplateFunction(eventargs.template);
9890
+ templateFn = getTemplateFunction(eventargs.template, this.maps);
9611
9891
  const templateElement = templateFn ? templateFn(!isNullOrUndefined(datasrcObj) ?
9612
9892
  datasrcObj : shapeData['properties'], this.maps, eventargs.template, this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
9613
9893
  templateElement.innerHTML = !templateFn ? eventargs.template : '';
9614
9894
  labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, this.maps);
9615
- labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + 'px';
9616
- 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';
9617
9897
  labelTemplateElement.appendChild(labelElement);
9618
9898
  }
9619
9899
  else {
@@ -9701,26 +9981,26 @@ class DataLabel {
9701
9981
  y = ((location['y'] + transPoint['y']) * scale) - textSize['height'] / 2;
9702
9982
  }
9703
9983
  border.opacity = isNullOrUndefined(border.opacity) ? opacity : border.opacity;
9704
- 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);
9705
9985
  const rect = this.maps.renderer.drawRectangle(rectOptions);
9706
9986
  group.appendChild(rect);
9707
9987
  }
9708
9988
  }
9709
9989
  element = renderTextElement(options, style, style.color || this.maps.themeStyle.dataLabelFontColor, group);
9710
9990
  if (zoomLabelsPosition && scaleZoomValue > 1 && !this.maps.zoomNotApplied) {
9711
- element.setAttribute('transform', 'translate( ' + ((location['x'])) + ' '
9712
- + (((location['y']))) + ' )');
9991
+ element.setAttribute('transform', 'translate( ' + ((location['x'] + labelArgs.offsetX)) + ' '
9992
+ + (((location['y'] + labelArgs.offsetY))) + ' )');
9713
9993
  location['x'] = locationX;
9714
9994
  location['y'] = locationY;
9715
9995
  }
9716
9996
  else {
9717
- element.setAttribute('transform', 'translate( ' + ((location['x'] + transPoint.x) * scale) + ' '
9718
- + (((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) + ' )');
9719
9999
  }
9720
10000
  group.appendChild(element);
9721
10001
  }
9722
10002
  this.dataLabelCollections.push({
9723
- location: { x: location['x'], y: location['y'] },
10003
+ location: { x: location['x'] + labelArgs.offsetX, y: location['y'] + labelArgs.offsetY },
9724
10004
  element: isNullOrUndefined(labelElement) ? element : labelElement,
9725
10005
  layerIndex: layerIndex,
9726
10006
  shapeIndex: sublayerIndexLabel ? oldIndex : index,
@@ -9737,10 +10017,21 @@ class DataLabel {
9737
10017
  }
9738
10018
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9739
10019
  getPoint(shapes, points) {
9740
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9741
- shapes.map((current, index) => {
9742
- points.push(new Point(current['point']['x'], current['point']['y']));
9743
- });
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
+ }
9744
10035
  return points;
9745
10036
  }
9746
10037
  /**
@@ -9752,16 +10043,14 @@ class DataLabel {
9752
10043
  return 'DataLabel';
9753
10044
  }
9754
10045
  /**
9755
- * To destroy the layers.
9756
10046
  *
9757
- * @param {Maps} maps - Specifies the instance of the maps.
9758
10047
  * @returns {void}
9759
10048
  * @private
9760
10049
  */
9761
- destroy(maps) {
9762
- /**
9763
- * Destroy method performed here
9764
- */
10050
+ destroy() {
10051
+ this.dataLabelCollections = [];
10052
+ this.value = null;
10053
+ this.maps = null;
9765
10054
  }
9766
10055
  }
9767
10056
 
@@ -9912,14 +10201,11 @@ class NavigationLine {
9912
10201
  /**
9913
10202
  * To destroy the layers.
9914
10203
  *
9915
- * @param {Maps} maps - Specifies the instance of the map
9916
10204
  * @returns {void}
9917
10205
  * @private
9918
10206
  */
9919
- destroy(maps) {
9920
- /**
9921
- * Destroy method performed here
9922
- */
10207
+ destroy() {
10208
+ this.maps = null;
9923
10209
  }
9924
10210
  }
9925
10211
 
@@ -9932,6 +10218,10 @@ class Legend {
9932
10218
  * @private
9933
10219
  */
9934
10220
  this.legendBorderRect = new Rect(0, 0, 0, 0);
10221
+ /**
10222
+ * @private
10223
+ */
10224
+ this.initialMapAreaRect = new Rect(0, 0, 0, 0);
9935
10225
  /**
9936
10226
  * @private
9937
10227
  */
@@ -9990,6 +10280,7 @@ class Legend {
9990
10280
  this.heightIncrement = 0;
9991
10281
  this.defsElement = this.maps.renderer.createDefs();
9992
10282
  this.maps.svgObject.appendChild(this.defsElement);
10283
+ this.initialMapAreaRect = this.maps.mapAreaRect;
9993
10284
  this.calculateLegendBounds();
9994
10285
  this.drawLegend();
9995
10286
  }
@@ -10027,9 +10318,9 @@ class Legend {
10027
10318
  }
10028
10319
  }
10029
10320
  }
10030
- else {
10031
- this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
10032
- }
10321
+ }
10322
+ if (legend.type === 'Markers') {
10323
+ this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
10033
10324
  }
10034
10325
  });
10035
10326
  if (this.legendCollection.length > 0) {
@@ -10220,8 +10511,9 @@ class Legend {
10220
10511
  }
10221
10512
  }
10222
10513
  else {
10514
+ let padding = 10;
10223
10515
  shapeX = shapeLocation[j - 1].x;
10224
- shapeY = prevPositionY + topPadding + (shapeHeight / 2);
10516
+ shapeY = prevPositionY + padding + (shapeHeight / 2);
10225
10517
  }
10226
10518
  }
10227
10519
  }
@@ -10324,7 +10616,14 @@ class Legend {
10324
10616
  const legend = map.legendSettings;
10325
10617
  const render = map.renderer;
10326
10618
  let textOptions;
10327
- 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
+ };
10328
10627
  this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
10329
10628
  if (legend.mode === 'Interactive') {
10330
10629
  for (let i = 0; i < this.legendRenderingCollections.length; i++) {
@@ -10340,7 +10639,7 @@ class Legend {
10340
10639
  textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
10341
10640
  const rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
10342
10641
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
10343
- textFont.fontFamily = map.themeStyle.fontFamily || textFont.fontFamily;
10642
+ textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
10344
10643
  textFont.size = map.themeStyle.legendFontSize || textFont.size;
10345
10644
  renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
10346
10645
  this.legendGroup.appendChild(render.drawRectangle(rectOptions));
@@ -10395,7 +10694,7 @@ class Legend {
10395
10694
  };
10396
10695
  legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
10397
10696
  this.maps.themeStyle.legendTextColor;
10398
- legendTextStyle.fontFamily = map.themeStyle.fontFamily || legendTextStyle.fontFamily;
10697
+ legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
10399
10698
  legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
10400
10699
  if (i === 0) {
10401
10700
  this.renderLegendBorder();
@@ -10471,7 +10770,9 @@ class Legend {
10471
10770
  'opacity': 1,
10472
10771
  'dominant-baseline': ''
10473
10772
  };
10474
- pagingGroup.appendChild(render.createText(pageTextOptions, pagingText));
10773
+ let pagingTextElement = render.createText(pageTextOptions, pagingText);
10774
+ pagingTextElement.setAttribute('style', 'user-select: none;');
10775
+ pagingGroup.appendChild(pagingTextElement);
10475
10776
  this.legendGroup.appendChild(pagingGroup);
10476
10777
  }
10477
10778
  this.legendToggle();
@@ -10483,6 +10784,7 @@ class Legend {
10483
10784
  let shapeIndex;
10484
10785
  let layerIndex;
10485
10786
  let dataIndex;
10787
+ let pointIndex;
10486
10788
  const legend = this.maps.legendSettings;
10487
10789
  const textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
10488
10790
  document.getElementById(targetElement.id + '_Text');
@@ -10570,12 +10872,20 @@ class Legend {
10570
10872
  }
10571
10873
  if (enable) {
10572
10874
  for (let j = 0; j < data.length; j++) {
10875
+ let shapeElement;
10573
10876
  shapeIndex = data[j]['shapeIndex'];
10574
10877
  layerIndex = data[j]['layerIndex'];
10575
10878
  dataIndex = data[j]['dataIndex'];
10576
- const shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
10577
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
10578
- 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) {
10579
10889
  let shapeMatch = true;
10580
10890
  if (this.maps.legendSelectionCollection !== null) {
10581
10891
  for (let i = 0; i < this.maps.legendSelectionCollection.length; i++) {
@@ -10592,13 +10902,13 @@ class Legend {
10592
10902
  }
10593
10903
  length = this.legendHighlightCollection.length;
10594
10904
  const legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
10595
- this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeEle);
10905
+ this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10596
10906
  const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
10597
- const shapeOldFillColor = shapeEle.getAttribute('fill');
10907
+ const shapeOldFillColor = shapeElement.getAttribute('fill');
10598
10908
  this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
10599
10909
  const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
10600
10910
  this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
10601
- 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');
10602
10912
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10603
10913
  }
10604
10914
  else if (value === 'selection') {
@@ -10621,12 +10931,12 @@ class Legend {
10621
10931
  }
10622
10932
  selectLength = this.maps.legendSelectionCollection.length;
10623
10933
  const legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
10624
- this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeEle);
10934
+ this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10625
10935
  this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
10626
10936
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10627
- this.setColor(shapeEle, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10628
- if (this.maps.selectedElementId.indexOf(shapeEle.getAttribute('id')) === -1) {
10629
- 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'));
10630
10940
  }
10631
10941
  if (j === data.length - 1) {
10632
10942
  this.maps.legendSelection = false;
@@ -10641,14 +10951,15 @@ class Legend {
10641
10951
  }
10642
10952
  }
10643
10953
  setColor(element, fill, opacity, borderColor, borderWidth, type) {
10954
+ const isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
10644
10955
  if (type === 'selection') {
10645
- maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
10646
- 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');
10647
10958
  }
10648
10959
  else {
10649
- element.setAttribute('fill', fill);
10960
+ element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
10650
10961
  element.setAttribute('fill-opacity', opacity);
10651
- element.setAttribute('stroke', borderColor);
10962
+ element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
10652
10963
  element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
10653
10964
  }
10654
10965
  }
@@ -10691,7 +11002,8 @@ class Legend {
10691
11002
  const dataCount = shapeElements.length;
10692
11003
  for (let j = 0; j < dataCount; j++) {
10693
11004
  const shapeElement = getElement(shapeElements[j]);
10694
- if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11005
+ if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
11006
+ shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
10695
11007
  removeClass(shapeElement);
10696
11008
  const selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
10697
11009
  if (selectedElementIdIndex !== -1) {
@@ -10769,12 +11081,14 @@ class Legend {
10769
11081
  this.maps.legendSelectionClass = module;
10770
11082
  }
10771
11083
  else {
10772
- if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11084
+ if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11085
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
10773
11086
  if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
10774
11087
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
10775
11088
  }
10776
11089
  else {
10777
- if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11090
+ if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11091
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
10778
11092
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
10779
11093
  }
10780
11094
  }
@@ -10861,7 +11175,8 @@ class Legend {
10861
11175
  }
10862
11176
  }
10863
11177
  }
10864
- if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle')) {
11178
+ if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11179
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
10865
11180
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10866
11181
  const element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
10867
11182
  let multiSelection = 0;
@@ -10952,7 +11267,7 @@ class Legend {
10952
11267
  }
10953
11268
  for (let j = 0; j < this.maps.selectedLegendElementId.length; j++) {
10954
11269
  const idIndex = this.maps.legendSettings.mode === 'Interactive' ?
10955
- 'container_Legend_Index_' : 'container_Legend_Shape_Index_';
11270
+ this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
10956
11271
  const selectedElement = idIndex + this.maps.selectedLegendElementId[j];
10957
11272
  const legendElement = document.getElementById(selectedElement);
10958
11273
  if (!isNullOrUndefined(legendElement)) {
@@ -11004,6 +11319,7 @@ class Legend {
11004
11319
  let shapeIndex;
11005
11320
  let layerIndex;
11006
11321
  let dataIndex;
11322
+ let pointIndex;
11007
11323
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11008
11324
  const collection = this.maps.legendModule.legendCollection;
11009
11325
  const legend = this.maps.legendSettings;
@@ -11016,15 +11332,23 @@ class Legend {
11016
11332
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11017
11333
  const currentElement = { Elements: [] };
11018
11334
  for (let j = 0; j < data.length; j++) {
11335
+ let shapeElement;
11019
11336
  shapeIndex = data[j]['shapeIndex'];
11020
11337
  layerIndex = data[j]['layerIndex'];
11021
11338
  dataIndex = data[j]['dataIndex'];
11022
- const shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11023
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11024
- 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) {
11025
11349
  process = true;
11026
11350
  }
11027
- elements.push(shapeEle);
11351
+ elements.push(shapeElement);
11028
11352
  }
11029
11353
  if (process) {
11030
11354
  if (isNullOrUndefined(currentElement['LegendEle'])) {
@@ -11042,16 +11366,25 @@ class Legend {
11042
11366
  let shapeIndex;
11043
11367
  let layerIndex;
11044
11368
  let dataIndex;
11369
+ let pointIndex;
11045
11370
  const idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
11046
11371
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11047
11372
  const data = this.maps.legendModule.legendCollection[idIndex]['data'];
11048
11373
  const legendShapeElements = [];
11049
11374
  for (let i = 0; i < data.length; i++) {
11375
+ let shapeElement;
11050
11376
  shapeIndex = data[i]['shapeIndex'];
11051
11377
  layerIndex = data[i]['layerIndex'];
11052
11378
  dataIndex = data[i]['dataIndex'];
11053
- const shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11054
- 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
+ }
11055
11388
  if (!isNullOrUndefined(shapeElement)) {
11056
11389
  legendShapeElements.push(shapeElement.id);
11057
11390
  }
@@ -11119,9 +11452,11 @@ class Legend {
11119
11452
  const renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
11120
11453
  this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
11121
11454
  this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
11122
- this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-(this.legendBorderRect.x))) + ' ' +
11455
+ this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
11123
11456
  (this.translate.y + (-(this.legendBorderRect.y))) + ' )');
11124
- map.svgObject.appendChild(this.legendGroup);
11457
+ if (legend.position !== 'Float') {
11458
+ map.svgObject.appendChild(this.legendGroup);
11459
+ }
11125
11460
  if (legendTitle) {
11126
11461
  textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
11127
11462
  textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
@@ -11133,7 +11468,16 @@ class Legend {
11133
11468
  this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
11134
11469
  (this.currentPage + 1);
11135
11470
  this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
11471
+ this.maps.mapAreaRect = this.initialMapAreaRect;
11136
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
+ }
11137
11481
  if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
11138
11482
  querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
11139
11483
  }
@@ -11151,53 +11495,60 @@ class Legend {
11151
11495
  const areaWidth = totalRect.width;
11152
11496
  const totalWidth = map.availableSize.width;
11153
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;
11154
11500
  if (legend.position === 'Float') {
11155
- 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;
11156
11503
  }
11157
11504
  else {
11158
11505
  switch (legend.position) {
11159
11506
  case 'Top':
11160
11507
  case 'Bottom':
11161
- totalRect.height = (areaHeight - height);
11508
+ totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
11162
11509
  x = (totalWidth / 2) - (width / 2);
11163
11510
  y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
11164
- 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);
11165
11512
  break;
11166
11513
  case 'Left':
11167
11514
  case 'Right':
11168
- totalRect.width = (areaWidth - width);
11169
- 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);
11170
11517
  y = (totalHeight / 2) - (height / 2);
11171
- totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
11518
+ totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
11172
11519
  break;
11173
11520
  }
11174
11521
  switch (legend.alignment) {
11175
11522
  case 'Near':
11176
11523
  if (legend.position === 'Top' || legend.position === 'Bottom') {
11177
- x = totalRect.x;
11524
+ x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
11178
11525
  }
11179
11526
  else {
11180
- y = totalRect.y;
11527
+ y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
11181
11528
  }
11182
11529
  break;
11183
11530
  case 'Far':
11184
11531
  if (legend.position === 'Top' || legend.position === 'Bottom') {
11185
- x = (totalWidth - width) - spacing;
11532
+ x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
11186
11533
  }
11187
11534
  else {
11188
- y = totalHeight - height;
11535
+ y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
11189
11536
  }
11190
11537
  break;
11191
11538
  }
11192
11539
  if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
11193
- this.legendTotalRect = map.totalRect = totalRect;
11540
+ this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
11194
11541
  }
11195
11542
  else {
11543
+ map.totalRect = null;
11196
11544
  if ((legend.height || legend.width) && legend.mode === 'Interactive') {
11197
11545
  map.totalRect = totalRect;
11198
11546
  }
11199
11547
  this.legendTotalRect = map.mapAreaRect = totalRect;
11200
11548
  }
11549
+ if (legend.position === 'Left') {
11550
+ map.mapAreaRect.width = totalRect.width;
11551
+ }
11201
11552
  this.translate = new Point(x, y);
11202
11553
  }
11203
11554
  }
@@ -11214,7 +11565,7 @@ class Legend {
11214
11565
  data[this.maps.legendSettings.showLegendPath];
11215
11566
  if (marker$$1.visible && showLegend && (!isNullOrUndefined(data['latitude'])) && (!isNullOrUndefined(data['longitude']))) {
11216
11567
  if (marker$$1.template) {
11217
- templateFn = getTemplateFunction(marker$$1.template);
11568
+ templateFn = getTemplateFunction(marker$$1.template, this.maps);
11218
11569
  const templateElement = templateFn(this.maps);
11219
11570
  const markerEle = isNullOrUndefined(templateElement.childElementCount) ? templateElement[0] :
11220
11571
  templateElement;
@@ -11318,6 +11669,13 @@ class Legend {
11318
11669
  borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
11319
11670
  });
11320
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
+ }
11321
11679
  }
11322
11680
  }
11323
11681
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -11512,15 +11870,16 @@ class Legend {
11512
11870
  const width = 10;
11513
11871
  const direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
11514
11872
  ? 'Horizontal' : 'Vertical' : legend.orientation;
11873
+ rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
11515
11874
  if (direction === 'Horizontal') {
11516
11875
  if (!legend.invertedPointer) {
11517
- locX = rect.x + (rect.width / 2);
11876
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11518
11877
  locY = rect.y;
11519
11878
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
11520
11879
  ' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
11521
11880
  }
11522
11881
  else {
11523
- locX = rect.x + (rect.width / 2);
11882
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11524
11883
  locY = rect.y + (rect.height);
11525
11884
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
11526
11885
  ' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
@@ -11528,20 +11887,25 @@ class Legend {
11528
11887
  }
11529
11888
  else {
11530
11889
  if (!legend.invertedPointer) {
11531
- locX = rect.x + (rect.width);
11890
+ locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11532
11891
  locY = rect.y + (rect.height / 2);
11533
11892
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
11534
11893
  ' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
11535
11894
  }
11536
11895
  else {
11537
- locX = rect.x;
11896
+ locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11538
11897
  locY = rect.y + (rect.height / 2);
11539
11898
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
11540
11899
  ' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
11541
11900
  }
11542
11901
  }
11543
11902
  const pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
11544
- 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
+ }
11545
11909
  }
11546
11910
  wireEvents(element) {
11547
11911
  EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
@@ -11598,6 +11962,9 @@ class Legend {
11598
11962
  '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
11599
11963
  '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
11600
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);
11601
11968
  mapElement = mapElement.children[0];
11602
11969
  }
11603
11970
  if (isVisible && mapElement !== null) {
@@ -11739,6 +12106,9 @@ class Legend {
11739
12106
  '_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
11740
12107
  '_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id);
11741
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);
11742
12112
  LegendInteractive = LegendInteractive.children[0];
11743
12113
  }
11744
12114
  if (isVisible && LegendInteractive !== null) {
@@ -11902,10 +12272,20 @@ class Legend {
11902
12272
  const shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
11903
12273
  && isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
11904
12274
  if (shapeDataValueCase === dataPathValueCase) {
11905
- legendData.push({
11906
- layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
11907
- name: data[dataPath], value: value
11908
- });
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
+ }
11909
12289
  }
11910
12290
  }
11911
12291
  }
@@ -11951,15 +12331,30 @@ class Legend {
11951
12331
  /**
11952
12332
  * To destroy the legend.
11953
12333
  *
11954
- * @param {Maps} maps - Specifies the instance of the maps
11955
12334
  * @returns {void}
11956
12335
  * @private
11957
12336
  */
11958
- destroy(maps) {
11959
- /**
11960
- * Destroy method performed here
11961
- */
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;
11962
12356
  this.removeEventListener();
12357
+ this.maps = null;
11963
12358
  }
11964
12359
  }
11965
12360
 
@@ -12016,7 +12411,8 @@ class Highlight {
12016
12411
  targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
12017
12412
  targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
12018
12413
  targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
12019
- targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle') {
12414
+ targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
12415
+ targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
12020
12416
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
12021
12417
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12022
12418
  let shapeData;
@@ -12026,8 +12422,9 @@ class Highlight {
12026
12422
  let dataIndex;
12027
12423
  if (targetEle.id.indexOf('shapeIndex') > -1) {
12028
12424
  shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
12029
- shapeData = this.maps.layers[layerIndex].shapeData['features'] ?
12030
- 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;
12031
12428
  dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
12032
12429
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
12033
12430
  this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
@@ -12099,7 +12496,8 @@ class Highlight {
12099
12496
  */
12100
12497
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12101
12498
  handleHighlight(targetElement, layerIndex, data, shapeData) {
12102
- 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') {
12103
12501
  this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
12104
12502
  }
12105
12503
  const selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
@@ -12117,7 +12515,7 @@ class Highlight {
12117
12515
  isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
12118
12516
  }
12119
12517
  const border = {
12120
- 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),
12121
12519
  width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
12122
12520
  opacity: this.highlightSettings.border.opacity
12123
12521
  };
@@ -12173,15 +12571,13 @@ class Highlight {
12173
12571
  /**
12174
12572
  * To destroy the highlight.
12175
12573
  *
12176
- * @param {Maps} maps - Specifies the maps instance
12177
12574
  * @returns {void}
12178
12575
  * @private
12179
12576
  */
12180
- destroy(maps) {
12181
- /**
12182
- * Destroy method performed here
12183
- */
12577
+ destroy() {
12578
+ this.highlightSettings = null;
12184
12579
  this.removeEventListener();
12580
+ this.maps = null;
12185
12581
  }
12186
12582
  }
12187
12583
 
@@ -12201,7 +12597,6 @@ class Selection {
12201
12597
  addEventListener() {
12202
12598
  if (!this.maps.isDestroyed) {
12203
12599
  this.maps.on(click, this.mouseClick, this);
12204
- this.maps.on(Browser.touchEndEvent, this.mouseClick, this);
12205
12600
  }
12206
12601
  }
12207
12602
  /**
@@ -12214,7 +12609,6 @@ class Selection {
12214
12609
  return;
12215
12610
  }
12216
12611
  this.maps.off(click, this.mouseClick);
12217
- this.maps.off(Browser.touchEndEvent, this.mouseClick);
12218
12612
  }
12219
12613
  mouseClick(targetElement) {
12220
12614
  if (!isNullOrUndefined(targetElement['type']) && targetElement['type'].indexOf('touch') !== -1 &&
@@ -12232,8 +12626,12 @@ class Selection {
12232
12626
  const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
12233
12627
  if (targetElement.id.indexOf('shapeIndex') > -1) {
12234
12628
  shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
12235
- shapeData = this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
12236
- 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;
12237
12635
  dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
12238
12636
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
12239
12637
  this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
@@ -12313,15 +12711,17 @@ class Selection {
12313
12711
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12314
12712
  selectMap(targetElement, shapeData, data) {
12315
12713
  const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
12714
+ const isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
12316
12715
  const selectionsettings = this.selectionsettings;
12317
12716
  const border = {
12318
- color: (targetElement.parentElement.id.indexOf('LineString') === -1) ? this.selectionsettings.border.color : (this.selectionsettings.border.color || this.selectionsettings.fill),
12319
- 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)),
12320
12720
  opacity: this.selectionsettings.border.opacity
12321
12721
  };
12322
12722
  const eventArgs = {
12323
12723
  opacity: this.selectionsettings.opacity,
12324
- 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'),
12325
12725
  border: border,
12326
12726
  name: itemSelection,
12327
12727
  target: targetElement.id,
@@ -12333,7 +12733,8 @@ class Selection {
12333
12733
  this.maps.trigger('itemSelection', eventArgs, (observedArgs) => {
12334
12734
  eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ? this.selectionsettings.opacity : this.selectionsettings.border.opacity;
12335
12735
  if (!eventArgs.cancel) {
12336
- if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle') {
12736
+ if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
12737
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle') {
12337
12738
  removeClass(targetElement);
12338
12739
  this.removedSelectionList(targetElement);
12339
12740
  for (let m = 0; m < this.maps.shapeSelectionItem.length; m++) {
@@ -12352,14 +12753,23 @@ class Selection {
12352
12753
  else {
12353
12754
  const layetElement = getElementByID(this.maps.element.id + '_Layer_Collections');
12354
12755
  if (!this.selectionsettings.enableMultiSelect &&
12355
- layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0) {
12356
- 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;
12357
12759
  let ele;
12358
12760
  for (let k = 0; k < eleCount; k++) {
12359
12761
  ele = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle')[0];
12360
12762
  removeClass(ele);
12361
12763
  this.removedSelectionList(ele);
12362
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
+ }
12363
12773
  if (this.selectionType === 'Shape') {
12364
12774
  this.maps.shapeSelectionItem = [];
12365
12775
  const selectionLength = this.maps.selectedElementId.length;
@@ -12377,13 +12787,24 @@ class Selection {
12377
12787
  ele.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
12378
12788
  }
12379
12789
  }
12380
- if (!getElement(this.selectionType + 'selectionMap')) {
12381
- 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');
12382
12798
  }
12383
12799
  else {
12384
- 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');
12385
12807
  }
12386
- targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
12387
12808
  if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
12388
12809
  this.maps.shapeSelectionClass = getElement(this.selectionType + 'selectionMap');
12389
12810
  this.maps.selectedElementId.push(targetElement.getAttribute('id'));
@@ -12452,15 +12873,13 @@ class Selection {
12452
12873
  /**
12453
12874
  * To destroy the selection.
12454
12875
  *
12455
- * @param {Maps} maps - Specifies the maps instance.
12456
12876
  * @returns {void}
12457
12877
  * @private
12458
12878
  */
12459
- destroy(maps) {
12460
- /**
12461
- * Destroy method performed here
12462
- */
12879
+ destroy() {
12880
+ this.selectionsettings = null;
12463
12881
  this.removeEventListener();
12882
+ this.maps = null;
12464
12883
  }
12465
12884
  }
12466
12885
 
@@ -12643,7 +13062,7 @@ class MapsTooltip {
12643
13062
  options: tooltipOption,
12644
13063
  fill: option.fill,
12645
13064
  maps: this.maps,
12646
- element: target, eventArgs: e
13065
+ element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
12647
13066
  };
12648
13067
  this.maps.trigger(tooltipRender, tooltipArgs, (args) => {
12649
13068
  if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
@@ -12661,7 +13080,7 @@ class MapsTooltip {
12661
13080
  header: '',
12662
13081
  data: option['data'],
12663
13082
  template: option['template'],
12664
- content: [currentData.toString()],
13083
+ content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
12665
13084
  shapes: [],
12666
13085
  location: option['location'],
12667
13086
  palette: [markerFill],
@@ -12677,7 +13096,7 @@ class MapsTooltip {
12677
13096
  header: '',
12678
13097
  data: tooltipArgs.options['data'],
12679
13098
  template: tooltipArgs.options['template'],
12680
- content: [currentData.toString()],
13099
+ content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
12681
13100
  shapes: [],
12682
13101
  location: tooltipArgs.options['location'],
12683
13102
  palette: [markerFill],
@@ -12687,6 +13106,10 @@ class MapsTooltip {
12687
13106
  fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor
12688
13107
  });
12689
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
+ }
12690
13113
  this.svgTooltip.opacity = this.maps.themeStyle.tooltipFillOpacity || this.svgTooltip.opacity;
12691
13114
  this.svgTooltip.appendTo(tooltipEle);
12692
13115
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -12700,9 +13123,7 @@ class MapsTooltip {
12700
13123
  }
12701
13124
  }
12702
13125
  else {
12703
- this.removeTooltip();
12704
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12705
- this.maps.clearTemplate();
13126
+ this.clearTooltip();
12706
13127
  }
12707
13128
  });
12708
13129
  if (this.svgTooltip) {
@@ -12717,9 +13138,7 @@ class MapsTooltip {
12717
13138
  });
12718
13139
  }
12719
13140
  else {
12720
- this.removeTooltip();
12721
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12722
- this.maps.clearTemplate();
13141
+ this.clearTooltip();
12723
13142
  }
12724
13143
  }
12725
13144
  else {
@@ -12729,9 +13148,7 @@ class MapsTooltip {
12729
13148
  this.maps.notify(click, this);
12730
13149
  }
12731
13150
  else {
12732
- this.removeTooltip();
12733
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12734
- this.maps.clearTemplate();
13151
+ this.clearTooltip();
12735
13152
  }
12736
13153
  }
12737
13154
  }
@@ -12775,8 +13192,18 @@ class MapsTooltip {
12775
13192
  }
12776
13193
  }
12777
13194
  removeTooltip() {
13195
+ let isTooltipRemoved = false;
12778
13196
  if (document.getElementsByClassName('EJ2-maps-Tooltip').length > 0) {
12779
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();
12780
13207
  }
12781
13208
  }
12782
13209
  // eslint-disable-next-line valid-jsdoc
@@ -12825,12 +13252,17 @@ class MapsTooltip {
12825
13252
  /**
12826
13253
  * To destroy the tooltip.
12827
13254
  *
12828
- * @param {Maps} maps Specifies the maps instance
12829
13255
  * @returns {void}
12830
13256
  * @private
12831
13257
  */
12832
- destroy(maps) {
13258
+ destroy() {
13259
+ if (!isNullOrUndefined(this.svgTooltip)) {
13260
+ this.svgTooltip.destroy();
13261
+ }
13262
+ this.svgTooltip = null;
12833
13263
  this.removeEventListener();
13264
+ //TODO: Calling the below code throws spec issue.
13265
+ //this.maps = null;
12834
13266
  }
12835
13267
  }
12836
13268
 
@@ -12843,7 +13275,6 @@ class Zoom {
12843
13275
  this.mouseEnter = false;
12844
13276
  this.isTouch = false;
12845
13277
  this.rectZoomingStart = false;
12846
- this.pinchRect = new Rect(0, 0, 0, 0);
12847
13278
  this.browserName = Browser.info.name;
12848
13279
  // eslint-disable-next-line @typescript-eslint/ban-types
12849
13280
  this.isPointer = Browser.isPointer;
@@ -12852,8 +13283,6 @@ class Zoom {
12852
13283
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12853
13284
  this.startTouches = [];
12854
13285
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12855
- this.shapeZoomLocation = [];
12856
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12857
13286
  this.intersect = [];
12858
13287
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12859
13288
  this.mouseDownLatLong = { x: 0, y: 0 };
@@ -12869,7 +13298,6 @@ class Zoom {
12869
13298
  this.selectionColor = this.maps.zoomSettings.selectionColor;
12870
13299
  this.fillColor = this.maps.zoomSettings.color;
12871
13300
  this.addEventListener();
12872
- this.groupElements = [];
12873
13301
  }
12874
13302
  /**
12875
13303
  * To perform zooming for maps
@@ -12892,24 +13320,43 @@ class Zoom {
12892
13320
  const minZoom = map.zoomSettings.minZoom;
12893
13321
  newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
12894
13322
  const prevTilePoint = map.tileTranslatePoint;
12895
- 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)) {
12896
13325
  const availSize = map.mapAreaRect;
12897
13326
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12898
13327
  const minBounds = map.baseMapRectBounds['min'];
12899
13328
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12900
13329
  const maxBounds = map.baseMapRectBounds['max'];
12901
- const mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
12902
- const mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
12903
- const point = map.translatePoint;
12904
- let translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
12905
- let translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
12906
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
12907
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
12908
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
12909
- 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
+ }
12910
13352
  map.scale = newZoomFactor;
12911
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
12912
- 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
+ }
12913
13360
  }
12914
13361
  else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
12915
13362
  this.getTileTranslatePosition(prevLevel, newZoomFactor, position, type);
@@ -12926,34 +13373,49 @@ class Zoom {
12926
13373
  }
12927
13374
  map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
12928
13375
  map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
12929
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
12930
- if (document.querySelector('.GroupElement')) {
12931
- document.querySelector('.GroupElement').style.display = 'none';
12932
- }
12933
- if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
12934
- document.getElementById(this.maps.element.id + '_LayerIndex_1').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;
12935
13381
  }
12936
- this.markerLineAnimation(map);
12937
- map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
12938
- const element1 = document.getElementById(this.maps.element.id + '_tiles');
12939
- const animationDuration = this.maps.layersCollection[0].animationDuration;
12940
- setTimeout(() => {
12941
- // if (type === 'ZoomOut') {
12942
- // element1.removeChild(element1.children[element1.childElementCount - 1]);
12943
- // if (element1.childElementCount) {
12944
- // element1.removeChild(element1.children[element1.childElementCount - 1]);
12945
- // } else {
12946
- // element1 = element1;
12947
- // }
12948
- // }
12949
- this.applyTransform();
13382
+ else {
13383
+ if (document.querySelector('.GroupElement')) {
13384
+ document.querySelector('.GroupElement').style.display = 'none';
13385
+ }
12950
13386
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
12951
- document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
13387
+ document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
12952
13388
  }
12953
- }, 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
+ }
12954
13408
  }
12955
13409
  this.maps.zoomNotApplied = false;
12956
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
+ }
12957
13419
  triggerZoomEvent(prevTilePoint, prevLevel, type) {
12958
13420
  const map = this.maps;
12959
13421
  let zoomArgs;
@@ -12972,6 +13434,7 @@ class Zoom {
12972
13434
  };
12973
13435
  }
12974
13436
  map.trigger('zoom', zoomArgs);
13437
+ return zoomArgs.cancel;
12975
13438
  }
12976
13439
  getTileTranslatePosition(prevLevel, currentLevel, position, type) {
12977
13440
  const map = this.maps;
@@ -12997,6 +13460,7 @@ class Zoom {
12997
13460
  const zoomRect = this.zoomingRect;
12998
13461
  const maxZoom = map.zoomSettings.maxZoom;
12999
13462
  const minZoom = map.zoomSettings.minZoom;
13463
+ let isZoomCancelled;
13000
13464
  if (zoomRect.height > 0 && zoomRect.width > 0) {
13001
13465
  const x = this.zoomingRect.x + (this.zoomingRect.width / 2);
13002
13466
  const y = this.zoomingRect.y + (this.zoomingRect.height / 2);
@@ -13009,7 +13473,11 @@ class Zoom {
13009
13473
  const translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomCalculationFactor)) / (size.height / y));
13010
13474
  map.translatePoint = new Point(translatePointX, translatePointY);
13011
13475
  map.scale = zoomCalculationFactor;
13012
- this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13476
+ isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13477
+ if (isZoomCancelled) {
13478
+ map.translatePoint = map.previousPoint;
13479
+ map.scale = map.previousScale;
13480
+ }
13013
13481
  }
13014
13482
  else {
13015
13483
  zoomCalculationFactor = prevLevel + (Math.round(prevLevel + (((size.width / zoomRect.width) + (size.height / zoomRect.height)) / 2)));
@@ -13022,13 +13490,21 @@ class Zoom {
13022
13490
  map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, zoomCalculationFactor))) /
13023
13491
  (Math.pow(2, zoomCalculationFactor));
13024
13492
  map.scale = (Math.pow(2, zoomCalculationFactor));
13025
- this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13026
- 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;
13027
13507
  }
13028
- map.mapScaleValue = zoomCalculationFactor;
13029
- this.applyTransform(true);
13030
- this.maps.zoomNotApplied = false;
13031
- this.zoomingRect = null;
13032
13508
  }
13033
13509
  }
13034
13510
  setInteraction(newInteraction) {
@@ -13056,23 +13532,41 @@ class Zoom {
13056
13532
  this.lastScale = scale;
13057
13533
  this.pinchFactor *= newScale;
13058
13534
  this.pinchFactor = Math.min(this.maps.zoomSettings.maxZoom, Math.max(this.pinchFactor, this.maps.zoomSettings.minZoom));
13059
- const zoomCalculationFactor = this.pinchFactor;
13535
+ let zoomCalculationFactor = this.pinchFactor;
13536
+ let isZoomCancelled;
13060
13537
  if (!map.isTileMap) {
13061
13538
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13062
13539
  const minBounds = map.baseMapRectBounds['min'];
13063
13540
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13064
13541
  const maxBounds = map.baseMapRectBounds['max'];
13065
- const mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
13066
- 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']);
13067
13544
  const translatePoint = map.translatePoint;
13068
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
13069
- let translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
13070
- let translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
13071
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
13072
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
13073
- 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
+ }
13074
13564
  map.scale = zoomCalculationFactor;
13075
- this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13565
+ isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13566
+ if (isZoomCancelled) {
13567
+ map.translatePoint = map.previousPoint;
13568
+ map.scale = map.previousScale;
13569
+ }
13076
13570
  }
13077
13571
  else {
13078
13572
  const newTileFactor = zoomCalculationFactor;
@@ -13083,10 +13577,20 @@ class Zoom {
13083
13577
  map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, newTileFactor))) /
13084
13578
  (Math.pow(2, newTileFactor));
13085
13579
  map.scale = (Math.pow(2, newTileFactor));
13086
- this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13087
- 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);
13088
13593
  }
13089
- this.applyTransform();
13090
13594
  }
13091
13595
  drawZoomRectangle() {
13092
13596
  const map = this.maps;
@@ -13132,17 +13636,17 @@ class Zoom {
13132
13636
  zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
13133
13637
  }
13134
13638
  }
13135
- applyTransform(animate$$1) {
13639
+ applyTransform(maps, animate$$1) {
13136
13640
  let layerIndex;
13137
13641
  this.templateCount = 0;
13138
13642
  let markerStyle;
13139
- const scale = this.maps.scale;
13140
- const x = this.maps.translatePoint.x;
13141
- const y = this.maps.translatePoint.y;
13643
+ const scale = maps.scale;
13644
+ const x = maps.translatePoint.x;
13645
+ const y = maps.translatePoint.y;
13142
13646
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13143
- this.maps.zoomShapeCollection = [];
13144
- if (document.getElementById(this.maps.element.id + '_mapsTooltip')) {
13145
- removeElement(this.maps.element.id + '_mapsTooltip');
13647
+ maps.zoomShapeCollection = [];
13648
+ if (document.getElementById(maps.element.id + '_mapsTooltip')) {
13649
+ removeElement(maps.element.id + '_mapsTooltip');
13146
13650
  }
13147
13651
  if (this.layerCollectionEle) {
13148
13652
  for (let i = 0; i < this.layerCollectionEle.childElementCount; i++) {
@@ -13150,30 +13654,29 @@ class Zoom {
13150
13654
  if (layerElement.tagName === 'g') {
13151
13655
  this.templateCount++;
13152
13656
  this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
13153
- this.currentLayer = this.maps.layersCollection[this.index];
13154
- const factor = this.maps.mapLayerPanel.calculateFactor(this.currentLayer);
13657
+ this.currentLayer = maps.layersCollection[this.index];
13658
+ const factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
13155
13659
  for (let j = 0; j < layerElement.childElementCount; j++) {
13156
13660
  let currentEle = layerElement.childNodes[j];
13157
13661
  if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
13158
13662
  && (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
13159
- if (this.maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
13663
+ if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
13160
13664
  currentEle.remove();
13161
13665
  if (layerElement.children.length > 0 && layerElement.children[0]) {
13162
- 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]);
13163
13667
  }
13164
13668
  else {
13165
- 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));
13166
13670
  }
13167
13671
  }
13168
- else {
13169
- changeBorderWidth(currentEle, this.index, scale, this.maps);
13170
- 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;
13171
13675
  this.animateTransform(currentEle, animate$$1, x, y, scale);
13172
- this.shapeZoomLocation = currentEle.childNodes;
13173
13676
  }
13174
13677
  }
13175
13678
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
13176
- if (!this.isPanning) {
13679
+ if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
13177
13680
  this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
13178
13681
  }
13179
13682
  currentEle = layerElement.childNodes[j];
@@ -13192,11 +13695,11 @@ class Zoom {
13192
13695
  markerSelectionValues['latitude'] ||
13193
13696
  this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x]['longitude'] ===
13194
13697
  markerSelectionValues['longitude']) {
13195
- 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]);
13196
13699
  }
13197
13700
  }
13198
- if ((this.currentLayer.animationDuration > 0 || (this.maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
13199
- 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) {
13200
13703
  const groupElement = document.querySelector('.GroupElement');
13201
13704
  if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
13202
13705
  groupElement.style.display = 'none';
@@ -13208,29 +13711,29 @@ class Zoom {
13208
13711
  }
13209
13712
  }
13210
13713
  }
13211
- if (this.isPanning && this.maps.markerModule.sameMarkerData.length > 0) {
13212
- 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);
13213
13716
  }
13214
- else if (this.maps.markerModule.sameMarkerData.length > 0) {
13215
- this.maps.markerModule.sameMarkerData = [];
13216
- if (document.getElementById(this.maps.element.id + '_mapsTooltip')) {
13217
- 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');
13218
13721
  }
13219
13722
  }
13220
- 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_')
13221
13724
  && !this.isPanning) {
13222
- const mapsTooltip = this.maps.mapsTooltipModule;
13725
+ const mapsTooltip = maps.mapsTooltipModule;
13223
13726
  const tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
13224
13727
  if (!isNullOrUndefined(tooltipElement)) {
13225
13728
  if (tooltipElement['style']['visibility'] === 'hidden') {
13226
- removeElement(this.maps.element.id + '_mapsTooltip');
13729
+ removeElement(maps.element.id + '_mapsTooltip');
13227
13730
  }
13228
13731
  else {
13229
13732
  let x = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[1]);
13230
13733
  let y = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[2]);
13231
- if (this.maps.isTileMap) {
13232
- x += +getElement(this.maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
13233
- 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];
13234
13737
  }
13235
13738
  mapsTooltip.svgTooltip.location.x = x;
13236
13739
  mapsTooltip.svgTooltip.location.y = y;
@@ -13248,9 +13751,9 @@ class Zoom {
13248
13751
  layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
13249
13752
  const bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
13250
13753
  const dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
13251
- for (let l = 0; l < this.maps.bubbleModule.bubbleCollection.length; l++) {
13754
+ for (let l = 0; l < maps.bubbleModule.bubbleCollection.length; l++) {
13252
13755
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13253
- const bubbleCollection = this.maps.bubbleModule.bubbleCollection[l];
13756
+ const bubbleCollection = maps.bubbleModule.bubbleCollection[l];
13254
13757
  if (bubbleCollection['LayerIndex'] === layerIndex && bubbleCollection['BubbleIndex'] === bubleIndex &&
13255
13758
  bubbleCollection['DataIndex'] === dataIndex) {
13256
13759
  const centerX = bubbleCollection['center']['x'];
@@ -13269,24 +13772,25 @@ class Zoom {
13269
13772
  }
13270
13773
  }
13271
13774
  }
13272
- else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1) {
13775
+ else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
13273
13776
  this.intersect = [];
13274
- this.maps.zoomLabelPositions = [];
13275
- this.maps.zoomLabelPositions = this.maps.dataLabelModule.dataLabelCollections;
13777
+ maps.zoomLabelPositions = [];
13778
+ maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
13779
+ let labelAnimate = !maps.isTileMap && animate$$1;
13276
13780
  for (let k = 0; k < currentEle.childElementCount; k++) {
13277
13781
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
13278
13782
  const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
13279
- this.zoomshapewidth = this.shapeZoomLocation[labelIndex].getBoundingClientRect();
13280
- this.maps.zoomShapeCollection.push(this.zoomshapewidth);
13281
- this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', animate$$1);
13282
- 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;
13283
13787
  const border = dataLabel.border;
13284
13788
  if (k > 0 && border['width'] > 1) {
13285
- if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1) {
13286
- const labelX = ((this.maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
13287
- 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);
13288
13792
  const zoomtext = currentEle.childNodes[k]['innerHTML'];
13289
- const style = this.maps.layers[this.index].dataLabelSettings.textStyle;
13793
+ const style = maps.layers[this.index].dataLabelSettings.textStyle;
13290
13794
  const zoomtextSize = measureText(zoomtext, style);
13291
13795
  const padding = 5;
13292
13796
  const rectElement = currentEle.childNodes[k - 1];
@@ -13301,11 +13805,11 @@ class Zoom {
13301
13805
  }
13302
13806
  }
13303
13807
  }
13304
- this.maps.arrangeTemplate();
13808
+ maps.arrangeTemplate();
13305
13809
  }
13306
13810
  if (!isNullOrUndefined(this.currentLayer)) {
13307
- if (!animate$$1 || this.currentLayer.animationDuration === 0 || this.maps.isTileMap) {
13308
- this.processTemplate(x, y, scale, this.maps);
13811
+ if (!animate$$1 || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
13812
+ this.processTemplate(x, y, scale, maps);
13309
13813
  }
13310
13814
  }
13311
13815
  }
@@ -13363,10 +13867,10 @@ class Zoom {
13363
13867
  }
13364
13868
  const lati = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
13365
13869
  Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
13366
- parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : 0;
13870
+ parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : null;
13367
13871
  const long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
13368
13872
  Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
13369
- parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : 0;
13873
+ parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : null;
13370
13874
  const offset = markerSettings.offset;
13371
13875
  if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
13372
13876
  const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
@@ -13386,10 +13890,10 @@ class Zoom {
13386
13890
  nullCount += (!isNaN(lati) && !isNaN(long)) ? 0 : 1;
13387
13891
  markerTemplateCounts += (eventArgs.cancel) ? 1 : 0;
13388
13892
  markerCounts += (eventArgs.cancel) ? 1 : 0;
13389
- this.maps.markerNullCount = (!isNullOrUndefined(lati) || !isNullOrUndefined(long))
13390
- ? this.maps.markerNullCount : this.maps.markerNullCount + 1;
13893
+ this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
13894
+ ? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
13391
13895
  const markerDataLength = markerDatas.length - this.maps.markerNullCount;
13392
- if (markerSVGObject.childElementCount === (markerDatas.length - markerTemplateCounts - nullCount) && (type !== 'Template')) {
13896
+ if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
13393
13897
  layerElement.appendChild(markerSVGObject);
13394
13898
  if (currentLayers.markerClusterSettings.allowClustering) {
13395
13899
  this.maps.svgObject.appendChild(markerSVGObject);
@@ -13397,7 +13901,7 @@ class Zoom {
13397
13901
  clusterTemplate(currentLayers, markerSVGObject, this.maps, layerIndex, markerSVGObject, layerElement, true, true);
13398
13902
  }
13399
13903
  }
13400
- 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')) {
13401
13905
  getElementByID(this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
13402
13906
  if (scale >= 1) {
13403
13907
  if (currentLayers.markerClusterSettings.allowClustering) {
@@ -13492,7 +13996,7 @@ class Zoom {
13492
13996
  }
13493
13997
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
13494
13998
  if (scale > 1) {
13495
- text = (this.zoomshapewidth['width'] >= zoomtextSize['width']) ? zoomtext : '';
13999
+ text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
13496
14000
  element.innerHTML = text;
13497
14001
  }
13498
14002
  else {
@@ -13502,7 +14006,7 @@ class Zoom {
13502
14006
  }
13503
14007
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
13504
14008
  if (scale > 1) {
13505
- zoomtrimLabel = textTrim(this.zoomshapewidth['width'], zoomtext, style);
14009
+ zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
13506
14010
  text = zoomtrimLabel;
13507
14011
  element.innerHTML = text;
13508
14012
  }
@@ -13540,7 +14044,7 @@ class Zoom {
13540
14044
  || textLocations['heightTop'] > this.intersect[j]['heightBottom']) {
13541
14045
  trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
13542
14046
  if (scale > 1) {
13543
- trimmedLable = textTrim(this.zoomshapewidth['width'], trimmedLable, style);
14047
+ trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
13544
14048
  }
13545
14049
  element.innerHTML = trimmedLable;
13546
14050
  }
@@ -13566,11 +14070,11 @@ class Zoom {
13566
14070
  }
13567
14071
  this.intersect.push(textLocations);
13568
14072
  if (isNullOrUndefined(trimmedLable)) {
13569
- trimmedLable = textTrim(this.zoomshapewidth['width'], zoomtext, style);
14073
+ trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
13570
14074
  element.innerHTML = trimmedLable;
13571
14075
  }
13572
14076
  }
13573
- else {
14077
+ if (animate$$1 || duration > 0) {
13574
14078
  smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
13575
14079
  }
13576
14080
  }
@@ -13691,7 +14195,7 @@ class Zoom {
13691
14195
  const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
13692
14196
  const elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
13693
14197
  const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
13694
- ((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
14198
+ ((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
13695
14199
  const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
13696
14200
  ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
13697
14201
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13705,15 +14209,15 @@ class Zoom {
13705
14209
  if (!panArgs.cancel) {
13706
14210
  if (panningXDirection && panningYDirection) {
13707
14211
  map.translatePoint = new Point(x, y);
13708
- this.applyTransform();
14212
+ this.applyTransform(map);
13709
14213
  }
13710
14214
  else if (panningXDirection) {
13711
14215
  map.translatePoint = new Point(x, map.translatePoint.y);
13712
- this.applyTransform();
14216
+ this.applyTransform(map);
13713
14217
  }
13714
14218
  else if (panningYDirection) {
13715
14219
  map.translatePoint = new Point(map.translatePoint.x, y);
13716
- this.applyTransform();
14220
+ this.applyTransform(map);
13717
14221
  }
13718
14222
  }
13719
14223
  this.maps.zoomNotApplied = false;
@@ -13741,7 +14245,7 @@ class Zoom {
13741
14245
  };
13742
14246
  map.trigger(pan, panArgs);
13743
14247
  map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
13744
- this.applyTransform();
14248
+ this.applyTransform(map);
13745
14249
  }
13746
14250
  map.zoomTranslatePoint = map.translatePoint;
13747
14251
  this.mouseDownPoints = this.mouseMovePoints;
@@ -13753,7 +14257,7 @@ class Zoom {
13753
14257
  (this.distanceX / this.maps.scale)) : this.maps.translatePoint.x;
13754
14258
  this.maps.translatePoint.y = !isNullOrUndefined(this.distanceY) ? this.maps.translatePoint.y -
13755
14259
  (this.distanceY / this.maps.scale) : this.maps.translatePoint.y;
13756
- this.applyTransform(false);
14260
+ this.applyTransform(this.maps, false);
13757
14261
  }
13758
14262
  toolBarZooming(zoomFactor, type) {
13759
14263
  const map = this.maps;
@@ -13780,20 +14284,38 @@ class Zoom {
13780
14284
  const min = map.baseMapRectBounds['min'];
13781
14285
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13782
14286
  const max = map.baseMapRectBounds['max'];
13783
- const mapWidth = Math.abs(max['x'] - min['x']);
13784
- const mapHeight = Math.abs(min['y'] - max['y']);
13785
- let translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
13786
- let translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
13787
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
13788
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
13789
- : translatePointX;
13790
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
13791
- : translatePointY;
13792
- 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
+ }
13793
14310
  map.zoomTranslatePoint = map.translatePoint;
13794
14311
  map.scale = zoomFactor;
13795
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
13796
- 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
+ }
13797
14319
  }
13798
14320
  else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
13799
14321
  let tileZoomFactor = prevLevel < minZoom && !map.isReset ? minZoom : zoomFactor;
@@ -13810,34 +14332,44 @@ class Zoom {
13810
14332
  map.tileTranslatePoint.y = map.initialTileTranslate.y;
13811
14333
  tileZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
13812
14334
  }
13813
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
13814
- map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
13815
- map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
13816
- if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
13817
- document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
13818
- }
13819
- if (document.querySelector('.GroupElement')) {
13820
- 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;
13821
14340
  }
13822
- this.markerLineAnimation(map);
13823
- map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
13824
- const element1 = document.getElementById(this.maps.element.id + '_tiles');
13825
- const animationDuration = this.maps.layersCollection[0].animationDuration;
13826
- setTimeout(() => {
13827
- 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;
13828
14344
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
13829
- document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
14345
+ document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
13830
14346
  }
13831
- }, 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
+ }
13832
14362
  }
13833
14363
  this.maps.zoomNotApplied = false;
13834
14364
  }
13835
14365
  }
13836
14366
  createZoomingToolbars() {
13837
14367
  const map = this.maps;
14368
+ let zoomInElements;
14369
+ let zoomOutElements;
13838
14370
  this.toolBarGroup = map.renderer.createGroup({
13839
14371
  id: map.element.id + '_Zooming_KitCollection',
13840
- opacity: map.theme.toLowerCase() === 'fluentuidark' ? 0.6 : 0.3
14372
+ opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
13841
14373
  });
13842
14374
  const kitHeight = 16;
13843
14375
  const kitWidth = 16;
@@ -13852,7 +14384,6 @@ class Zoom {
13852
14384
  const toolBarLength = map.zoomSettings.toolbars.length;
13853
14385
  const toolWidth = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (toolBarLength * kitWidth) + (toolBarLength * padding) : (kitWidth * 2);
13854
14386
  const toolHeight = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (kitHeight * 2) : (toolBarLength * kitHeight) + (toolBarLength * padding);
13855
- 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)));
13856
14387
  const defElement = map.renderer.createDefs();
13857
14388
  defElement.innerHTML = shadowElement;
13858
14389
  this.toolBarGroup.appendChild(defElement);
@@ -13901,13 +14432,13 @@ class Zoom {
13901
14432
  case 'zoomin':
13902
14433
  direction = 'M 8, 0 L 8, 16 M 0, 8 L 16, 8';
13903
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)));
13904
- this.zoomInElements = this.currentToolbarEle;
14435
+ zoomInElements = this.currentToolbarEle;
13905
14436
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
13906
14437
  break;
13907
14438
  case 'zoomout':
13908
14439
  direction = 'M 0, 8 L 16, 8';
13909
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)));
13910
- this.zoomOutElements = this.currentToolbarEle;
14441
+ zoomOutElements = this.currentToolbarEle;
13911
14442
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
13912
14443
  break;
13913
14444
  case 'pan': {
@@ -14092,7 +14623,12 @@ class Zoom {
14092
14623
  x = (size.width / 2) - (toolBarSize.width / 2);
14093
14624
  break;
14094
14625
  case 'Far':
14095
- 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
+ }
14096
14632
  break;
14097
14633
  }
14098
14634
  let extraPosition = map.getExtraPosition();
@@ -14148,6 +14684,7 @@ class Zoom {
14148
14684
  }
14149
14685
  else {
14150
14686
  map.mapScaleValue = value - delta;
14687
+ map.isReset = (map.mapScaleValue < 1) ? true : false;
14151
14688
  map.staticMapZoom = map.tileZoomLevel;
14152
14689
  if (map.mapScaleValue === 1) {
14153
14690
  map.markerCenterLatitude = null;
@@ -14241,14 +14778,14 @@ class Zoom {
14241
14778
  if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
14242
14779
  if (!this.maps.zoomSettings.enablePanning) {
14243
14780
  if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
14244
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
14245
- 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');
14246
14783
  }
14247
14784
  }
14248
14785
  }
14249
14786
  }
14250
14787
  else {
14251
- 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');
14252
14789
  if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
14253
14790
  getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
14254
14791
  getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
@@ -14398,15 +14935,30 @@ class Zoom {
14398
14935
  /**
14399
14936
  * To destroy the zoom.
14400
14937
  *
14401
- * @param {Maps} maps - Specifies the instance of the maps.
14402
14938
  * @returns {void}
14403
14939
  * @private
14404
14940
  */
14405
- 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;
14406
14958
  this.removeEventListener();
14407
- /**
14408
- * Destroy method performed here
14409
- */
14959
+ //TODO: Calling the below code throws spec issue.
14960
+ //this.maps = null;
14961
+ this.currentLayer = null;
14410
14962
  }
14411
14963
  }
14412
14964
 
@@ -14422,9 +14974,7 @@ class Print {
14422
14974
  *
14423
14975
  * @param {Maps} control - Specifies the instance of the map
14424
14976
  */
14425
- constructor(control) {
14426
- this.control = control;
14427
- }
14977
+ constructor(control) { }
14428
14978
  /**
14429
14979
  * To print the Maps
14430
14980
  *
@@ -14432,16 +14982,16 @@ class Print {
14432
14982
  * @returns {void}
14433
14983
  * @private
14434
14984
  */
14435
- print(elements) {
14436
- this.printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
14437
- this.printWindow.moveTo(0, 0);
14438
- 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);
14439
14989
  const argsData = {
14440
- cancel: false, htmlContent: this.getHTMLContent(elements), name: beforePrint
14990
+ cancel: false, htmlContent: this.getHTMLContent(maps, elements), name: beforePrint
14441
14991
  };
14442
- this.control.trigger('beforePrint', argsData, (beforePrintArgs) => {
14992
+ maps.trigger('beforePrint', argsData, (beforePrintArgs) => {
14443
14993
  if (!argsData.cancel) {
14444
- print(argsData.htmlContent, this.printWindow);
14994
+ print(argsData.htmlContent, printWindow);
14445
14995
  }
14446
14996
  });
14447
14997
  }
@@ -14452,8 +15002,29 @@ class Print {
14452
15002
  * @returns {Element} - Returns the div element
14453
15003
  * @private
14454
15004
  */
14455
- getHTMLContent(elements) {
14456
- 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
+ }
14457
15028
  if (elements) {
14458
15029
  if (elements instanceof Array) {
14459
15030
  Array.prototype.forEach.call(elements, (value) => {
@@ -14468,7 +15039,7 @@ class Print {
14468
15039
  }
14469
15040
  }
14470
15041
  else {
14471
- div.appendChild(this.control.element.cloneNode(true));
15042
+ div.appendChild(divElement);
14472
15043
  }
14473
15044
  return div;
14474
15045
  }
@@ -14483,15 +15054,10 @@ class Print {
14483
15054
  /**
14484
15055
  * To destroy the print.
14485
15056
  *
14486
- * @param {Maps} maps - Specifies the instance of the maps
14487
15057
  * @returns {void}
14488
15058
  * @private
14489
15059
  */
14490
- destroy(maps) {
14491
- /**
14492
- * Destroy method performed here
14493
- */
14494
- }
15060
+ destroy() { }
14495
15061
  }
14496
15062
 
14497
15063
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -14507,7 +15073,6 @@ class ImageExport {
14507
15073
  * @param {Maps} control - Specifies the instance of the map
14508
15074
  */
14509
15075
  constructor(control) {
14510
- this.control = control;
14511
15076
  }
14512
15077
  /**
14513
15078
  * To export the file as image/svg format
@@ -14518,31 +15083,33 @@ class ImageExport {
14518
15083
  * @returns {Promise<string>} - Returns the promise string.
14519
15084
  * @private
14520
15085
  */
14521
- export(type, fileName, allowDownload) {
15086
+ export(maps, type, fileName, allowDownload) {
14522
15087
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14523
15088
  const promise = new Promise((resolve, reject) => {
14524
15089
  const imageCanvasElement = createElement('canvas', {
14525
15090
  id: 'ej2-canvas',
14526
15091
  attrs: {
14527
- 'width': this.control.availableSize.width.toString(),
14528
- 'height': this.control.availableSize.height.toString()
15092
+ 'width': maps.availableSize.width.toString(),
15093
+ 'height': maps.availableSize.height.toString()
14529
15094
  }
14530
15095
  });
14531
15096
  const isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
14532
- const toolbarEle = document.getElementById(this.control.element.id + '_ToolBar');
14533
- 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');
14534
15099
  let svgDataElement;
14535
- if (!this.control.isTileMap) {
15100
+ let tileSvg;
15101
+ let svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
15102
+ if (!maps.isTileMap) {
14536
15103
  svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
14537
- this.control.svgObject.outerHTML + '</svg>';
15104
+ maps.svgObject.outerHTML + '</svg>';
14538
15105
  }
14539
15106
  else {
14540
- const tileSvg = document.getElementById(this.control.element.id + '_Tile_SVG');
15107
+ tileSvg = getElementByID(maps.element.id + '_Tile_SVG').cloneNode(true);
14541
15108
  svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
14542
- this.control.svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
15109
+ svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
14543
15110
  }
14544
15111
  const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgDataElement] :
14545
- [(new XMLSerializer()).serializeToString(this.control.svgObject)], { type: 'image/svg+xml' }));
15112
+ [(new XMLSerializer()).serializeToString(svgObject)], { type: 'image/svg+xml' }));
14546
15113
  if (type === 'SVG') {
14547
15114
  if (allowDownload) {
14548
15115
  triggerDownload(fileName, type, url, isDownload);
@@ -14554,7 +15121,7 @@ class ImageExport {
14554
15121
  else {
14555
15122
  const image = new Image();
14556
15123
  const ctxt = imageCanvasElement.getContext('2d');
14557
- if (!this.control.isTileMap) {
15124
+ if (!maps.isTileMap) {
14558
15125
  image.onload = (() => {
14559
15126
  ctxt.drawImage(image, 0, 0);
14560
15127
  window.URL.revokeObjectURL(url);
@@ -14573,31 +15140,37 @@ class ImageExport {
14573
15140
  image.src = url;
14574
15141
  }
14575
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'));
14576
15146
  const imgxHttp = new XMLHttpRequest();
14577
- const imgTileLength = this.control.mapLayerPanel.tiles.length;
15147
+ const imgTileLength = maps.mapLayerPanel.tiles.length;
14578
15148
  for (let i = 0; i <= imgTileLength + 1; i++) {
14579
- const tile = document.getElementById(this.control.element.id + '_tile_' + (i - 1));
15149
+ const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
14580
15150
  const exportTileImg = new Image();
14581
15151
  exportTileImg.crossOrigin = 'Anonymous';
14582
- ctxt.fillStyle = this.control.background ? this.control.background : '#FFFFFF';
14583
- ctxt.fillRect(0, 0, this.control.availableSize.width, this.control.availableSize.height);
14584
- ctxt.font = this.control.titleSettings.textStyle.size + ' Arial';
14585
- ctxt.fillStyle = document.getElementById(this.control.element.id + '_Map_title').getAttribute('fill');
14586
- 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
+ }
14587
15160
  exportTileImg.onload = (() => {
14588
15161
  if (i === 0 || i === imgTileLength + 1) {
14589
15162
  if (i === 0) {
14590
15163
  ctxt.setTransform(1, 0, 0, 1, 0, 0);
14591
- 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));
14592
15165
  ctxt.clip();
14593
15166
  }
14594
15167
  else {
14595
- ctxt.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), parseFloat(svgParent.style.top));
15168
+ ctxt.setTransform(1, 0, 0, 1, left, top);
14596
15169
  }
14597
15170
  }
14598
15171
  else {
14599
- ctxt.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + 10, parseFloat(tile.style.top) +
14600
- (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);
14601
15174
  }
14602
15175
  ctxt.drawImage(exportTileImg, 0, 0);
14603
15176
  if (i === imgTileLength + 1) {
@@ -14623,7 +15196,7 @@ class ImageExport {
14623
15196
  }
14624
15197
  else {
14625
15198
  setTimeout(() => {
14626
- 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' }));
14627
15200
  }, 300);
14628
15201
  }
14629
15202
  }
@@ -14649,15 +15222,10 @@ class ImageExport {
14649
15222
  /**
14650
15223
  * To destroy the ImageExport.
14651
15224
  *
14652
- * @param {Maps} maps - Specifies the instance of the maps.
14653
15225
  * @returns {void}
14654
15226
  * @private
14655
15227
  */
14656
- destroy(maps) {
14657
- /**
14658
- * Destroy method performed here
14659
- */
14660
- }
15228
+ destroy() { }
14661
15229
  }
14662
15230
 
14663
15231
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -14672,9 +15240,7 @@ class PdfExport {
14672
15240
  *
14673
15241
  * @param {Maps} control Specifies the instance of the map
14674
15242
  */
14675
- constructor(control) {
14676
- this.control = control;
14677
- }
15243
+ constructor() { }
14678
15244
  /**
14679
15245
  * To export the file as image/svg format
14680
15246
  *
@@ -14685,24 +15251,24 @@ class PdfExport {
14685
15251
  * @returns {Promise<string>} - Returns the promise string
14686
15252
  * @private
14687
15253
  */
14688
- export(type, fileName, allowDownload, orientation) {
15254
+ export(maps, type, fileName, allowDownload, orientation) {
14689
15255
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14690
15256
  const promise = new Promise((resolve, reject) => {
14691
15257
  const canvasElement = createElement('canvas', {
14692
15258
  id: 'ej2-canvas',
14693
15259
  attrs: {
14694
- 'width': this.control.availableSize.width.toString(),
14695
- 'height': this.control.availableSize.height.toString()
15260
+ 'width': maps.availableSize.width.toString(),
15261
+ 'height': maps.availableSize.height.toString()
14696
15262
  }
14697
15263
  });
14698
15264
  orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;
14699
- const svgParent = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
15265
+ const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
14700
15266
  let svgData;
14701
- const exportElement = this.control.svgObject.cloneNode(true);
15267
+ const exportElement = maps.svgObject.cloneNode(true);
14702
15268
  const backgroundElement = exportElement.childNodes[0];
14703
15269
  const backgroundColor = backgroundElement.getAttribute('fill');
14704
- if ((this.control.theme === 'Tailwind' || this.control.theme === 'TailwindDark' || this.control.theme === 'Bootstrap5' || this.control.theme === 'Bootstrap5Dark')
14705
- && (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')) {
14706
15272
  exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
14707
15273
  }
14708
15274
  const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
@@ -14710,7 +15276,7 @@ class PdfExport {
14710
15276
  const pdfDocument = new PdfDocument();
14711
15277
  const image = new Image();
14712
15278
  const ctx = canvasElement.getContext('2d');
14713
- if (!this.control.isTileMap) {
15279
+ if (!maps.isTileMap) {
14714
15280
  image.onload = (() => {
14715
15281
  ctx.drawImage(image, 0, 0);
14716
15282
  window.URL.revokeObjectURL(url);
@@ -14718,7 +15284,7 @@ class PdfExport {
14718
15284
  let imageString = canvasElement.toDataURL('image/jpeg').replace('image/jpeg', 'image/octet-stream');
14719
15285
  pdfDocument.pageSettings.orientation = orientation;
14720
15286
  imageString = imageString.slice(imageString.indexOf(',') + 1);
14721
- 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);
14722
15288
  if (allowDownload) {
14723
15289
  pdfDocument.save(fileName + '.pdf');
14724
15290
  pdfDocument.destroy();
@@ -14731,31 +15297,36 @@ class PdfExport {
14731
15297
  image.src = url;
14732
15298
  }
14733
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'));
14734
15303
  const xHttp = new XMLHttpRequest();
14735
- const tileLength = this.control.mapLayerPanel.tiles.length;
15304
+ const tileLength = maps.mapLayerPanel.tiles.length;
14736
15305
  for (let i = 0; i <= tileLength + 1; i++) {
14737
- const tile = document.getElementById(this.control.element.id + '_tile_' + (i - 1));
15306
+ const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
14738
15307
  const tileImg = new Image();
14739
15308
  tileImg.crossOrigin = 'Anonymous';
14740
- ctx.fillStyle = this.control.background ? this.control.background : '#FFFFFF';
14741
- ctx.fillRect(0, 0, this.control.availableSize.width, this.control.availableSize.height);
14742
- ctx.font = this.control.titleSettings.textStyle.size + ' Arial';
14743
- ctx.fillStyle = document.getElementById(this.control.element.id + '_Map_title').getAttribute('fill');
14744
- 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
+ }
14745
15317
  tileImg.onload = (() => {
14746
15318
  if (i === 0 || i === tileLength + 1) {
14747
15319
  if (i === 0) {
14748
15320
  ctx.setTransform(1, 0, 0, 1, 0, 0);
14749
- 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));
14750
15322
  ctx.clip();
14751
15323
  }
14752
15324
  else {
14753
- ctx.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), parseFloat(svgParent.style.top));
15325
+ ctx.setTransform(1, 0, 0, 1, left, top);
14754
15326
  }
14755
15327
  }
14756
15328
  else {
14757
- ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + 10, parseFloat(tile.style.top) +
14758
- (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);
14759
15330
  }
14760
15331
  ctx.drawImage(tileImg, 0, 0);
14761
15332
  if (i === tileLength + 1) {
@@ -14764,7 +15335,7 @@ class PdfExport {
14764
15335
  let x = localStorage.getItem('saved-image-example');
14765
15336
  pdfDocument.pageSettings.orientation = orientation;
14766
15337
  x = x.slice(x.indexOf(',') + 1);
14767
- 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);
14768
15339
  if (allowDownload) {
14769
15340
  pdfDocument.save(fileName + '.pdf');
14770
15341
  pdfDocument.destroy();
@@ -14781,7 +15352,8 @@ class PdfExport {
14781
15352
  }
14782
15353
  else {
14783
15354
  setTimeout(() => {
14784
- 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' }));
14785
15357
  }, 300);
14786
15358
  }
14787
15359
  }
@@ -14804,17 +15376,12 @@ class PdfExport {
14804
15376
  return 'PdfExport';
14805
15377
  }
14806
15378
  /**
14807
- * To destroy the PdfExports.
15379
+ * To destroy the PdfExport.
14808
15380
  *
14809
- * @param {Maps} maps - Specifies the instance of the maps.
14810
15381
  * @returns {void}
14811
15382
  * @private
14812
15383
  */
14813
- destroy(maps) {
14814
- /**
14815
- * Destroy method performed here
14816
- */
14817
- }
15384
+ destroy() { }
14818
15385
  }
14819
15386
 
14820
15387
  /**
@@ -14825,5 +15392,5 @@ class PdfExport {
14825
15392
  * exporting all modules from maps index
14826
15393
  */
14827
15394
 
14828
- 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 };
14829
15396
  //# sourceMappingURL=ej2-maps.es2015.js.map