@syncfusion/ej2-maps 20.4.49 → 21.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +4 -20
  2. package/dist/ej2-maps.min.js +2 -2
  3. package/dist/ej2-maps.umd.min.js +2 -2
  4. package/dist/ej2-maps.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-maps.es2015.js +993 -236
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +1008 -236
  8. package/dist/es6/ej2-maps.es5.js.map +1 -1
  9. package/dist/global/ej2-maps.min.js +2 -2
  10. package/dist/global/ej2-maps.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/maps/layers/bubble.d.ts +2 -0
  14. package/src/maps/layers/bubble.js +2 -1
  15. package/src/maps/layers/color-mapping.d.ts +1 -0
  16. package/src/maps/layers/color-mapping.js +1 -0
  17. package/src/maps/layers/data-label.d.ts +1 -0
  18. package/src/maps/layers/data-label.js +9 -4
  19. package/src/maps/layers/layer-panel.js +1 -0
  20. package/src/maps/layers/legend.d.ts +2 -0
  21. package/src/maps/layers/legend.js +2 -0
  22. package/src/maps/layers/marker.d.ts +5 -0
  23. package/src/maps/layers/marker.js +42 -3
  24. package/src/maps/layers/navigation-selected-line.d.ts +1 -0
  25. package/src/maps/layers/navigation-selected-line.js +1 -0
  26. package/src/maps/maps-model.d.ts +47 -33
  27. package/src/maps/maps.d.ts +144 -88
  28. package/src/maps/maps.js +217 -61
  29. package/src/maps/model/base-model.d.ts +535 -230
  30. package/src/maps/model/base.d.ts +540 -263
  31. package/src/maps/model/base.js +168 -28
  32. package/src/maps/model/constants.d.ts +12 -0
  33. package/src/maps/model/constants.js +12 -0
  34. package/src/maps/model/export-image.d.ts +1 -1
  35. package/src/maps/model/export-image.js +1 -1
  36. package/src/maps/model/export-pdf.d.ts +2 -2
  37. package/src/maps/model/export-pdf.js +2 -2
  38. package/src/maps/model/interface.d.ts +137 -108
  39. package/src/maps/model/theme.d.ts +1 -0
  40. package/src/maps/model/theme.js +1 -0
  41. package/src/maps/user-interaction/annotation.d.ts +2 -0
  42. package/src/maps/user-interaction/annotation.js +2 -0
  43. package/src/maps/user-interaction/highlight.d.ts +1 -0
  44. package/src/maps/user-interaction/highlight.js +1 -0
  45. package/src/maps/user-interaction/selection.d.ts +1 -0
  46. package/src/maps/user-interaction/selection.js +1 -0
  47. package/src/maps/user-interaction/tooltip.d.ts +16 -0
  48. package/src/maps/user-interaction/tooltip.js +23 -6
  49. package/src/maps/user-interaction/zoom.d.ts +99 -3
  50. package/src/maps/user-interaction/zoom.js +405 -100
  51. package/src/maps/utils/enum.d.ts +105 -91
  52. package/src/maps/utils/helper.d.ts +76 -16
  53. package/src/maps/utils/helper.js +122 -37
  54. package/.eslintrc.json +0 -259
  55. package/tslint.json +0 -111
