@syncfusion/ej2-maps 19.3.46 → 19.4.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.
Files changed (37) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -0
  3. package/CHANGELOG.md +34 -1
  4. package/README.md +1 -1
  5. package/dist/ej2-maps.umd.min.js +2 -2
  6. package/dist/ej2-maps.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-maps.es2015.js +478 -257
  8. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  9. package/dist/es6/ej2-maps.es5.js +474 -253
  10. package/dist/es6/ej2-maps.es5.js.map +1 -1
  11. package/dist/global/ej2-maps.min.js +2 -2
  12. package/dist/global/ej2-maps.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +12 -12
  15. package/src/maps/layers/bubble.d.ts +6 -0
  16. package/src/maps/layers/bubble.js +7 -1
  17. package/src/maps/layers/data-label.js +1 -0
  18. package/src/maps/layers/layer-panel.d.ts +2 -1
  19. package/src/maps/layers/layer-panel.js +86 -50
  20. package/src/maps/layers/legend.js +47 -18
  21. package/src/maps/layers/marker.js +2 -8
  22. package/src/maps/maps-model.d.ts +1 -1
  23. package/src/maps/maps.d.ts +5 -0
  24. package/src/maps/maps.js +42 -16
  25. package/src/maps/model/base-model.d.ts +7 -0
  26. package/src/maps/model/base.d.ts +6 -0
  27. package/src/maps/model/base.js +5 -2
  28. package/src/maps/model/interface.d.ts +1 -3
  29. package/src/maps/model/theme.js +62 -5
  30. package/src/maps/user-interaction/highlight.js +4 -4
  31. package/src/maps/user-interaction/selection.js +10 -9
  32. package/src/maps/user-interaction/tooltip.js +9 -3
  33. package/src/maps/user-interaction/zoom.d.ts +1 -0
  34. package/src/maps/user-interaction/zoom.js +76 -44
  35. package/src/maps/utils/enum.d.ts +3 -1
  36. package/src/maps/utils/helper.d.ts +4 -2
  37. package/src/maps/utils/helper.js +130 -98
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 19.3.46
3
+ * version : 19.4.47
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-maps@*",
3
- "_id": "@syncfusion/ej2-maps@19.3.44",
3
+ "_id": "@syncfusion/ej2-maps@19.4.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-LbgxW0wAlbWrML2ObYm3nXttmMjkI4Of/fgzKrZDEogTb5eS6jzVMs4lWAiskLxD8BuZIQ62Qvx+8RBsPWdHsQ==",
5
+ "_integrity": "sha512-6IogYAgkvC+yY7H06Uxil3SdTZuWzu2boQhnZA/djQSae2/fAdgMqnJqOMUYLodljc+O6wddpuilkmx2zAkLWg==",
6
6
  "_location": "/@syncfusion/ej2-maps",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-maps",
24
24
  "/@syncfusion/ej2-vue-maps"
25
25
  ],
26
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-maps/-/ej2-maps-19.3.44.tgz",
27
- "_shasum": "b5e2577f13b3d71488189447fc8cad2fea6d8993",
26
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-19.4.42.tgz",
27
+ "_shasum": "9aaa735f0d4d3574c0da6101157be9c1a6208652",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
29
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
30
30
  "author": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~19.3.43",
39
- "@syncfusion/ej2-buttons": "~19.3.44",
40
- "@syncfusion/ej2-compression": "~19.3.43",
41
- "@syncfusion/ej2-data": "~19.3.46",
42
- "@syncfusion/ej2-file-utils": "~19.3.43",
43
- "@syncfusion/ej2-pdf-export": "~19.3.43",
44
- "@syncfusion/ej2-svg-base": "~19.3.45"
38
+ "@syncfusion/ej2-base": "~19.4.42",
39
+ "@syncfusion/ej2-buttons": "~19.4.42",
40
+ "@syncfusion/ej2-compression": "~19.4.38",
41
+ "@syncfusion/ej2-data": "~19.4.47",
42
+ "@syncfusion/ej2-file-utils": "~19.4.38",
43
+ "@syncfusion/ej2-pdf-export": "~19.4.43",
44
+ "@syncfusion/ej2-svg-base": "~19.4.42"
45
45
  },
46
46
  "deprecated": false,
47
47
  "description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
@@ -80,6 +80,6 @@
80
80
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
81
81
  },
82
82
  "typings": "index.d.ts",
83
- "version": "19.3.46",
83
+ "version": "19.4.47",
84
84
  "sideEffects": false
85
85
  }
