@syncfusion/ej2-maps 25.2.4 → 26.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 (58) hide show
  1. package/.eslintrc.json +3 -2
  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 +1328 -1138
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +1375 -1180
  8. package/dist/es6/ej2-maps.es5.js.map +1 -1
  9. package/dist/global/ej2-maps.min.js +2 -2
  10. package/dist/global/ej2-maps.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/maps/layers/bing-map.d.ts +2 -2
  14. package/src/maps/layers/bubble.d.ts +3 -4
  15. package/src/maps/layers/bubble.js +3 -4
  16. package/src/maps/layers/color-mapping.d.ts +2 -2
  17. package/src/maps/layers/color-mapping.js +2 -2
  18. package/src/maps/layers/data-label.d.ts +1 -1
  19. package/src/maps/layers/data-label.js +6 -6
  20. package/src/maps/layers/layer-panel.d.ts +7 -7
  21. package/src/maps/layers/layer-panel.js +129 -193
  22. package/src/maps/layers/legend.d.ts +9 -0
  23. package/src/maps/layers/legend.js +147 -55
  24. package/src/maps/layers/marker.d.ts +8 -8
  25. package/src/maps/layers/marker.js +109 -105
  26. package/src/maps/layers/navigation-selected-line.d.ts +1 -1
  27. package/src/maps/layers/navigation-selected-line.js +2 -2
  28. package/src/maps/layers/polygon.d.ts +1 -1
  29. package/src/maps/layers/polygon.js +10 -7
  30. package/src/maps/maps.d.ts +24 -26
  31. package/src/maps/maps.js +39 -46
  32. package/src/maps/model/base-model.d.ts +20 -93
  33. package/src/maps/model/base.d.ts +19 -83
  34. package/src/maps/model/base.js +13 -40
  35. package/src/maps/model/constants.d.ts +0 -4
  36. package/src/maps/model/constants.js +0 -4
  37. package/src/maps/model/export-image.js +5 -2
  38. package/src/maps/model/export-pdf.js +5 -2
  39. package/src/maps/model/interface.d.ts +14 -1
  40. package/src/maps/model/interface.js +0 -1
  41. package/src/maps/model/print.d.ts +3 -3
  42. package/src/maps/model/print.js +8 -5
  43. package/src/maps/model/theme.d.ts +1 -1
  44. package/src/maps/model/theme.js +190 -15
  45. package/src/maps/user-interaction/annotation.d.ts +1 -2
  46. package/src/maps/user-interaction/annotation.js +1 -2
  47. package/src/maps/user-interaction/highlight.d.ts +4 -4
  48. package/src/maps/user-interaction/highlight.js +4 -4
  49. package/src/maps/user-interaction/selection.d.ts +5 -5
  50. package/src/maps/user-interaction/selection.js +5 -5
  51. package/src/maps/user-interaction/tooltip.d.ts +6 -6
  52. package/src/maps/user-interaction/tooltip.js +30 -13
  53. package/src/maps/user-interaction/zoom.d.ts +6 -4
  54. package/src/maps/user-interaction/zoom.js +50 -50
  55. package/src/maps/utils/enum.d.ts +7 -53
  56. package/src/maps/utils/helper.d.ts +87 -72
  57. package/src/maps/utils/helper.js +130 -102
  58. package/CHANGELOG.md +0 -632
@@ -33,7 +33,7 @@ var Size = /** @class */ (function () {
33
33
  }());
34
34
  export { Size };
35
35
  /**
36
- * To find number from string
36
+ * To find number from string.
37
37
  *
38
38
  * @param {string} value Specifies the value
39
39
  * @param {number} containerSize Specifies the container size
@@ -47,7 +47,7 @@ export function stringToNumber(value, containerSize) {
47
47
  return null;
48
48
  }
49
49
  /**
50
- * Method to calculate the width and height of the maps
50
+ * Method to calculate the width and height of the maps.
51
51
  *
52
52
  * @param {Maps} maps Specifies the maps instance
53
53
  * @returns {void}
@@ -92,7 +92,7 @@ export function createSvg(maps) {
92
92
  }
93
93
  }
94
94
  /**
95
- * Method to get the mouse position
95
+ * Method to get the mouse position.
96
96
  *
97
97
  * @param {number} pageX - Specifies the pageX.
98
98
  * @param {number} pageY - Specifies the pageY.
@@ -111,7 +111,7 @@ export function getMousePosition(pageX, pageY, element) {
111
111
  return new MapLocation((pageX - positionX), (pageY - positionY));
112
112
  }
113
113
  /**
114
- * Method to convert degrees to radians
114
+ * Method to convert degrees to radians.
115
115
  *
116
116
  * @param {number} deg Specifies the degree value
117
117
  * @returns {number} Returns the number
@@ -121,7 +121,7 @@ export function degreesToRadians(deg) {
121
121
  return deg * (Math.PI / 180);
122
122
  }
123
123
  /**
124
- * Convert radians to degrees method
124
+ * Convert radians to degrees method.
125
125
  *
126
126
  * @param {number} radian Specifies the radian value
127
127
  * @returns {number} Returns the number
@@ -131,7 +131,7 @@ export function radiansToDegrees(radian) {
131
131
  return radian * (180 / Math.PI);
132
132
  }
133
133
  /**
134
- * Method for converting from latitude and longitude values to points
134
+ * Method for converting from latitude and longitude values to points.
135
135
  *
136
136
  * @param {number} latitude - Specifies the latitude.
137
137
  * @param {number} longitude - Specifies the longitude.
@@ -225,22 +225,24 @@ export function convertGeoToPoint(latitude, longitude, factor, layer, mapModel)
225
225
  */