@@ -15,14 +15,14 @@ var __extends = (this && this.__extends) || (function () {
15
15
  /**
16
16
  * Helper functions for maps control
17
17
  */
18
- import { createElement, isNullOrUndefined, remove, compile as templateComplier, merge } from '@syncfusion/ej2-base';
18
+ import { createElement, isNullOrUndefined, remove, compile as templateComplier, merge, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
19
19
  import { Animation } from '@syncfusion/ej2-base';
20
20
  import { SvgRenderer } from '@syncfusion/ej2-svg-base';
21
21
  import { itemSelection } from '../../index';
22
22
  import { animationComplete } from '../index';
23
23
  import { markerClusterRendering } from '../index';
24
24
  /**
25
- * Maps internal use of `Size` type
25
+ * Specifies the size information of an element.
26
26
  */
27
27
  var Size = /** @class */ (function () {
28
28
  function Size(width, height) {
@@ -51,6 +51,7 @@ export function stringToNumber(value, containerSize) {
51
51
  *
52
52
  * @param {Maps} maps Specifies the maps instance
53
53
  * @returns {void}
54
+ * @private
54
55
  */
55
56
  export function calculateSize(maps) {
56
57
  maps.element.style.height = !isNullOrUndefined(maps.height) ? maps.height : 'auto';
@@ -74,6 +75,7 @@ export function calculateSize(maps) {
74
75
  *
75
76
  * @param {Maps} maps Specifies the map instance
76
77
  * @returns {void}
78
+ * @private
77
79
  */
78
80
  export function createSvg(maps) {
79
81
  maps.renderer = new SvgRenderer(maps.element.id);
@@ -95,6 +97,7 @@ export function createSvg(maps) {
95
97
  * @param {number} pageY - Specifies the pageY.
96
98
  * @param {Element} element - Specifies the element.
97
99
  * @returns {MapLocation} - Returns the location.
100
+ * @private
98
101
  */
99
102
  export function getMousePosition(pageX, pageY, element) {
100
103
  var elementRect = element.getBoundingClientRect();
@@ -111,6 +114,7 @@ export function getMousePosition(pageX, pageY, element) {
111
114
  *
112
115
  * @param {number} deg Specifies the degree value
113
116
  * @returns {number} Returns the number
117
+ * @private
114
118
  */
115
119
  export function degreesToRadians(deg) {
116
120
  return deg * (Math.PI / 180);
@@ -120,6 +124,7 @@ export function degreesToRadians(deg) {
120
124
  *
121
125
  * @param {number} radian Specifies the radian value
122
126
  * @returns {number} Returns the number
127
+ * @private
123
128
  */
124
129
  export function radiansToDegrees(radian) {
125
130
  return radian * (180 / Math.PI);
@@ -133,6 +138,7 @@ export function radiansToDegrees(radian) {
133
138
  * @param {LayerSettings} layer - Specifies the layer settings.
134
139
  * @param {Maps} mapModel - Specifies the maps.
135
140
  * @returns {Point} - Returns the point values.
141
+ * @private
136
142
  */
137
143
  export function convertGeoToPoint(latitude, longitude, factor, layer, mapModel) {
138
144
  var mapSize = new Size(mapModel.mapAreaRect.width, mapModel.mapAreaRect.height);
@@ -216,6 +222,7 @@ export function convertGeoToPoint(latitude, longitude, factor, layer, mapModel)
216
222
  * @param {MapLocation} tileTranslatePoint Specifies the tile translate point
217
223
  * @param {boolean} isMapCoordinates Specifies the boolean value
218
224
  * @returns {MapLocation} Returns the location value
225
+ * @private
219
226
  */
220
227
  export function convertTileLatLongToPoint(center, zoomLevel, tileTranslatePoint, isMapCoordinates) {
221
228
  var size = Math.pow(2, zoomLevel) * 256;
@@ -236,6 +243,7 @@ export function convertTileLatLongToPoint(center, zoomLevel, tileTranslatePoint,
236
243
  * @param {Maps} mapObject - Specifies the maps.
237
244
  * @param {number} val - Specifies the value.
238
245
  * @returns {number} - Returns the number.
246
+ * @private
239
247
  */
240
248
  export function xToCoordinate(mapObject, val) {
241
249
  var longitudeMinMax = mapObject.baseMapBounds.longitude;
@@ -249,6 +257,7 @@ export function xToCoordinate(mapObject, val) {
249
257
  * @param {Maps} mapObject - Specifies the maps.
250
258
  * @param {number} val - Specifies the value.
251
259
  * @returns {number} - Returns the number.
260
+ * @private
252
261
  */
253
262
  export function yToCoordinate(mapObject, val) {
254
263
  var latitudeMinMax = mapObject.baseMapBounds.latitude;
@@ -260,6 +269,7 @@ export function yToCoordinate(mapObject, val) {
260
269
  * @param {number} x - Specifies the x value.
261
270
  * @param {number} y - Specifies the y value.
262
271
  * @returns {Point} - Returns the point value.
272
+ * @private
263
273
  */
264
274
  export function aitoff(x, y) {
265
275
  var cosy = Math.cos(y);
@@ -272,6 +282,7 @@ export function aitoff(x, y) {
272
282
  * @param {number} a - Specifies the a value
273
283
  * @param {number} b - Specifies the b value
274
284
  * @returns {number} - Returns the number
285
+ * @private
275
286
  */
276
287
  export function roundTo(a, b) {
277
288
  var c = Math.pow(10, b);
@@ -281,6 +292,7 @@ export function roundTo(a, b) {
281
292
  *
282
293
  * @param {number} x - Specifies the x value
283
294
  * @returns {number} - Returns the number
295
+ * @private
284
296
  */
285
297
  export function sinci(x) {
286
298
  return x / Math.sin(x);
@@ -289,6 +301,7 @@ export function sinci(x) {
289
301
  *
290
302
  * @param {number} a - Specifies the a value
291
303
  * @returns {number} - Returns the number
304
+ * @private
292
305
  */
293
306
  export function acos(a) {
294
307
  return Math.acos(a);
@@ -300,6 +313,7 @@ export function acos(a) {
300
313
  * @param {number} min Specifies the minimum value
301
314
  * @param {number} max Specifies the maximum value
302
315
  * @returns {number} Returns the value
316
+ * @private
303
317
  */
304
318
  export function calculateBound(value, min, max) {
305
319
  if (!isNullOrUndefined(min)) {
@@ -318,6 +332,7 @@ export function calculateBound(value, min, max) {
318
332
  * @param {string} url Specifies the url
319
333
  * @param {boolean} isDownload Specifies whether download a file.
320
334
  * @returns {void}
335
+ * @private
321
336
  */
322
337
  export function triggerDownload(fileName, type, url, isDownload) {
323
338
  createElement('a', {
@@ -332,7 +347,7 @@ export function triggerDownload(fileName, type, url, isDownload) {
332
347
  }));
333
348
  }
334
349
  /**
335
- * Map internal class for point
350
+ * Specifies the information of the position of the point in maps.
336
351
  */
337
352
  var Point = /** @class */ (function () {
338
353
  function Point(x, y) {
@@ -379,7 +394,7 @@ export function measureText(text, font) {
379
394
  measureObject = createElement('text', { id: 'mapsmeasuretext' });
380
395
  document.body.appendChild(measureObject);
381
396
  }
382
- measureObject.innerHTML = text;
397
+ measureObject.innerText = text;
383
398
  measureObject.style.position = 'absolute';
384
399
  if (typeof (font.size) === 'number') {
385
400
  measureObject.style.fontSize = (font.size) + 'px';
@@ -551,6 +566,7 @@ export { LineOption };
551
566
  * Internal use of line
552
567
  *
553
568
  * @property {number} Line - Specifies the line class
569
+ * @private
554
570
  */
555
571
  var Line = /** @class */ (function () {
556
572
  function Line(x1, y1, x2, y2) {
@@ -565,6 +581,7 @@ export { Line };
565
581
  /**
566
582
  * Internal use of map location type
567
583
  *
584
+ * @private
568
585
  */
569
586
  var MapLocation = /** @class */ (function () {
570
587
  function MapLocation(x, y) {
@@ -593,6 +610,7 @@ export { Rect };
593
610
  * Internal use for pattern creation.
594
611
  *
595
612
  * @property {PatternOptions} PatternOptions - Specifies the pattern option class.
613
+ * @private
596
614
  */
597
615
  var PatternOptions = /** @class */ (function () {
598
616
  function PatternOptions(id, x, y, width, height, patternUnits, patternContentUnits, patternTransform, href) {
@@ -710,6 +728,7 @@ export function convertElement(element, markerId, data, index, mapObj) {
710
728
  * @param {string} value - Specifies the value
711
729
  * @param {Maps} maps - Specifies the instance of the maps
712
730
  * @returns {string} - Returns the string value
731
+ * @private
713
732
  */
714
733
  export function formatValue(value, maps) {
715
734
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -731,6 +750,7 @@ export function formatValue(value, maps) {
731
750
  * @param {any} data - Specifies the data
732
751
  * @param {Maps} maps - Specifies the instance of the maps
733
752
  * @returns {string} - Returns the string value
753
+ * @private
734
754
  */
735
755
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
736
756
  export function convertStringToValue(stringTemplate, format, data, maps) {
@@ -761,6 +781,7 @@ export function convertStringToValue(stringTemplate, format, data, maps) {
761
781
  * @param {number} index - Specifies the index
762
782
  * @param {Maps} mapObj - Specifies the map object
763
783
  * @returns {HTMLElement} - Returns the html element
784
+ * @private
764
785
  */
765
786
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
766
787
  export function convertElementFromLabel(element, labelId, data, index, mapObj) {
@@ -790,6 +811,7 @@ export function convertElementFromLabel(element, labelId, data, index, mapObj) {
790
811
  * @param {Element} markerCollection - Specifies the marker collection
791
812
  * @param {Maps} maps - Specifies the instance of the maps
792
813
  * @returns {Element} - Returns the element
814
+ * @private
793
815
  */
794
816
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
795
817
  export function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCollection, maps) {
@@ -823,7 +845,7 @@ export function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, ma
823
845
  }
824
846
  else if (shape === 'Image') {
825
847
  x = location.x - (size.width / 2);
826
- y = location.y - size.height;
848
+ y = location.y - (size.height / 2);
827
849
  merge(pathOptions, { 'href': imageUrl, 'height': size.height, 'width': size.width, x: x, y: y });
828
850
  markerEle = maps.renderer.drawImage(pathOptions);
829
851
  }
@@ -837,6 +859,7 @@ export function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, ma
837
859
  * @param {any} data - Specifies the data
838
860
  * @param {string} value - Specifies the value
839
861
  * @returns {any} - Returns the data
862
+ * @private
840
863
  */
841
864
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
842
865
  export function getValueFromObject(data, value) {
@@ -858,6 +881,7 @@ export function getValueFromObject(data, value) {
858
881
  * @param {IMarkerRenderingEventArgs} eventArgs - Specifies the event arguments
859
882
  * @param {any} data - Specifies the data
860
883
  * @returns {IMarkerRenderingEventArgs} - Returns the arguments
884
+ * @private
861
885
  */
862
886
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
863
887
  export function markerColorChoose(eventArgs, data) {
@@ -874,6 +898,7 @@ export function markerColorChoose(eventArgs, data) {
874
898
  * @param {IMarkerRenderingEventArgs} eventArgs - Specifies the event arguments
875
899
  * @param {any} data - Specifies the data
876
900
  * @returns {IMarkerRenderingEventArgs} - Returns the arguments
901
+ * @private
877
902
  */
878
903
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
879
904
  export function markerShapeChoose(eventArgs, data) {
@@ -909,6 +934,7 @@ export function markerShapeChoose(eventArgs, data) {
909
934
  * @param {boolean} check - Specifies the boolean value
910
935
  * @param {boolean} zoomCheck - Specifies the boolean value
911
936
  * @returns {void}
937
+ * @private
912
938
  */
913
939
  export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerCollection, layerElement, check, zoomCheck) {
914
940
  var bounds1;
@@ -1034,14 +1060,13 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
1034
1060
  var clusterID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_dataIndex_' + dataIndex + '_cluster_' + (m);
1035
1061
  var labelID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_dataIndex_' + dataIndex + '_cluster_' + (m) + '_datalabel_' + m;
1036
1062
  m++;
1037
- var imageShapeY = shapeCustom['shape'] === 'Image' ? shapeCustom['size']['height'] / 2 : 0;
1038
- var ele = drawSymbols(shapeCustom['shape'], shapeCustom['imageUrl'], { x: 0, y: imageShapeY }, clusterID, shapeCustom, markerCollection, maps);
1063
+ var ele = drawSymbols(shapeCustom['shape'], shapeCustom['imageUrl'], { x: 0, y: 0 }, clusterID, shapeCustom, markerCollection, maps);
1039
1064
  ele.setAttribute('transform', 'translate( ' + tempX + ' ' + tempY + ' )');
1040
1065
  if (eventArg.shape === 'Balloon') {
1041
- ele.children[0].innerHTML = indexCollection.toString();
1066
+ ele.children[0].innerText = indexCollection.toString();
1042
1067
  }
1043
1068
  else {
1044
- ele.innerHTML = indexCollection.toString();
1069
+ ele.innerText = indexCollection.toString();
1045
1070
  }
1046
1071
  options = new TextOption(labelID, (0), postionY, 'middle', (colloideBounds.length + 1).toString(), '', '');
1047
1072
  textElement = renderTextElement(options, style, style.color, markerCollection);
@@ -1123,6 +1148,7 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
1123
1148
  * @param {Maps} maps - Specifies the instance of the maps
1124
1149
  * @param {Element | HTMLElement} markerElement - Specifies the marker element
1125
1150
  * @returns {void}
1151
+ * @private
1126
1152
  */
1127
1153
  export function mergeSeparateCluster(sameMarkerData, maps, markerElement) {
1128
1154
  var layerIndex = sameMarkerData[0].layerIndex;
@@ -1151,6 +1177,7 @@ export function mergeSeparateCluster(sameMarkerData, maps, markerElement) {
1151
1177
  * @param {Element | HTMLElement} markerElement - Specifies the marker element
1152
1178
  * @param {boolean} isDom - Specifies the boolean value
1153
1179
  * @returns {void}
1180
+ * @private
1154
1181
  */
1155
1182
  export function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1156
1183
  var layerIndex = sameMarkerData[0].layerIndex;
@@ -1245,6 +1272,7 @@ export function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
1245
1272
  * @param {Maps} maps - Specifies the instance of the maps
1246
1273
  * @param {Element} markerCollection - Specifies the marker collection
1247
1274
  * @returns {Element} - Returns the element
1275
+ * @private
1248
1276
  */
1249
1277
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1250
1278
  export function marker(eventArgs, markerSettings, markerData, dataIndex, location, transPoint, markerID, offset, scale, maps, markerCollection) {
@@ -1284,6 +1312,7 @@ export function marker(eventArgs, markerSettings, markerData, dataIndex, locatio
1284
1312
  * @param {Point} offset - Specifies the offset value
1285
1313
  * @param {Maps} maps - Specifies the instance of the maps
1286
1314
  * @returns {HTMLElement} - Returns the html element
1315
+ * @private
1287
1316
  */
1288
1317
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1289
1318
  export function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplate, location, transPoint, scale, offset, maps) {
@@ -1352,11 +1381,12 @@ export function maintainSelection(elementId, elementClass, element, className) {
1352
1381
  export function maintainStyleClass(id, idClass, fill, opacity, borderColor, borderWidth, maps) {
1353
1382
  if (!getElement(id)) {
1354
1383
  var styleClass = createElement('style', {
1355
- id: id, innerHTML: '.' + idClass + '{fill:'
1356
- + fill + ';' + 'opacity:' + opacity + ';' +
1357
- 'stroke-width:' + borderWidth + ';' +
1358
- 'stroke:' + borderColor + ';' + '}'
1384
+ id: id
1359
1385
  });
1386
+ styleClass.innerText = '.' + idClass + '{fill:'
1387
+ + fill + ';' + 'opacity:' + opacity + ';' +
1388
+ 'stroke-width:' + borderWidth + ';' +
1389
+ 'stroke:' + borderColor + ';' + '}';
1360
1390
  maps.shapeSelectionClass = styleClass;
1361
1391
  document.body.appendChild(styleClass);
1362
1392
  }
@@ -1627,7 +1657,7 @@ export function drawBalloon(maps, options, size, location, type, element) {
1627
1657
  var height = size.height;
1628
1658
  var pathElement;
1629
1659
  location.x -= width / 2;
1630
- location.y -= height;
1660
+ location.y -= height / 2;
1631
1661
  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' +
1632
1662
  'c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S17.8,16,15,16z';
1633
1663
  var balloon = maps.renderer.drawPath(options);
@@ -1700,6 +1730,7 @@ export function getFieldData(dataSource, fields) {
1700
1730
  * @param {string | string[]} propertyPath - Specifies the property path
1701
1731
  * @param {LayerSettingsModel} layer - Specifies the layer settings
1702
1732
  * @returns {number} - Returns the number
1733
+ * @private
1703
1734
  */
1704
1735
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1705
1736
  export function checkShapeDataFields(dataSource, properties, dataPath, propertyPath, layer) {
@@ -1752,6 +1783,7 @@ export function checkPropertyPath(shapeData, shapePropertyPath, shape) {
1752
1783
  * @param {number} start - Specifies the start value
1753
1784
  * @param {number} end - Specifies the end value
1754
1785
  * @returns {MapLocation[]} - Returns the location
1786
+ * @private
1755
1787
  */
1756
1788
  export function filter(points, start, end) {
1757
1789
  var pointObject = [];
@@ -1771,6 +1803,7 @@ export function filter(points, start, end) {
1771
1803
  * @param {number} minValue - Specifies the minValue
1772
1804
  * @param {number} maxValue -Specifies the maxValue
1773
1805
  * @returns {number} - Returns the number
1806
+ * @private
1774
1807
  */
1775
1808
  export function getRatioOfBubble(min, max, value, minValue, maxValue) {
1776
1809
  var percent = (100 / (maxValue - minValue)) * (value - minValue);
@@ -1787,6 +1820,7 @@ export function getRatioOfBubble(min, max, value, minValue, maxValue) {
1787
1820
  * @param {string} type - Specifies the type
1788
1821
  * @param {string} geometryType - Specified the type of the geometry
1789
1822
  * @returns {any} - Specifies the object
1823
+ * @private
1790
1824
  */
1791
1825
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1792
1826
  export function findMidPointOfPolygon(points, type, geometryType) {
@@ -1927,6 +1961,7 @@ export function textTrim(maxWidth, text, font) {
1927
1961
  * @param {Size} textSize - Specifies the text size
1928
1962
  * @param {string} type - Specifies the type
1929
1963
  * @returns {Point} - Returns the point values
1964
+ * @private
1930
1965
  */
1931
1966
  export function findPosition(location, alignment, textSize, type) {
1932
1967
  var x;
@@ -1951,6 +1986,7 @@ export function findPosition(location, alignment, textSize, type) {
1951
1986
  *
1952
1987
  * @param {string} id - Specifies the id
1953
1988
  * @returns {void}
1989
+ * @private
1954
1990
  */
1955
1991
  export function removeElement(id) {
1956
1992
  var element = document.getElementById(id);
@@ -1962,6 +1998,7 @@ export function removeElement(id) {
1962
1998
  * @param {Maps} mapObject - Specifies the map object
1963
1999
  * @param {LayerSettings} layer - Specifies the layer settings
1964
2000
  * @returns {Point} - Returns the x and y points
2001
+ * @private
1965
2002
  */
1966
2003
  export function calculateCenterFromPixel(mapObject, layer) {
1967
2004
  var point1 = convertGeoToPoint(mapObject.minLatOfGivenLocation, mapObject.minLongOfGivenLocation, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
@@ -2290,6 +2327,7 @@ export function getZoomTranslate(mapObject, layer, animate) {
2290
2327
  *
2291
2328
  * @param {Maps} map - Specifies the instance of the maps
2292
2329
  * @returns {void}
2330
+ * @private
2293
2331
  */
2294
2332
  export function fixInitialScaleForTile(map) {
2295
2333
  map.tileZoomScale = map.tileZoomLevel = Math.floor(map.availableSize.height / 512) + 1;
@@ -2306,6 +2344,7 @@ export function fixInitialScaleForTile(map) {
2306
2344
  *
2307
2345
  * @param {string} id - Specifies the id
2308
2346
  * @returns {Element} - Returns the element
2347
+ * @private
2309
2348
  */
2310
2349
  export function getElementByID(id) {
2311
2350
  return document.getElementById(id);
@@ -2332,6 +2371,7 @@ export function getClientElement(id) {
2332
2371
  * @param {Maps} maps - Specifies the instance of the maps
2333
2372
  * @param {number} value - Specifies the value
2334
2373
  * @returns {string} - Returns the string
2374
+ * @private
2335
2375
  */
2336
2376
  export function Internalize(maps, value) {
2337
2377
  maps.formatFunction =
@@ -2380,6 +2420,7 @@ export function getElement(id) {
2380
2420
  * @param {string} targetId - Specifies the target id
2381
2421
  * @param {Maps} map - Specifies the instance of the maps
2382
2422
  * @returns {any} - Returns the object
2423
+ * @private
2383
2424
  */
2384
2425
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2385
2426
  export function getShapeData(targetId, map) {
@@ -2445,6 +2486,7 @@ export function triggerShapeEvent(targetId, selection, maps, eventName) {
2445
2486
  *
2446
2487
  * @param {string} className - Specifies the class name
2447
2488
  * @returns {HTMLCollectionOf<Element>} - Returns the collection
2489
+ * @private
2448
2490
  */
2449
2491
  export function getElementsByClassName(className) {
2450
2492
  return document.getElementsByClassName(className);
@@ -2461,6 +2503,7 @@ export function getElementsByClassName(className) {
2461
2503
  * @param {string} args - Specifies the args
2462
2504
  * @param {string} elementSelector - Specifies the element selector
2463
2505
  * @returns {Element} - Returns the element
2506
+ * @private
2464
2507
  */
2465
2508
  export function querySelector(args, elementSelector) {
2466
2509
  var targetEle = null;
@@ -2477,6 +2520,7 @@ export function querySelector(args, elementSelector) {
2477
2520
  * @param {boolean} enable - Specifies the boolean value
2478
2521
  * @param {Maps} map - Specifies the instance of the maps
2479
2522
  * @returns {Element} - Returns the element
2523
+ * @private
2480
2524
  */
2481
2525
  export function getTargetElement(layerIndex, name, enable, map) {
2482
2526
  var targetId;
@@ -2498,16 +2542,19 @@ export function getTargetElement(layerIndex, name, enable, map) {
2498
2542
  * @param {string} className - Specifies the class name
2499
2543
  * @param {IShapeSelectedEventArgs | any} eventArgs - Specifies the event args
2500
2544
  * @returns {Element} - Returns the element
2545
+ * @private
2501
2546
  */
2502
2547
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2503
2548
  export function createStyle(id, className, eventArgs) {
2504
- return createElement('style', {
2505
- id: id, innerHTML: '.' + className + '{fill:'
2506
- + eventArgs['fill'] + ';' + 'fill-opacity:' + (eventArgs['opacity']).toString() + ';' +
2507
- 'stroke-opacity:' + (eventArgs['border']['opacity']).toString() + ';' +
2508
- 'stroke-width:' + (eventArgs['border']['width']).toString() + ';' +
2509
- 'stroke:' + eventArgs['border']['color'] + ';' + '}'
2549
+ var styleEle = createElement('style', {
2550
+ id: id
2510
2551
  });
2552
+ styleEle.innerText = '.' + className + '{fill:'
2553
+ + eventArgs['fill'] + ';' + 'fill-opacity:' + (eventArgs['opacity']).toString() + ';' +
2554
+ 'stroke-opacity:' + (eventArgs['border']['opacity']).toString() + ';' +
2555
+ 'stroke-width:' + (eventArgs['border']['width']).toString() + ';' +
2556
+ 'stroke:' + eventArgs['border']['color'] + ';' + '}';
2557
+ return styleEle;
2511
2558
  }
2512
2559
  /**
2513
2560
  * Function to customize the style for highlight and selection
@@ -2516,12 +2563,13 @@ export function createStyle(id, className, eventArgs) {
2516
2563
  * @param {string} className - Specifies the class name
2517
2564
  * @param {IShapeSelectedEventArgs | any} eventArgs - Specifies the event args
2518
2565
  * @returns {void}
2566
+ * @private
2519
2567
  */
2520
2568
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2521
2569
  export function customizeStyle(id, className, eventArgs) {
2522
2570
  var styleEle = getElement(id);
2523
2571
  if (!isNullOrUndefined(styleEle)) {
2524
- styleEle.innerHTML = '.' + className + '{fill:'
2572
+ styleEle.innerText = '.' + className + '{fill:'
2525
2573
  + eventArgs['fill'] + ';' + 'fill-opacity:' + (eventArgs['opacity']).toString() + ';' +
2526
2574
  'stroke-width:' + (eventArgs['border']['width']).toString() + ';' +
2527
2575
  'stroke-opacity:' + (eventArgs['border']['opacity']).toString() + ';' +
@@ -2537,6 +2585,7 @@ export function customizeStyle(id, className, eventArgs) {
2537
2585
  * @param {any} shapeData - Specifies the shape data
2538
2586
  * @param {any} data - Specifies the data
2539
2587
  * @returns {void}
2588
+ * @private
2540
2589
  */
2541
2590
  export function triggerItemSelectionEvent(selectionSettings, map, targetElement,
2542
2591
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2574,6 +2623,7 @@ shapeData, data) {
2574
2623
  *
2575
2624
  * @param {Element} element - Specifies the element
2576
2625
  * @returns {void}
2626
+ * @private
2577
2627
  */
2578
2628
  export function removeClass(element) {
2579
2629
  element.removeAttribute('class');
@@ -2628,6 +2678,7 @@ export function elementAnimate(element, delay, duration, point, maps, ele, radiu
2628
2678
  /**
2629
2679
  * @param {string} id - Specifies the id
2630
2680
  * @returns {void}
2681
+ * @private
2631
2682
  */
2632
2683
  export function timeout(id) {
2633
2684
  removeElement(id);
@@ -2643,6 +2694,7 @@ export function timeout(id) {
2643
2694
  * @param {Element} element - Specifies the element
2644
2695
  * @param {boolean} isTouch - Specifies the boolean value
2645
2696
  * @returns {void}
2697
+ * @private
2646
2698
  */
2647
2699
  export function showTooltip(text, size, x, y, areaWidth, areaHeight, id, element, isTouch) {
2648
2700
  var location = getMousePosition(x, y, element);
@@ -2708,9 +2760,10 @@ export function showTooltip(text, size, x, y, areaWidth, areaHeight, id, element
2708
2760
  * @param {number} areaWidth - Specifies the area width
2709
2761
  * @param {Element} element - Specifies the element
2710
2762
  * @returns {void}
2763
+ * @private
2711
2764
  */
2712
2765
  export function wordWrap(tooltip, text, x, y, size1, width, areaWidth, element) {
2713
- tooltip.innerHTML = text;
2766
+ tooltip.innerText = text;
2714
2767
  tooltip.style.top = tooltip.id.indexOf('_Legend') !== -1 ?
2715
2768
  (parseInt(size1[0], 10) + y).toString() + 'px' : (parseInt(size1[0], 10) * 2).toString() + 'px';
2716
2769
  tooltip.style.left = (x).toString() + 'px';
@@ -2752,30 +2805,59 @@ export function wordWrap(tooltip, text, x, y, size1, width, areaWidth, element)
2752
2805
  * @param {string} text - Specifies the text
2753
2806
  * @param {string} top - Specifies the top
2754
2807
  * @param {string} left - Specifies the left
2755
- * @param {string} fontSize - Specifies the fontSize
2808
+ * @param {ZoomToolbarTooltipSettingsModel} settings - Specifies the tooltip settings.
2756
2809
  * @returns {void}
2757
2810
  * @private
2758
2811
  */
2759
- export function createTooltip(id, text, top, left, fontSize) {
2812
+ export function createTooltip(id, text, top, left, settings) {
2760
2813
  var tooltip = getElement(id);
2814
+ var borderColor = getHexColor(settings.borderColor);
2815
+ var fontColor = getHexColor(settings.fontColor);
2761
2816
  var style = 'top:' + top.toString() + 'px;' +
2762
2817
  'left:' + left.toString() + 'px;' +
2763
- 'color: #000000; ' +
2764
- 'background:' + '#FFFFFF' + ';' +
2818
+ 'color:' + (fontColor ? 'rgba(' + fontColor.r + ',' + fontColor.g + ',' + fontColor.b + ',' + settings.fontOpacity + ')'
2819
+ : settings.fontColor) + ';' +
2820
+ 'background:' + settings.fill + ';' +
2765
2821
  'z-index: 2;' +
2766
- 'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
2767
- if (!tooltip) {
2822
+ 'position:absolute;border:' + settings.borderWidth + 'px solid ' +
2823
+ (borderColor ? 'rgba(' + borderColor.r + ',' + borderColor.g + ',' + borderColor.b + ',' + settings.borderOpacity + ')'
2824
+ : settings.borderColor) + ';font-family:' + settings.fontFamily +
2825
+ ';font-style:' + settings.fontStyle + ';font-weight:' + settings.fontWeight +
2826
+ ';font-size:' + settings.fontSize + ';border-radius:' + settings.borderWidth + 'px;';
2827
+ if (!tooltip && settings.visible) {
2768
2828
  tooltip = createElement('div', {
2769
- id: id, innerHTML: '&nbsp;' + text + '&nbsp;'
2829
+ id: id
2770
2830
  });
2831
+ tooltip.innerHTML = SanitizeHtmlHelper.sanitize('&nbsp;' + text + '&nbsp;');
2771
2832
  tooltip.style.cssText = style;
2772
2833
  document.body.appendChild(tooltip);
2773
2834
  }
2774
- else {
2775
- tooltip.innerHTML = '&nbsp;' + text + '&nbsp;';
2835
+ else if (settings.visible) {
2836
+ tooltip.innerHTML = SanitizeHtmlHelper.sanitize('&nbsp;' + text + '&nbsp;');
2776
2837
  tooltip.style.cssText = style;
2777
2838
  }
2778
2839
  }
2840
+ /**
2841
+ * @private
2842
+ */
2843
+ export function getHexColor(color) {
2844
+ if (color.indexOf('#') !== -1 && color.toLowerCase().indexOf('rgb') === -1) {
2845
+ var colorArray = (/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i).exec(color);
2846
+ return colorArray ? { r: parseInt(colorArray[1], 16), g: parseInt(colorArray[2], 16), b: parseInt(colorArray[3], 16) } : null;
2847
+ }
2848
+ else if (color.toLowerCase().indexOf('rgb') !== -1) {
2849
+ var colorArray = color.match(/\d+/g).map(function (a) { return parseInt(a, 10); });
2850
+ return colorArray ? { r: colorArray[0], g: colorArray[1], b: colorArray[2] } : null;
2851
+ }
2852
+ else {
2853
+ var divElment = document.createElement('div');
2854
+ divElment.style.color = color;
2855
+ // eslint-disable-next-line @typescript-eslint/tslint/config
2856
+ var colorArray = window.getComputedStyle(document.body.appendChild(divElment)).color.match(/\d+/g).map(function (a) { return parseInt(a, 10); });
2857
+ document.body.removeChild(divElment);
2858
+ return colorArray ? { r: colorArray[0], g: colorArray[1], b: colorArray[2] } : null;
2859
+ }
2860
+ }
2779
2861
  /**
2780
2862
  * @param {Point} location - Specifies the location
2781
2863
  * @param {string} shape - Specifies the shape
@@ -3148,6 +3230,7 @@ export function zoomAnimate(element, delay, duration, point, scale, size, maps)
3148
3230
  * @param {Function} process - Specifies the process
3149
3231
  * @param {Function} end - Specifies the end
3150
3232
  * @returns {void}
3233
+ * @private
3151
3234
  */
3152
3235
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3153
3236
  export function animate(element, delay, duration, process, end) {
@@ -3177,7 +3260,7 @@ export function animate(element, delay, duration, process, end) {
3177
3260
  clearAnimation = window.requestAnimationFrame(startAnimation);
3178
3261
  }
3179
3262
  /**
3180
- * To get shape data file using Ajax.
3263
+ * Defines the options to get shape data file using Ajax request.
3181
3264
  */
3182
3265
  var MapAjax = /** @class */ (function () {
3183
3266
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -3229,6 +3312,7 @@ export function smoothTranslate(element, delay, duration, point) {
3229
3312
  * @param {number} scaleFactor - Specifies the scale factor
3230
3313
  * @param {Maps} maps - Specifies the instance of the maps
3231
3314
  * @returns {void}
3315
+ * @private
3232
3316
  */
3233
3317
  export function compareZoomFactor(scaleFactor, maps) {
3234
3318
  var previous = isNullOrUndefined(maps.shouldZoomPreviousFactor) ?
@@ -3259,8 +3343,9 @@ export function compareZoomFactor(scaleFactor, maps) {
3259
3343
  * @param {number} mapHeight - Specifies the height of the maps
3260
3344
  * @param {Maps} maps - Specifies the instance of the maps
3261
3345
  * @returns {number} - Returns the scale factor
3346
+ * @private
3262
3347
  */
3263
- export function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeight, maps) {
3348
+ export function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeight, maps, isZoomToCoordinates) {
3264
3349
  var scaleFactor;
3265
3350
  var maxZoomFact = maps.zoomSettings.maxZoom;
3266
3351
  var applyMethodeZoom;
@@ -3273,9 +3358,7 @@ export function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, m
3273
3358
  if (maps.zoomNotApplied && !maps.isTileMap) {
3274
3359
  var latiRatio = Math.abs((maps.baseMapBounds.latitude.max - maps.baseMapBounds.latitude.min) / (maxLat - minLat));
3275
3360
  var longiRatio = Math.abs((maps.baseMapBounds.longitude.max - maps.baseMapBounds.longitude.min) / (maxLong - minLong));
3276
- applyMethodeZoom = Math.min(latiRatio, longiRatio);
3277
- var minLocation = convertGeoToPoint(minLat, minLong, 1, maps.layersCollection[0], maps);
3278
- var maxLocation = convertGeoToPoint(maxLat, maxLong, 1, maps.layersCollection[0], maps);
3361
+ applyMethodeZoom = isZoomToCoordinates ? (latiRatio + longiRatio) / 2 : Math.min(latiRatio, longiRatio);
3279
3362
  }
3280
3363
  var latRatio = (maxLatValue - minLatValue) / Math.PI;
3281
3364
  var lngDiff = maxLong - minLong;
@@ -3284,7 +3367,8 @@ export function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, m
3284
3367
  var WORLD_PX_WIDTH = 256;
3285
3368
  var latZoom = (Math.log(mapHeight / WORLD_PX_HEIGHT / latRatio) / Math.LN2);
3286
3369
  var lngZoom = (Math.log(mapWidth / WORLD_PX_WIDTH / lngRatio) / Math.LN2);
3287
- var result = (maps.zoomNotApplied && !maps.isTileMap) ? applyMethodeZoom : Math.min(latZoom, lngZoom);
3370
+ var result = (maps.zoomNotApplied && !maps.isTileMap) ? applyMethodeZoom :
3371
+ isZoomToCoordinates && !maps.isTileMap ? (latZoom + lngZoom) / 2 : Math.min(latZoom, lngZoom);
3288
3372
  scaleFactor = Math.min(result, maxZoomFact);
3289
3373
  scaleFactor = maps.isTileMap || !maps.zoomNotApplied ? Math.floor(scaleFactor) : scaleFactor;
3290
3374
  if (!maps.isTileMap) {
@@ -3297,6 +3381,7 @@ export function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, m
3297
3381
  *
3298
3382
  * @param {any} e - Specifies the any type value
3299
3383
  * @returns {any} - Returns the data value
3384
+ * @private
3300
3385
  */
3301
3386
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3302
3387
  export function processResult(e) {