@syncfusion/ej2-maps 19.3.53 → 19.4.48

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 (40) 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 +42 -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 +663 -293
  8. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  9. package/dist/es6/ej2-maps.es5.js +659 -289
  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 +89 -52
  20. package/src/maps/layers/legend.d.ts +41 -2
  21. package/src/maps/layers/legend.js +90 -29
  22. package/src/maps/layers/marker.js +2 -8
  23. package/src/maps/maps-model.d.ts +1 -1
  24. package/src/maps/maps.d.ts +8 -0
  25. package/src/maps/maps.js +142 -19
  26. package/src/maps/model/base-model.d.ts +7 -0
  27. package/src/maps/model/base.d.ts +6 -0
  28. package/src/maps/model/base.js +5 -2
  29. package/src/maps/model/interface.d.ts +1 -3
  30. package/src/maps/model/theme.js +62 -5
  31. package/src/maps/user-interaction/highlight.d.ts +9 -1
  32. package/src/maps/user-interaction/highlight.js +22 -15
  33. package/src/maps/user-interaction/selection.d.ts +9 -1
  34. package/src/maps/user-interaction/selection.js +27 -19
  35. package/src/maps/user-interaction/tooltip.js +9 -3
  36. package/src/maps/user-interaction/zoom.d.ts +5 -1
  37. package/src/maps/user-interaction/zoom.js +82 -45
  38. package/src/maps/utils/enum.d.ts +3 -1
  39. package/src/maps/utils/helper.d.ts +4 -2
  40. package/src/maps/utils/helper.js +130 -98
@@ -107,8 +107,10 @@ var Zoom = /** @class */ (function () {
107
107
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
108
108
  document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
109
109
  }
110
+ this.markerLineAnimation(map);
110
111
  map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
111
112
  var element1 = document.getElementById(this.maps.element.id + '_tiles');
113
+ var animationDuration = this.maps.layersCollection[0].animationDuration;
112
114
  setTimeout(function () {
113
115
  // if (type === 'ZoomOut') {
114
116
  // element1.removeChild(element1.children[element1.childElementCount - 1]);
@@ -122,7 +124,7 @@ var Zoom = /** @class */ (function () {
122
124
  if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
123
125
  document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
124
126
  }
125
- }, 250);
127
+ }, animationDuration);
126
128
  }
127
129
  this.maps.zoomNotApplied = false;
128
130
  };
