@syncfusion/ej2-maps 23.2.7 → 24.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -213,6 +213,25 @@ function convertGeoToPoint(latitude, longitude, factor, layer, mapModel) {
213
213
  }
214
214
  return new Point(x, y);
215
215
  }
216
+ /**
217
+ * @private
218
+ */
219
+ function calculatePolygonPath(maps, factor, currentLayer, markerData) {
220
+ var path = '';
221
+ Array.prototype.forEach.call(markerData, function (data, dataIndex) {
222
+ var lat = data.latitude;
223
+ var lng = data.longitude;
224
+ var location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
225
+ if (dataIndex === 0) {
226
+ path += 'M ' + location.x + ' ' + location.y;
227
+ }
228
+ else {
229
+ path += ' L ' + location.x + ' ' + location.y;
230
+ }
231
+ });
232
+ path += ' z ';
233
+ return path;
234
+ }
216
235
  /**
217
236
  * Converting tile latitude and longitude to point
218
237
  *
@@ -355,6 +374,16 @@ var Point = /** @__PURE__ @class */ (function () {
355
374
  }
356
375
  return Point;
357
376
  }());
377
+ /**
378
+ * Defines the latitude and longitude values that define a map location.
379
+ */
380
+ var Coordinate = /** @__PURE__ @class */ (function () {
381
+ function Coordinate(latitude, longitude) {
382
+ this.latitude = latitude;
383
+ this.longitude = longitude;
384
+ }
385
+ return Coordinate;
386
+ }());
358
387
  /**
359
388
  * Map internal class for min and max
360
389
  *
@@ -947,46 +976,50 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
947
976
  width: clusters.width, imageUrl: clusters.imageUrl, shape: clusters.shape,
948
977
  data: data, maps: maps, cluster: clusters, border: clusters.border
949
978
  };
979
+ var containerRect = maps.element.getBoundingClientRect();
980
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
981
+ var translatePoint = (maps.isTileMap) ? new Object() : getTranslate(maps, currentLayer, false);
982
+ var factor;
983
+ if (!maps.isTileMap) {
984
+ factor = maps.mapLayerPanel.calculateFactor(currentLayer);
985
+ }
986
+ var isClusteringCompleted = false;
950
987
  maps.trigger('markerClusterRendering', eventArg, function (clusterargs) {
951
- for (var o = 0; o < markerTemplate.childElementCount; o++) {
988
+ Array.prototype.forEach.call(markerTemplate.childNodes, function (markerElement, o) {
952
989
  indexCollection = [];
953
- if (markerTemplate.childNodes[o]['style']['visibility'] !== 'hidden') {
954
- tempElement = markerTemplate.childNodes[o];
990
+ if (markerElement['style']['visibility'] !== 'hidden') {
991
+ tempElement = markerElement;
955
992
  bounds1 = tempElement.getBoundingClientRect();
956
993
  indexCollection.push(o);
957
994
  if (!isNullOrUndefined(bounds1)) {
958
- for (var p = o + 1; p < markerTemplate.childElementCount; p++) {
959
- if (markerTemplate.childNodes[p]['style']['visibility'] !== 'hidden') {
960
- tempElement = markerTemplate.childNodes[p];
995
+ Array.prototype.forEach.call(markerTemplate.childNodes, function (otherMarkerElement, p) {
996
+ if (p >= o + 1 && otherMarkerElement['style']['visibility'] !== 'hidden') {
997
+ tempElement = otherMarkerElement;
961
998
  bounds2 = tempElement.getBoundingClientRect();
962
999
  if (!isNullOrUndefined(bounds2)) {
963
1000
  if (!(bounds1.left > bounds2.right || bounds1.right < bounds2.left
964
1001
  || bounds1.top > bounds2.bottom || bounds1.bottom < bounds2.top)) {
965
1002
  colloideBounds.push(bounds2);
966
- markerTemplate.childNodes[p]['style']['visibility'] = 'hidden';
1003
+ otherMarkerElement['style']['visibility'] = 'hidden';
967
1004
  indexCollection.push(p);
968
1005
  }
969
1006
  }
970
1007
  }
971
- }
1008
+ });
972
1009
  tempX = bounds1.left + bounds1.width / 2;
973
1010
  tempY = bounds1.top + bounds1.height;
974
1011
  if (colloideBounds.length > 0) {
975
1012
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
976
1013
  indexCollection = indexCollection.filter(function (item, index, value) { return value.indexOf(item) === index; });
977
- var container = maps.element.getBoundingClientRect();
978
- tempX = tempX - container['left'];
979
- tempY = (tempY - ((maps.availableSize.height <= container['height']) ?
980
- container['top'] : (container['bottom'] - container['top'])));
981
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
982
- var translate = (maps.isTileMap) ? new Object() : getTranslate(maps, currentLayer, false);
983
- var dataIndex = parseInt(markerTemplate.childNodes[o]['id'].split('_dataIndex_')[1].split('_')[0], 10);
984
- var markerIndex = parseInt(markerTemplate.childNodes[o]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
1014
+ tempX = tempX - containerRect['left'];
1015
+ tempY = (tempY - ((maps.availableSize.height <= containerRect['height']) ?
1016
+ containerRect['top'] : (containerRect['bottom'] - containerRect['top'])));
1017
+ var dataIndex = parseInt(markerElement['id'].split('_dataIndex_')[1].split('_')[0], 10);
1018
+ var markerIndex = parseInt(markerElement['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
985
1019
  var markerSetting = currentLayer.markerSettings[markerIndex];
986
1020
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
987
1021
  var markerData = markerSetting.dataSource[dataIndex];
988
- var factor = void 0;
989
- var location_1 = void 0;
1022
+ var location_1;
990
1023
  var longitude = (!isNullOrUndefined(markerSetting.longitudeValuePath)) ?
991
1024
  Number(getValueFromObject(markerData, markerSetting.longitudeValuePath)) :
992
1025
  !isNullOrUndefined(markerData['longitude']) ? parseFloat(markerData['longitude']) :
@@ -996,45 +1029,30 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
996
1029
  !isNullOrUndefined(markerData['latitude']) ? parseFloat(markerData['latitude']) :
997
1030
  !isNullOrUndefined(markerData['Latitude']) ? parseFloat(markerData['Latitude']) : 0;
998
1031
  if (!maps.isTileMap) {
999
- factor = maps.mapLayerPanel.calculateFactor(currentLayer);
1000
1032
  location_1 = convertGeoToPoint(latitude, longitude, factor, currentLayer, maps);
1001
1033
  }
1002
1034
  else if (maps.isTileMap && !maps.zoomSettings.enable) {
1003
1035
  location_1 = convertTileLatLongToPoint(new Point(longitude, latitude), maps.tileZoomLevel, maps.tileTranslatePoint, true);
1004
1036
  }
1005
- markerTemplate.childNodes[o]['style']['visibility'] = 'hidden';
1006
- var clusters_1 = currentLayer.markerClusterSettings;
1037
+ markerElement['style']['visibility'] = 'hidden';
1007
1038
  if (eventArg.cancel) {
1008
1039
  shapeCustom = {
1009
- size: new Size(clusters_1.width, clusters_1.height),
1010
- fill: clusters_1.fill, borderColor: clusters_1.border.color,
1011
- borderWidth: clusters_1.border.width, opacity: clusters_1.opacity,
1012
- dashArray: clusters_1.dashArray
1040
+ size: new Size(clusters.width, clusters.height),
1041
+ fill: clusters.fill, borderColor: clusters.border.color,
1042
+ borderWidth: clusters.border.width, opacity: clusters.opacity,
1043
+ dashArray: clusters.dashArray, imageUrl: clusters.imageUrl, shape: clusters.shape
1013
1044
  };
1014
- shapeCustom['fill'] = clusters_1.fill;
1015
- shapeCustom['size']['width'] = clusters_1.width;
1016
- shapeCustom['size']['height'] = clusters_1.height;
1017
- shapeCustom['imageUrl'] = clusters_1.imageUrl;
1018
- shapeCustom['shape'] = clusters_1.shape;
1019
- shapeCustom['borderColor'] = clusters_1.border.color;
1020
- shapeCustom['borderWidth'] = clusters_1.border.width;
1021
- shapeCustom['borderOpacity'] = isNullOrUndefined(clusters_1.border.opacity) ? clusters_1.opacity : clusters_1.border.opacity;
1045
+ shapeCustom['borderOpacity'] = isNullOrUndefined(clusters.border.opacity) ? clusters.opacity : clusters.border.opacity;
1022
1046
  }
1023
1047
  else {
1024
1048
  shapeCustom = {
1025
- size: new Size(clusters_1.width, clusters_1.height),
1026
- fill: clusters_1.fill, borderColor: clusters_1.border.color,
1027
- borderWidth: clusters_1.border.width, opacity: clusters_1.opacity,
1028
- dashArray: clusters_1.dashArray
1049
+ size: new Size(eventArg.width, eventArg.height),
1050
+ fill: eventArg.fill, borderColor: eventArg.border.color,
1051
+ borderWidth: eventArg.border.width, opacity: clusters.opacity,
1052
+ dashArray: clusters.dashArray, imageUrl: eventArg.imageUrl,
1053
+ shape: eventArg.shape
1029
1054
  };
1030
- shapeCustom['fill'] = eventArg.fill;
1031
- shapeCustom['size']['width'] = eventArg.width;
1032
- shapeCustom['size']['height'] = eventArg.height;
1033
- shapeCustom['imageUrl'] = eventArg.imageUrl;
1034
- shapeCustom['shape'] = eventArg.shape;
1035
- shapeCustom['borderColor'] = eventArg.border.color;
1036
- shapeCustom['borderWidth'] = eventArg.border.width;
1037
- shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters_1.opacity : eventArg.border.opacity;
1055
+ shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters.opacity : eventArg.border.opacity;
1038
1056
  }
1039
1057
  tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
1040
1058
  tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
@@ -1062,48 +1080,51 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1062
1080
  }
1063
1081
  colloideBounds = [];
1064
1082
  }
1065
- }
1083
+ isClusteringCompleted = true;
1084
+ });
1066
1085
  layerElement.appendChild(clusterGroup);
1067
1086
  maps.svgObject.appendChild(layerElement);
1068
1087
  maps.element.appendChild(maps.svgObject);
1069
- for (var o = 0; o < clusterGroup.childElementCount; o++) {
1070
- if (clusterGroup.childNodes[o]['style']['visibility'] !== 'hidden') {
1071
- tempElement = clusterGroup.childNodes[o];
1072
- bounds1 = tempElement.getBoundingClientRect();
1073
- if (!isNullOrUndefined(bounds1) && !(tempElement.id.indexOf('_datalabel_') > -1)) {
1074
- for (var p = o + 1; p < clusterGroup.childElementCount; p++) {
1075
- if (clusterGroup.childNodes[p]['style']['visibility'] !== 'hidden') {
1076
- tempElement1 = clusterGroup.childNodes[p];
1077
- bounds2 = tempElement1.getBoundingClientRect();
1078
- if (!isNullOrUndefined(bounds2) && !(tempElement1.id.indexOf('_datalabel_') > -1)) {
1079
- if (!(bounds1.left > bounds2.right || bounds1.right < bounds2.left
1080
- || bounds1.top > bounds2.bottom || bounds1.bottom < bounds2.top)) {
1081
- clusterColloideBounds.push(tempElement1);
1082
- clusterColloideBounds.push(clusterGroup.childNodes[p - 1]);
1083
- clusterGroup.childNodes[p]['style']['visibility'] = 'hidden';
1084
- clusterGroup.childNodes[p - 1]['style']['visibility'] = 'hidden';
1085
- indexCollection.push(p);
1088
+ if (clusters.allowDeepClustering) {
1089
+ Array.prototype.forEach.call(clusterGroup.childNodes, function (clusterElement, o) {
1090
+ if (clusterElement['style']['visibility'] !== 'hidden') {
1091
+ tempElement = clusterElement;
1092
+ bounds1 = tempElement.getBoundingClientRect();
1093
+ if (!isNullOrUndefined(bounds1) && !(tempElement.id.indexOf('_datalabel_') > -1)) {
1094
+ for (var p = o + 1; p < clusterGroup.childElementCount; p++) {
1095
+ if (clusterGroup.childNodes[p]['style']['visibility'] !== 'hidden') {
1096
+ tempElement1 = clusterGroup.childNodes[p];
1097
+ bounds2 = tempElement1.getBoundingClientRect();
1098
+ if (!isNullOrUndefined(bounds2) && !(tempElement1.id.indexOf('_datalabel_') > -1)) {
1099
+ if (!(bounds1.left > bounds2.right || bounds1.right < bounds2.left
1100
+ || bounds1.top > bounds2.bottom || bounds1.bottom < bounds2.top)) {
1101
+ clusterColloideBounds.push(tempElement1);
1102
+ clusterColloideBounds.push(clusterGroup.childNodes[p - 1]);
1103
+ clusterGroup.childNodes[p]['style']['visibility'] = 'hidden';
1104
+ clusterGroup.childNodes[p - 1]['style']['visibility'] = 'hidden';
1105
+ indexCollection.push(p);
1106
+ }
1086
1107
  }
1087
1108
  }
1088
1109
  }
1089
- }
1090
- if (clusterColloideBounds.length > 0) {
1091
- tempElement = clusterGroup.childNodes[o];
1092
- for (var i = 0; i < clusterColloideBounds.length; i++) {
1093
- if (tempElement.tagName === 'g') {
1094
- tempElement.childNodes[0].textContent = tempElement.childNodes[0].textContent + ',' +
1095
- clusterColloideBounds[i].textContent;
1096
- }
1097
- else {
1098
- tempElement.textContent = tempElement.textContent + ',' + clusterColloideBounds[i].textContent;
1110
+ if (clusterColloideBounds.length > 0) {
1111
+ tempElement = clusterElement;
1112
+ for (var i = 0; i < clusterColloideBounds.length; i++) {
1113
+ if (tempElement.tagName === 'g') {
1114
+ tempElement.childNodes[0].textContent = tempElement.childNodes[0].textContent + ',' +
1115
+ clusterColloideBounds[i].textContent;
1116
+ }
1117
+ else {
1118
+ tempElement.textContent = tempElement.textContent + ',' + clusterColloideBounds[i].textContent;
1119
+ }
1120
+ clusterGroup.childNodes[o - 1].textContent = ((+(clusterGroup.childNodes[o - 1].textContent)) + (+(clusterColloideBounds[i + 1].textContent))).toString();
1121
+ i++;
1099
1122
  }
1100
- clusterGroup.childNodes[o - 1].textContent = ((+(clusterGroup.childNodes[o - 1].textContent)) + (+(clusterColloideBounds[i + 1].textContent))).toString();
1101
- i++;
1102
1123
  }
1124
+ clusterColloideBounds = [];
1103
1125
  }
1104
- clusterColloideBounds = [];
1105
1126
  }
1106
- }
1127
+ });
1107
1128
  }
1108
1129
  while (0 < clusterGroup.childNodes.length) {
1109
1130
  markerCollection.insertBefore(clusterGroup.childNodes[0], markerCollection.firstChild);
@@ -1112,12 +1133,24 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1112
1133
  getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
1113
1134
  }
1114
1135
  var element = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
1115
- if (isNullOrUndefined(element)) {
1136
+ var polygonElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
1137
+ if (isNullOrUndefined(element) && !maps.isTileMap) {
1116
1138
  layerElement.insertBefore(markerCollection, layerElement.firstChild);
1117
1139
  }
1118
- else {
1140
+ else if (!maps.isTileMap) {
1119
1141
  layerElement.appendChild(markerCollection);
1120
1142
  }
1143
+ else {
1144
+ if (!isNullOrUndefined(polygonElement)) {
1145
+ polygonElement.insertAdjacentElement('afterend', markerCollection);
1146
+ }
1147
+ else if (!isNullOrUndefined(element)) {
1148
+ element.insertAdjacentElement('afterend', markerCollection);
1149
+ }
1150
+ else {
1151
+ layerElement.insertBefore(markerCollection, layerElement.firstChild);
1152
+ }
1153
+ }
1121
1154
  var markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
1122
1155
  if (!isNullOrUndefined(markerCluster)) {
1123
1156
  markerCluster.remove();
@@ -1133,6 +1166,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
1133
1166
  }
1134
1167
  }
1135
1168
  });
1169
+ return isClusteringCompleted;
1136
1170
  }
1137
1171
  /**
1138
1172
  *
@@ -1649,7 +1683,7 @@ function drawBalloon(maps, options, size, location, type, element) {
1649
1683
  var height = size.height;
1650
1684
  var pathElement;
1651
1685
  location.x -= width / 2;
1652
- location.y -= height / 2;
1686
+ location.y -= ((options.id.indexOf('cluster') > -1) ? (height / 2) : options.id.indexOf('Legend') > -1 ? height / 1.25 : height);
1653
1687
  options.d = 'M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16' +
1654
1688
  'c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S17.8,16,15,16z';
1655
1689
  var balloon = maps.renderer.drawPath(options);
@@ -2058,7 +2092,8 @@ function getTranslate(mapObject, layer, animate) {
2058
2092
  var topPosition = (((mapHeight + Math.abs(mapObject.mapAreaRect.height - mapHeight)) / 2) + mapObject.mapAreaRect.y) / factor;
2059
2093
  var point = checkMethodeZoom ? calculateCenterFromPixel(mapObject, layer) :
2060
2094
  convertGeoToPoint(centerLatitude, centerLongitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
2061
- if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
2095
+ if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
2096
+ || mapObject.isMarkerZoomCompleted) {
2062
2097
  x = -point.x + leftPosition;
2063
2098
  y = -point.y + topPosition;
2064
2099
  scaleFactor = zoomFactor;
@@ -3027,6 +3062,13 @@ function changeBorderWidth(element, index, scale, maps) {
3027
3062
  if (childNode.id.indexOf('_NavigationGroup') > -1) {
3028
3063
  changeNavaigationLineWidth(childNode, index, scale, maps);
3029
3064
  }
3065
+ else if (childNode.id.indexOf('_Polygons_Group') > -1) {
3066
+ for (var i = 0; i < childNode.childElementCount; i++) {
3067
+ // eslint-disable-next-line
3068
+ var width = maps.layersCollection[index].polygonSettings.polygons[parseInt(childNode.children[i].id.split('_PolygonIndex_')[1])].borderWidth;
3069
+ childNode.children[i].setAttribute('stroke-width', (width / scale).toString());
3070
+ }
3071
+ }
3030
3072
  else {
3031
3073
  var currentStroke = void 0;
3032
3074
  var value = 0;
@@ -4411,6 +4453,9 @@ var MarkerClusterSettings = /** @__PURE__ @class */ (function (_super) {
4411
4453
  __decorate$1([
4412
4454
  Property(false)
4413
4455
  ], MarkerClusterSettings.prototype, "allowClustering", void 0);
4456
+ __decorate$1([
4457
+ Property(true)
4458
+ ], MarkerClusterSettings.prototype, "allowDeepClustering", void 0);
4414
4459
  __decorate$1([
4415
4460
  Complex({ color: 'transparent', width: 1 }, Border)
4416
4461
  ], MarkerClusterSettings.prototype, "border", void 0);
@@ -4574,6 +4619,54 @@ var HighlightSettings = /** @__PURE__ @class */ (function (_super) {
4574
4619
  ], HighlightSettings.prototype, "border", void 0);
4575
4620
  return HighlightSettings;
4576
4621
  }(ChildProperty));