@@ -14,6 +14,8 @@ export declare class Bubble {
14
14
  constructor(maps: Maps);
15
15
  /**
16
16
  * To render bubble
17
+ *
18
+ * @private
17
19
  */
18
20
  renderBubble(bubbleSettings: BubbleSettingsModel, shapeData: any, color: string, range: {
19
21
  min: number;
@@ -22,6 +24,8 @@ export declare class Bubble {
22
24
  private getPoints;
23
25
  /**
24
26
  * To check and trigger bubble click event
27
+ *
28
+ * @private
25
29
  */
26
30
  bubbleClick(e: PointerEvent): void;
27
31
  /**
@@ -33,6 +37,8 @@ export declare class Bubble {
33
37
  private getbubble;
34
38
  /**
35
39
  * To check and trigger bubble move event
40
+ *
41
+ * @private
36
42
  */
37
43
  bubbleMove(e: PointerEvent): void;
38
44
  /**
@@ -18,6 +18,8 @@ var Bubble = /** @class */ (function () {
18
18
  // eslint-disable-next-line valid-jsdoc
19
19
  /**
20
20
  * To render bubble
21
+ *
22
+ * @private
21
23
  */
22
24
  Bubble.prototype.renderBubble = function (
23
25
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -63,7 +65,7 @@ var Bubble = /** @class */ (function () {
63
65
  isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
64
66
  var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
65
67
  ? shape[shapePath].toLowerCase() : shape[shapePath];
66
- if (shapeDataLayerPathValue === shapePathValue) {
68
+ if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
67
69
  if (layerData[i]['type'] === 'Point') {
68
70
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
71
  shapePoints.push(this.getPoints(layerData[i], []));
@@ -194,6 +196,8 @@ var Bubble = /** @class */ (function () {
194
196
  // eslint-disable-next-line valid-jsdoc
195
197
  /**
196
198
  * To check and trigger bubble click event
199
+ *
200
+ * @private
197
201
  */
198
202
  Bubble.prototype.bubbleClick = function (e) {
199
203
  var target = e.target.id;
@@ -237,6 +241,8 @@ var Bubble = /** @class */ (function () {
237
241
  // eslint-disable-next-line valid-jsdoc
238
242
  /**
239
243
  * To check and trigger bubble move event
244
+ *
245
+ * @private
240
246
  */
241
247
  Bubble.prototype.bubbleMove = function (e) {
242
248
  var target = e.target.id;
@@ -267,6 +267,7 @@ var DataLabel = /** @class */ (function () {
267
267
  }
268
268
  else {
269
269
  if (dataLabelSettings.smartLabelMode === 'Trim') {
270
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
270
271
  var textType = typeof text === 'number' ? text.toString() : text;
271
272
  trimmedLable = textTrim(width, textType, style);
272
273
  elementSize = measureText(trimmedLable, style);
@@ -96,11 +96,12 @@ export declare class LayerPanel {
96
96
  */
97
97
  private getShapeColorMapping;
98
98
  generatePoints(type: string, coordinates: any[], data: any, properties: any): void;
99
+ calculateBox(point: Point, extraSpace: number): void;
99
100
  calculateFactor(layer: LayerSettings): number;
100
101
  translateLayerElements(layerElement: Element, index: number): void;
101
102
  calculateRectBounds(layerData: any[]): void;
102
103
  calculatePolygonBox(coordinates: any[], data: any, properties: any): any;
103
- calculateRectBox(coordinates: any[]): void;
104
+ calculateRectBox(coordinates: any[], type?: string, isFirstItem?: boolean): void;
104
105
  generateTiles(zoomLevel: number, tileTranslatePoint: Point, zoomType?: string, bing?: BingMap, position?: Point): void;
105
106
  arrangeTiles(type: string, x: number, y: number): void;
106
107
  /**
@@ -4,7 +4,7 @@
4
4
  /* eslint-disable @typescript-eslint/no-unused-vars */
5
5
  import { isNullOrUndefined, extend, createElement, Ajax } from '@syncfusion/ej2-base';
6
6
  import { getShapeColor } from '../model/theme';
7
- import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size, PolylineOption, removeElement } from '../utils/helper';
7
+ import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size, removeElement } from '../utils/helper';
8
8
  import { getElementByID, maintainSelection, getValueFromObject } from '../utils/helper';
9
9
  import { RectOption, getTranslate, convertTileLatLongToPoint, checkShapeDataFields, CircleOption } from '../utils/helper';
10
10
  import { getZoomTranslate, fixInitialScaleForTile } from '../utils/helper';
@@ -178,7 +178,7 @@ var LayerPanel = /** @class */ (function () {
178
178
  if (this.mapObject.zoomSettings.resetToInitial && this.mapObject.initialCheck && !isNullOrUndefined(panel.mapObject.height)
179
179
  && this.mapObject.availableSize.height > 512) {
180
180
  this.mapObject.applyZoomReset = true;
181
- this.mapObject.initialZoomLevel = Math.floor(this.mapObject.availableSize.height / 512) + 1;
181
+ this.mapObject.initialZoomLevel = Math.floor(this.mapObject.availableSize.height / 512);
182
182
  var padding = this.mapObject.layers[this.mapObject.baseLayerIndex].layerType !== 'GoogleStaticMap' ?
183
183
  20 : 0;
184
184
  var totalSize = Math.pow(2, this.mapObject.initialZoomLevel) * 256;
@@ -260,6 +260,9 @@ var LayerPanel = /** @class */ (function () {
260
260
  proxy_1.mapObject['bingMap'] = bing_1;
261
261
  proxy_1.renderTileLayer(proxy_1, layer, layerIndex, bing_1);
262
262
  _this.mapObject.arrangeTemplate();
263
+ if (_this.mapObject.zoomModule && (_this.mapObject.previousScale !== _this.mapObject.scale)) {
264
+ _this.mapObject.zoomModule.applyTransform(true);
265
+ }
263
266
  };
264
267
  ajax.send();
265
268
  }
@@ -338,9 +341,7 @@ var LayerPanel = /** @class */ (function () {
338
341
  var data = geometryData['geometry'];
339
342
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
340
343
  var properties = geometryData['properties'];
341
- if (type !== 'LineString') {
342
- _this.generatePoints(type, coords, data, properties);
343
- }
344
+ _this.generatePoints(type, coords, data, properties);
344
345
  }
345
346
  });
346
347
  this.currentLayer.rectBounds = this.rectBounds;
@@ -368,7 +369,7 @@ var LayerPanel = /** @class */ (function () {
368
369
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
369
370
  var currentShapeData = this_1.currentLayer.layerData[i];
370
371
  var pathOptions;
371
- var polyLineOptions;
372
+ var polyLineOptions = void 0;
372
373
  var circleOptions;
373
374
  var groupElement;
374
375
  var drawObject = void 0;
@@ -437,7 +438,7 @@ var LayerPanel = /** @class */ (function () {
437
438
  if (isNullOrUndefined(shapeSettings.borderColorValuePath)) {
438
439
  _this.mapObject.layers[layerIndex].shapeSettings.border.color = eventArgs.border.color;
439
440
  }
440
- else if (isNullOrUndefined(shapeSettings.borderWidthValuePath)) {
441
+ if (isNullOrUndefined(shapeSettings.borderWidthValuePath)) {
441
442
  _this.mapObject.layers[layerIndex].shapeSettings.border.width = eventArgs.border.width;
442
443
  }
443
444
  }
@@ -491,17 +492,21 @@ var LayerPanel = /** @class */ (function () {
491
492
  }
492
493
  break;
493
494
  case 'LineString':
495
+ path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
494
496
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
495
497
  currentShapeData.map(function (lineData) {
496
- points += lineData['point']['x'] + ' , ' + lineData['point']['y'] + ' ';
498
+ path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
497
499
  });
498
- polyLineOptions = new PolylineOption(shapeID, points, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray);
499
- pathEle = _this.mapObject.renderer.drawPolyline(polyLineOptions);
500
+ if (path.length > 3) {
501
+ pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
502
+ pathEle = _this.mapObject.renderer.drawPath(pathOptions);
503
+ }
500
504
  break;
501
505
  case 'Point':
502
506
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
503
507
  var pointData = currentShapeData['point'];
504
- circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], shapeSettings.circleRadius, null);
508
+ var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / _this.currentFactor;
509
+ circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, null);
505
510
  pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
506
511
  break;
507
512
  case 'Path':
@@ -523,6 +528,9 @@ var LayerPanel = /** @class */ (function () {
523
528
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
524
529
  (currentShapeData['property'][properties]) : ''));
525
530
  pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 2).toString());
531
+ if (drawingType === 'LineString') {
532
+ pathEle.setAttribute('style', 'outline:none');
533
+ }
526
534
  maintainSelection(_this.mapObject.selectedElementId, _this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
527
535
  if (_this.mapObject.toggledShapeElementId) {
528
536
  for (var j = 0; j < _this.mapObject.toggledShapeElementId.length; j++) {
@@ -741,11 +749,14 @@ var LayerPanel = /** @class */ (function () {
741
749
  this.currentLayer.layerData.push(multiPolygonDatas);
742
750
  break;
743
751
  case 'linestring':
752
+ var extraSpace_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
753
+ this.currentLayer.shapeSettings.border.width : 1;
744
754
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
745
755
  coordinates.map(function (points, index) {
746
756
  latitude = points[1];
747
757
  longitude = points[0];
748
758
  var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
759
+ _this.calculateBox(point, extraSpace_1);
749
760
  newData.push({
750
761
  point: point, lat: latitude, lng: longitude
751
762
  });
@@ -756,6 +767,8 @@ var LayerPanel = /** @class */ (function () {
756
767
  break;
757
768
  case 'point': {
758
769
  var arrayCollections_1 = false;
770
+ var extraSpace_2 = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
771
+ this.currentLayer.shapeSettings.border.width : 1) + (this.currentLayer.shapeSettings.circleRadius * 2);
759
772
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
760
773
  coordinates.map(function (points, index) {
761
774
  if (Object.prototype.toString.call(points) === '[object Array]') {
@@ -772,6 +785,7 @@ var LayerPanel = /** @class */ (function () {
772
785
  latitude = coordinates[1];
773
786
  longitude = coordinates[0];
774
787
  var point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
788
+ this.calculateBox(point, extraSpace_2);
775
789
  this.currentLayer.layerData.push({
776
790
  point: point, type: type, lat: latitude, lng: longitude, property: properties
777
791
  });
@@ -785,6 +799,17 @@ var LayerPanel = /** @class */ (function () {
785
799
  break;
786
800
  }
787
801
  };
802
+ LayerPanel.prototype.calculateBox = function (point, extraSpace) {
803
+ if (isNullOrUndefined(this.rectBounds)) {
804
+ this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
805
+ }
806
+ else {
807
+ this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
808
+ this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
809
+ this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
810
+ this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
811
+ }
812
+ };
788
813
  LayerPanel.prototype.calculateFactor = function (layer) {
789
814
  var horFactor;
790
815
  var verFactor = 1;
@@ -893,6 +918,15 @@ var LayerPanel = /** @class */ (function () {
893
918
  _this.calculateRectBox(point[0]);
894
919
  });
895
920
  break;
921
+ case 'linestring':
922
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
923
+ coordinates.map(function (point, index) {
924
+ _this.calculateRectBox(point, 'LineString', index === 0 ? true : false);
925
+ });
926
+ break;
927
+ case 'point':
928
+ _this.calculateRectBox(coordinates, 'point');
929
+ break;
896
930
  }
897
931
  }
898
932
  });
@@ -929,20 +963,33 @@ var LayerPanel = /** @class */ (function () {
929
963
  return newData;
930
964
  };
931
965
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
932
- LayerPanel.prototype.calculateRectBox = function (coordinates) {
966
+ LayerPanel.prototype.calculateRectBox = function (coordinates, type, isFirstItem) {
933
967
  var _this = this;
934
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
935
- Array.prototype.forEach.call(coordinates, function (currentCoords) {
936
- if (isNullOrUndefined(_this.mapObject.baseMapBounds)) {
937
- _this.mapObject.baseMapBounds = new GeoLocation({ min: currentCoords[1], max: currentCoords[1] }, { min: currentCoords[0], max: currentCoords[0] });
968
+ if (type !== 'LineString' && type !== 'point') {
969
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
970
+ Array.prototype.forEach.call(coordinates, function (currentCoords) {
971
+ if (isNullOrUndefined(_this.mapObject.baseMapBounds)) {
972
+ _this.mapObject.baseMapBounds = new GeoLocation({ min: currentCoords[1], max: currentCoords[1] }, { min: currentCoords[0], max: currentCoords[0] });
973
+ }
974
+ else {
975
+ _this.mapObject.baseMapBounds.latitude.min = Math.min(_this.mapObject.baseMapBounds.latitude.min, currentCoords[1]);
976
+ _this.mapObject.baseMapBounds.latitude.max = Math.max(_this.mapObject.baseMapBounds.latitude.max, currentCoords[1]);
977
+ _this.mapObject.baseMapBounds.longitude.min = Math.min(_this.mapObject.baseMapBounds.longitude.min, currentCoords[0]);
978
+ _this.mapObject.baseMapBounds.longitude.max = Math.max(_this.mapObject.baseMapBounds.longitude.max, currentCoords[0]);
979
+ }
980
+ });
981
+ }
982
+ else {
983
+ if ((isFirstItem || type === 'point') && isNullOrUndefined(this.mapObject.baseMapBounds)) {
984
+ this.mapObject.baseMapBounds = new GeoLocation({ min: coordinates[1], max: coordinates[1] }, { min: coordinates[0], max: coordinates[0] });
938
985
  }
939
986
  else {
940
- _this.mapObject.baseMapBounds.latitude.min = Math.min(_this.mapObject.baseMapBounds.latitude.min, currentCoords[1]);
941
- _this.mapObject.baseMapBounds.latitude.max = Math.max(_this.mapObject.baseMapBounds.latitude.max, currentCoords[1]);
942
- _this.mapObject.baseMapBounds.longitude.min = Math.min(_this.mapObject.baseMapBounds.longitude.min, currentCoords[0]);
943
- _this.mapObject.baseMapBounds.longitude.max = Math.max(_this.mapObject.baseMapBounds.longitude.max, currentCoords[0]);
987
+ this.mapObject.baseMapBounds.latitude.min = Math.min(this.mapObject.baseMapBounds.latitude.min, coordinates[1]);
988
+ this.mapObject.baseMapBounds.latitude.max = Math.max(this.mapObject.baseMapBounds.latitude.max, coordinates[1]);
989
+ this.mapObject.baseMapBounds.longitude.min = Math.min(this.mapObject.baseMapBounds.longitude.min, coordinates[0]);
990
+ this.mapObject.baseMapBounds.longitude.max = Math.max(this.mapObject.baseMapBounds.longitude.max, coordinates[0]);
944
991
  }
945
- });
992
+ }
946
993
  };
947
994
  LayerPanel.prototype.generateTiles = function (zoomLevel, tileTranslatePoint, zoomType, bing, position) {
948
995
  var userLang = this.mapObject.locale;
@@ -1031,16 +1078,18 @@ var LayerPanel = /** @class */ (function () {
1031
1078
  }
1032
1079
  }
1033
1080
  }
1034
- this.arrangeTiles(zoomType, this.animateToZoomX, this.animateToZoomY);
1081
+ if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset) {
1082
+ this.arrangeTiles(zoomType, this.animateToZoomX, this.animateToZoomY);
1083
+ }
1035
1084
  };
1036
1085
  LayerPanel.prototype.arrangeTiles = function (type, x, y) {
1037
1086
  var _this = this;
1038
1087
  var element = document.getElementById(this.mapObject.element.id + '_tile_parent');
1039
1088
  var element1 = document.getElementById(this.mapObject.element.id + '_tiles');
1040
1089
  var timeOut;
1041
- if (!isNullOrUndefined(type) && type !== 'Pan' && type !== 'Reset' && type.indexOf('ZoomOut') === -1) {
1090
+ if (!isNullOrUndefined(type) && type !== 'Pan') {
1042
1091
  this.tileAnimation(type, x, y);
1043
- timeOut = 250;
1092
+ timeOut = this.mapObject.layersCollection[0].animationDuration;
1044
1093
  }
1045
1094
  else {
1046
1095
  timeOut = 0;
@@ -1055,7 +1104,6 @@ var LayerPanel = /** @class */ (function () {
1055
1104
  }
1056
1105
  if (element1) {
1057
1106
  element1.style.zIndex = '0';
1058
- element1.style.visibility = 'hidden';
1059
1107
  }
1060
1108
  var animateElement;
1061
1109
  if (!document.getElementById(_this.mapObject.element.id + '_animated_tiles') && element) {
@@ -1117,35 +1165,23 @@ var LayerPanel = /** @class */ (function () {
1117
1165
  * @returns {void}
1118
1166
  */
1119
1167
  LayerPanel.prototype.tileAnimation = function (zoomType, translateX, translateY) {
1120
- var element = document.getElementById(this.mapObject.element.id + '_tile_parent');
1121
- var element1 = document.getElementById('animated_tiles');
1122
- var ele = document.getElementById(this.mapObject.element.id + '_tiles');
1168
+ var tileParent = document.getElementById(this.mapObject.element.id + '_tile_parent');
1169
+ var animatedTiles = document.getElementById(this.mapObject.element.id + '_animated_tiles');
1170
+ var tileElement = document.getElementById(this.mapObject.element.id + '_tiles');
1123
1171
  var scaleValue = '2';
1124
- if (zoomType.indexOf('ZoomOut') === 0) {
1125
- ele.style.zIndex = '1';
1126
- element.style.zIndex = '0';
1127
- // element1 = ele.children[ele.childElementCount - 1] as HTMLElement;
1128
- while (ele.childElementCount >= 1) {
1129
- ele.removeChild(ele.children[0]);
1130
- }
1131
- translateX = 0;
1132
- translateY = 128 - 23;
1133
- scaleValue = '0.5';
1134
- }
1135
- else if (zoomType === 'Reset') {
1136
- ele.style.zIndex = '1';
1137
- element.style.zIndex = '0';
1138
- while (!(ele.childElementCount === 1) && !(ele.childElementCount === 0)) {
1139
- ele.removeChild(ele.children[1]);
1172
+ if (zoomType.indexOf('ZoomOut') === 0 || zoomType === 'Reset') {
1173
+ tileElement.style.zIndex = '1';
1174
+ tileParent.style.zIndex = '0';
1175
+ while (tileElement.childElementCount >= 1) {
1176
+ tileElement.removeChild(tileElement.children[0]);
1140
1177
  }
1141
- element1 = ele.children[0];
1142
1178
  translateX = 0;
1143
- translateY = 0;
1144
- scaleValue = '1';
1179
+ translateY = document.getElementById(this.mapObject.element.id + '_tile_parent').getClientRects()[0].height / 4;
1180
+ scaleValue = zoomType.indexOf('ZoomOut') === 0 ? '0.5' : '0.2';
1145
1181
  }
1146
- if (!isNullOrUndefined(element1)) {
1147
- element1.style.transition = '250ms';
1148
- element1.style.transform = 'translate(' + translateX + 'px, ' + translateY + 'px) scale(' + scaleValue + ')';
1182
+ if (!isNullOrUndefined(animatedTiles)) {
1183
+ animatedTiles.style.transition = this.mapObject.layersCollection[0].animationDuration + 'ms';
1184
+ animatedTiles.style.transform = 'translate(' + translateX + 'px, ' + translateY + 'px) scale(' + scaleValue + ')';
1149
1185
  }
1150
1186
  };
1151
1187
  /**
@@ -1,5 +1,5 @@
1
1
  import { click, legendRendering } from '../index';
2
- import { Rect, measureText, PathOption, textTrim, removeClass, querySelector, getTemplateFunction, maintainStyleClass, getValueFromObject } from '../utils/helper';
2
+ import { Rect, measureText, PathOption, textTrim, drawBalloon, removeClass, querySelector, getTemplateFunction, maintainStyleClass, getValueFromObject } from '../utils/helper';
3
3
  import { RectOption, Size, TextOption, Point, renderTextElement, drawSymbol, checkPropertyPath, getElement } from '../utils/helper';
4
4
  import { isNullOrUndefined, Browser, EventHandler, remove, extend } from '@syncfusion/ej2-base';
5
5
  /**
@@ -422,6 +422,7 @@ var Legend = /** @class */ (function () {
422
422
  var textOptions;
423
423
  var renderOptions;
424
424
  var render = map.renderer;
425
+ var legendShape = legend.shape;
425
426
  if (page >= 0 && page < this.totalPages.length) {
426
427
  if (querySelector(this.legendGroup.id, this.maps.element.id)) {
427
428
  remove(querySelector(this.legendGroup.id, this.maps.element.id));
@@ -446,21 +447,35 @@ var Legend = /** @class */ (function () {
446
447
  var textLocation = collection['Text'];
447
448
  var imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
448
449
  var renderOptions_1 = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
449
- legend.textStyle.color = (legend.textStyle.color !== null) ? legend.textStyle.color :
450
+ var legendTextStyle = {
451
+ fontFamily: legend.textStyle.fontFamily, fontStyle: legend.textStyle.fontStyle,
452
+ fontWeight: legend.textStyle.fontWeight, size: legend.textStyle.size, color: legend.textStyle.color, opacity: legend.textStyle.opacity
453
+ };
454
+ legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
450
455
  this.maps.themeStyle.legendTextColor;
451
- legend.textStyle.fontFamily = map.themeStyle.fontFamily || legend.textStyle.fontFamily;
452
- legend.textStyle.size = map.themeStyle.legendFontSize || legend.textStyle.size;
456
+ legendTextStyle.fontFamily = map.themeStyle.fontFamily || legendTextStyle.fontFamily;
457
+ legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
453
458
  if (i === 0) {
454
459
  this.renderLegendBorder();
455
460
  }
456
- legendElement.appendChild(drawSymbol(shapeLocation, shape, shapeSize, collection['ImageSrc'], renderOptions_1));
461
+ if (legend.type === 'Markers' && legend.useMarkerShape) {
462
+ var legendShapeData = this.legendCollection[collection['idIndex']].data[0];
463
+ var marker = map.layers[legendShapeData['layerIndex']].markerSettings[legendShapeData['markerIndex']];
464
+ legendShape = !isNullOrUndefined(marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']]) && marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']] !== '' ? marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']] : marker.shape;
465
+ }
466
+ if (legendShape === "Balloon") {
467
+ legendElement.appendChild(drawBalloon(map, renderOptions_1, shapeSize, { x: shapeLocation.x, y: (shapeLocation.y + 5) }, 'Legend'));
468
+ }
469
+ else {
470
+ legendElement.appendChild(drawSymbol(shapeLocation, legendShape, shapeSize, collection['ImageSrc'], renderOptions_1));
471
+ }
457
472
  var legendRectSize = collection['Rect']['x'] + collection['Rect']['width'];
458
473
  if (legendRectSize > this.legendBorderRect.width) {
459
- var trimmedText = this.legendTextTrim(this.legendBorderRect.width, legendText, legend.textStyle, legendRectSize);
474
+ var trimmedText = this.legendTextTrim(this.legendBorderRect.width, legendText, legendTextStyle, legendRectSize);
460
475
  legendText = trimmedText;
461
476
  }
462
477
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
463
- renderTextElement(textOptions, legend.textStyle, legend.textStyle.color, legendElement);
478
+ renderTextElement(textOptions, legendTextStyle, legendTextStyle.color, legendElement);
464
479
  this.legendGroup.appendChild(legendElement);
465
480
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
466
481
  if (i === (this.totalPages[page]['Collection'].length - 1)) {
@@ -1141,7 +1156,10 @@ var Legend = /** @class */ (function () {
1141
1156
  var map = this.maps;
1142
1157
  var legend = map.legendSettings;
1143
1158
  var legendTitle = legend.title.text;
1144
- var textStyle = legend.titleStyle;
1159
+ var textStyle = {
1160
+ fontFamily: legend.titleStyle.fontFamily, fontStyle: legend.titleStyle.fontStyle,
1161
+ fontWeight: legend.titleStyle.fontWeight, size: legend.titleStyle.size, color: legend.titleStyle.color, opacity: legend.titleStyle.opacity
1162
+ };
1145
1163
  var textOptions;
1146
1164
  var spacing = 10;
1147
1165
  var trimTitle = textTrim((this.legendItemRect.width + (spacing * 2)), legendTitle, textStyle);
@@ -1160,6 +1178,7 @@ var Legend = /** @class */ (function () {
1160
1178
  map.svgObject.appendChild(this.legendGroup);
1161
1179
  if (legendTitle) {
1162
1180
  textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
1181
+ textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
1163
1182
  textOptions = new TextOption(map.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - spacing / 2, 'middle', trimTitle, '');
1164
1183
  renderTextElement(textOptions, textStyle, textStyle.color, this.legendGroup);
1165
1184
  }
@@ -1268,21 +1287,25 @@ var Legend = /** @class */ (function () {
1268
1287
  }
1269
1288
  else {
1270
1289
  newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
1271
- shape: !isNullOrUndefined(marker.shapeValuePath) ? data[marker.shapeValuePath] : marker.shape });
1290
+ shape: (!isNullOrUndefined(marker.shapeValuePath) && !isNullOrUndefined(data[marker.shapeValuePath]) && data[marker.shapeValuePath] !== '') ? data[marker.shapeValuePath] : (_this.maps.legendSettings.useMarkerShape ? marker.shape : _this.maps.legendSettings.shape) });
1272
1291
  _this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
1273
1292
  }
1274
1293
  }
1275
1294
  });
1276
1295
  });
1277
1296
  };
1297
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1278
1298
  Legend.prototype.getMarkerLegendData = function (layerIndex, text, legendFill) {
1279
1299
  var _this = this;
1300
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1280
1301
  var legendData = [];
1281
1302
  this.maps.layers[layerIndex].markerSettings.map(function (markerSettings, markerIndex) {
1303
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1282
1304
  var markerData = markerSettings.dataSource;
1305
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1283
1306
  Array.prototype.forEach.call(markerData, function (data, dataIndex) {
1284
1307
  var marker = _this.maps.layers[layerIndex].markerSettings[markerIndex];
1285
- if ((text === data[marker.legendText] || text === '') && legendFill == data[marker.colorValuePath]) {
1308
+ if ((text === data[marker.legendText] || text === '') && legendFill === data[marker.colorValuePath]) {
1286
1309
  legendData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
1287
1310
  shape: !isNullOrUndefined(marker.shapeValuePath) ? data[marker.shapeValuePath] : marker.shape });
1288
1311
  }
@@ -1650,7 +1673,7 @@ var Legend = /** @class */ (function () {
1650
1673
  shape = this.legendCollection[legendIndex]['data'][i];
1651
1674
  mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
1652
1675
  '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
1653
- '_MarkerIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
1676
+ '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
1654
1677
  if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
1655
1678
  mapElement = mapElement.children[0];
1656
1679
  }
@@ -1659,7 +1682,7 @@ var Legend = /** @class */ (function () {
1659
1682
  mapElement.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
1660
1683
  mapElement.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
1661
1684
  mapElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
1662
- mapElement.setAttribute('stroke-width', (this.maps.layers[k].shapeSettings.border.width).toString());
1685
+ mapElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
1663
1686
  mapElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
1664
1687
  this.maps.layers[k].shapeSettings.opacity :
1665
1688
  this.maps.layers[k].shapeSettings.border.opacity).toString());
@@ -1674,6 +1697,9 @@ var Legend = /** @class */ (function () {
1674
1697
  if (targetEle !== null) {
1675
1698
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1676
1699
  legendShapeId.setAttribute('fill', '#E5E5E5');
1700
+ if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
1701
+ legendShapeId.setAttribute('stroke', '#E5E5E5');
1702
+ }
1677
1703
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1678
1704
  legendTextId.setAttribute('fill', '#E5E5E5');
1679
1705
  }
@@ -1688,6 +1714,9 @@ var Legend = /** @class */ (function () {
1688
1714
  if (targetEle !== null) {
1689
1715
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1690
1716
  legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
1717
+ if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
1718
+ legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
1719
+ }
1691
1720
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1692
1721
  legendTextId.setAttribute('fill', '#757575');
1693
1722
  }
@@ -1722,7 +1751,7 @@ var Legend = /** @class */ (function () {
1722
1751
  layerElement.setAttribute('fill', this.maps.layers[j].shapeSettings.fill);
1723
1752
  layerElement.setAttribute('fill-opacity', (this.maps.layers[j].shapeSettings.opacity).toString());
1724
1753
  layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
1725
- layerElement.setAttribute('stroke-width', (this.maps.layers[j].shapeSettings.border.width).toString());
1754
+ layerElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.width) ? 0 : this.maps.layers[j].shapeSettings.border.width).toString());
1726
1755
  layerElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity) ?
1727
1756
  this.maps.layers[j].shapeSettings.opacity :
1728
1757
  this.maps.layers[j].shapeSettings.border.opacity).toString());
@@ -1752,7 +1781,7 @@ var Legend = /** @class */ (function () {
1752
1781
  layerElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.opacity) ?
1753
1782
  this.maps.layers[j].shapeSettings.opacity :
1754
1783
  this.maps.layers[j].shapeSettings.border.opacity).toString());
1755
- layerElement.setAttribute('stroke-width', (this.maps.layers[j].shapeSettings.border.width).toString());
1784
+ layerElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[j].shapeSettings.border.width) ? 0 : this.maps.layers[j].shapeSettings.border.width).toString());
1756
1785
  layerElement.setAttribute('fill-opacity', (this.maps.layers[j].shapeSettings.opacity).toString());
1757
1786
  layerElement.setAttribute('stroke', this.maps.layers[j].shapeSettings.border.color);
1758
1787
  if (targetEle !== null) {
@@ -1772,7 +1801,7 @@ var Legend = /** @class */ (function () {
1772
1801
  targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendSettings.visible &&
1773
1802
  targetEle.id.indexOf('_Text') === -1) {
1774
1803
  var LegendInteractive = void 0;
1775
- var legendIndex = parseFloat(targetEle.id.substr((this.maps.element.id + '_Legend_Index_').length));
1804
+ var legendIndex = parseFloat(targetEle.id.split(this.maps.element.id + '_Legend_Index_')[1]);
1776
1805
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1777
1806
  var mapdata = void 0;
1778
1807
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1793,7 +1822,7 @@ var Legend = /** @class */ (function () {
1793
1822
  if (this.maps.legendSettings.toggleLegendSettings.applyShapeSettings) {
1794
1823
  LegendInteractive.setAttribute('fill', this.maps.layers[k].shapeSettings.fill);
1795
1824
  LegendInteractive.setAttribute('stroke', this.maps.layers[k].shapeSettings.border.color);
1796
- LegendInteractive.setAttribute('stroke-width', (this.maps.layers[k].shapeSettings.border.width).toString());
1825
+ LegendInteractive.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
1797
1826
  LegendInteractive.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
1798
1827
  this.maps.layers[k].shapeSettings.opacity :
1799
1828
  this.maps.layers[k].shapeSettings.border.opacity).toString());
@@ -1857,7 +1886,7 @@ var Legend = /** @class */ (function () {
1857
1886
  mapLegendElement.setAttribute('fill', this.maps.layers[0].shapeSettings.fill);
1858
1887
  mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color);
1859
1888
  mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
1860
- mapLegendElement.setAttribute('stroke-width', (this.maps.layers[k].shapeSettings.border.width).toString());
1889
+ mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
1861
1890
  mapLegendElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
1862
1891
  this.maps.layers[k].shapeSettings.opacity :
1863
1892
  this.maps.layers[k].shapeSettings.border.opacity).toString());
@@ -1884,7 +1913,7 @@ var Legend = /** @class */ (function () {
1884
1913
  this.maps.toggledShapeElementId.splice(toggledShapeIdIndex, 1);
1885
1914
  }
1886
1915
  mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
1887
- mapLegendElement.setAttribute('stroke-width', (this.maps.layers[k].shapeSettings.border.width).toString());
1916
+ mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 : this.maps.layers[k].shapeSettings.border.width).toString());
1888
1917
  mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color);
1889
1918
  mapLegendElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
1890
1919
  this.maps.layers[k].shapeSettings.opacity : this.maps.layers[k].shapeSettings.border.opacity).toString());