@@ -297,11 +299,13 @@ var Zoom = /** @class */ (function () {
297
299
  */
298
300
  Zoom.prototype.animateTransform = function (element, animate, x, y, scale) {
299
301
  var duration = this.currentLayer.animationDuration;
300
- if (!animate || duration === 0) {
302
+ if (!animate || duration === 0 || this.maps.isTileMap) {
301
303
  element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
302
304
  return;
303
305
  }
304
- zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
306
+ if (!this.maps.isTileMap) {
307
+ zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
308
+ }
305
309
  };
306
310
  Zoom.prototype.applyTransform = function (animate) {
307
311
  var layerIndex;
@@ -353,12 +357,14 @@ var Zoom = /** @class */ (function () {
353
357
  this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate);
354
358
  }
355
359
  currentEle = layerElement.childNodes[j];
360
+ var markerAnimation = void 0;
356
361
  if (!isNullOrUndefined(currentEle) && currentEle.id.indexOf('Markers') !== -1) {
357
362
  for (var k = 0; k < currentEle.childElementCount; k++) {
358
363
  this.markerTranslate(currentEle.childNodes[k], factor, x, y, scale, 'Marker', animate);
359
364
  var layerIndex_1 = parseInt(currentEle.childNodes[k]['id'].split('_LayerIndex_')[1].split('_')[0], 10);
360
365
  var dataIndex = parseInt(currentEle.childNodes[k]['id'].split('_dataIndex_')[1].split('_')[0], 10);
361
366
  var markerIndex = parseInt(currentEle.childNodes[k]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
367
+ markerAnimation = this.currentLayer.markerSettings[markerIndex].animationDuration > 0;
362
368
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
363
369
  var markerSelectionValues = this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
364
370
  for (var x_1 = 0; x_1 < this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length; x_1++) {
@@ -369,9 +375,17 @@ var Zoom = /** @class */ (function () {
369
375
  this.maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, this.maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
370
376
  }
371
377
  }
372
- if (!this.maps.isTileMap && this.currentLayer.animationDuration > 0) {
373
- markerStyle = 'visibility:hidden';
374
- currentEle.setAttribute('style', markerStyle);
378
+ if ((this.currentLayer.animationDuration > 0 || (this.maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
379
+ if (this.maps.isTileMap) {
380
+ var groupElement = document.querySelector('.GroupElement');
381
+ if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
382
+ groupElement.style.display = 'none';
383
+ }
384
+ }
385
+ else {
386
+ markerStyle = 'visibility:hidden';
387
+ currentEle.setAttribute('style', markerStyle);
388
+ }
375
389
  }
376
390
  }
377
391
  if (this.isPanning && this.maps.markerModule.sameMarkerData.length > 0) {
@@ -470,7 +484,7 @@ var Zoom = /** @class */ (function () {
470
484
  this.maps.arrangeTemplate();
471
485
  }
472
486
  if (!isNullOrUndefined(this.currentLayer)) {
473
- if (!animate || this.currentLayer.animationDuration === 0) {
487
+ if (!animate || this.currentLayer.animationDuration === 0 || this.maps.isTileMap) {
474
488
  this.processTemplate(x, y, scale, this.maps);
475
489
  }
476
490
  }
@@ -589,7 +603,6 @@ var Zoom = /** @class */ (function () {
589
603
  */
590
604
  Zoom.prototype.processTemplate = function (x, y, scale, maps) {
591
605
  for (var i = 0; i < this.templateCount; i++) {
592
- this.currentLayer = maps.layersCollection[i];
593
606
  var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
594
607
  var markerTemplateElement = getElementByID(maps.element.id + '_LayerIndex_' +
595
608
  i + '_Markers_Template_Group');
@@ -820,6 +833,23 @@ var Zoom = /** @class */ (function () {
820
833
  }
821
834
  }
822
835
  };
836
+ Zoom.prototype.markerLineAnimation = function (map) {
837
+ if (map.isTileMap) {
838
+ for (var i = 0; i < map.layersCollection.length; i++) {
839
+ var markerTemplateElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
840
+ var lineElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_line_Group');
841
+ if (!isNullOrUndefined(markerTemplateElement)) {
842
+ markerTemplateElement.style.visibility = 'hidden';
843
+ }
844
+ if (!isNullOrUndefined(lineElement)) {
845
+ lineElement.style.visibility = 'hidden';
846
+ }
847
+ }
848
+ }
849
+ };
850
+ /**
851
+ * @private
852
+ */
823
853
  Zoom.prototype.panning = function (direction, xDifference, yDifference, mouseLocation) {
824
854
  var map = this.maps;
825
855
  var panArgs;
@@ -838,6 +868,8 @@ var Zoom = /** @class */ (function () {
838
868
  yDifference = !isNullOrUndefined(yDifference) ? yDifference : (down.y - move.y);
839
869
  this.maps.mergeCluster();
840
870
  if (!map.isTileMap) {
871
+ var legendElement = document.getElementById(map.element.id + '_Legend_Group');
872
+ var legendHeight = !isNullOrUndefined(legendElement) ? legendElement.getClientRects()[0].height : 0;
841
873
  x = translatePoint.x - xDifference / scale;
842
874
  y = translatePoint.y - yDifference / scale;
843
875
  var layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
@@ -845,7 +877,7 @@ var Zoom = /** @class */ (function () {
845
877
  var panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
846
878
  ((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
847
879
  var panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
848
- ((layerRect.top + layerRect.height + map.margin.top) >= (elementRect.top + elementRect.height))));
880
+ ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
849
881
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
850
882
  var location_3 = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
851
883
  panArgs = {
@@ -953,45 +985,49 @@ var Zoom = /** @class */ (function () {
953
985
  var tileZoomFactor = prevLevel < minZoom && !map.isReset ? minZoom : zoomFactor;
954
986
  map.scale = Math.pow(2, tileZoomFactor - 1);
955
987
  map.tileZoomLevel = tileZoomFactor;
956
- map.zoomSettings.zoomFactor = zoomFactor;
957
- var position = { x: map.availableSize.width / 2, y: map.availableSize.height / 2 };
958
- this.getTileTranslatePosition(prevLevel, tileZoomFactor, position, type);
959
- if (map.zoomSettings.resetToInitial && map.applyZoomReset && type === 'Reset' || (type === 'ZoomOut' && map.zoomSettings.resetToInitial && map.applyZoomReset && tileZoomFactor <= map.initialZoomLevel)) {
960
- map.initialCheck = true;
961
- map.zoomPersistence = false;
962
- map.tileTranslatePoint.x = map.initialTileTranslate.x;
963
- map.tileTranslatePoint.y = map.initialTileTranslate.y;
964
- tileZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
965
- }
966
- this.triggerZoomEvent(prevTilePoint, prevLevel, type);
967
- map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
968
- map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
969
- if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
970
- document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
971
- }
972
- if (document.querySelector('.GroupElement')) {
973
- document.querySelector('.GroupElement').style.display = 'none';
974
- }
975
- map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
976
- var element1 = document.getElementById(this.maps.element.id + '_tiles');
977
- setTimeout(function () {
978
- if (type === 'ZoomOut' || type === 'Reset') {
979
- // element1.removeChild(element1.children[element1.childElementCount - 1]);
980
- // element1.childElementCount ? element1.removeChild(element1.children[element1.childElementCount - 1]) : element1;
988
+ if (map.previousScale !== map.scale || map.isReset) {
989
+ map.zoomSettings.zoomFactor = zoomFactor;
990
+ var position = { x: map.availableSize.width / 2, y: map.availableSize.height / 2 };
991
+ this.getTileTranslatePosition(prevLevel, tileZoomFactor, position, type);
992
+ if (map.zoomSettings.resetToInitial && map.applyZoomReset && type === 'Reset' || (type === 'ZoomOut' && map.zoomSettings.resetToInitial && map.applyZoomReset && tileZoomFactor <= map.initialZoomLevel)) {
993
+ map.initialCheck = true;
994
+ map.zoomPersistence = false;
995
+ map.tileTranslatePoint.x = map.initialTileTranslate.x;
996
+ map.tileTranslatePoint.y = map.initialTileTranslate.y;
997
+ tileZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
981
998
  }
982
- _this.applyTransform(true);
983
- if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
984
- document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
999
+ this.triggerZoomEvent(prevTilePoint, prevLevel, type);
1000
+ map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
1001
+ map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
1002
+ if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
1003
+ document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
985
1004
  }
986
- }, 250);
1005
+ if (document.querySelector('.GroupElement')) {
1006
+ document.querySelector('.GroupElement').style.display = 'none';
1007
+ }
1008
+ this.markerLineAnimation(map);
1009
+ map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
1010
+ var element1 = document.getElementById(this.maps.element.id + '_tiles');
1011
+ var animationDuration = this.maps.layersCollection[0].animationDuration;
1012
+ setTimeout(function () {
1013
+ if (type === 'ZoomOut' || type === 'Reset') {
1014
+ // element1.removeChild(element1.children[element1.childElementCount - 1]);
1015
+ // element1.childElementCount ? element1.removeChild(element1.children[element1.childElementCount - 1]) : element1;
1016
+ }
1017
+ _this.applyTransform(true);
1018
+ if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
1019
+ document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
1020
+ }
1021
+ }, animationDuration);
1022
+ }
1023
+ this.maps.zoomNotApplied = false;
987
1024
  }
988
- this.maps.zoomNotApplied = false;
989
1025
  };
990
1026
  Zoom.prototype.createZoomingToolbars = function () {
991
1027
  var map = this.maps;
992
1028
  this.toolBarGroup = map.renderer.createGroup({
993
1029
  id: map.element.id + '_Zooming_KitCollection',
994
- opacity: 0.3
1030
+ opacity: map.theme.toLowerCase() === 'fluentuidark' ? 0.6 : 0.3
995
1031
  });
996
1032
  var kitHeight = 16;
997
1033
  var kitWidth = 16;
@@ -1254,8 +1290,9 @@ var Zoom = /** @class */ (function () {
1254
1290
  x = (size.width - toolBarSize.width) - padding;
1255
1291
  break;
1256
1292
  }
1257
- element.style.left = x + 'px';
1258
- element.style.top = y + 'px';
1293
+ var extraPosition = map.getExtraPosition();
1294
+ element.style.left = x + extraPosition.x + 'px';
1295
+ element.style.top = y + extraPosition.y + 'px';
1259
1296
  var color = this.maps.zoomSettings.highlightColor || this.maps.themeStyle.zoomSelectionColor;
1260
1297
  var css = ' .e-maps-toolbar:hover > circle { stroke:' + color + '; } .e-maps-toolbar:hover > path { fill: ' + color + ' ; stroke: ' + color + '; }' +
1261
1298
  '.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } ' +
@@ -1400,14 +1437,14 @@ var Zoom = /** @class */ (function () {
1400
1437
  if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
1401
1438
  if (!this.maps.zoomSettings.enablePanning) {
1402
1439
  if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
1403
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '0.3');
1404
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '0.3');
1440
+ getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
1441
+ getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
1405
1442
  }
1406
1443
  }
1407
1444
  }
1408
1445
  }
1409
1446
  else {
1410
- getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', '0.3');
1447
+ getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
1411
1448
  if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
1412
1449
  getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
1413
1450
  getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
@@ -245,7 +245,9 @@ export declare type LegendShape =
245
245
  /** Specifies the legend shape as a pentagon. */
246
246
  'Pentagon' |
247
247
  /** Specifies the legend shape as a inverted triangle. */
248
- 'InvertedTriangle';
248
+ 'InvertedTriangle' |
249
+ /** Specifies to render the marker shape as balloon on maps. */
250
+ 'Balloon';
249
251
  /**
250
252
  * Defines the legend arrangement in the maps component.
251
253
  */
@@ -31,7 +31,7 @@ export declare function stringToNumber(value: string, containerSize: number): nu
31
31
  * @param {Maps} maps Specifies the maps instance
32
32
  * @returns {void}
33
33
  */
34
- export declare function calculateSize(maps: Maps): void;
34
+ export declare function calculateSize(maps: Maps): Size;
35
35
  /**
36
36
  * Method to create svg for maps.
37
37
  *
@@ -481,6 +481,7 @@ export declare function marker(eventArgs: IMarkerRenderingEventArgs, markerSetti
481
481
  * @param {number} markerIndex - Specifies the marker index
482
482
  * @param {HTMLElement} markerTemplate - Specifies the marker template element
483
483
  * @param {Point} location - Specifies the location
484
+ * @param {Point} transPoint - Specifies the translate point.
484
485
  * @param {number} scale - Specifies the scale value
485
486
  * @param {Point} offset - Specifies the offset value
486
487
  * @param {Maps} maps - Specifies the instance of the maps
@@ -677,7 +678,7 @@ export declare function drawStar(maps: Maps, options: PathOption, size: Size, lo
677
678
  * @returns {Element} - Returns the element
678
679
  * @private
679
680
  */
680
- export declare function drawBalloon(maps: Maps, options: PathOption, size: Size, location: MapLocation, element?: Element): Element;
681
+ export declare function drawBalloon(maps: Maps, options: PathOption, size: Size, location: MapLocation, type: string, element?: Element): Element;
681
682
  /**
682
683
  * Internal rendering of Pattern
683
684
  *
@@ -740,6 +741,7 @@ export declare function getRatioOfBubble(min: number, max: number, value: number
740
741
  *
741
742
  * @param {MapLocation[]} points - Specifies the points
742
743
  * @param {string} type - Specifies the type
744
+ * @param {string} geometryType - Specified the type of the geometry
743
745
  * @returns {any} - Specifies the object
744
746
  */
745
747
  export declare function findMidPointOfPolygon(points: MapLocation[], type: string, geometryType?: string): any;