4622
+ /**
4623
+ * Defines the properties for a single polygon shape to render over the Maps, such as coordinates, fill, border, and opacity.
4624
+ */
4625
+ var PolygonSetting = /** @__PURE__ @class */ (function (_super) {
4626
+ __extends$2(PolygonSetting, _super);
4627
+ function PolygonSetting() {
4628
+ return _super !== null && _super.apply(this, arguments) || this;
4629
+ }
4630
+ __decorate$1([
4631
+ Property(1)
4632
+ ], PolygonSetting.prototype, "borderWidth", void 0);
4633
+ __decorate$1([
4634
+ Property(1)
4635
+ ], PolygonSetting.prototype, "borderOpacity", void 0);
4636
+ __decorate$1([
4637
+ Property(1)
4638
+ ], PolygonSetting.prototype, "opacity", void 0);
4639
+ __decorate$1([
4640
+ Property('#FF471A')
4641
+ ], PolygonSetting.prototype, "borderColor", void 0);
4642
+ __decorate$1([
4643
+ Property('#FF471A')
4644
+ ], PolygonSetting.prototype, "fill", void 0);
4645
+ __decorate$1([
4646
+ Property([])
4647
+ ], PolygonSetting.prototype, "points", void 0);
4648
+ return PolygonSetting;
4649
+ }(ChildProperty));
4650
+ /**
4651
+ * Defines the properties of the polygon shapes that will be rendered on a map layer.
4652
+ * The selection and highlight settings for polygon shapes can also be defined.
4653
+ */
4654
+ var PolygonSettings = /** @__PURE__ @class */ (function (_super) {
4655
+ __extends$2(PolygonSettings, _super);
4656
+ function PolygonSettings() {
4657
+ return _super !== null && _super.apply(this, arguments) || this;
4658
+ }
4659
+ __decorate$1([
4660
+ Collection([], PolygonSetting)
4661
+ ], PolygonSettings.prototype, "polygons", void 0);
4662
+ __decorate$1([
4663
+ Complex({}, SelectionSettings)
4664
+ ], PolygonSettings.prototype, "selectionSettings", void 0);
4665
+ __decorate$1([
4666
+ Complex({}, HighlightSettings)
4667
+ ], PolygonSettings.prototype, "highlightSettings", void 0);
4668
+ return PolygonSettings;
4669
+ }(ChildProperty));
4577
4670
  /**
4578
4671
  * Gets or sets the options to customize the navigation lines in maps which is used to connect different locations.
4579
4672
  */
@@ -5185,6 +5278,9 @@ var LayerSettings = /** @__PURE__ @class */ (function (_super) {
5185
5278
  __decorate$1([
5186
5279
  Collection([], NavigationLineSettings)
5187
5280
  ], LayerSettings.prototype, "navigationLineSettings", void 0);
5281
+ __decorate$1([
5282
+ Complex({}, PolygonSettings)
5283
+ ], LayerSettings.prototype, "polygonSettings", void 0);
5188
5284
  __decorate$1([
5189
5285
  Complex({}, TooltipSettings)
5190
5286
  ], LayerSettings.prototype, "tooltipSettings", void 0);
@@ -5240,501 +5336,7 @@ var MapsAreaSettings = /** @__PURE__ @class */ (function (_super) {
5240
5336
  }(ChildProperty));
5241
5337
 
5242
5338
  /**
5243
- * Marker class
5244
- */
5245
- var Marker = /** @__PURE__ @class */ (function () {
5246
- function Marker(maps) {
5247
- this.maps = maps;
5248
- this.trackElements = [];
5249
- this.sameMarkerData = [];
5250
- }
5251
- Marker.prototype.markerRender = function (maps, layerElement, layerIndex, factor, type) {
5252
- var _this = this;
5253
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5254
- var templateFn;
5255
- var markerCount = 0;
5256
- var nullCount = 0;
5257
- var markerTemplateCount = 0;
5258
- maps.translateType = 'marker';
5259
- var currentLayer = maps.layersCollection[layerIndex];
5260
- this.markerSVGObject = maps.renderer.createGroup({
5261
- id: maps.element.id + '_Markers_Group',
5262
- class: 'GroupElement'
5263
- });
5264
- this.markerSVGObject.style.pointerEvents = 'auto';
5265
- var markerTemplateEle = createElement('div', {
5266
- id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
5267
- className: maps.element.id + '_template'
5268
- });
5269
- markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
5270
- 'top:' + maps.mapAreaRect.y + 'px;' +
5271
- 'left:' + maps.mapAreaRect.x + 'px;' +
5272
- 'height:' + maps.mapAreaRect.height + 'px;' +
5273
- 'width:' + maps.mapAreaRect.width + 'px;';
5274
- currentLayer.markerSettings.map(function (markerSettings, markerIndex) {
5275
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5276
- var markerData = markerSettings.dataSource;
5277
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5278
- Array.prototype.forEach.call(markerData, function (data, dataIndex) {
5279
- maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
5280
- var eventArgs = {
5281
- cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
5282
- width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
5283
- template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
5284
- border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
5285
- shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
5286
- };
5287
- maps.trigger('markerRendering', eventArgs, function (MarkerArgs) {
5288
- eventArgs = markerColorChoose(eventArgs, data);
5289
- eventArgs = markerShapeChoose(eventArgs, data);
5290
- var lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
5291
- Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
5292
- parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
5293
- var lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
5294
- Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
5295
- parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
5296
- var offset = markerSettings.offset;
5297
- if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
5298
- var markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
5299
- + markerIndex + '_dataIndex_' + dataIndex;
5300
- var location_1 = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
5301
- var animate$$1 = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
5302
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5303
- var translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location_1 = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
5304
- !isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
5305
- getZoomTranslate(maps, currentLayer, animate$$1) :
5306
- getTranslate(maps, currentLayer, animate$$1);
5307
- var scale = type === 'AddMarker' ? maps.scale : translate['scale'];
5308
- var transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
5309
- if (eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
5310
- markerTemplateCount++;
5311
- markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location_1, transPoint, scale, offset, maps);
5312
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5313
- maps.renderReactTemplates();
5314
- }
5315
- else if (!eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
5316
- markerCount++;
5317
- marker(eventArgs, markerSettings, markerData, dataIndex, location_1, transPoint, markerID, offset, scale, maps, _this.markerSVGObject);
5318
- }
5319
- }
5320
- nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
5321
- markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
5322
- markerCount += (eventArgs.cancel) ? 1 : 0;
5323
- maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
5324
- maps.markerNullCount + 1 : maps.markerNullCount;
5325
- var markerDataLength = markerData.length - maps.markerNullCount;
5326
- if (_this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
5327
- layerElement.appendChild(_this.markerSVGObject);
5328
- if (currentLayer.markerClusterSettings.allowClustering) {
5329
- maps.svgObject.appendChild(_this.markerSVGObject);
5330
- maps.element.appendChild(maps.svgObject);
5331
- if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
5332
- && maps.zoomSettings.enable) {
5333
- clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
5334
- layerElement.appendChild(_this.markerSVGObject);
5335
- }
5336
- else {
5337
- clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
5338
- }
5339
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5340
- maps.renderReactTemplates();
5341
- }
5342
- }
5343
- if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
5344
- getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
5345
- if (maps.checkInitialRender) {
5346
- if (currentLayer.markerClusterSettings.allowClustering) {
5347
- clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, _this.markerSVGObject, layerElement, false, false);
5348
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5349
- maps.renderReactTemplates();
5350
- }
5351
- }
5352
- }
5353
- });
5354
- });
5355
- });
5356
- };
5357
- /**
5358
- * To find zoom level for individual layers like India, USA.
5359
- *
5360
- * @param {number} mapWidth - Specifies the width of the maps
5361
- * @param {number} mapHeight - Specifies the height of the maps
5362
- * @param {number} maxZoomFact - Specifies the maximum zoom factor
5363
- * @returns {number} - Returns the scale factor
5364
- */
5365
- Marker.prototype.calculateIndividualLayerMarkerZoomLevel = function (mapWidth, mapHeight, maxZoomFact) {
5366
- var latZoom;
5367
- var lngZoom;
5368
- var height = Math.abs(this.maps.baseMapBounds.latitude.max - this.maps.baseMapBounds.latitude.min);
5369
- var width = Math.abs(this.maps.baseMapBounds.longitude.max - this.maps.baseMapBounds.longitude.min);
5370
- latZoom = Math.floor(Math.log(mapHeight / height));
5371
- latZoom = (latZoom > maxZoomFact) ? maxZoomFact : latZoom;
5372
- lngZoom = Math.floor(Math.log(mapWidth / width));
5373
- lngZoom = (lngZoom > maxZoomFact) ? maxZoomFact : lngZoom;
5374
- var result = Math.min(latZoom, lngZoom);
5375
- var scaleFactor = Math.min(result, maxZoomFact - 1);
5376
- if (!this.maps.isTileMap) {
5377
- compareZoomFactor(scaleFactor, this.maps);
5378
- }
5379
- return scaleFactor;
5380
- };
5381
- /**
5382
- * To calculate center position and factor value dynamically
5383
- *
5384
- * @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
5385
- * @returns {void}
5386
- * @private
5387
- */
5388
- Marker.prototype.calculateZoomCenterPositionAndFactor = function (layersCollection) {
5389
- if (!isNullOrUndefined(this.maps)) {
5390
- if (this.maps.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
5391
- var minLong_1;
5392
- var maxLat_1;
5393
- var minLat_1;
5394
- var maxLong_1;
5395
- var zoomLevel = void 0;
5396
- var centerLat = void 0;
5397
- var centerLong = void 0;
5398
- var maxZoomFact = this.maps.zoomSettings.maxZoom;
5399
- var mapWidth = this.maps.mapAreaRect.width;
5400
- var mapHeight = this.maps.mapAreaRect.height;
5401
- this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState :
5402
- isNullOrUndefined(this.maps.markerZoomFactor) ? !this.maps.markerZoomedState :
5403
- this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
5404
- this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
5405
- Array.prototype.forEach.call(layersCollection, function (currentLayer) {
5406
- var isMarker = currentLayer.markerSettings.length !== 0;
5407
- if (isMarker) {
5408
- Array.prototype.forEach.call(currentLayer.markerSettings, function (markerSetting) {
5409
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5410
- var markerData = markerSetting.dataSource;
5411
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5412
- Array.prototype.forEach.call(markerData, function (data, dataIndex) {
5413
- var latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
5414
- !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
5415
- var longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
5416
- !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
5417
- minLong_1 = isNullOrUndefined(minLong_1) && dataIndex === 0 ?
5418
- longitude : minLong_1;
5419
- maxLat_1 = isNullOrUndefined(maxLat_1) && dataIndex === 0 ?
5420
- latitude : maxLat_1;
5421
- minLat_1 = isNullOrUndefined(minLat_1) && dataIndex === 0 ?
5422
- latitude : minLat_1;
5423
- maxLong_1 = isNullOrUndefined(maxLong_1) && dataIndex === 0 ?
5424
- longitude : maxLong_1;
5425
- if (minLong_1 > longitude) {
5426
- minLong_1 = longitude;
5427
- }
5428
- if (minLat_1 > latitude) {
5429
- minLat_1 = latitude;
5430
- }
5431
- if (maxLong_1 < longitude) {
5432
- maxLong_1 = longitude;
5433
- }
5434
- if (maxLat_1 < latitude) {
5435
- maxLat_1 = latitude;
5436
- }
5437
- });
5438
- });
5439
- }
5440
- });
5441
- if (!isNullOrUndefined(minLat_1) && !isNullOrUndefined(minLong_1) &&
5442
- !isNullOrUndefined(maxLong_1) && !isNullOrUndefined(maxLat_1)) {
5443
- // To find the center position
5444
- centerLat = (minLat_1 + maxLat_1) / 2;
5445
- centerLong = (minLong_1 + maxLong_1) / 2;
5446
- this.maps.markerCenterLatitude = centerLat;
5447
- this.maps.markerCenterLongitude = centerLong;
5448
- if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
5449
- this.maps.markerZoomCenterPoint = {
5450
- latitude: centerLat,
5451
- longitude: centerLong
5452
- };
5453
- }
5454
- var markerFactor = void 0;
5455
- if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
5456
- zoomLevel = calculateZoomLevel(minLat_1, maxLat_1, minLong_1, maxLong_1, mapWidth, mapHeight, this.maps, false);
5457
- if (this.maps.isTileMap) {
5458
- markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
5459
- zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
5460
- zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
5461
- this.maps.mapScaleValue : zoomLevel;
5462
- }
5463
- else {
5464
- markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
5465
- (Math.floor(this.maps.scale) !== 1 &&
5466
- this.maps.mapScaleValue !== zoomLevel)
5467
- &&
5468
- (isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
5469
- ? this.maps.mapScaleValue : zoomLevel;
5470
- if (((markerFactor === this.maps.mapScaleValue &&
5471
- (this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
5472
- && (!this.maps.enablePersistence))) {
5473
- markerFactor = zoomLevel;
5474
- }
5475
- }
5476
- }
5477
- else {
5478
- zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
5479
- markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
5480
- (this.maps.mapScaleValue !== zoomLevel)
5481
- ? this.maps.mapScaleValue : zoomLevel;
5482
- }
5483
- this.maps.markerZoomFactor = markerFactor;
5484
- }
5485
- }
5486
- else {
5487
- this.maps.markerZoomedState = false;
5488
- if (this.maps.markerZoomFactor > 1) {
5489
- this.maps.markerCenterLatitude = null;
5490
- this.maps.markerCenterLongitude = null;
5491
- this.maps.markerZoomFactor = 1;
5492
- if (!this.maps.enablePersistence) {
5493
- this.maps.mapScaleValue = 1;
5494
- }
5495
- }
5496
- if (this.maps.isTileMap && !this.maps.enablePersistence
5497
- && this.maps.mapScaleValue <= 1) {
5498
- this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
5499
- : this.maps.mapScaleValue;
5500
- if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
5501
- this.maps.tileTranslatePoint.x = 0;
5502
- this.maps.tileTranslatePoint.y = 0;
5503
- }
5504
- }
5505
- }
5506
- }
5507
- };
5508
- /**
5509
- * To check and trigger marker click event
5510
- * @param {PointerEvent} e - Specifies the pointer event argument.
5511
- * @returns {void}
5512
- * @private
5513
- */
5514
- Marker.prototype.markerClick = function (e) {
5515
- var target = e.target.id;
5516
- if (target.indexOf(this.maps.element.id) === -1) {
5517
- var ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
5518
- if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
5519
- target = ancestor.id;
5520
- }
5521
- }
5522
- if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
5523
- return;
5524
- }
5525
- var options = this.getMarker(target);
5526
- if (isNullOrUndefined(options)) {
5527
- return;
5528
- }
5529
- if (options.marker.enableDrag) {
5530
- document.getElementById(this.maps.element.id + "_svg").style.cursor = 'grabbing';
5531
- }
5532
- var eventArgs = {
5533
- cancel: false, name: markerClick, data: options.data, maps: this.maps,
5534
- marker: options.marker, target: target, x: e.clientX, y: e.clientY,
5535
- latitude: options.data['latitude'] || options.data['Latitude'],
5536
- longitude: options.data['longitude'] || options.data['Longitude'],
5537
- value: options.data['name']
5538
- };
5539
- this.maps.trigger(markerClick, eventArgs);
5540
- if (options.marker.enableDrag) {
5541
- var isCluster = false;
5542
- var layerIndex = parseInt(target.split('_LayerIndex_')[1].split('_')[0], 10);
5543
- var markerIndex = parseInt(target.split('_MarkerIndex_')[1].split('_')[0], 10);
5544
- var dataIndex_1 = parseInt(target.split('_dataIndex_')[1].split('_')[0], 10);
5545
- var marker_1 = this.maps.layers[layerIndex].markerSettings[markerIndex];
5546
- if (this.sameMarkerData.length > 0) {
5547
- isCluster = (this.sameMarkerData[0].data.filter(function (el) { return (el['index'] == dataIndex_1); })).length > 0 &&
5548
- this.sameMarkerData[0].layerIndex === layerIndex && this.sameMarkerData[0].markerIndex === markerIndex;
5549
- }
5550
- if (!isCluster) {
5551
- var dragEventArgs = {
5552
- name: markerDragStart, x: e.clientX, y: e.clientY,
5553
- latitude: options.data['latitude'] || options.data['Latitude'],
5554
- longitude: options.data['longitude'] || options.data['Longitude'],
5555
- layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex_1
5556
- };
5557
- this.maps.trigger(markerDragStart, dragEventArgs);
5558
- this.maps.markerDragArgument = {
5559
- targetId: target, x: e.clientX, y: e.clientY,
5560
- latitude: options.data['latitude'] || options.data['Latitude'],
5561
- longitude: options.data['longitude'] || options.data['Longitude'],
5562
- shape: isNullOrUndefined(marker_1.shapeValuePath) ? marker_1.shape : marker_1.dataSource[dataIndex_1][marker_1.shapeValuePath],
5563
- layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex_1
5564
- };
5565
- }
5566
- }
5567
- };
5568
- /**
5569
- * To check and trigger Cluster click event
5570
- * @param {PointerEvent} e - Specifies the pointer event argument.
5571
- * @returns {void}
5572
- * @private
5573
- */
5574
- Marker.prototype.markerClusterClick = function (e) {
5575
- var target = e.target.id;
5576
- if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') === -1) {
5577
- return;
5578
- }
5579
- var options = this.getMarker(target);
5580
- if (isNullOrUndefined(options)) {
5581
- return;
5582
- }
5583
- if ((options.clusterCollection.length > 0 && this.maps.markerClusterExpand)) {
5584
- if (getElement(this.maps.element.id + '_mapsTooltip') &&
5585
- this.maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
5586
- removeElement(this.maps.element.id + '_mapsTooltip');
5587
- }
5588
- if (this.sameMarkerData.length > 0 && !this.maps.markerClusterExpandCheck) {
5589
- this.maps.markerClusterExpandCheck = true;
5590
- mergeSeparateCluster(this.sameMarkerData, this.maps, this.markerSVGObject);
5591
- }
5592
- else {
5593
- this.sameMarkerData = options.clusterCollection;
5594
- this.maps.markerClusterExpandCheck = false;
5595
- clusterSeparate(this.sameMarkerData, this.maps, this.markerSVGObject, true);
5596
- }
5597
- }
5598
- var eventArgs = {
5599
- cancel: false, name: markerClusterClick, data: options, maps: this.maps,
5600
- target: target, x: e.clientX, y: e.clientY,
5601
- latitude: options.data['latitude'] || options.data['Latitude'], longitude: options.data['longitude'] || options.data['Longitude'],
5602
- markerClusterCollection: options['markCollection']
5603
- };
5604
- this.maps.trigger(markerClusterClick, eventArgs);
5605
- };
5606
- /**
5607
- * To get marker from target id
5608
- *
5609
- * @param {string} target - Specifies the target
5610
- * @returns {string} - Returns the string
5611
- */
5612
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5613
- Marker.prototype.getMarker = function (target) {
5614
- var id = target.split('_LayerIndex_');
5615
- var index = parseInt(id[1].split('_')[0], 10);
5616
- var layer = this.maps.layers[index];
5617
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5618
- var data;
5619
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5620
- var markCollection = [];
5621
- var clusterCollection = [];
5622
- var marker$$1;
5623
- this.maps.markerClusterExpand = layer.markerClusterSettings.allowClusterExpand;
5624
- if (target.indexOf('_MarkerIndex_') > -1) {
5625
- var markerIndex = parseInt(id[1].split('_MarkerIndex_')[1].split('_')[0], 10);
5626
- var dataIndex = parseInt(id[1].split('_dataIndex_')[1].split('_')[0], 10);
5627
- marker$$1 = layer.markerSettings[markerIndex];
5628
- if (!isNaN(markerIndex)) {
5629
- data = marker$$1.dataSource[dataIndex];
5630
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5631
- var collection_1 = [];
5632
- if (!marker$$1.template && (target.indexOf('_cluster_') > -1) && (this.maps.layers[index].markerClusterSettings.allowClusterExpand)) {
5633
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5634
- Array.prototype.forEach.call(marker$$1.dataSource, function (location, index) {
5635
- if (location['latitude'] === data['latitude'] && location['longitude'] === data['longitude']) {
5636
- collection_1.push({ data: data, index: index });
5637
- }
5638
- });
5639
- }
5640
- if ((target.indexOf('_cluster_') > -1)) {
5641
- var isClusterSame = false;
5642
- var 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);
5643
- var indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].textContent.split(',').map(Number) : clusterElement.textContent.split(',').map(Number);
5644
- collection_1 = [];
5645
- for (var _i = 0, indexes_1 = indexes; _i < indexes_1.length; _i++) {
5646
- var i = indexes_1[_i];
5647
- collection_1.push({ data: marker$$1.dataSource[i], index: i });
5648
- markCollection.push(marker$$1.dataSource[i]);
5649
- }
5650
- isClusterSame = false;
5651
- clusterCollection.push({
5652
- data: collection_1, layerIndex: index, markerIndex: markerIndex, dataIndex: dataIndex,
5653
- targetClusterIndex: +(target.split('_cluster_')[1].indexOf('_datalabel_') > -1 ? target.split('_cluster_')[1].split('_datalabel_')[0] : target.split('_cluster_')[1]),
5654
- isClusterSame: isClusterSame
5655
- });
5656
- }
5657
- return { marker: marker$$1, data: data, clusterCollection: clusterCollection, markCollection: markCollection };
5658
- }
5659
- }
5660
- return null;
5661
- };
5662
- /**
5663
- * To check and trigger marker move event
5664
- *
5665
- * @param {PointerEvent} e - Specifies the pointer event argument.
5666
- * @returns {void}
5667
- * @private
5668
- */
5669
- Marker.prototype.markerMove = function (e) {
5670
- var targetId = e.target.id;
5671
- if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') > 0) {
5672
- return;
5673
- }
5674
- var options = this.getMarker(targetId);
5675
- if (isNullOrUndefined(options)) {
5676
- return;
5677
- }
5678
- if (options.marker.enableDrag) {
5679
- document.getElementById(this.maps.element.id + "_svg").style.cursor = isNullOrUndefined(this.maps.markerDragArgument) ?
5680
- 'pointer' : 'grabbing';
5681
- }
5682
- var eventArgs = {
5683
- cancel: false, name: markerMouseMove, data: options.data,
5684
- maps: this.maps, target: targetId, x: e.clientX, y: e.clientY
5685
- };
5686
- this.maps.trigger(markerMouseMove, eventArgs);
5687
- };
5688
- /**
5689
- * To check and trigger cluster move event
5690
- *
5691
- * @param {PointerEvent} e - Specifies the pointer event argument.
5692
- * @returns {void}
5693
- * @private
5694
- */
5695
- Marker.prototype.markerClusterMouseMove = function (e) {
5696
- var targetId = e.target.id;
5697
- if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') === -1) {
5698
- return;
5699
- }
5700
- var options = this.getMarker(targetId);
5701
- if (this.maps.markerClusterExpand) {
5702
- e.target.style.cursor = 'pointer';
5703
- }
5704
- if (isNullOrUndefined(options)) {
5705
- return;
5706
- }
5707
- var eventArgs = {
5708
- cancel: false, name: markerClusterMouseMove, data: options.data, maps: this.maps,
5709
- target: targetId, x: e.clientX, y: e.clientY
5710
- };
5711
- this.maps.trigger(markerClusterMouseMove, eventArgs);
5712
- };
5713
- /**
5714
- * Get module name.
5715
- *
5716
- * @returns {string} - Returns the module name
5717
- */
5718
- Marker.prototype.getModuleName = function () {
5719
- return 'Marker';
5720
- };
5721
- /**
5722
- * To destroy the layers.
5723
- *
5724
- * @returns {void}
5725
- * @private
5726
- */
5727
- Marker.prototype.destroy = function () {
5728
- this.maps = null;
5729
- this.trackElements = [];
5730
- this.markerSVGObject = null;
5731
- this.sameMarkerData = [];
5732
- };
5733
- return Marker;
5734
- }());
5735
-
5736
- /**
5737
- * Maps constants doc
5339
+ * Maps constants doc
5738
5340
  */