226
226
  export function calculatePolygonPath(maps, factor, currentLayer, markerData) {
227
227
  var path = '';
228
- Array.prototype.forEach.call(markerData, function (data, dataIndex) {
229
- var lat = data.latitude;
230
- var lng = data.longitude;
231
- var location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
232
- if (dataIndex === 0) {
233
- path += 'M ' + location.x + ' ' + location.y;
234
- }
235
- else {
236
- path += ' L ' + location.x + ' ' + location.y;
237
- }
238
- });
239
- path += ' z ';
228
+ if (!isNullOrUndefined(markerData) && markerData.length > 1) {
229
+ Array.prototype.forEach.call(markerData, function (data, dataIndex) {
230
+ var lat = data.latitude;
231
+ var lng = data.longitude;
232
+ var location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
233
+ if (dataIndex === 0) {
234
+ path += 'M ' + location.x + ' ' + location.y;
235
+ }
236
+ else {
237
+ path += ' L ' + location.x + ' ' + location.y;
238
+ }
239
+ });
240
+ path += ' z ';
241
+ }
240
242
  return path;
241
243
  }
242
244
  /**
243
- * Converting tile latitude and longitude to point
245
+ * Converting tile latitude and longitude to point.
244
246
  *
245
247
  * @param {MapLocation} center Specifies the map center location
246
248
  * @param {number} zoomLevel Specifies the zoom level
@@ -263,7 +265,7 @@ export function convertTileLatLongToPoint(center, zoomLevel, tileTranslatePoint,
263
265
  return { x: pixelX, y: pixelY };
264
266
  }
265
267
  /**
266
- * Method for calculate x point
268
+ * Method for calculate x point.
267
269
  *
268
270
  * @param {Maps} mapObject - Specifies the maps.
269
271
  * @param {number} val - Specifies the value.
@@ -277,7 +279,7 @@ export function xToCoordinate(mapObject, val) {
277
279
  return Math.round(totalSize * (val - longitudeMinMax.min) / (longitudeMinMax.max - longitudeMinMax.min) * 100) / 100;
278
280
  }
279
281
  /**
280
- * Method for calculate y point
282
+ * Method for calculate y point.
281
283
  *
282
284
  * @param {Maps} mapObject - Specifies the maps.
283
285
  * @param {number} val - Specifies the value.
@@ -289,7 +291,7 @@ export function yToCoordinate(mapObject, val) {
289
291
  return Math.round(mapObject.mapAreaRect.height * (val - latitudeMinMax.min) / (latitudeMinMax.max - latitudeMinMax.min) * 100) / 100;
290
292
  }
291
293
  /**
292
- * Method for calculate aitoff projection
294
+ * Method for calculate aitoff projection.
293
295
  *
294
296
  * @param {number} x - Specifies the x value.
295
297
  * @param {number} y - Specifies the y value.
@@ -302,7 +304,7 @@ export function aitoff(x, y) {
302
304
  return new Point(2 * cosy * Math.sin(x) * sincia, Math.sin(y) * sincia);
303
305
  }
304
306
  /**
305
- * Method to round the number
307
+ * Method to round the number.
306
308
  *
307
309
  * @param {number} a - Specifies the a value
308
310
  * @param {number} b - Specifies the b value
@@ -332,7 +334,7 @@ export function acos(a) {
332
334
  return Math.acos(a);
333
335
  }
334
336
  /**
335
- * Method to calculate bound
337
+ * Method to calculate bound.
336
338
  *
337
339
  * @param {number} value Specifies the value
338
340
  * @param {number} min Specifies the minimum value
@@ -350,7 +352,7 @@ export function calculateBound(value, min, max) {
350
352
  return value;
351
353
  }
352
354
  /**
353
- * To trigger the download element
355
+ * To trigger the download element.
354
356
  *
355
357
  * @param {string} fileName Specifies the file name
356
358
  * @param {ExportType} type Specifies the type
@@ -441,7 +443,8 @@ export function measureText(text, font) {
441
443
  * @param {string} text - Specifies the text.
442
444
  * @param {FontModel} font - Specifies the font.
443
445
  * @returns {Size} - Returns the size of text.
444
- * @private */
446
+ * @private
447
+ */
445
448
  export function measureTextElement(text, font) {
446
449
  var canvas = document.createElement('canvas');
447
450
  // eslint-disable-next-line @typescript-eslint/tslint/config
@@ -453,7 +456,7 @@ export function measureTextElement(text, font) {
453
456
  return new Size(width, height);
454
457
  }
455
458
  /**
456
- * Internal use of text options
459
+ * Internal use of text options.
457
460
  *
458
461
  * @private
459
462
  */
@@ -474,7 +477,7 @@ var TextOption = /** @class */ (function () {
474
477
  }());
475
478
  export { TextOption };
476
479
  /**
477
- * Internal use of path options
480
+ * Internal use of path options.
478
481
  *
479
482
  * @private
480
483
  */
@@ -503,7 +506,7 @@ var ColorValue = /** @class */ (function () {
503
506
  }());
504
507
  export { ColorValue };
505
508
  /**
506
- * Internal use of rectangle options
509
+ * Internal use of rectangle options.
507
510
  *
508
511
  * @private
509
512
  */
@@ -527,7 +530,7 @@ var RectOption = /** @class */ (function (_super) {
527
530
  }(PathOption));
528
531
  export { RectOption };
529
532
  /**
530
- * Internal use of circle options
533
+ * Internal use of circle options.
531
534
  *
532
535
  * @private
533
536
  */
@@ -547,7 +550,7 @@ var CircleOption = /** @class */ (function (_super) {
547
550
  }(PathOption));
548
551
  export { CircleOption };
549
552
  /**
550
- * Internal use of polygon options
553
+ * Internal use of polygon options.
551
554
  *
552
555
  * @private
553
556
  */
@@ -565,7 +568,7 @@ var PolygonOption = /** @class */ (function (_super) {
565
568
  }(PathOption));
566
569
  export { PolygonOption };
567
570
  /**
568
- * Internal use of polyline options
571
+ * Internal use of polyline options.
569
572
  *
570
573
  * @private
571
574
  */
@@ -581,7 +584,7 @@ var PolylineOption = /** @class */ (function (_super) {
581
584
  }(PolygonOption));
582
585
  export { PolylineOption };
583
586
  /**
584
- * Internal use of line options
587
+ * Internal use of line options.
585
588
  *
586
589
  * @private
587
590
  */
@@ -602,7 +605,7 @@ var LineOption = /** @class */ (function (_super) {
602
605
  }(PathOption));
603
606
  export { LineOption };
604
607
  /**
605
- * Internal use of line
608
+ * Internal use of line.
606
609
  *
607
610
  * @property {number} Line - Specifies the line class
608
611
  * @private
@@ -618,7 +621,7 @@ var Line = /** @class */ (function () {
618
621
  }());
619
622
  export { Line };
620
623
  /**
621
- * Internal use of map location type
624
+ * Internal use of map location type.
622
625
  *
623
626
  * @private
624
627
  */
@@ -631,7 +634,7 @@ var MapLocation = /** @class */ (function () {
631
634
  }());
632
635
  export { MapLocation };
633
636
  /**
634
- * Internal use of type rect
637
+ * Internal use of type rect.
635
638
  *
636
639
  * @private
637
640
  */
@@ -671,7 +674,7 @@ var PatternOptions = /** @class */ (function () {
671
674
  }());
672
675
  export { PatternOptions };
673
676
  /**
674
- * Internal rendering of text
677
+ * Internal rendering of text.
675
678
  *
676
679
  * @param {TextOption} option Specifies the text option
677
680
  * @param {FontModel} style Specifies the style
@@ -851,7 +854,7 @@ export function convertElementFromLabel(element, labelId, data) {
851
854
  * @returns {Element} - Returns the element
852
855
  * @private
853
856
  */
854
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
857
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
855
858
  export function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCollection, maps) {
856
859
  var markerEle;
857
860
  var x;
@@ -1209,7 +1212,8 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
1209
1212
  * @param {number} index - Specifies the index.
1210
1213
  * @param {number} indexCollection - Specifies the index Collection.
1211
1214
  * @returns {void}
1212
- * @private */
1215
+ * @private
1216
+ */
1213
1217
  export function markerClusterListHandler(maps, currentZoomFactor, layerIndex, index, indexCollection) {
1214
1218
  if (currentZoomFactor === 1) {
1215
1219
  var initialMarkerClusterList = isNullOrUndefined(maps.markerModule.initialMarkerCluster[layerIndex][index]) ? [] : indexCollection.length > 1 ? indexCollection : [];
@@ -1228,7 +1232,8 @@ export function markerClusterListHandler(maps, currentZoomFactor, layerIndex, in
1228
1232
  * @param {number[]} indexCollection - Specifies the index collection.
1229
1233
  * @param {number} p - Specifies the p.
1230
1234
  * @returns {void}
1231
- * @private */
1235
+ * @private
1236
+ */
1232
1237
  export function markerBoundsComparer(tempElement, markerBounds, colloideBounds, indexCollection, p) {
1233
1238
  // eslint-disable-next-line @typescript-eslint/tslint/config
1234
1239
  var currentMarkerBound = tempElement.getBoundingClientRect();
@@ -1388,6 +1393,11 @@ export function marker(eventArgs, markerSettings, markerData, dataIndex, locatio
1388
1393
  var y = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y;
1389
1394
  ele.setAttribute('transform', 'translate( ' + x + ' ' + y + ' )');
1390
1395
  maintainSelection(maps.selectedMarkerElementId, maps.markerSelectionClass, ele, 'MarkerselectionMapStyle');
1396
+ if (maps.legendSettings.toggleLegendSettings.enable && maps.legendSettings.type === 'Markers') {
1397
+ var layerIndex = parseInt(ele.id.split('_LayerIndex_')[1], 10);
1398
+ maintainToggleSelection(maps.toggledElementId, ele.tagName === 'g' ? ele.children[0] : ele, maps.legendSettings.toggleLegendSettings.applyShapeSettings ?
1399
+ maps.layers[layerIndex].shapeSettings : maps.legendSettings.toggleLegendSettings);
1400
+ }
1391
1401
  markerCollection.appendChild(ele);
1392
1402
  var element = (markerData.length - 1) === dataIndex ? 'marker' : null;
1393
1403
  var markerPoint = new Point(x, y);
@@ -1412,7 +1422,7 @@ export function marker(eventArgs, markerSettings, markerData, dataIndex, locatio
1412
1422
  * @returns {HTMLElement} - Returns the html element
1413
1423
  * @private
1414
1424
  */
1415
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
1425
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1416
1426
  export function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplate, location, transPoint, scale, offset, maps) {
1417
1427
  templateFn = getTemplateFunction(eventArgs.template, maps);
1418
1428
  if (templateFn && (templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false).length)) {
@@ -1424,20 +1434,11 @@ export function markerTemplate(eventArgs, templateFn, markerID, data, markerInde
1424
1434
  markerElement.style.left = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x - maps.mapAreaRect.x + 'px';
1425
1435
  markerElement.style.top = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y - maps.mapAreaRect.y + 'px';
1426
1436
  markerTemplate.appendChild(markerElement);
1427
- if (maps.layers[maps.baseLayerIndex].layerType === 'GoogleStaticMap') {
1428
- var staticMapOffset = getElementByID(maps.element.id + '_StaticGoogleMap').getBoundingClientRect();
1429
- var markerElementOffset = markerElement.getBoundingClientRect();
1430
- var staticMapOffsetWidth = 640;
1431
- if ((staticMapOffset['x'] > markerElementOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < markerElementOffset['x'] + markerElementOffset['width'])
1432
- && (staticMapOffset['y'] > markerElementOffset['y'] || staticMapOffset['y'] + staticMapOffset['height'] < markerElementOffset['y'] + markerElementOffset['height'])) {
1433
- markerElement.style.display = 'none';
1434
- }
1435
- }
1436
1437
  }
1437
1438
  return markerTemplate;
1438
1439
  }
1439
1440
  /**
1440
- * To maintain selection during page resize
1441
+ * To maintain selection during page resize.
1441
1442
  *
1442
1443
  * @param {string[]} elementId - Specifies the element id
1443
1444
  * @param {Element} elementClass - Specifies the element class
@@ -1464,7 +1465,30 @@ export function maintainSelection(elementId, elementClass, element, className) {
1464
1465
  }
1465
1466
  }
1466
1467
  /**
1467
- * To maintain selection style class
1468
+ * To maintain toggle state during page resize.
1469
+ *
1470
+ * @param {string[]} toggledElements - Specifies the list of toggled elements
1471
+ * @param {Element} element - Specifies the element id
1472
+ * @param {any} styleProperty - Specifies the style properties
1473
+ * @returns {void}
1474
+ * @private
1475
+ */
1476
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1477
+ export function maintainToggleSelection(toggledElements, element, styleProperty) {
1478
+ if (!isNullOrUndefined(toggledElements) && toggledElements.length > 0) {
1479
+ for (var j = 0; j < toggledElements.length; j++) {
1480
+ if (toggledElements[j] === element.id) {
1481
+ element.setAttribute('fill', styleProperty.fill);
1482
+ element.setAttribute('stroke', styleProperty.border.color);
1483
+ element.setAttribute('fill-opacity', (styleProperty.opacity).toString());
1484
+ element.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
1485
+ element.setAttribute('stroke-width', (isNullOrUndefined(styleProperty.border.width) ? 0 : styleProperty.border.width).toString());
1486
+ }
1487
+ }
1488
+ }
1489
+ }
1490
+ /**
1491
+ * To maintain selection style class.
1468
1492
  *
1469
1493
  * @param {string} id - Specifies the id
1470
1494
  * @param {string} idClass - Specifies the class id
@@ -1490,7 +1514,7 @@ export function maintainStyleClass(id, idClass, fill, opacity, borderColor, bord
1490
1514
  }
1491
1515
  }
1492
1516
  /**
1493
- * Internal use of append shape element
1517
+ * Internal use of append shape element.
1494
1518
  *
1495
1519
  * @param {Element} shape - Specifies the shape
1496
1520
  * @param {Element} element - Specifies the element
@@ -1504,7 +1528,7 @@ export function appendShape(shape, element) {
1504
1528
  return shape;
1505
1529
  }
1506
1530
  /**
1507
- * Internal rendering of Circle
1531
+ * Internal rendering of Circle.
1508
1532
  *
1509
1533
  * @param {Maps} maps - Specifies the instance of the maps
1510
1534
  * @param {CircleOption} options - Specifies the circle options
@@ -1516,7 +1540,7 @@ export function drawCircle(maps, options, element) {
1516
1540
  return appendShape(maps.renderer.drawCircle(options), element);
1517
1541
  }
1518
1542
  /**
1519
- * Internal rendering of Rectangle
1543
+ * Internal rendering of Rectangle.
1520
1544
  *
1521
1545
  * @param {Maps} maps - Specifies the instance of the maps
1522
1546
  * @param {RectOption} options - Specifies the rect options
@@ -1528,7 +1552,7 @@ export function drawRectangle(maps, options, element) {
1528
1552
  return appendShape(maps.renderer.drawRectangle(options), element);
1529
1553
  }
1530
1554
  /**
1531
- * Internal rendering of Path
1555
+ * Internal rendering of Path.
1532
1556
  *
1533
1557
  * @param {Maps} maps - Specifies the instance of the maps
1534
1558
  * @param {PathOption} options - Specifies the polygon options
@@ -1540,7 +1564,7 @@ export function drawPath(maps, options, element) {
1540
1564
  return appendShape(maps.renderer.drawPath(options), element);
1541
1565
  }
1542
1566
  /**
1543
- * Internal rendering of Polygon
1567
+ * Internal rendering of Polygon.
1544
1568
  *
1545
1569
  * @param {Maps} maps - Specifies the instance of the maps
1546
1570
  * @param {PolygonOption} options - Specifies the polygon options
@@ -1552,7 +1576,7 @@ export function drawPolygon(maps, options, element) {
1552
1576
  return appendShape(maps.renderer.drawPolygon(options), element);
1553
1577
  }
1554
1578
  /**
1555
- * Internal rendering of Polyline
1579
+ * Internal rendering of Polyline.
1556
1580
  *
1557
1581
  * @param {Maps} maps - Specifies the instance of the maps
1558
1582
  * @param {PolylineOption} options - Specifies the poly line options
@@ -1564,7 +1588,7 @@ export function drawPolyline(maps, options, element) {
1564
1588
  return appendShape(maps.renderer.drawPolyline(options), element);
1565
1589
  }
1566
1590
  /**
1567
- * Internal rendering of Line
1591
+ * Internal rendering of Line.
1568
1592
  *
1569
1593
  * @param {Maps} maps - Specifies the instance of the maps
1570
1594
  * @param {LineOption} options - Specifies the line options
@@ -1576,7 +1600,7 @@ export function drawLine(maps, options, element) {
1576
1600
  return appendShape(maps.renderer.drawLine(options), element);
1577
1601
  }
1578
1602
  /**
1579
- * Calculate marker shapes
1603
+ * Calculate marker shapes.
1580
1604
  *
1581
1605
  * @param {Maps} maps - Specifies the instance of the maps
1582
1606
  * @param {MarkerType} shape - Specifies the marker type
@@ -1643,7 +1667,7 @@ export function calculateShapes(maps, shape, options, size, location, markerEle)
1643
1667
  return shape === 'Balloon' ? tempGroup : maps.renderer.drawPath(options);
1644
1668
  }
1645
1669
  /**
1646
- * Internal rendering of Diamond
1670
+ * Internal rendering of Diamond.
1647
1671
  *
1648
1672
  * @param {Maps} maps - Specifies the instance of the maps
1649
1673
  * @param {PathOption} options - Specifies the path options
@@ -1659,7 +1683,7 @@ export function drawDiamond(maps, options, size, location, element) {
1659
1683
  return appendShape(maps.renderer.drawPath(options), element);
1660
1684
  }
1661
1685
  /**
1662
- * Internal rendering of Triangle
1686
+ * Internal rendering of Triangle.
1663
1687
  *
1664
1688
  * @param {Maps} maps - Specifies the instance of the maps
1665
1689
  * @param {PathOption} options - Specifies the path options
@@ -1675,7 +1699,7 @@ export function drawTriangle(maps, options, size, location, element) {
1675
1699
  return appendShape(maps.renderer.drawPath(options), element);
1676
1700
  }
1677
1701
  /**
1678
- * Internal rendering of Cross
1702
+ * Internal rendering of Cross.
1679
1703
  *
1680
1704
  * @param {Maps} maps - Specifies the instance of the maps
1681
1705
  * @param {PathOption} options - Specifies the path options
@@ -1691,7 +1715,7 @@ export function drawCross(maps, options, size, location, element) {
1691
1715
  return appendShape(maps.renderer.drawPath(options), element);
1692
1716
  }
1693
1717
  /**
1694
- * Internal rendering of HorizontalLine
1718
+ * Internal rendering of HorizontalLine.
1695
1719
  *
1696
1720
  * @param {Maps} maps - Specifies the instance of the maps
1697
1721
  * @param {PathOption} options - Specifies the path options
@@ -1706,7 +1730,7 @@ export function drawHorizontalLine(maps, options, size, location, element) {
1706
1730
  return appendShape(maps.renderer.drawPath(options), element);
1707
1731
  }
1708
1732
  /**
1709
- * Internal rendering of VerticalLine
1733
+ * Internal rendering of VerticalLine.
1710
1734
  *
1711
1735
  * @param {Maps} maps - Specifies the instance of the maps
1712
1736
  * @param {PathOption} options - Specifies the path options
@@ -1721,7 +1745,7 @@ export function drawVerticalLine(maps, options, size, location, element) {
1721
1745
  return appendShape(maps.renderer.drawPath(options), element);
1722
1746
  }
1723
1747
  /**
1724
- * Internal rendering of Star
1748
+ * Internal rendering of Star.
1725
1749
  *
1726
1750
  * @param {Maps} maps - Specifies the instance of the maps
1727
1751
  * @param {PathOption} options - Specifies the path options
@@ -1739,7 +1763,7 @@ export function drawStar(maps, options, size, location, element) {
1739
1763
  return appendShape(maps.renderer.drawPath(options), element);
1740
1764
  }
1741
1765
  /**
1742
- * Internal rendering of Balloon
1766
+ * Internal rendering of Balloon.
1743
1767
  *
1744
1768
  * @param {Maps} maps - Specifies the instance of the maps
1745
1769
  * @param {PathOption} options - Specifies the path options
@@ -1773,7 +1797,7 @@ export function drawBalloon(maps, options, size, location, type, element) {
1773
1797
  return pathElement;
1774
1798
  }
1775
1799
  /**
1776
- * Internal rendering of Pattern
1800
+ * Internal rendering of Pattern.
1777
1801
  *
1778
1802
  * @param {Maps} maps - Specifies the instance of the maps
1779
1803
  * @param {PatternOptions} options - Specifies the pattern options
@@ -1820,7 +1844,7 @@ export function getFieldData(dataSource, fields) {
1820
1844
  return newData;
1821
1845
  }
1822
1846
  /**
1823
- * To find the index of dataSource from shape properties
1847
+ * To find the index of dataSource from shape properties.
1824
1848
  *
1825
1849
  * @param {any[]} dataSource - Specifies the data source
1826
1850
  * @param {any} properties - Specifies the properties
@@ -1830,11 +1854,11 @@ export function getFieldData(dataSource, fields) {
1830
1854
  * @returns {number} - Returns the number
1831
1855
  * @private
1832
1856
  */
1833
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
1857
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1834
1858
  export function checkShapeDataFields(dataSource, properties, dataPath, propertyPath,
1835
1859
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1836
1860
  layer) {
1837
- if (!(isNullOrUndefined(properties))) {
1861
+ if (!(isNullOrUndefined(properties)) && !isNullOrUndefined(dataSource)) {
1838
1862
  for (var i = 0; i < dataSource.length; i++) {
1839
1863
  var shapeDataPath = ((dataPath.indexOf('.') > -1) ? getValueFromObject(dataSource[i], dataPath) :
1840
1864
  dataSource[i][dataPath]);
@@ -1913,7 +1937,7 @@ export function getRatioOfBubble(min, max, value, minValue, maxValue) {
1913
1937
  return bubbleRadius;
1914
1938
  }
1915
1939
  /**
1916
- * To find the midpoint of the polygon from points
1940
+ * To find the midpoint of the polygon from points.
1917
1941
  *
1918
1942
  * @param {MapLocation[]} points - Specifies the points
1919
1943
  * @param {string} type - Specifies the type
@@ -2009,7 +2033,7 @@ export function findMidPointOfPolygon(points, type, geometryType) {
2009
2033
  };
2010
2034
  }
2011
2035
  /**
2012
- * Check custom path
2036
+ * Check custom path.
2013
2037
  *
2014
2038
  * @param {any[]} layerData - Specifies the layer data
2015
2039
  * @returns {boolean} - Returns the boolean vlue
@@ -2028,7 +2052,7 @@ export function isCustomPath(layerData) {
2028
2052
  return customPath;
2029
2053
  }
2030
2054
  /**
2031
- * Trim the title text
2055
+ * Trim the title text.
2032
2056
  *
2033
2057
  * @param {number} maxWidth - Specifies the maximum width
2034
2058
  * @param {string} text - Specifies the text
@@ -2076,7 +2100,7 @@ export function textTrim(maxWidth, text, font, width, isCanvasMeasure, widthList
2076
2100
  return label;
2077
2101
  }
2078
2102
  /**
2079
- * Method to calculate x position of title
2103
+ * Method to calculate x position of title.
2080
2104
  *
2081
2105
  * @param {Rect} location - Specifies the location
2082
2106
  * @param {Alignment} alignment - Specifies the alignment
@@ -2104,7 +2128,7 @@ export function findPosition(location, alignment, textSize, type) {
2104
2128
  return new Point(x, y);
2105
2129
  }
2106
2130
  /**
2107
- * To remove element by id
2131
+ * To remove element by id.
2108
2132
  *
2109
2133
  * @param {string} id - Specifies the id
2110
2134
  * @returns {void}
@@ -2115,7 +2139,7 @@ export function removeElement(id) {
2115
2139
  return element ? remove(element) : null;
2116
2140
  }
2117
2141
  /**
2118
- * To calculate map center position from pixel values
2142
+ * To calculate map center position from pixel values.
2119
2143
  *
2120
2144
  * @param {Maps} mapObject - Specifies the map object
2121
2145
  * @param {LayerSettings} layer - Specifies the layer settings
@@ -2450,7 +2474,7 @@ export function getZoomTranslate(mapObject, layer, animate) {
2450
2474
  return { scale: animate ? 1 : scaleFactor, location: new Point(x, y) };
2451
2475
  }
2452
2476
  /**
2453
- * To get the html element by specified id
2477
+ * To get the html element by specified id.
2454
2478
  *
2455
2479
  * @param {Maps} map - Specifies the instance of the maps
2456
2480
  * @returns {void}
@@ -2458,8 +2482,7 @@ export function getZoomTranslate(mapObject, layer, animate) {
2458
2482
  */
2459
2483
  export function fixInitialScaleForTile(map) {
2460
2484
  map.tileZoomScale = map.tileZoomLevel = Math.floor(map.availableSize.height / 512) + 1;
2461
- var padding = map.layers[map.baseLayerIndex].layerType !== 'GoogleStaticMap' ?
2462
- 20 : 0;
2485
+ var padding = 20;
2463
2486
  var totalSize = Math.pow(2, map.tileZoomLevel) * 256;
2464
2487
  map.tileTranslatePoint.x = (map.availableSize.width / 2) - (totalSize / 2);
2465
2488
  map.tileTranslatePoint.y = (map.availableSize.height / 2) - (totalSize / 2) + padding;
@@ -2467,7 +2490,7 @@ export function fixInitialScaleForTile(map) {
2467
2490
  map.previousTileHeight = map.availableSize.height;
2468
2491
  }
2469
2492
  /**
2470
- * To get the html element by specified id
2493
+ * To get the html element by specified id.
2471
2494
  *
2472
2495
  * @param {string} id - Specifies the id
2473
2496
  * @returns {Element} - Returns the element
@@ -2493,7 +2516,7 @@ export function getClientElement(id) {
2493
2516
  }
2494
2517
  }
2495
2518
  /**
2496
- * To apply internalization
2519
+ * To apply internalization.
2497
2520
  *
2498
2521
  * @param {Maps} maps - Specifies the instance of the maps
2499
2522
  * @param {number} value - Specifies the value
@@ -2545,7 +2568,7 @@ export function getElement(id) {
2545
2568
  return document.getElementById(id);
2546
2569
  }
2547
2570
  /**
2548
- * Function to get shape data using target id
2571
+ * Function to get shape data using target id.
2549
2572
  *
2550
2573
  * @param {string} targetId - Specifies the target id
2551
2574
  * @param {Maps} map - Specifies the instance of the maps
@@ -2568,7 +2591,7 @@ export function getShapeData(targetId, map) {
2568
2591
  return { shapeData: shapeData, data: data };
2569
2592
  }
2570
2593
  /**
2571
- * Function to trigger shapeSelected event
2594
+ * Function to trigger shapeSelected event.
2572
2595
  *
2573
2596
  * @param {string} targetId - Specifies the target id
2574
2597
  * @param {SelectionSettingsModel} selection - Specifies the selection
@@ -2612,7 +2635,7 @@ export function triggerShapeEvent(targetId, selection, maps, eventName) {
2612
2635
  return eventArgs;
2613
2636
  }
2614
2637
  /**
2615
- * Function to get elements using class name
2638
+ * Function to get elements using class name.
2616
2639
  *
2617
2640
  * @param {string} className - Specifies the class name
2618
2641
  * @returns {HTMLCollectionOf<Element>} - Returns the collection
@@ -2628,7 +2651,7 @@ export function getElementsByClassName(className) {
2628
2651
  // return element.querySelectorAll('.' + args);
2629
2652
  // }
2630
2653
  /**
2631
- * Function to get elements using querySelector
2654
+ * Function to get elements using querySelector.
2632
2655
  *
2633
2656
  * @param {string} args - Specifies the args
2634
2657
  * @param {string} elementSelector - Specifies the element selector
@@ -2643,7 +2666,7 @@ export function querySelector(args, elementSelector) {
2643
2666
  return targetEle;
2644
2667
  }
2645
2668
  /**
2646
- * Function to get the element for selection and highlight using public method
2669
+ * Function to get the element for selection and highlight using public method.
2647
2670
  *
2648
2671
  * @param {number} layerIndex - Specifies the layer index
2649
2672
  * @param {string} name - Specifies the layer name
@@ -2666,7 +2689,7 @@ export function getTargetElement(layerIndex, name, enable, map) {
2666
2689
  return targetEle;
2667
2690
  }
2668
2691
  /**
2669
- * Function to create style element for highlight and selection
2692
+ * Function to create style element for highlight and selection.
2670
2693
  *
2671
2694
  * @param {string} id - Specifies the id
2672
2695
  * @param {string} className - Specifies the class name
@@ -2687,7 +2710,7 @@ export function createStyle(id, className, eventArgs) {
2687
2710
  return styleEle;
2688
2711
  }
2689
2712
  /**
2690
- * Function to customize the style for highlight and selection
2713
+ * Function to customize the style for highlight and selection.
2691
2714
  *
2692
2715
  * @param {string} id - Specifies the id
2693
2716
  * @param {string} className - Specifies the class name
@@ -2707,7 +2730,7 @@ export function customizeStyle(id, className, eventArgs) {
2707
2730
  }
2708
2731
  }
2709
2732
  /**
2710
- * Function to trigger itemSelection event for legend selection and public method
2733
+ * Function to trigger itemSelection event for legend selection and public method.
2711
2734
  *
2712
2735
  * @param {SelectionSettingsModel} selectionSettings - Specifies the selection settings
2713
2736
  * @param {Maps} map - Specifies the instance of the maps
@@ -2748,7 +2771,7 @@ export function triggerItemSelectionEvent(selectionSettings, map, targetElement,
2748
2771
  });
2749
2772
  }
2750
2773
  /**
2751
- * Function to remove class from element
2774
+ * Function to remove class from element.
2752
2775
  *
2753
2776
  * @param {Element} element - Specifies the element
2754
2777
  * @returns {void}
@@ -2780,7 +2803,7 @@ export function elementAnimate(element, delay, duration, point, maps, ele, radiu
2780
2803
  duration: (duration === 0 && animationMode === 'Enable') ? 1000 : duration,
2781
2804
  delay: delay,
2782
2805
  progress: function (args) {
2783
- if (args.timeStamp > args.delay) {
2806
+ if ((args.timeStamp > args.delay) && !maps.zoomModule.isPanningInProgress) {
2784
2807
  if (maps.isTileMap && height === 0) {
2785
2808
  var layerGroupElement = document.querySelector('.GroupElement');
2786
2809
  if (!isNullOrUndefined(layerGroupElement)) {
@@ -2794,7 +2817,10 @@ export function elementAnimate(element, delay, duration, point, maps, ele, radiu
2794
2817
  },
2795
2818
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2796
2819
  end: function (model) {
2797
- element.setAttribute('transform', transform);
2820
+ if (!maps.zoomModule.isPanningInProgress) {
2821
+ element.setAttribute('transform', transform);
2822
+ }
2823
+ maps.zoomModule.isPanningInProgress = false;
2798
2824
  if (!ele) {
2799
2825
  return;
2800
2826
  }
@@ -3226,7 +3252,8 @@ export function changeNavaigationLineWidth(element, index, scale, maps) {
3226
3252
  /**
3227
3253
  * @param {PointerEvent | TouchEvent} event - Specifies the pointer or touch event
3228
3254
  * @returns {ITouches[]} - Returns the target
3229
- * @private */
3255
+ * @private
3256
+ */
3230
3257
  export function targetTouches(event) {
3231
3258
  var targetTouches = [];
3232
3259
  var touches = event.touches;
@@ -3250,7 +3277,8 @@ export function calculateScale(startTouches, endTouches) {
3250
3277
  * @param {ITouches} a - Specifies the a value
3251
3278
  * @param {ITouches} b - Specifies the b value
3252
3279
  * @returns {number} - Returns the number
3253
- * @private */
3280
+ * @private
3281
+ */
3254
3282
  export function getDistance(a, b) {
3255
3283
  var x = a.pageX - b.pageX;
3256
3284
  var y = a.pageY - b.pageY;
@@ -3298,7 +3326,7 @@ export function sum(a, b) {
3298
3326
  return a + b;
3299
3327
  }
3300
3328
  /**
3301
- * Animation Effect Calculation End
3329
+ * Animation Effect Calculation End.
3302
3330
  *
3303
3331
  * @param {Element} element - Specifies the element.
3304
3332
  * @param {number} delay - Specifies the delay.
@@ -3364,7 +3392,7 @@ export function zoomAnimate(element, delay, duration, point, scale, size, maps)
3364
3392
  });
3365
3393
  }
3366
3394
  /**
3367
- * To process custom animation
3395
+ * To process custom animation.
3368
3396
  *
3369
3397
  * @param {Element} element - Specifies the element
3370
3398
  * @param {number} delay - Specifies the delay
@@ -3417,7 +3445,7 @@ var MapAjax = /** @class */ (function () {
3417
3445
  }());
3418
3446
  export { MapAjax };
3419
3447
  /**
3420
- * Animation Translate
3448
+ * Animation Translate.
3421
3449
  *
3422
3450
  * @param {Element} element - Specifies the element
3423
3451
  * @param {number} delay - Specifies the delay
@@ -3449,7 +3477,7 @@ export function smoothTranslate(element, delay, duration, point) {
3449
3477
  });
3450
3478
  }
3451
3479
  /**
3452
- * To find compare should zoom factor with previous factor and current factor
3480
+ * To find compare should zoom factor with previous factor and current factor.
3453
3481
  *
3454
3482
  * @param {number} scaleFactor - Specifies the scale factor
3455
3483
  * @param {Maps} maps - Specifies the instance of the maps
@@ -3475,7 +3503,7 @@ export function compareZoomFactor(scaleFactor, maps) {
3475
3503
  }
3476
3504
  }
3477
3505
  /**
3478
- * To find zoom level for the min and max latitude values
3506
+ * To find zoom level for the min and max latitude values.
3479
3507
  *
3480
3508
  * @param {number} minLat - Specifies the minimum latitude
3481
3509
  * @param {number} maxLat - Specifies the maximum latitude
@@ -3520,13 +3548,13 @@ export function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, m
3520
3548
  return scaleFactor;
3521
3549
  }
3522
3550
  /**
3523
- * Method to get the result
3551
+ * Method to get the result.
3524
3552
  *
3525
3553
  * @param {any} e - Specifies the any type value
3526
3554
  * @returns {any} - Returns the data value
3527
3555
  * @private
3528
3556
  */
3529
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
3557
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3530
3558
  export function processResult(e) {
3531
3559
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3532
3560
  var dataValue;