5739
5341
  /**
5740
5342
  * Specifies the maps load event name.
@@ -6400,6 +6002,12 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
6400
6002
  && panel.mapObject.previousZoomFactor !== panel.mapObject.zoomSettings.zoomFactor) {
6401
6003
  panel.mapObject.previousZoomFactor = panel.mapObject.zoomSettings.zoomFactor;
6402
6004
  }
6005
+ if (panel.mapObject.polygonModule) {
6006
+ var polygonElement = panel.mapObject.polygonModule.polygonRender(this.mapObject, layerIndex, panel.mapObject.tileZoomLevel);
6007
+ if (!isNullOrUndefined(polygonElement)) {
6008
+ panel.layerObject.appendChild(polygonElement);
6009
+ }
6010
+ }
6403
6011
  if (panel.mapObject.navigationLineModule) {
6404
6012
  var navigationLineElement = panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex);
6405
6013
  if (!isNullOrUndefined(navigationLineElement)) {
@@ -6865,6 +6473,9 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
6865
6473
  layerIndex, colors, renderData, labelTemplateEle) {
6866
6474
  var _this = this;
6867
6475
  var bubbleG;
6476
+ if (this.mapObject.polygonModule) {
6477
+ this.groupElements.push(this.mapObject.polygonModule.polygonRender(this.mapObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor) : this.currentFactor)));
6478
+ }
6868
6479
  if (this.currentLayer.bubbleSettings.length && this.mapObject.bubbleModule) {
6869
6480
  var length_1 = this.currentLayer.bubbleSettings.length;
6870
6481
  var bubble_1;
@@ -7220,9 +6831,11 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
7220
6831
  (!(childNode.id.indexOf('_bubble_Group') > -1)) &&
7221
6832
  (!(childNode.id.indexOf('_dataLableIndex_Group') > -1)) &&
7222
6833
  (!(childNode.id.indexOf('_line_Group') > -1))) {
7223
- var transform = 'scale( ' + this.mapObject.scale + ' ) ' + 'translate( ' + this.mapObject.translatePoint.x
7224
- + ' ' + this.mapObject.translatePoint.y + ' ) ';
7225
- childNode.setAttribute('transform', transform);
6834
+ if (childNode.id.indexOf('_Polygons_Group') === -1) {
6835
+ var transform = 'scale( ' + this.mapObject.scale + ' ) ' + 'translate( ' + this.mapObject.translatePoint.x
6836
+ + ' ' + this.mapObject.translatePoint.y + ' ) ';
6837
+ childNode.setAttribute('transform', transform);
6838
+ }
7226
6839
  }
7227
6840
  }
7228
6841
  }
@@ -7939,6 +7552,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
7939
7552
  /** @private */
7940
7553
  _this.selectedNavigationElementId = [];
7941
7554
  /** @private */
7555
+ _this.selectedPolygonElementId = [];
7556
+ /** @private */
7942
7557
  _this.selectedLegendElementId = [];
7943
7558
  /** @private */
7944
7559
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -7956,6 +7571,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
7956
7571
  /** @private */
7957
7572
  _this.initialTileTranslate = new Point(0, 0);
7958
7573
  /** @private */
7574
+ _this.isMarkerZoomCompleted = false;
7575
+ /** @private */
7959
7576
  _this.markerDragId = '';
7960
7577
  /** @private */
7961
7578
  _this.initialCheck = true;
@@ -8322,10 +7939,20 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8322
7939
  this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.mapScaleValue, this.element.id + '_Zooming_');
8323
7940
  }
8324
7941
  if (!this.isZoomByPosition && !this.zoomNotApplied) {
8325
- this.trigger(loaded, { maps: this, isResized: this.isResize });
7942
+ this.triggerZoomEvent();
8326
7943
  }
8327
7944
  this.isResize = false;
8328
7945
  };
7946
+ Maps.prototype.triggerZoomEvent = function () {
7947
+ var loadedArgs;
7948
+ var minMaxLatitudeLongitude = this.getMinMaxLatitudeLongitude();
7949
+ loadedArgs = {
7950
+ maps: this, isResized: this.isResize, minLatitude: minMaxLatitudeLongitude.minLatitude,
7951
+ maxLatitude: minMaxLatitudeLongitude.maxLatitude, minLongitude: minMaxLatitudeLongitude.minLongitude,
7952
+ maxLongitude: minMaxLatitudeLongitude.maxLongitude, cancel: false, name: 'Loaded'
7953
+ };
7954
+ this.trigger('loaded', loadedArgs);
7955
+ };
8329
7956
  /**
8330
7957
  * To apply color to the initial selected marker
8331
7958
  *
@@ -8497,6 +8124,20 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8497
8124
  this.element.appendChild(secondaryElement);
8498
8125
  }
8499
8126
  };
8127
+ /**
8128
+ * @returns {void}
8129
+ */
8130
+ Maps.prototype.getMinMaxLatitudeLongitude = function () {
8131
+ var element = document.getElementById(this.element.id).getBoundingClientRect();
8132
+ var minPosition = this.isTileMap ? this.pointToLatLong((this.mapAreaRect.x - this.margin.left), -this.mapAreaRect.y) : this.getGeoLocation(0, (this.mapAreaRect.x + element.left), this.mapAreaRect.y);
8133
+ var maxPosition = this.isTileMap ? this.pointToLatLong(this.mapAreaRect.width, (this.mapAreaRect.height - this.mapAreaRect.y)) :
8134
+ this.getGeoLocation(0, (this.mapAreaRect.x + element.left + this.mapAreaRect.width), (this.mapAreaRect.y + this.mapAreaRect.height));
8135
+ var MinMaxLatitudeLongitude = {
8136
+ minLatitude: minPosition.latitude, maxLatitude: maxPosition.latitude, minLongitude: minPosition.longitude,
8137
+ maxLongitude: maxPosition.longitude
8138
+ };
8139
+ return MinMaxLatitudeLongitude;
8140
+ };
8500
8141
  /**
8501
8142
  * @returns {void}
8502
8143
  * @private
@@ -9414,7 +9055,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9414
9055
  */
9415
9056
  Maps.prototype.zoomByPosition = function (centerPosition, zoomFactor) {
9416
9057
  if (!this.isDestroyed) {
9417
- this.zoomNotApplied = false;
9058
+ this.zoomNotApplied = this.isMarkerZoomCompleted = false;
9418
9059
  var isRefresh = this.zoomSettings.zoomFactor === zoomFactor;
9419
9060
  this.previousProjection = null;
9420
9061
  if (!this.isTileMap && this.zoomModule) {
@@ -9511,15 +9152,14 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9511
9152
  * @returns {void}
9512
9153
  */
9513
9154
  Maps.prototype.addMarker = function (layerIndex, markerCollection) {
9514
- if (!this.isDestroyed) {
9155
+ if (!this.isDestroyed && !isNullOrUndefined(this.markerModule)) {
9515
9156
  var layerEle = document.getElementById(this.element.id + '_LayerIndex_' + layerIndex);
9516
9157
  if (markerCollection.length > 0 && layerEle) {
9517
9158
  for (var _i = 0, markerCollection_1 = markerCollection; _i < markerCollection_1.length; _i++) {
9518
9159
  var newMarker = markerCollection_1[_i];
9519
9160
  this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
9520
9161
  }
9521
- var markerModule = new Marker(this);
9522
- markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
9162
+ this.markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
9523
9163
  this.arrangeTemplate();
9524
9164
  }
9525
9165
  }
@@ -9645,6 +9285,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9645
9285
  Maps.prototype.zoomToCoordinates = function (minLatitude, minLongitude, maxLatitude, maxLongitude) {
9646
9286
  var _a, _b;
9647
9287
  if (!this.isDestroyed) {
9288
+ this.isMarkerZoomCompleted = false;
9648
9289
  var centerLatitude = void 0;
9649
9290
  var centerLongtitude = void 0;
9650
9291
  var isTwoCoordinates = false;
@@ -9683,12 +9324,15 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9683
9324
  this.maxLongOfGivenLocation = maxLongitude;
9684
9325
  this.zoomNotApplied = true;
9685
9326
  this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this, true);
9327
+ var minMaxLatitudeLongitude = this.getMinMaxLatitudeLongitude();
9686
9328
  var zoomArgs = {
9687
9329
  cancel: false, name: 'zoom', type: zoomIn, maps: this,
9688
9330
  tileTranslatePoint: {}, translatePoint: {},
9689
9331
  tileZoomLevel: this.isTileMap ? { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation } : {},
9690
9332
  scale: !this.isTileMap ? { previous: this.scale, current: this.scaleOfGivenLocation } :
9691
- { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation }
9333
+ { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation },
9334
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
9335
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
9692
9336
  };
9693
9337
  this.trigger('zoom', zoomArgs);
9694
9338
  this.refresh();
@@ -9860,6 +9504,9 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9860
9504
  }
9861
9505
  else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
9862
9506
  this.zoomSettings.zoomFactor = 1;
9507
+ this.previousProjection = null;
9508
+ this.scale = this.isMarkerZoomCompleted ? null : this.scale;
9509
+ this.isMarkerZoomCompleted = !newProp.zoomSettings.shouldZoomInitially;
9863
9510
  render = true;
9864
9511
  }
9865
9512
  else if (newProp.zoomSettings.enable !== oldProp.zoomSettings.enable) {
@@ -9958,6 +9605,12 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9958
9605
  args: [this]
9959
9606
  });
9960
9607
  }
9608
+ if (this.isPolygonVisible()) {
9609
+ modules.push({
9610
+ member: 'Polygon',
9611
+ args: [this]
9612
+ });
9613
+ }
9961
9614
  if (isVisible.tooltip) {
9962
9615
  modules.push({
9963
9616
  member: 'MapsTooltip',
@@ -10039,6 +9692,23 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
10039
9692
  });
10040
9693
  return isVisible;
10041
9694
  };
9695
+ /**
9696
+ * To find navigation line visibility
9697
+ *
9698
+ * @returns {boolean} - Returns whether the navigation lines are visible or not.
9699
+ */
9700
+ Maps.prototype.isPolygonVisible = function () {
9701
+ var isVisible = false;
9702
+ Array.prototype.forEach.call(this.layers, function (layer) {
9703
+ for (var i = 0; i < layer.polygonSettings.polygons.length; i++) {
9704
+ if (layer.polygonSettings.polygons.length > 0) {
9705
+ isVisible = true;
9706
+ break;
9707
+ }
9708
+ }
9709
+ });
9710
+ return isVisible;
9711
+ };
10042
9712
  /**
10043
9713
  * To find marker visibility
10044
9714
  */
@@ -10152,14 +9822,15 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
10152
9822
  if (isHighlight === void 0) { isHighlight = false; }
10153
9823
  var bubbles;
10154
9824
  var markers;
10155
- var navigationLine;
9825
+ var polygonSetting;
10156
9826
  for (var _i = 0, layers_1 = layers; _i < layers_1.length; _i++) {
10157
9827
  var layer = layers_1[_i];
10158
9828
  isLayerVisible = layer.visible || isLayerVisible;
10159
9829
  if (layer.visible) {
10160
9830
  bubbles = layer.bubbleSettings;
10161
9831
  markers = layer.markerSettings;
10162
- navigationLine = layer.navigationLineSettings;
9832
+ polygonSetting = layer.polygonSettings;
9833
+ var navigationLine = layer.navigationLineSettings;
10163
9834
  for (var _a = 0, navigationLine_1 = navigationLine; _a < navigationLine_1.length; _a++) {
10164
9835
  var navigation = navigationLine_1[_a];
10165
9836
  if (navigation.visible) {
@@ -10167,8 +9838,15 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
10167
9838
  isHighlight = (!isNullOrUndefined(navigation.selectionSettings) && navigation.selectionSettings.enable) || isHighlight;
10168
9839
  }
10169
9840
  }
10170
- for (var _b = 0, markers_1 = markers; _b < markers_1.length; _b++) {
10171
- var marker$$1 = markers_1[_b];
9841
+ for (var _b = 0, _c = polygonSetting.polygons; _b < _c.length; _b++) {
9842
+ var polygon = _c[_b];
9843
+ if (polygon.points.length > 0) {
9844
+ isSelection = layer.polygonSettings.highlightSettings.enable || isSelection;
9845
+ isHighlight = layer.polygonSettings.selectionSettings.enable || isHighlight;
9846
+ }
9847
+ }
9848
+ for (var _d = 0, markers_1 = markers; _d < markers_1.length; _d++) {
9849
+ var marker$$1 = markers_1[_d];
10172
9850
  if (marker$$1.visible) {
10173
9851
  istooltipVisible = marker$$1.tooltipSettings.visible || istooltipVisible;
10174
9852
  isSelection = marker$$1.selectionSettings.enable || isSelection;
@@ -10178,8 +9856,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
10178
9856
  break;
10179
9857
  }
10180
9858
  }
10181
- for (var _c = 0, bubbles_1 = bubbles; _c < bubbles_1.length; _c++) {
10182
- var bubble = bubbles_1[_c];
9859
+ for (var _e = 0, bubbles_1 = bubbles; _e < bubbles_1.length; _e++) {
9860
+ var bubble = bubbles_1[_e];
10183
9861
  if (bubble.visible) {
10184
9862
  istooltipVisible = bubble.tooltipSettings.visible || istooltipVisible;
10185
9863
  isSelection = bubble.selectionSettings.enable || isSelection;
@@ -10263,7 +9941,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
10263
9941
  Maps.prototype.pointToLatLong = function (pageX, pageY) {
10264
9942
  var latitude = 0;
10265
9943
  var longitude = 0;
10266
- if (!this.isDestroyed) {
9944
+ if (!this.isDestroyed && !isNullOrUndefined(this.translatePoint)) {
10267
9945
  var padding = this.layers[this.layers.length - 1].layerType === 'GoogleStaticMap' ? 0 : 10;
10268
9946
  pageY = pageY + padding;
10269
9947
  var mapSize = 256 * Math.pow(2, this.tileZoomLevel);
@@ -10463,269 +10141,836 @@ var Bubble = /** @__PURE__ @class */ (function () {
10463
10141
  }
10464
10142
  // eslint-disable-next-line valid-jsdoc
10465
10143
  /**
10466
- * To render bubble
10144
+ * To render bubble
10145
+ *
10146
+ * @private
10147
+ */
10148
+ Bubble.prototype.renderBubble = function (
10149
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10150
+ bubbleSettings, shapeData, color, range, bubbleIndex, dataIndex, layerIndex, layer, group, bubbleID) {
10151
+ var _this = this;
10152
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10153
+ var layerData = layer.layerData;
10154
+ var colorValuePath = bubbleSettings.colorValuePath;
10155
+ var equalValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
10156
+ (getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : shapeData[colorValuePath]) :
10157
+ shapeData[colorValuePath];
10158
+ var colorValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
10159
+ Number(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : Number(shapeData[colorValuePath])) :
10160
+ Number(shapeData[colorValuePath]);
10161
+ var bubbleValue = (!isNullOrUndefined(bubbleSettings.valuePath)) ? ((bubbleSettings.valuePath.indexOf('.') > -1) ?
10162
+ Number(getValueFromObject(shapeData, bubbleSettings.valuePath)) : Number(shapeData[bubbleSettings.valuePath])) :
10163
+ Number(shapeData[bubbleSettings.valuePath]);
10164
+ var opacity;
10165
+ var bubbleColor;
10166
+ if (isNaN(bubbleValue) && isNaN(colorValue) && isNullOrUndefined(equalValue)) {
10167
+ return null;
10168
+ }
10169
+ var radius = getRatioOfBubble(bubbleSettings.minRadius, bubbleSettings.maxRadius, bubbleValue, range.min, range.max);
10170
+ var colorMapping = new ColorMapping(this.maps);
10171
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10172
+ var shapeColor = colorMapping.getColorByValue(bubbleSettings.colorMapping, colorValue, equalValue);
10173
+ // eslint-disable-next-line prefer-const
10174
+ bubbleColor = (Object.prototype.toString.call(shapeColor) === '[object Object]' &&
10175
+ !isNullOrUndefined(shapeColor['fill'])) ? shapeColor['fill'] : color;
10176
+ // eslint-disable-next-line prefer-const
10177
+ opacity = (Object.prototype.toString.call(shapeColor) === '[object Object]' &&
10178
+ !isNullOrUndefined(shapeColor['opacity'])) ? shapeColor['opacity'] : bubbleSettings.opacity;
10179
+ var shapePoints = [[]];
10180
+ this.maps.translateType = 'bubble';
10181
+ var midIndex = 0;
10182
+ var pointsLength = 0;
10183
+ var currentLength = 0;
10184
+ for (var i = 0, len = layerData.length; i < len; i++) {
10185
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10186
+ var shape = layerData[i];
10187
+ shape = shape['property'];
10188
+ var shapePath = checkPropertyPath(shapeData[layer.shapeDataPath], layer.shapePropertyPath, shape);
10189
+ var shapeDataLayerPathValue = !isNullOrUndefined(shapeData[layer.shapeDataPath]) &&
10190
+ isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
10191
+ var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
10192
+ ? shape[shapePath].toLowerCase() : shape[shapePath];
10193
+ if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
10194
+ if (!layerData[i]['_isMultiPolygon']) {
10195
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10196
+ shapePoints.push(this.getPoints(layerData[i], []));
10197
+ currentLength = shapePoints[shapePoints.length - 1].length;
10198
+ if (pointsLength < currentLength) {
10199
+ pointsLength = currentLength;
10200
+ midIndex = shapePoints.length - 1;
10201
+ }
10202
+ }
10203
+ else {
10204
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10205
+ var layer_1 = layerData[i];
10206
+ for (var j = 0; j < layer_1.length; j++) {
10207
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10208
+ shapePoints.push(this.getPoints(layer_1[j], []));
10209
+ currentLength = shapePoints[shapePoints.length - 1].length;
10210
+ if (pointsLength < currentLength) {
10211
+ pointsLength = currentLength;
10212
+ midIndex = shapePoints.length - 1;
10213
+ }
10214
+ }
10215
+ }
10216
+ }
10217
+ }
10218
+ var projectionType = this.maps.projectionType;
10219
+ var centerY;
10220
+ var eventArgs;
10221
+ var bubbleBorder = {
10222
+ color: bubbleSettings.border.color, opacity: bubbleSettings.border.opacity,
10223
+ width: bubbleSettings.border.width
10224
+ };
10225
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10226
+ var center = findMidPointOfPolygon(shapePoints[midIndex], projectionType, layer.geometryType);
10227
+ if (bubbleSettings.visible) {
10228
+ if (!isNullOrUndefined(center)) {
10229
+ centerY = this.maps.projectionType === 'Mercator' ? center['y'] : (-center['y']);
10230
+ eventArgs = {
10231
+ cancel: false, name: bubbleRendering, border: bubbleBorder,
10232
+ cx: center['x'], cy: centerY, data: shapeData, fill: bubbleColor,
10233
+ maps: this.maps, radius: radius
10234
+ };
10235
+ }
10236
+ else {
10237
+ var shapePointsLength = shapePoints.length - 1;
10238
+ if (shapePoints[shapePointsLength]['x'] && shapePoints[shapePointsLength]['y']) {
10239
+ eventArgs = {
10240
+ cancel: false, name: bubbleRendering, border: bubbleBorder,
10241
+ cx: shapePoints[shapePointsLength]['x'], cy: shapePoints[shapePointsLength]['y'],
10242
+ data: shapeData, fill: bubbleColor, maps: this.maps,
10243
+ radius: radius
10244
+ };
10245
+ }
10246
+ else {
10247
+ return;
10248
+ }
10249
+ }
10250
+ this.maps.trigger('bubbleRendering', eventArgs, function (bubbleArgs) {
10251
+ if (eventArgs.cancel) {
10252
+ return;
10253
+ }
10254
+ var bubbleElement;
10255
+ eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? opacity : eventArgs.border.opacity;
10256
+ if (bubbleSettings.bubbleType === 'Circle') {
10257
+ var circle = new CircleOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, 0, 0, eventArgs.radius, null);
10258
+ bubbleElement = drawCircle(_this.maps, circle, group);
10259
+ }
10260
+ else {
10261
+ var y = _this.maps.projectionType === 'Mercator' ? (eventArgs.cy - radius) : (eventArgs.cy + radius);
10262
+ var rectangle = new RectOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, new Rect(0, 0, radius * 2, radius * 2), 2, 2);
10263
+ eventArgs.cx -= radius;
10264
+ eventArgs.cy = y;
10265
+ bubbleElement = drawRectangle(_this.maps, rectangle, group);
10266
+ }
10267
+ maintainSelection(_this.maps.selectedBubbleElementId, _this.maps.bubbleSelectionClass, bubbleElement, 'BubbleselectionMapStyle');
10268
+ _this.bubbleCollection.push({
10269
+ LayerIndex: layerIndex,
10270
+ BubbleIndex: bubbleIndex,
10271
+ DataIndex: dataIndex,
10272
+ element: bubbleElement,
10273
+ center: { x: eventArgs.cx, y: eventArgs.cy }
10274
+ });
10275
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10276
+ var translate;
10277
+ var animate$$1 = (layer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(_this.maps.zoomModule);
10278
+ if (_this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(_this.maps.zoomModule) && !_this.maps.isTileMap) {
10279
+ translate = getZoomTranslate(_this.maps, layer, animate$$1);
10280
+ }
10281
+ else {
10282
+ translate = getTranslate(_this.maps, layer, animate$$1);
10283
+ }
10284
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10285
+ var bubbleDataSource = bubbleSettings.dataSource;
10286
+ var scale = translate['scale'];
10287
+ var transPoint = translate['location'];
10288
+ var position = new MapLocation((_this.maps.isTileMap ? ((eventArgs.cx + _this.maps.translatePoint.x) * _this.maps.tileZoomLevel) : ((eventArgs.cx + transPoint.x) * scale)), (_this.maps.isTileMap ? ((eventArgs.cy + _this.maps.translatePoint.y) * _this.maps.tileZoomLevel) : ((eventArgs.cy + transPoint.y) * scale)));
10289
+ bubbleElement.setAttribute('transform', 'translate( ' + (position.x) + ' ' + (position.y) + ' )');
10290
+ var bubble = (bubbleDataSource.length - 1) === dataIndex ? 'bubble' : null;
10291
+ if (bubbleSettings.bubbleType === 'Square') {
10292
+ position.x += radius;
10293
+ position.y += radius * (_this.maps.projectionType === 'Mercator' ? 1 : -1);
10294
+ }
10295
+ else {
10296
+ radius = 0;
10297
+ }
10298
+ if (bubbleSettings.animationDuration > 0 || animationMode === 'Enable') {
10299
+ elementAnimate(bubbleElement, bubbleSettings.animationDelay, bubbleSettings.animationDuration, position, _this.maps, bubble, radius);
10300
+ }
10301
+ });
10302
+ }
10303
+ };
10304
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10305
+ Bubble.prototype.getPoints = function (shape, points) {
10306
+ if (isNullOrUndefined(shape.map)) {
10307
+ points = shape['point'];
10308
+ }
10309
+ else {
10310
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10311
+ shape.map(function (current) {
10312
+ points.push(new Point(current['point']['x'], current['point']['y']));
10313
+ });
10314
+ }
10315
+ return points;
10316
+ };
10317
+ /**
10318
+ * To check and trigger bubble click event
10467
10319
  *
10320
+ * @param {PointerEvent} e - Specifies the pointer event argument.
10321
+ * @returns {void}
10468
10322
  * @private
10469
10323
  */
10470
- Bubble.prototype.renderBubble = function (
10324
+ Bubble.prototype.bubbleClick = function (e) {
10325
+ var target = e.target.id;
10326
+ if (target.indexOf('_LayerIndex_') === -1) {
10327
+ return;
10328
+ }
10329
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10330
+ var data = this.getbubble(target);
10331
+ if (isNullOrUndefined(data)) {
10332
+ return;
10333
+ }
10334
+ var eventArgs = {
10335
+ cancel: false, name: bubbleClick, data: data, maps: this.maps,
10336
+ target: target, x: e.clientX, y: e.clientY
10337
+ };
10338
+ this.maps.trigger(bubbleClick, eventArgs);
10339
+ };
10340
+ /**
10341
+ * To get bubble from target id
10342
+ *
10343
+ * @param {string} target - Specifies the target
10344
+ * @returns {object} - Returns the object
10345
+ */
10471
10346
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10472
- bubbleSettings, shapeData, color, range, bubbleIndex, dataIndex, layerIndex, layer, group, bubbleID) {
10473
- var _this = this;
10347
+ Bubble.prototype.getbubble = function (target) {
10348
+ var id = target.split('_LayerIndex_');
10349
+ var index = parseInt(id[1].split('_')[0], 10);
10350
+ var layer = this.maps.layers[index];
10474
10351
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10475
- var layerData = layer.layerData;
10476
- var colorValuePath = bubbleSettings.colorValuePath;
10477
- var equalValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
10478
- (getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : shapeData[colorValuePath]) :
10479
- shapeData[colorValuePath];
10480
- var colorValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
10481
- Number(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : Number(shapeData[colorValuePath])) :
10482
- Number(shapeData[colorValuePath]);
10483
- var bubbleValue = (!isNullOrUndefined(bubbleSettings.valuePath)) ? ((bubbleSettings.valuePath.indexOf('.') > -1) ?
10484
- Number(getValueFromObject(shapeData, bubbleSettings.valuePath)) : Number(shapeData[bubbleSettings.valuePath])) :
10485
- Number(shapeData[bubbleSettings.valuePath]);
10486
- var opacity;
10487
- var bubbleColor;
10488
- if (isNaN(bubbleValue) && isNaN(colorValue) && isNullOrUndefined(equalValue)) {
10489
- return null;
10352
+ var data;
10353
+ if (target.indexOf('_BubbleIndex_') > -1) {
10354
+ var bubbleIndex = parseInt(id[1].split('_BubbleIndex_')[1], 10);
10355
+ var dataIndex = parseInt(id[1].split('_BubbleIndex_')[1].split('_dataIndex_')[1], 10);
10356
+ if (!isNaN(bubbleIndex)) {
10357
+ data = layer.bubbleSettings[bubbleIndex].dataSource[dataIndex];
10358
+ return data;
10359
+ }
10360
+ }
10361
+ return null;
10362
+ };
10363
+ // eslint-disable-next-line valid-jsdoc
10364
+ /**
10365
+ * To check and trigger bubble move event
10366
+ *
10367
+ * @param {PointerEvent} e - Specifies the pointer event argument.
10368
+ * @retruns {void}
10369
+ * @private
10370
+ */
10371
+ Bubble.prototype.bubbleMove = function (e) {
10372
+ var target = e.target.id;
10373
+ if (target.indexOf('_LayerIndex_') === -1) {
10374
+ return;
10490
10375
  }
10491
- var radius = getRatioOfBubble(bubbleSettings.minRadius, bubbleSettings.maxRadius, bubbleValue, range.min, range.max);
10492
- var colorMapping = new ColorMapping(this.maps);
10493
10376
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10494
- var shapeColor = colorMapping.getColorByValue(bubbleSettings.colorMapping, colorValue, equalValue);
10495
- // eslint-disable-next-line prefer-const
10496
- bubbleColor = (Object.prototype.toString.call(shapeColor) === '[object Object]' &&
10497
- !isNullOrUndefined(shapeColor['fill'])) ? shapeColor['fill'] : color;
10498
- // eslint-disable-next-line prefer-const
10499
- opacity = (Object.prototype.toString.call(shapeColor) === '[object Object]' &&
10500
- !isNullOrUndefined(shapeColor['opacity'])) ? shapeColor['opacity'] : bubbleSettings.opacity;
10501
- var shapePoints = [[]];
10502
- this.maps.translateType = 'bubble';
10503
- var midIndex = 0;
10504
- var pointsLength = 0;
10505
- var currentLength = 0;
10506
- for (var i = 0, len = layerData.length; i < len; i++) {
10377
+ var data = this.getbubble(target);
10378
+ if (isNullOrUndefined(data)) {
10379
+ return;
10380
+ }
10381
+ var eventArgs = {
10382
+ cancel: false, name: bubbleMouseMove, data: data, maps: this.maps,
10383
+ target: target, x: e.clientX, y: e.clientY
10384
+ };
10385
+ this.maps.trigger(bubbleMouseMove, eventArgs);
10386
+ };
10387
+ /**
10388
+ * Get module name.
10389
+ *
10390
+ * @returns {string} - Returns the module name.
10391
+ */
10392
+ Bubble.prototype.getModuleName = function () {
10393
+ return 'Bubble';
10394
+ };
10395
+ /**
10396
+ * To destroy the bubble.
10397
+ *
10398
+ * @returns {void}
10399
+ * @private
10400
+ */
10401
+ Bubble.prototype.destroy = function () {
10402
+ this.bubbleCollection = [];
10403
+ //TODO: Calling the below code throws spec issue.
10404
+ //this.maps = null;
10405
+ };
10406
+ return Bubble;
10407
+ }());
10408
+
10409
+ /**
10410
+ * Marker class
10411
+ */
10412
+ var Marker = /** @__PURE__ @class */ (function () {
10413
+ function Marker(maps) {
10414
+ this.maps = maps;
10415
+ this.trackElements = [];
10416
+ this.sameMarkerData = [];
10417
+ }
10418
+ Marker.prototype.markerRender = function (maps, layerElement, layerIndex, factor, type) {
10419
+ var _this = this;
10420
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10421
+ var templateFn;
10422
+ var markerCount = 0;
10423
+ var nullCount = 0;
10424
+ var markerTemplateCount = 0;
10425
+ maps.translateType = 'marker';
10426
+ var currentLayer = maps.layersCollection[layerIndex];
10427
+ this.markerSVGObject = maps.renderer.createGroup({
10428
+ id: maps.element.id + '_Markers_Group',
10429
+ class: 'GroupElement'
10430
+ });
10431
+ this.markerSVGObject.style.pointerEvents = 'auto';
10432
+ var markerTemplateEle = createElement('div', {
10433
+ id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
10434
+ className: maps.element.id + '_template'
10435
+ });
10436
+ markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
10437
+ 'top:' + maps.mapAreaRect.y + 'px;' +
10438
+ 'left:' + maps.mapAreaRect.x + 'px;' +
10439
+ 'height:' + maps.mapAreaRect.height + 'px;' +
10440
+ 'width:' + maps.mapAreaRect.width + 'px;';
10441
+ var allowAnimation = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
10442
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10443
+ var translatePoint;
10444
+ if (!maps.isTileMap) {
10445
+ translatePoint = !isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
10446
+ getZoomTranslate(maps, currentLayer, allowAnimation) :
10447
+ getTranslate(maps, currentLayer, allowAnimation);
10448
+ }
10449
+ var _loop_1 = function (markerIndex) {
10450
+ var markerSettings = currentLayer.markerSettings[markerIndex];
10507
10451
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10508
- var shape = layerData[i];
10509
- shape = shape['property'];
10510
- var shapePath = checkPropertyPath(shapeData[layer.shapeDataPath], layer.shapePropertyPath, shape);
10511
- var shapeDataLayerPathValue = !isNullOrUndefined(shapeData[layer.shapeDataPath]) &&
10512
- isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
10513
- var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
10514
- ? shape[shapePath].toLowerCase() : shape[shapePath];
10515
- if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
10516
- if (!layerData[i]['_isMultiPolygon']) {
10517
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10518
- shapePoints.push(this.getPoints(layerData[i], []));
10519
- currentLength = shapePoints[shapePoints.length - 1].length;
10520
- if (pointsLength < currentLength) {
10521
- pointsLength = currentLength;
10522
- midIndex = shapePoints.length - 1;
10452
+ var markerData = markerSettings.dataSource;
10453
+ var _loop_2 = function (dataIndex) {
10454
+ var data = markerData[dataIndex];
10455
+ maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
10456
+ var eventArgs = {
10457
+ cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
10458
+ width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
10459
+ template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
10460
+ border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
10461
+ shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
10462
+ };
10463
+ maps.trigger('markerRendering', eventArgs, function (MarkerArgs) {
10464
+ eventArgs = markerColorChoose(eventArgs, data);
10465
+ eventArgs = markerShapeChoose(eventArgs, data);
10466
+ var lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
10467
+ Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
10468
+ parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
10469
+ var lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
10470
+ Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
10471
+ parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
10472
+ var offset = markerSettings.offset;
10473
+ if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
10474
+ var markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
10475
+ + markerIndex + '_dataIndex_' + dataIndex;
10476
+ var location_1 = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
10477
+ if (maps.isTileMap) {
10478
+ translatePoint = (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location_1 = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object();
10479
+ }
10480
+ var scale = type === 'AddMarker' ? maps.scale : translatePoint['scale'];
10481
+ var transPoint = type === 'AddMarker' ? maps.translatePoint : translatePoint['location'];
10482
+ if (eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
10483
+ markerTemplateCount++;
10484
+ markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location_1, transPoint, scale, offset, maps);
10485
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10486
+ maps.renderReactTemplates();
10487
+ }
10488
+ else if (!eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
10489
+ markerCount++;
10490
+ marker(eventArgs, markerSettings, markerData, dataIndex, location_1, transPoint, markerID, offset, scale, maps, _this.markerSVGObject);
10491
+ }
10523
10492
  }
10524
- }
10525
- else {
10526
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10527
- var layer_1 = layerData[i];
10528
- for (var j = 0; j < layer_1.length; j++) {
10529
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10530
- shapePoints.push(this.getPoints(layer_1[j], []));
10531
- currentLength = shapePoints[shapePoints.length - 1].length;
10532
- if (pointsLength < currentLength) {
10533
- pointsLength = currentLength;
10534
- midIndex = shapePoints.length - 1;
10493
+ nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
10494
+ markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
10495
+ markerCount += (eventArgs.cancel) ? 1 : 0;
10496
+ maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
10497
+ maps.markerNullCount + 1 : maps.markerNullCount;
10498
+ var markerDataLength = markerData.length - maps.markerNullCount;
10499
+ var isMarkersClustered = false;
10500
+ if (_this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
10501
+ layerElement.appendChild(_this.markerSVGObject);
10502
+ if (currentLayer.markerClusterSettings.allowClustering) {
10503
+ maps.svgObject.appendChild(_this.markerSVGObject);
10504
+ maps.element.appendChild(maps.svgObject);
10505
+ if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
10506
+ && maps.zoomSettings.enable) {
10507
+ isMarkersClustered = clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
10508
+ layerElement.appendChild(_this.markerSVGObject);
10509
+ }
10510
+ else {
10511
+ isMarkersClustered = clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
10512
+ }
10513
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10514
+ maps.renderReactTemplates();
10515
+ }
10516
+ }
10517
+ if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
10518
+ getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
10519
+ if (maps.checkInitialRender) {
10520
+ if (currentLayer.markerClusterSettings.allowClustering && !isMarkersClustered) {
10521
+ clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, _this.markerSVGObject, layerElement, false, false);
10522
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10523
+ maps.renderReactTemplates();
10524
+ }
10535
10525
  }
10536
10526
  }
10537
- }
10527
+ });
10528
+ };
10529
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10530
+ for (var dataIndex = 0; dataIndex < markerData.length; dataIndex++) {
10531
+ _loop_2(dataIndex);
10538
10532
  }
10539
- }
10540
- var projectionType = this.maps.projectionType;
10541
- var centerY;
10542
- var eventArgs;
10543
- var bubbleBorder = {
10544
- color: bubbleSettings.border.color, opacity: bubbleSettings.border.opacity,
10545
- width: bubbleSettings.border.width
10546
10533
  };
10547
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10548
- var center = findMidPointOfPolygon(shapePoints[midIndex], projectionType, layer.geometryType);
10549
- if (bubbleSettings.visible) {
10550
- if (!isNullOrUndefined(center)) {
10551
- centerY = this.maps.projectionType === 'Mercator' ? center['y'] : (-center['y']);
10552
- eventArgs = {
10553
- cancel: false, name: bubbleRendering, border: bubbleBorder,
10554
- cx: center['x'], cy: centerY, data: shapeData, fill: bubbleColor,
10555
- maps: this.maps, radius: radius
10556
- };
10534
+ for (var markerIndex = 0; markerIndex < currentLayer.markerSettings.length; markerIndex++) {
10535
+ _loop_1(markerIndex);
10536
+ }
10537
+ };
10538
+ /**
10539
+ * To find zoom level for individual layers like India, USA.
10540
+ *
10541
+ * @param {number} mapWidth - Specifies the width of the maps
10542
+ * @param {number} mapHeight - Specifies the height of the maps
10543
+ * @param {number} maxZoomFact - Specifies the maximum zoom factor
10544
+ * @returns {number} - Returns the scale factor
10545
+ */
10546
+ Marker.prototype.calculateIndividualLayerMarkerZoomLevel = function (mapWidth, mapHeight, maxZoomFact) {
10547
+ var latZoom;
10548
+ var lngZoom;
10549
+ var height = Math.abs(this.maps.baseMapBounds.latitude.max - this.maps.baseMapBounds.latitude.min);
10550
+ var width = Math.abs(this.maps.baseMapBounds.longitude.max - this.maps.baseMapBounds.longitude.min);
10551
+ latZoom = Math.floor(Math.log(mapHeight / height));
10552
+ latZoom = (latZoom > maxZoomFact) ? maxZoomFact : latZoom;
10553
+ lngZoom = Math.floor(Math.log(mapWidth / width));
10554
+ lngZoom = (lngZoom > maxZoomFact) ? maxZoomFact : lngZoom;
10555
+ var result = Math.min(latZoom, lngZoom);
10556
+ var scaleFactor = Math.min(result, maxZoomFact - 1);
10557
+ if (!this.maps.isTileMap) {
10558
+ compareZoomFactor(scaleFactor, this.maps);
10559
+ }
10560
+ return scaleFactor;
10561
+ };
10562
+ /**
10563
+ * To calculate center position and factor value dynamically
10564
+ *
10565
+ * @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
10566
+ * @returns {void}
10567
+ * @private
10568
+ */
10569
+ Marker.prototype.calculateZoomCenterPositionAndFactor = function (layersCollection) {
10570
+ if (!isNullOrUndefined(this.maps)) {
10571
+ if (this.maps.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
10572
+ var minLong_1;
10573
+ var maxLat_1;
10574
+ var minLat_1;
10575
+ var maxLong_1;
10576
+ var zoomLevel = void 0;
10577
+ var centerLat = void 0;
10578
+ var centerLong = void 0;
10579
+ var maxZoomFact = this.maps.zoomSettings.maxZoom;
10580
+ var mapWidth = this.maps.mapAreaRect.width;
10581
+ var mapHeight = this.maps.mapAreaRect.height;
10582
+ this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState :
10583
+ isNullOrUndefined(this.maps.markerZoomFactor) ? !this.maps.markerZoomedState :
10584
+ this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
10585
+ this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
10586
+ Array.prototype.forEach.call(layersCollection, function (currentLayer) {
10587
+ var isMarker = currentLayer.markerSettings.length !== 0;
10588
+ if (isMarker) {
10589
+ Array.prototype.forEach.call(currentLayer.markerSettings, function (markerSetting) {
10590
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10591
+ var markerData = markerSetting.dataSource;
10592
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10593
+ Array.prototype.forEach.call(markerData, function (data, dataIndex) {
10594
+ var latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
10595
+ !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
10596
+ var longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
10597
+ !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
10598
+ if (!isNullOrUndefined(latitude) && !isNullOrUndefined(longitude)) {
10599
+ minLong_1 = isNullOrUndefined(minLong_1) && dataIndex === 0 ?
10600
+ longitude : minLong_1;
10601
+ maxLat_1 = isNullOrUndefined(maxLat_1) && dataIndex === 0 ?
10602
+ latitude : maxLat_1;
10603
+ minLat_1 = isNullOrUndefined(minLat_1) && dataIndex === 0 ?
10604
+ latitude : minLat_1;
10605
+ maxLong_1 = isNullOrUndefined(maxLong_1) && dataIndex === 0 ?
10606
+ longitude : maxLong_1;
10607
+ if (minLong_1 > longitude) {
10608
+ minLong_1 = longitude;
10609
+ }
10610
+ if (minLat_1 > latitude) {
10611
+ minLat_1 = latitude;
10612
+ }
10613
+ if (maxLong_1 < longitude) {
10614
+ maxLong_1 = longitude;
10615
+ }
10616
+ if (maxLat_1 < latitude) {
10617
+ maxLat_1 = latitude;
10618
+ }
10619
+ }
10620
+ });
10621
+ });
10622
+ }
10623
+ });
10624
+ if (!isNullOrUndefined(minLat_1) && !isNullOrUndefined(minLong_1) &&
10625
+ !isNullOrUndefined(maxLong_1) && !isNullOrUndefined(maxLat_1)) {
10626
+ // To find the center position
10627
+ centerLat = (minLat_1 + maxLat_1) / 2;
10628
+ centerLong = (minLong_1 + maxLong_1) / 2;
10629
+ this.maps.markerCenterLatitude = centerLat;
10630
+ this.maps.markerCenterLongitude = centerLong;
10631
+ if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
10632
+ this.maps.markerZoomCenterPoint = {
10633
+ latitude: centerLat,
10634
+ longitude: centerLong
10635
+ };
10636
+ }
10637
+ var markerFactor = void 0;
10638
+ if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
10639
+ zoomLevel = calculateZoomLevel(minLat_1, maxLat_1, minLong_1, maxLong_1, mapWidth, mapHeight, this.maps, false);
10640
+ if (this.maps.isTileMap) {
10641
+ markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
10642
+ zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
10643
+ zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
10644
+ this.maps.mapScaleValue : zoomLevel;
10645
+ }
10646
+ else {
10647
+ markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
10648
+ (Math.floor(this.maps.scale) !== 1 &&
10649
+ this.maps.mapScaleValue !== zoomLevel)
10650
+ &&
10651
+ (isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
10652
+ ? this.maps.mapScaleValue : zoomLevel;
10653
+ if (((markerFactor === this.maps.mapScaleValue &&
10654
+ (this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
10655
+ && (!this.maps.enablePersistence))) {
10656
+ markerFactor = zoomLevel;
10657
+ }
10658
+ }
10659
+ }
10660
+ else {
10661
+ zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
10662
+ markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
10663
+ (this.maps.mapScaleValue !== zoomLevel)
10664
+ ? this.maps.mapScaleValue : zoomLevel;
10665
+ }
10666
+ this.maps.markerZoomFactor = markerFactor;
10667
+ }
10557
10668
  }
10558
10669
  else {
10559
- var shapePointsLength = shapePoints.length - 1;
10560
- if (shapePoints[shapePointsLength]['x'] && shapePoints[shapePointsLength]['y']) {
10561
- eventArgs = {
10562
- cancel: false, name: bubbleRendering, border: bubbleBorder,
10563
- cx: shapePoints[shapePointsLength]['x'], cy: shapePoints[shapePointsLength]['y'],
10564
- data: shapeData, fill: bubbleColor, maps: this.maps,
10565
- radius: radius
10566
- };
10670
+ this.maps.markerZoomedState = false;
10671
+ if (this.maps.markerZoomFactor > 1) {
10672
+ this.maps.markerCenterLatitude = null;
10673
+ this.maps.markerCenterLongitude = null;
10674
+ this.maps.markerZoomFactor = 1;
10675
+ if (!this.maps.enablePersistence) {
10676
+ this.maps.mapScaleValue = 1;
10677
+ }
10567
10678
  }
10568
- else {
10569
- return;
10679
+ if (this.maps.isTileMap && !this.maps.enablePersistence
10680
+ && this.maps.mapScaleValue <= 1) {
10681
+ this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
10682
+ : this.maps.mapScaleValue;
10683
+ if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
10684
+ this.maps.tileTranslatePoint.x = 0;
10685
+ this.maps.tileTranslatePoint.y = 0;
10686
+ }
10570
10687
  }
10571
10688
  }
10572
- this.maps.trigger('bubbleRendering', eventArgs, function (bubbleArgs) {
10573
- if (eventArgs.cancel) {
10574
- return;
10575
- }
10576
- var bubbleElement;
10577
- eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? opacity : eventArgs.border.opacity;
10578
- if (bubbleSettings.bubbleType === 'Circle') {
10579
- var circle = new CircleOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, 0, 0, eventArgs.radius, null);
10580
- bubbleElement = drawCircle(_this.maps, circle, group);
10581
- }
10582
- else {
10583
- var y = _this.maps.projectionType === 'Mercator' ? (eventArgs.cy - radius) : (eventArgs.cy + radius);
10584
- var rectangle = new RectOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, new Rect(0, 0, radius * 2, radius * 2), 2, 2);
10585
- eventArgs.cx -= radius;
10586
- eventArgs.cy = y;
10587
- bubbleElement = drawRectangle(_this.maps, rectangle, group);
10588
- }
10589
- maintainSelection(_this.maps.selectedBubbleElementId, _this.maps.bubbleSelectionClass, bubbleElement, 'BubbleselectionMapStyle');
10590
- _this.bubbleCollection.push({
10591
- LayerIndex: layerIndex,
10592
- BubbleIndex: bubbleIndex,
10593
- DataIndex: dataIndex,
10594
- element: bubbleElement,
10595
- center: { x: eventArgs.cx, y: eventArgs.cy }
10596
- });
10597
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10598
- var translate;
10599
- var animate$$1 = (layer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(_this.maps.zoomModule);
10600
- if (_this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(_this.maps.zoomModule) && !_this.maps.isTileMap) {
10601
- translate = getZoomTranslate(_this.maps, layer, animate$$1);
10602
- }
10603
- else {
10604
- translate = getTranslate(_this.maps, layer, animate$$1);
10605
- }
10606
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10607
- var bubbleDataSource = bubbleSettings.dataSource;
10608
- var scale = translate['scale'];
10609
- var transPoint = translate['location'];
10610
- var position = new MapLocation((_this.maps.isTileMap ? ((eventArgs.cx + _this.maps.translatePoint.x) * _this.maps.tileZoomLevel) : ((eventArgs.cx + transPoint.x) * scale)), (_this.maps.isTileMap ? ((eventArgs.cy + _this.maps.translatePoint.y) * _this.maps.tileZoomLevel) : ((eventArgs.cy + transPoint.y) * scale)));
10611
- bubbleElement.setAttribute('transform', 'translate( ' + (position.x) + ' ' + (position.y) + ' )');
10612
- var bubble = (bubbleDataSource.length - 1) === dataIndex ? 'bubble' : null;
10613
- if (bubbleSettings.bubbleType === 'Square') {
10614
- position.x += radius;
10615
- position.y += radius * (_this.maps.projectionType === 'Mercator' ? 1 : -1);
10616
- }
10617
- else {
10618
- radius = 0;
10619
- }
10620
- if (bubbleSettings.animationDuration > 0 || animationMode === 'Enable') {
10621
- elementAnimate(bubbleElement, bubbleSettings.animationDelay, bubbleSettings.animationDuration, position, _this.maps, bubble, radius);
10622
- }
10623
- });
10624
10689
  }
10625
10690
  };
10626
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10627
- Bubble.prototype.getPoints = function (shape, points) {
10628
- if (isNullOrUndefined(shape.map)) {
10629
- points = shape['point'];
10691
+ /**
10692
+ * To check and trigger marker click event
10693
+ * @param {PointerEvent} e - Specifies the pointer event argument.
10694
+ * @returns {void}
10695
+ * @private
10696
+ */
10697
+ Marker.prototype.markerClick = function (e) {
10698
+ var target = e.target.id;
10699
+ if (target.indexOf(this.maps.element.id) === -1) {
10700
+ var ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
10701
+ if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
10702
+ target = ancestor.id;
10703
+ }
10630
10704
  }
10631
- else {
10632
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10633
- shape.map(function (current) {
10634
- points.push(new Point(current['point']['x'], current['point']['y']));
10635
- });
10705
+ if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
10706
+ return;
10707
+ }
10708
+ var options = this.getMarker(target);
10709
+ if (isNullOrUndefined(options)) {
10710
+ return;
10711
+ }
10712
+ if (options.marker.enableDrag) {
10713
+ document.getElementById(this.maps.element.id + "_svg").style.cursor = 'grabbing';
10714
+ }
10715
+ var eventArgs = {
10716
+ cancel: false, name: markerClick, data: options.data, maps: this.maps,
10717
+ marker: options.marker, target: target, x: e.clientX, y: e.clientY,
10718
+ latitude: options.data['latitude'] || options.data['Latitude'],
10719
+ longitude: options.data['longitude'] || options.data['Longitude'],
10720
+ value: options.data['name']
10721
+ };
10722
+ this.maps.trigger(markerClick, eventArgs);
10723
+ if (options.marker.enableDrag) {
10724
+ var isCluster = false;
10725
+ var layerIndex = parseInt(target.split('_LayerIndex_')[1].split('_')[0], 10);
10726
+ var markerIndex = parseInt(target.split('_MarkerIndex_')[1].split('_')[0], 10);
10727
+ var dataIndex_1 = parseInt(target.split('_dataIndex_')[1].split('_')[0], 10);
10728
+ var marker_1 = this.maps.layers[layerIndex].markerSettings[markerIndex];
10729
+ if (this.sameMarkerData.length > 0) {
10730
+ isCluster = (this.sameMarkerData[0].data.filter(function (el) { return (el['index'] == dataIndex_1); })).length > 0 &&
10731
+ this.sameMarkerData[0].layerIndex === layerIndex && this.sameMarkerData[0].markerIndex === markerIndex;
10732
+ }
10733
+ if (!isCluster) {
10734
+ var dragEventArgs = {
10735
+ name: markerDragStart, x: e.clientX, y: e.clientY,
10736
+ latitude: options.data['latitude'] || options.data['Latitude'],
10737
+ longitude: options.data['longitude'] || options.data['Longitude'],
10738
+ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex_1
10739
+ };
10740
+ this.maps.trigger(markerDragStart, dragEventArgs);
10741
+ this.maps.markerDragArgument = {
10742
+ targetId: target, x: e.clientX, y: e.clientY,
10743
+ latitude: options.data['latitude'] || options.data['Latitude'],
10744
+ longitude: options.data['longitude'] || options.data['Longitude'],
10745
+ shape: isNullOrUndefined(marker_1.shapeValuePath) ? marker_1.shape : marker_1.dataSource[dataIndex_1][marker_1.shapeValuePath],
10746
+ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex_1
10747
+ };
10748
+ }
10636
10749
  }
10637
- return points;
10638
10750
  };
10639
10751
  /**
10640
- * To check and trigger bubble click event
10641
- *
10752
+ * To check and trigger Cluster click event
10642
10753
  * @param {PointerEvent} e - Specifies the pointer event argument.
10643
10754
  * @returns {void}
10644
10755
  * @private
10645
10756
  */
10646
- Bubble.prototype.bubbleClick = function (e) {
10757
+ Marker.prototype.markerClusterClick = function (e) {
10647
10758
  var target = e.target.id;
10648
- if (target.indexOf('_LayerIndex_') === -1) {
10759
+ if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') === -1) {
10649
10760
  return;
10650
10761
  }
10651
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10652
- var data = this.getbubble(target);
10653
- if (isNullOrUndefined(data)) {
10762
+ var options = this.getMarker(target);
10763
+ if (isNullOrUndefined(options)) {
10654
10764
  return;
10655
10765
  }
10766
+ if ((options.clusterCollection.length > 0 && this.maps.markerClusterExpand)) {
10767
+ if (getElement(this.maps.element.id + '_mapsTooltip') &&
10768
+ this.maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
10769
+ removeElement(this.maps.element.id + '_mapsTooltip');
10770
+ }
10771
+ if (this.sameMarkerData.length > 0 && !this.maps.markerClusterExpandCheck) {
10772
+ this.maps.markerClusterExpandCheck = true;
10773
+ mergeSeparateCluster(this.sameMarkerData, this.maps, this.markerSVGObject);
10774
+ }
10775
+ else {
10776
+ this.sameMarkerData = options.clusterCollection;
10777
+ this.maps.markerClusterExpandCheck = false;
10778
+ clusterSeparate(this.sameMarkerData, this.maps, this.markerSVGObject, true);
10779
+ }
10780
+ }
10656
10781
  var eventArgs = {
10657
- cancel: false, name: bubbleClick, data: data, maps: this.maps,
10658
- target: target, x: e.clientX, y: e.clientY
10782
+ cancel: false, name: markerClusterClick, data: options, maps: this.maps,
10783
+ target: target, x: e.clientX, y: e.clientY,
10784
+ latitude: options.data['latitude'] || options.data['Latitude'], longitude: options.data['longitude'] || options.data['Longitude'],
10785
+ markerClusterCollection: options['markCollection']
10659
10786
  };
10660
- this.maps.trigger(bubbleClick, eventArgs);
10787
+ this.maps.trigger(markerClusterClick, eventArgs);
10661
10788
  };
10662
10789
  /**
10663
- * To get bubble from target id
10790
+ * To get marker from target id
10664
10791
  *
10665
10792
  * @param {string} target - Specifies the target
10666
- * @returns {object} - Returns the object
10793
+ * @returns {string} - Returns the string
10667
10794
  */
10668
10795
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10669
- Bubble.prototype.getbubble = function (target) {
10796
+ Marker.prototype.getMarker = function (target) {
10670
10797
  var id = target.split('_LayerIndex_');
10671
10798
  var index = parseInt(id[1].split('_')[0], 10);
10672
10799
  var layer = this.maps.layers[index];
10673
10800
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10674
10801
  var data;
10675
- if (target.indexOf('_BubbleIndex_') > -1) {
10676
- var bubbleIndex = parseInt(id[1].split('_BubbleIndex_')[1], 10);
10677
- var dataIndex = parseInt(id[1].split('_BubbleIndex_')[1].split('_dataIndex_')[1], 10);
10678
- if (!isNaN(bubbleIndex)) {
10679
- data = layer.bubbleSettings[bubbleIndex].dataSource[dataIndex];
10680
- return data;
10802
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10803
+ var markCollection = [];
10804
+ var clusterCollection = [];
10805
+ var marker$$1;
10806
+ this.maps.markerClusterExpand = layer.markerClusterSettings.allowClusterExpand;
10807
+ if (target.indexOf('_MarkerIndex_') > -1) {
10808
+ var markerIndex = parseInt(id[1].split('_MarkerIndex_')[1].split('_')[0], 10);
10809
+ var dataIndex = parseInt(id[1].split('_dataIndex_')[1].split('_')[0], 10);
10810
+ marker$$1 = layer.markerSettings[markerIndex];
10811
+ if (!isNaN(markerIndex)) {
10812
+ data = marker$$1.dataSource[dataIndex];
10813
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10814
+ var collection_1 = [];
10815
+ if (!marker$$1.template && (target.indexOf('_cluster_') > -1) && (this.maps.layers[index].markerClusterSettings.allowClusterExpand)) {
10816
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10817
+ Array.prototype.forEach.call(marker$$1.dataSource, function (location, index) {
10818
+ if (location['latitude'] === data['latitude'] && location['longitude'] === data['longitude']) {
10819
+ collection_1.push({ data: data, index: index });
10820
+ }
10821
+ });
10822
+ }
10823
+ if ((target.indexOf('_cluster_') > -1)) {
10824
+ var isClusterSame = false;
10825
+ var 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);
10826
+ var indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].textContent.split(',').map(Number) : clusterElement.textContent.split(',').map(Number);
10827
+ collection_1 = [];
10828
+ for (var _i = 0, indexes_1 = indexes; _i < indexes_1.length; _i++) {
10829
+ var i = indexes_1[_i];
10830
+ collection_1.push({ data: marker$$1.dataSource[i], index: i });
10831
+ markCollection.push(marker$$1.dataSource[i]);
10832
+ }
10833
+ isClusterSame = false;
10834
+ clusterCollection.push({
10835
+ data: collection_1, layerIndex: index, markerIndex: markerIndex, dataIndex: dataIndex,
10836
+ targetClusterIndex: +(target.split('_cluster_')[1].indexOf('_datalabel_') > -1 ? target.split('_cluster_')[1].split('_datalabel_')[0] : target.split('_cluster_')[1]),
10837
+ isClusterSame: isClusterSame
10838
+ });
10839
+ }
10840
+ return { marker: marker$$1, data: data, clusterCollection: clusterCollection, markCollection: markCollection };
10681
10841
  }
10682
10842
  }
10683
10843
  return null;
10684
10844
  };
10685
- // eslint-disable-next-line valid-jsdoc
10686
10845
  /**
10687
- * To check and trigger bubble move event
10846
+ * To check and trigger marker move event
10688
10847
  *
10689
10848
  * @param {PointerEvent} e - Specifies the pointer event argument.
10690
- * @retruns {void}
10849
+ * @returns {void}
10691
10850
  * @private
10692
10851
  */
10693
- Bubble.prototype.bubbleMove = function (e) {
10694
- var target = e.target.id;
10695
- if (target.indexOf('_LayerIndex_') === -1) {
10852
+ Marker.prototype.markerMove = function (e) {
10853
+ var targetId = e.target.id;
10854
+ if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') > 0) {
10696
10855
  return;
10697
10856
  }
10698
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10699
- var data = this.getbubble(target);
10700
- if (isNullOrUndefined(data)) {
10857
+ var options = this.getMarker(targetId);
10858
+ if (isNullOrUndefined(options)) {
10701
10859
  return;
10702
10860
  }
10861
+ if (options.marker.enableDrag) {
10862
+ document.getElementById(this.maps.element.id + "_svg").style.cursor = isNullOrUndefined(this.maps.markerDragArgument) ?
10863
+ 'pointer' : 'grabbing';
10864
+ }
10703
10865
  var eventArgs = {
10704
- cancel: false, name: bubbleMouseMove, data: data, maps: this.maps,
10705
- target: target, x: e.clientX, y: e.clientY
10866
+ cancel: false, name: markerMouseMove, data: options.data,
10867
+ maps: this.maps, target: targetId, x: e.clientX, y: e.clientY
10706
10868
  };
10707
- this.maps.trigger(bubbleMouseMove, eventArgs);
10869
+ this.maps.trigger(markerMouseMove, eventArgs);
10870
+ };
10871
+ /**
10872
+ * To check and trigger cluster move event
10873
+ *
10874
+ * @param {PointerEvent} e - Specifies the pointer event argument.
10875
+ * @returns {void}
10876
+ * @private
10877
+ */
10878
+ Marker.prototype.markerClusterMouseMove = function (e) {
10879
+ var targetId = e.target.id;
10880
+ if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') === -1) {
10881
+ return;
10882
+ }
10883
+ var options = this.getMarker(targetId);
10884
+ if (this.maps.markerClusterExpand) {
10885
+ e.target.style.cursor = 'pointer';
10886
+ }
10887
+ if (isNullOrUndefined(options)) {
10888
+ return;
10889
+ }
10890
+ var eventArgs = {
10891
+ cancel: false, name: markerClusterMouseMove, data: options.data, maps: this.maps,
10892
+ target: targetId, x: e.clientX, y: e.clientY
10893
+ };
10894
+ this.maps.trigger(markerClusterMouseMove, eventArgs);
10708
10895
  };
10709
10896
  /**
10710
10897
  * Get module name.
10711
10898
  *
10712
- * @returns {string} - Returns the module name.
10899
+ * @returns {string} - Returns the module name
10713
10900
  */
10714
- Bubble.prototype.getModuleName = function () {
10715
- return 'Bubble';
10901
+ Marker.prototype.getModuleName = function () {
10902
+ return 'Marker';
10716
10903
  };
10717
10904
  /**
10718
- * To destroy the bubble.
10905
+ * To destroy the layers.
10719
10906
  *
10720
10907
  * @returns {void}
10721
10908
  * @private
10722
10909
  */
10723
- Bubble.prototype.destroy = function () {
10724
- this.bubbleCollection = [];
10725
- //TODO: Calling the below code throws spec issue.
10726
- //this.maps = null;
10910
+ Marker.prototype.destroy = function () {
10911
+ this.maps = null;
10912
+ this.trackElements = [];
10913
+ this.markerSVGObject = null;
10914
+ this.sameMarkerData = [];
10727
10915
  };
10728
- return Bubble;
10916
+ return Marker;
10917
+ }());
10918
+
10919
+ /**
10920
+ * When injected, this module will be used to render polygon shapes over the Maps.
10921
+ */
10922
+ var Polygon = /** @__PURE__ @class */ (function () {
10923
+ function Polygon(maps) {
10924
+ this.maps = maps;
10925
+ }
10926
+ /**
10927
+ * To render polygon for maps
10928
+ *
10929
+ * @param {Maps} maps - Specifies the layer instance to which the polygon is to be rendered.
10930
+ * @param {number} layerIndex -Specifies the index of current layer.
10931
+ * @param {number} factor - Specifies the current zoom factor of the Maps.
10932
+ * @returns {Element} - Returns the polygon element.
10933
+ * @private
10934
+ */
10935
+ Polygon.prototype.polygonRender = function (maps, layerIndex, factor) {
10936
+ var _this = this;
10937
+ var currentLayer = maps.layersCollection[layerIndex];
10938
+ var polygonsSVGObject = maps.renderer.createGroup({
10939
+ id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group'
10940
+ });
10941
+ currentLayer.polygonSettings.polygons.map(function (polygonSetting, polygonIndex) {
10942
+ var polygonSVGObject = maps.renderer.createGroup({
10943
+ id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group_' + polygonIndex
10944
+ });
10945
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10946
+ var polygonData = polygonSetting.points;
10947
+ var path = calculatePolygonPath(maps, factor, currentLayer, polygonData);
10948
+ var pathOptions = new PathOption(maps.element.id + '_LayerIndex_' + layerIndex + '_PolygonIndex_' + polygonIndex, polygonSetting.fill, (polygonSetting.borderWidth / factor), polygonSetting.borderColor, polygonSetting.opacity, polygonSetting.borderOpacity, '', path);
10949
+ var polygonEle = maps.renderer.drawPath(pathOptions);
10950
+ maintainSelection(_this.maps.selectedPolygonElementId, _this.maps.polygonSelectionClass, polygonEle, 'PolygonselectionMapStyle');
10951
+ polygonSVGObject.appendChild(polygonEle);
10952
+ polygonsSVGObject.appendChild(polygonSVGObject);
10953
+ });
10954
+ return polygonsSVGObject;
10955
+ };
10956
+ /**
10957
+ * Get module name.
10958
+ *
10959
+ * @returns {string} - Returns the module name
10960
+ */
10961
+ Polygon.prototype.getModuleName = function () {
10962
+ return 'Polygon';
10963
+ };
10964
+ /**
10965
+ * To destroy the layers.
10966
+ *
10967
+ * @returns {void}
10968
+ * @private
10969
+ */
10970
+ Polygon.prototype.destroy = function () {
10971
+ this.maps = null;
10972
+ };
10973
+ return Polygon;
10729
10974
  }());
10730
10975
 
10731
10976
  /**
@@ -13121,7 +13366,7 @@ var Legend = /** @__PURE__ @class */ (function () {
13121
13366
  var legendToggleBorderWidth = this.maps.legendSettings.toggleLegendSettings.border.width;
13122
13367
  var legendToggleBorderOpacity = isNullOrUndefined(this.maps.legendSettings.toggleLegendSettings.border.opacity) ?
13123
13368
  this.maps.legendSettings.toggleLegendSettings.opacity : this.maps.legendSettings.toggleLegendSettings.border.opacity;
13124
- if (targetEle.parentNode['id'].indexOf(this.maps.element.id + '_Legend_Index_') > -1) {
13369
+ if (!isNullOrUndefined(targetEle.parentNode) && targetEle.parentNode['id'].indexOf(this.maps.element.id + '_Legend_Index_') > -1) {
13125
13370
  var mapElement = void 0;
13126
13371
  var legendIndex = parseFloat(targetEle.parentElement.id.substr((this.maps.element.id + '_Legend_Index_').length));
13127
13372
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13617,6 +13862,7 @@ var Highlight = /** @__PURE__ @class */ (function () {
13617
13862
  targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
13618
13863
  targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
13619
13864
  targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
13865
+ targetEle.getAttribute('class') !== 'PolygonselectionMapStyle' &&
13620
13866
  targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
13621
13867
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
13622
13868
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13646,6 +13892,11 @@ var Highlight = /** @__PURE__ @class */ (function () {
13646
13892
  data = this.maps.layers[layerIndex].markerSettings[marker$$1].dataSource[dataIndex];
13647
13893
  this.highlightSettings = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings;
13648
13894
  }
13895
+ else if (targetEle.id.indexOf('_PolygonIndex_') > -1) {
13896
+ dataIndex = parseInt(targetEle.id.split('_PolygonIndex_')[1].split('_')[0], 10);
13897
+ data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
13898
+ this.highlightSettings = this.maps.layers[layerIndex].polygonSettings.highlightSettings;
13899
+ }
13649
13900
  else {
13650
13901
  var index = parseInt(targetEle.id.split('_NavigationIndex_')[1].split('_')[0], 10);
13651
13902
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
@@ -13884,6 +14135,12 @@ var Selection = /** @__PURE__ @class */ (function () {
13884
14135
  this.selectionsettings = this.maps.layers[layerIndex].markerSettings[markerIndex].selectionSettings;
13885
14136
  this.selectionType = 'Marker';
13886
14137
  }
14138
+ else if (targetElement.id.indexOf('_PolygonIndex_') > -1) {
14139
+ dataIndex = parseInt(targetElement.id.split('_PolygonIndex_')[1].split('_')[0], 10);
14140
+ data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
14141
+ this.selectionsettings = this.maps.layers[layerIndex].polygonSettings.selectionSettings;
14142
+ this.selectionType = 'Polygon';
14143
+ }
13887
14144
  else if (targetElement.id.indexOf('NavigationIndex') > -1) {
13888
14145
  var index = parseInt(targetElement.id.split('_NavigationIndex_')[1].split('_')[0], 10);
13889
14146
  shapeData = null;
@@ -14059,6 +14316,10 @@ var Selection = /** @__PURE__ @class */ (function () {
14059
14316
  _this.maps.navigationSelectionClass = getElement(_this.selectionType + 'selectionMap');
14060
14317
  _this.maps.selectedNavigationElementId.push(targetElement.getAttribute('id'));
14061
14318
  }
14319
+ if (targetElement.getAttribute('class') === 'PolygonselectionMapStyle') {
14320
+ _this.maps.polygonSelectionClass = getElement(_this.selectionType + 'selectionMap');
14321
+ _this.maps.selectedPolygonElementId.push(targetElement.getAttribute('id'));
14322
+ }
14062
14323
  }
14063
14324
  }
14064
14325
  });
@@ -14098,6 +14359,9 @@ var Selection = /** @__PURE__ @class */ (function () {
14098
14359
  if (this.selectionType === 'navigationline') {
14099
14360
  this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(targetElement.getAttribute('id')), 1);
14100
14361
  }
14362
+ if (this.selectionType === 'Polygon') {
14363
+ this.maps.selectedPolygonElementId.splice(this.maps.selectedPolygonElementId.indexOf(targetElement.getAttribute('id')), 1);
14364
+ }
14101
14365
  };
14102
14366
  /**
14103
14367
  * Get module name.
@@ -14140,7 +14404,6 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
14140
14404
  var target;
14141
14405
  var touchArg;
14142
14406
  var tooltipArgs;
14143
- var tooltipTemplateElement;
14144
14407
  if (e.type.indexOf('touch') !== -1) {
14145
14408
  this.isTouch = true;
14146
14409
  touchArg = e;
@@ -14291,7 +14554,12 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
14291
14554
  id: this.maps.element.id + '_mapsTooltip',
14292
14555
  className: 'EJ2-maps-Tooltip'
14293
14556
  });
14294
- tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
14557
+ if (isNullOrUndefined(option.template) || option.template === '' || this.maps.tooltipDisplayMode === 'MouseMove') {
14558
+ tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
14559
+ }
14560
+ else {
14561
+ tooltipEle.style.position = 'absolute';
14562
+ }
14295
14563
  document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
14296
14564
  }
14297
14565
  if (typeof option.template !== 'function' && option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
@@ -14335,8 +14603,8 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
14335
14603
  header: '',
14336
14604
  data: option['data'],
14337
14605
  template: option['template'],
14338
- content: tooltipArgs.content.toString() !== currentData.toString() ? [SanitizeHtmlHelper.sanitize(tooltipArgs.content.toString())] :
14339
- [SanitizeHtmlHelper.sanitize(currentData.toString())],
14606
+ content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
14607
+ [currentData.toString()],
14340
14608
  shapes: [],
14341
14609
  location: option['location'],
14342
14610
  palette: [markerFill],
@@ -14353,8 +14621,8 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
14353
14621
  header: '',
14354
14622
  data: tooltipArgs.options['data'],
14355
14623
  template: tooltipArgs.options['template'],
14356
- content: tooltipArgs.content.toString() !== currentData.toString() ? [SanitizeHtmlHelper.sanitize(tooltipArgs.content.toString())] :
14357
- [SanitizeHtmlHelper.sanitize(currentData.toString())],
14624
+ content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
14625
+ [currentData.toString()],
14358
14626
  shapes: [],
14359
14627
  location: tooltipArgs.options['location'],
14360
14628
  palette: [markerFill],
@@ -14373,13 +14641,6 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
14373
14641
  _this.svgTooltip.appendTo(tooltipEle);
14374
14642
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14375
14643
  _this.maps.renderReactTemplates();
14376
- tooltipTemplateElement = document.getElementById(_this.maps.element.id + '_mapsTooltip');
14377
- if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
14378
- && tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
14379
- var templateStyle = tooltipTemplateElement.getAttribute('style');
14380
- templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
14381
- tooltipTemplateElement.style.cssText = templateStyle;
14382
- }
14383
14644
  }
14384
14645
  else {
14385
14646
  _this.clearTooltip(e.target);
@@ -14401,12 +14662,8 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
14401
14662
  }
14402
14663
  }
14403
14664
  else {
14404
- tooltipTemplateElement = document.getElementById(this.maps.element.id + '_mapsTooltip');
14405
- if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
14406
- && tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
14407
- this.maps.notify(click, this);
14408
- }
14409
- else {
14665
+ var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
14666
+ if (isNullOrUndefined(tooltipElement)) {
14410
14667
  this.clearTooltip(e.target);
14411
14668
  }
14412
14669
  }
@@ -14600,10 +14857,10 @@ var Zoom = /** @__PURE__ @class */ (function () {
14600
14857
  Zoom.prototype.performZooming = function (position, newZoomFactor, type) {
14601
14858
  var _this = this;
14602
14859
  var map = this.maps;
14603
- map.previousProjection = map.projectionType;
14860
+ map.previousProjection = newZoomFactor <= 1.5 ? undefined : map.projectionType;
14604
14861
  map.defaultState = false;
14605
14862
  map.initialCheck = false;
14606
- map.markerZoomedState = false;
14863
+ map.markerZoomedState = map.isMarkerZoomCompleted = false;
14607
14864
  map.zoomPersistence = map.enablePersistence;
14608
14865
  var prevLevel = map.tileZoomLevel;
14609
14866
  var scale = map.previousScale = map.scale;
@@ -14651,6 +14908,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
14651
14908
  map.translatePoint = new Point(translatePointX, translatePointY);
14652
14909
  }
14653
14910
  map.scale = newZoomFactor;
14911
+ map.zoomTranslatePoint = map.translatePoint;
14654
14912
  if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
14655
14913
  map.translatePoint = map.previousPoint;
14656
14914
  map.scale = map.mapScaleValue = map.previousScale;
@@ -14672,6 +14930,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
14672
14930
  newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
14673
14931
  map.scale = Math.pow(2, newZoomFactor - 1);
14674
14932
  }
14933
+ map.mapScaleValue = isNaN(map.mapScaleValue) ? 1 : map.mapScaleValue;
14675
14934
  map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
14676
14935
  map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
14677
14936
  if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
@@ -14725,18 +14984,28 @@ var Zoom = /** @__PURE__ @class */ (function () {
14725
14984
  Zoom.prototype.triggerZoomEvent = function (prevTilePoint, prevLevel, type) {
14726
14985
  var map = this.maps;
14727
14986
  var zoomArgs;
14987
+ if (map.isTileMap) {
14988
+ map.mapScaleValue = isNullOrUndefined(map.mapScaleValue) ? 1 : map.mapScaleValue;
14989
+ map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
14990
+ map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
14991
+ }
14992
+ var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
14728
14993
  if (!map.isTileMap) {
14729
14994
  zoomArgs = {
14730
14995
  cancel: false, name: 'zoom', type: type, maps: map,
14731
14996
  tileTranslatePoint: {}, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
14732
- tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale }
14997
+ tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale },
14998
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
14999
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
14733
15000
  };
14734
15001
  }
14735
15002
  else {
14736
15003
  zoomArgs = {
14737
15004
  cancel: false, name: 'zoom', type: type, maps: map,
14738
15005
  tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint }, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
14739
- tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale }
15006
+ tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale },
15007
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
15008
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
14740
15009
  };
14741
15010
  }
14742
15011
  map.trigger('zoom', zoomArgs);
@@ -14785,6 +15054,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
14785
15054
  map.translatePoint = new Point(translatePointX, translatePointY);
14786
15055
  }
14787
15056
  map.scale = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
15057
+ map.zoomTranslatePoint = map.translatePoint;
14788
15058
  isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
14789
15059
  if (isZoomCancelled) {
14790
15060
  map.translatePoint = map.previousPoint;
@@ -14840,6 +15110,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
14840
15110
  var map = this.maps;
14841
15111
  var prevLevel = map.tileZoomLevel;
14842
15112
  var availSize = map.mapAreaRect;
15113
+ map.isMarkerZoomCompleted = false;
14843
15114
  map.previousScale = map.scale;
14844
15115
  map.previousPoint = map.translatePoint;
14845
15116
  map.previousProjection = map.projectionType;
@@ -14955,7 +15226,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
14955
15226
  Zoom.prototype.animateTransform = function (element, animate$$1, x, y, scale) {
14956
15227
  var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
14957
15228
  if (!animate$$1 || duration === 0 || this.maps.isTileMap) {
14958
- element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
15229
+ if (!(this.maps.isTileMap && element.id.indexOf('_Polygons_Group') > -1)) {
15230
+ element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
15231
+ }
14959
15232
  return;
14960
15233
  }
14961
15234
  if (!this.maps.isTileMap) {
@@ -14966,6 +15239,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
14966
15239
  * @private
14967
15240
  */
14968
15241
  Zoom.prototype.applyTransform = function (maps, animate$$1) {
15242
+ var _this = this;
14969
15243
  var layerIndex;
14970
15244
  this.templateCount = 0;
14971
15245
  var markerStyle;
@@ -14978,60 +15252,73 @@ var Zoom = /** @__PURE__ @class */ (function () {
14978
15252
  removeElement(maps.element.id + '_mapsTooltip');
14979
15253
  }
14980
15254
  if (this.layerCollectionEle) {
14981
- for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
14982
- var layerElement = this.layerCollectionEle.childNodes[i_1];
15255
+ var _loop_1 = function (i_1) {
15256
+ var layerElement = this_1.layerCollectionEle.childNodes[i_1];
14983
15257
  if (layerElement.tagName === 'g') {
14984
- this.templateCount++;
14985
- this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
14986
- this.currentLayer = maps.layersCollection[this.index];
14987
- var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
15258
+ this_1.templateCount++;
15259
+ this_1.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
15260
+ this_1.currentLayer = maps.layersCollection[this_1.index];
15261
+ var factor_1 = maps.mapLayerPanel.calculateFactor(this_1.currentLayer);
14988
15262
  var elementCount = layerElement.childElementCount;
14989
- for (var j = 0; j < elementCount; j++) {
15263
+ var _loop_2 = function (j) {
14990
15264
  var currentEle = layerElement.childNodes[j];
14991
15265
  if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
14992
15266
  && (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
14993
15267
  if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
14994
15268
  currentEle.remove();
14995
15269
  if (layerElement.children.length > 0 && layerElement.children[0]) {
14996
- layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
15270
+ layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this_1.currentLayer, maps.tileZoomLevel, this_1.index), layerElement.children[1]);
14997
15271
  }
14998
15272
  else {
14999
- layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
15273
+ layerElement.appendChild(maps.navigationLineModule.renderNavigation(this_1.currentLayer, maps.tileZoomLevel, this_1.index));
15274
+ }
15275
+ }
15276
+ else if (maps.isTileMap && (currentEle.id.indexOf('_Polygons_Group') > -1)) {
15277
+ if (this_1.currentLayer.polygonSettings.polygons.length > 0) {
15278
+ this_1.currentLayer.polygonSettings.polygons.map(function (polygonSettings, polygonIndex) {
15279
+ var markerData = polygonSettings.points;
15280
+ var path = calculatePolygonPath(maps, maps.tileZoomLevel, _this.currentLayer, markerData);
15281
+ var element = document.getElementById(maps.element.id + '_LayerIndex_' + _this.index + '_PolygonIndex_' + polygonIndex);
15282
+ element.setAttribute('d', path);
15283
+ });
15284
+ document.getElementById(maps.element.id + '_LayerIndex_' + this_1.index + '_Polygons_Group').style.visibility = '';
15000
15285
  }
15001
15286
  }
15002
15287
  else if (currentEle.id.indexOf('Legend') === -1) {
15003
- changeBorderWidth(currentEle, this.index, scale, maps);
15288
+ changeBorderWidth(currentEle, this_1.index, scale, maps);
15004
15289
  maps.zoomTranslatePoint = maps.translatePoint;
15005
- this.animateTransform(currentEle, animate$$1, x, y, scale);
15290
+ this_1.animateTransform(currentEle, animate$$1, x, y, scale);
15006
15291
  }
15007
15292
  }
15008
15293
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
15009
- if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
15010
- this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
15294
+ if ((!this_1.isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
15295
+ this_1.markerTranslates(currentEle.childNodes[0], factor_1, x, y, scale, 'Marker', layerElement, animate$$1);
15011
15296
  }
15012
15297
  currentEle = layerElement.childNodes[j];
15013
- var markerAnimation = void 0;
15298
+ var markerAnimation_1;
15014
15299
  if (!isNullOrUndefined(currentEle) && currentEle.id.indexOf('Markers') !== -1) {
15015
- for (var k = 0; k < currentEle.childElementCount; k++) {
15016
- this.markerTranslate(currentEle.childNodes[k], factor, x, y, scale, 'Marker', animate$$1);
15017
- var layerIndex_1 = parseInt(currentEle.childNodes[k]['id'].split('_LayerIndex_')[1].split('_')[0], 10);
15018
- var dataIndex = parseInt(currentEle.childNodes[k]['id'].split('_dataIndex_')[1].split('_')[0], 10);
15019
- var markerIndex = parseInt(currentEle.childNodes[k]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
15020
- markerAnimation = this.currentLayer.markerSettings[markerIndex].animationDuration > 0 || animationMode === 'Enable';
15021
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15022
- var markerSelectionValues = this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
15023
- for (var x_1 = 0; x_1 < this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length; x_1++) {
15024
- if (this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['latitude'] ===
15025
- markerSelectionValues['latitude'] ||
15026
- this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
15027
- markerSelectionValues['longitude']) {
15028
- maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
15300
+ Array.prototype.forEach.call(currentEle.childNodes, function (childNode, k) {
15301
+ _this.markerTranslate(childNode, factor_1, x, y, scale, 'Marker', animate$$1);
15302
+ var layerIndex = parseInt(childNode['id'].split('_LayerIndex_')[1].split('_')[0], 10);
15303
+ var dataIndex = parseInt(childNode['id'].split('_dataIndex_')[1].split('_')[0], 10);
15304
+ var markerIndex = parseInt(childNode['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
15305
+ markerAnimation_1 = _this.currentLayer.markerSettings[markerIndex].animationDuration > 0 || animationMode === 'Enable';
15306
+ if (_this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length > 0) {
15307
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15308
+ var markerSelectionValues = _this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
15309
+ for (var x_1 = 0; x_1 < _this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length; x_1++) {
15310
+ if (_this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['latitude'] ===
15311
+ markerSelectionValues['latitude'] ||
15312
+ _this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
15313
+ markerSelectionValues['longitude']) {
15314
+ maps.markerSelection(_this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], _this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
15315
+ }
15029
15316
  }
15030
15317
  }
15031
- if (((this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
15318
+ if (((_this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && _this.currentLayer.type === 'SubLayer')) && !_this.isPanning) {
15032
15319
  if (maps.isTileMap) {
15033
15320
  var groupElement = document.querySelector('.GroupElement');
15034
- if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
15321
+ if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation_1) {
15035
15322
  groupElement.style.display = 'none';
15036
15323
  }
15037
15324
  }
@@ -15040,8 +15327,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
15040
15327
  currentEle.style.cssText = markerStyle;
15041
15328
  }
15042
15329
  }
15043
- }
15044
- if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
15330
+ });
15331
+ if (this_1.isPanning && maps.markerModule.sameMarkerData.length > 0) {
15045
15332
  clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
15046
15333
  }
15047
15334
  else if (maps.markerModule.sameMarkerData.length > 0) {
@@ -15051,7 +15338,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15051
15338
  }
15052
15339
  }
15053
15340
  if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
15054
- && !this.isPanning) {
15341
+ && !this_1.isPanning) {
15055
15342
  var mapsTooltip = maps.mapsTooltipModule;
15056
15343
  var tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
15057
15344
  if (!isNullOrUndefined(tooltipElement)) {
@@ -15089,7 +15376,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15089
15376
  var centerY = bubbleCollection['center']['y'];
15090
15377
  var currentX = ((centerX + x) * scale);
15091
15378
  var currentY = ((centerY + y) * scale);
15092
- var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
15379
+ var duration = this_1.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this_1.currentLayer.animationDuration;
15093
15380
  if (!animate$$1 || duration === 0) {
15094
15381
  childElement.setAttribute('transform', 'translate( ' + currentX + ' ' + currentY + ' )');
15095
15382
  }
@@ -15101,25 +15388,25 @@ var Zoom = /** @__PURE__ @class */ (function () {
15101
15388
  }
15102
15389
  }
15103
15390
  }
15104
- else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
15105
- this.intersect = [];
15391
+ else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this_1.index])) {
15392
+ this_1.intersect = [];
15106
15393
  maps.zoomLabelPositions = [];
15107
15394
  maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
15108
15395
  var labelAnimate = !maps.isTileMap && animate$$1;
15109
15396
  for (var k = 0; k < currentEle.childElementCount; k++) {
15110
15397
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
15111
15398
  var labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
15112
- this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
15113
- maps.zoomShapeCollection.push(this.zoomshapewidth);
15114
- this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
15115
- var dataLabel = maps.layers[this.index].dataLabelSettings;
15399
+ this_1.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
15400
+ maps.zoomShapeCollection.push(this_1.zoomshapewidth);
15401
+ this_1.dataLabelTranslate(currentEle.childNodes[k], factor_1, x, y, scale, 'DataLabel', labelAnimate);
15402
+ var dataLabel = maps.layers[this_1.index].dataLabelSettings;
15116
15403
  var border = dataLabel.border;
15117
15404
  if (k > 0 && border['width'] > 1) {
15118
15405
  if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
15119
15406
  var labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
15120
15407
  var labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
15121
15408
  var zoomtext = currentEle.childNodes[k]['textContent'];
15122
- var style = maps.layers[this.index].dataLabelSettings.textStyle;
15409
+ var style = maps.layers[this_1.index].dataLabelSettings.textStyle;
15123
15410
  var zoomtextSize = measureText(zoomtext, style);
15124
15411
  var padding = 5;
15125
15412
  var rectElement = currentEle.childNodes[k - 1];
@@ -15132,9 +15419,16 @@ var Zoom = /** @__PURE__ @class */ (function () {
15132
15419
  }
15133
15420
  }
15134
15421
  }
15422
+ };
15423
+ for (var j = 0; j < elementCount; j++) {
15424
+ _loop_2(j);
15135
15425
  }
15136
15426
  }
15137
15427
  maps.arrangeTemplate();
15428
+ };
15429
+ var this_1 = this;
15430
+ for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
15431
+ _loop_1(i_1);
15138
15432
  }
15139
15433
  if (!isNullOrUndefined(this.currentLayer)) {
15140
15434
  if (!animate$$1 || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
@@ -15174,7 +15468,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15174
15468
  removeElement(markerTemplateElements.id);
15175
15469
  }
15176
15470
  var currentLayers = this.maps.layersCollection[layerIndex];
15177
- currentLayers.markerSettings.map(function (markerSettings, markerIndex) {
15471
+ Array.prototype.forEach.call(currentLayers.markerSettings, function (markerSettings, markerIndex) {
15178
15472
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15179
15473
  var markerDatas = markerSettings.dataSource;
15180
15474
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -15223,9 +15517,22 @@ var Zoom = /** @__PURE__ @class */ (function () {
15223
15517
  _this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
15224
15518
  ? _this.maps.markerNullCount + 1 : _this.maps.markerNullCount;
15225
15519
  var markerDataLength = markerDatas.length - _this.maps.markerNullCount;
15520
+ var isMarkersClustered = false;
15226
15521
  if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
15227
15522
  if (_this.maps.isTileMap) {
15228
- layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
15523
+ var polygonsElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
15524
+ var polygonElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
15525
+ if (!isNullOrUndefined(polygonsElement)) {
15526
+ polygonsElement.insertAdjacentElement('afterend', markerSVGObject);
15527
+ }
15528
+ else {
15529
+ if (!isNullOrUndefined(polygonElement)) {
15530
+ polygonElement.insertAdjacentElement('afterend', markerSVGObject);
15531
+ }
15532
+ else {
15533
+ layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
15534
+ }
15535
+ }
15229
15536
  }
15230
15537
  else {
15231
15538
  layerElement.appendChild(markerSVGObject);
@@ -15233,13 +15540,13 @@ var Zoom = /** @__PURE__ @class */ (function () {
15233
15540
  if (currentLayers.markerClusterSettings.allowClustering) {
15234
15541
  _this.maps.svgObject.appendChild(markerSVGObject);
15235
15542
  _this.maps.element.appendChild(_this.maps.svgObject);
15236
- clusterTemplate(currentLayers, markerSVGObject, _this.maps, layerIndex, markerSVGObject, layerElement, true, true);
15543
+ isMarkersClustered = clusterTemplate(currentLayers, markerSVGObject, _this.maps, layerIndex, markerSVGObject, layerElement, true, true);
15237
15544
  }
15238
15545
  }
15239
15546
  if (markerTemplateElements.childElementCount === (markerDataLength - markerCounts - nullCount) && getElementByID(_this.maps.element.id + '_Secondary_Element')) {
15240
15547
  getElementByID(_this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
15241
15548
  if (scale >= 1) {
15242
- if (currentLayers.markerClusterSettings.allowClustering) {
15549
+ if (currentLayers.markerClusterSettings.allowClustering && !isMarkersClustered) {
15243
15550
  clusterTemplate(currentLayers, markerTemplateElements, _this.maps, layerIndex, markerSVGObject, layerElement, false, true);
15244
15551
  }
15245
15552
  }
@@ -15265,6 +15572,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
15265
15572
  i + '_Markers_Template_Group');
15266
15573
  var datalabelTemplateElemement = getElementByID(maps.element.id + '_LayerIndex_'
15267
15574
  + i + '_Label_Template_Group');
15575
+ var polygonElement = getElementByID(maps.element.id + '_LayerIndex_'
15576
+ + i + '_Polygons_Group');
15268
15577
  if ((!isNullOrUndefined(markerTemplateElement)) && markerTemplateElement.childElementCount > 0) {
15269
15578
  markerTemplateElement.style.visibility = 'visible';
15270
15579
  for (var k = 0; k < markerTemplateElement.childElementCount; k++) {
@@ -15276,6 +15585,12 @@ var Zoom = /** @__PURE__ @class */ (function () {
15276
15585
  this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template');
15277
15586
  }
15278
15587
  }
15588
+ if (!isNullOrUndefined(polygonElement)) {
15589
+ for (var k = 0; k < polygonElement.childElementCount; k++) {
15590
+ var width = maps.layersCollection[i].polygonSettings.polygons[k].borderWidth;
15591
+ polygonElement.childNodes[k].childNodes[0].setAttribute('stroke-width', (width / scale).toString());
15592
+ }
15593
+ }
15279
15594
  }
15280
15595
  };
15281
15596
  Zoom.prototype.dataLabelTranslate = function (element, factor, x, y, scale, type, animate$$1) {
@@ -15330,7 +15645,6 @@ var Zoom = /** @__PURE__ @class */ (function () {
15330
15645
  zoomtextSize = measureText(zoomtext, style);
15331
15646
  var start = labelY - zoomtextSize['height'] / 4;
15332
15647
  var end = labelY + zoomtextSize['height'] / 4;
15333
- labelY = end;
15334
15648
  var xpositionEnds = labelX + zoomtextSize['width'] / 2;
15335
15649
  var xpositionStart = labelX - zoomtextSize['width'] / 2;
15336
15650
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -15503,12 +15817,16 @@ var Zoom = /** @__PURE__ @class */ (function () {
15503
15817
  for (var i = 0; i < map.layersCollection.length; i++) {
15504
15818
  var markerTemplateElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
15505
15819
  var lineElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_line_Group');
15820
+ var polygonElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Polygons_Group');
15506
15821
  if (!isNullOrUndefined(markerTemplateElement)) {
15507
15822
  markerTemplateElement.style.visibility = 'hidden';
15508
15823
  }
15509
15824
  if (!isNullOrUndefined(lineElement)) {
15510
15825
  lineElement.style.visibility = 'hidden';
15511
15826
  }
15827
+ if (!isNullOrUndefined(polygonElement)) {
15828
+ polygonElement.style.visibility = 'hidden';
15829
+ }
15512
15830
  }
15513
15831
  }
15514
15832
  };
@@ -15550,10 +15868,13 @@ var Zoom = /** @__PURE__ @class */ (function () {
15550
15868
  ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
15551
15869
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15552
15870
  var location_3 = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
15871
+ var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
15553
15872
  panArgs = {
15554
15873
  cancel: false, name: pan, maps: map,
15555
15874
  tileTranslatePoint: {}, translatePoint: { previous: translatePoint, current: new Point(x, y) },
15556
- scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude']
15875
+ scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude'],
15876
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
15877
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
15557
15878
  };
15558
15879
  map.trigger(pan, panArgs);
15559
15880
  if (!panArgs.cancel) {
@@ -15587,11 +15908,14 @@ var Zoom = /** @__PURE__ @class */ (function () {
15587
15908
  map.translatePoint.y = (map.tileTranslatePoint.y - yDifference) / map.scale;
15588
15909
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15589
15910
  var location_4 = this.maps.getTileGeoLocation(mouseLocation['layerX'], mouseLocation['layerY']);
15911
+ var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
15590
15912
  panArgs = {
15591
15913
  cancel: false, name: pan, maps: map,
15592
15914
  tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint },
15593
15915
  translatePoint: { previous: translatePoint, current: map.translatePoint }, scale: map.scale,
15594
- tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude']
15916
+ tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude'],
15917
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
15918
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
15595
15919
  };
15596
15920
  map.trigger(pan, panArgs);
15597
15921
  map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
@@ -15614,7 +15938,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15614
15938
  Zoom.prototype.toolBarZooming = function (zoomFactor, type) {
15615
15939
  var _this = this;
15616
15940
  var map = this.maps;
15617
- map.initialCheck = false;
15941
+ map.initialCheck = map.isMarkerZoomCompleted = false;
15618
15942
  map.defaultState = ((type === 'Reset' && zoomFactor === 1 && !(map.zoomSettings.resetToInitial && map.applyZoomReset))
15619
15943
  || (type === 'ZoomOut' && zoomFactor === 1));
15620
15944
  var prevLevel = map.tileZoomLevel;
@@ -15627,7 +15951,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
15627
15951
  var size = map.mapAreaRect;
15628
15952
  var translatePoint = map.previousPoint = map.translatePoint;
15629
15953
  var prevTilePoint = map.tileTranslatePoint;
15630
- map.previousProjection = (type !== 'Reset') ? map.projectionType : null;
15954
+ map.previousProjection = type === 'Reset' ? undefined : map.projectionType;
15631
15955
  zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
15632
15956
  zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
15633
15957
  zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;
@@ -15885,7 +16209,10 @@ var Zoom = /** @__PURE__ @class */ (function () {
15885
16209
  isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) + 1 <= this.maps.zoomSettings.maxZoom;
15886
16210
  break;
15887
16211
  case 'zoomout':
15888
- isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) - 1 >= this.maps.zoomSettings.minZoom;
16212
+ var scaleValue = this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale;
16213
+ isToolbarPerform = (this.maps.projectionType === 'Miller' || this.maps.projectionType === 'Winkel3' ||
16214
+ this.maps.projectionType === 'AitOff') ? Math.round(scaleValue) - 1 >= this.maps.zoomSettings.minZoom :
16215
+ (scaleValue) - 1 >= this.maps.zoomSettings.minZoom;
15889
16216
  break;
15890
16217
  case 'reset':
15891
16218
  isToolbarPerform = Math.round(this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) != this.maps.zoomSettings.minZoom;
@@ -16319,8 +16646,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
16319
16646
  var pageX = e.pageX;
16320
16647
  var pageY = e.pageY;
16321
16648
  var target = e.target;
16649
+ var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
16322
16650
  if (this.maps.zoomSettings.enable && this.maps.zoomSettings.doubleClickZoom
16323
- && !(e.target['id'].indexOf('_Zooming_') > -1)) {
16651
+ && !(e.target['id'].indexOf('_Zooming_') > -1) && isNullOrUndefined(tooltipElement)) {
16324
16652
  var position = this.getMousePosition(pageX, pageY);
16325
16653
  var map = this.maps;
16326
16654
  var size = map.availableSize;
@@ -16493,8 +16821,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
16493
16821
  */
16494
16822
  Zoom.prototype.click = function (e) {
16495
16823
  var map = this.maps;
16824
+ var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
16496
16825
  if ((map.markerModule && map.markerModule.sameMarkerData.length > 0) ||
16497
- (e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1)) {
16826
+ (e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1) || !isNullOrUndefined(tooltipElement)) {
16498
16827
  return null;
16499
16828
  }
16500
16829
  if (this.isSingleClick && map.zoomSettings.zoomOnClick && !(e.target['id'].indexOf('_Zooming_') > -1) && !map.zoomSettings.doubleClickZoom
@@ -17075,5 +17404,5 @@ var PdfExport = /** @__PURE__ @class */ (function () {
17075
17404
  * exporting all modules from maps index
17076
17405
  */
17077
17406
 
17078
- export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerDragStart, markerDragEnd, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, ZoomToolbarButtonSettings, ZoomToolbarTooltipSettings, ZoomToolbarSettings, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, 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, getHexColor, 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 };
17407
+ export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerDragStart, markerDragEnd, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, ZoomToolbarButtonSettings, ZoomToolbarTooltipSettings, ZoomToolbarSettings, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, PolygonSetting, PolygonSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, calculatePolygonPath, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, Coordinate, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, getHexColor, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, Polygon, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
17079
17408
  //# sourceMappingURL=ej2-maps.es5.js.map