@syncfusion/ej2-maps 19.4.53 → 19.4.56-105067

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 (84) hide show
  1. package/.eslintrc.json +18 -3
  2. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
  3. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
  4. package/CHANGELOG.md +441 -422
  5. package/README.md +73 -73
  6. package/dist/ej2-maps.umd.min.js +1 -10
  7. package/dist/ej2-maps.umd.min.js.map +1 -1
  8. package/dist/es6/ej2-maps.es2015.js +1220 -653
  9. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  10. package/dist/es6/ej2-maps.es5.js +1258 -692
  11. package/dist/es6/ej2-maps.es5.js.map +1 -1
  12. package/dist/global/ej2-maps.min.js +1 -10
  13. package/dist/global/ej2-maps.min.js.map +1 -1
  14. package/dist/global/index.d.ts +0 -9
  15. package/dist/ts/maps/layers/bing-map.ts +50 -0
  16. package/dist/ts/maps/layers/bubble.ts +290 -0
  17. package/dist/ts/maps/layers/color-mapping.ts +226 -0
  18. package/dist/ts/maps/layers/data-label.ts +418 -0
  19. package/dist/ts/maps/layers/layer-panel.ts +1480 -0
  20. package/dist/ts/maps/layers/legend.ts +2236 -0
  21. package/dist/ts/maps/layers/marker.ts +453 -0
  22. package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
  23. package/dist/ts/maps/maps.ts +2886 -0
  24. package/dist/ts/maps/model/base.ts +1843 -0
  25. package/dist/ts/maps/model/constants.ts +200 -0
  26. package/dist/ts/maps/model/export-image.ts +178 -0
  27. package/dist/ts/maps/model/export-pdf.ts +170 -0
  28. package/dist/ts/maps/model/interface.ts +823 -0
  29. package/dist/ts/maps/model/print.ts +104 -0
  30. package/dist/ts/maps/model/theme.ts +554 -0
  31. package/dist/ts/maps/user-interaction/annotation.ts +127 -0
  32. package/dist/ts/maps/user-interaction/highlight.ts +233 -0
  33. package/dist/ts/maps/user-interaction/selection.ts +321 -0
  34. package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
  35. package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
  36. package/dist/ts/maps/utils/enum.ts +368 -0
  37. package/dist/ts/maps/utils/helper.ts +3421 -0
  38. package/helper/e2e/index.js +3 -3
  39. package/helper/e2e/maps-helper.js +13 -13
  40. package/license +9 -9
  41. package/package.json +85 -85
  42. package/src/maps/layers/bing-map.d.ts +4 -0
  43. package/src/maps/layers/bing-map.js +16 -3
  44. package/src/maps/layers/bubble.d.ts +1 -2
  45. package/src/maps/layers/bubble.js +7 -12
  46. package/src/maps/layers/data-label.d.ts +1 -4
  47. package/src/maps/layers/data-label.js +32 -35
  48. package/src/maps/layers/layer-panel.d.ts +18 -1
  49. package/src/maps/layers/layer-panel.js +226 -72
  50. package/src/maps/layers/legend.d.ts +5 -2
  51. package/src/maps/layers/legend.js +170 -61
  52. package/src/maps/layers/marker.d.ts +2 -4
  53. package/src/maps/layers/marker.js +49 -48
  54. package/src/maps/layers/navigation-selected-line.d.ts +1 -2
  55. package/src/maps/layers/navigation-selected-line.js +7 -13
  56. package/src/maps/maps-model.d.ts +259 -251
  57. package/src/maps/maps.d.ts +25 -3
  58. package/src/maps/maps.js +179 -106
  59. package/src/maps/model/base-model.d.ts +1025 -1021
  60. package/src/maps/model/base.d.ts +5 -1
  61. package/src/maps/model/base.js +24 -24
  62. package/src/maps/model/constants.d.ts +6 -0
  63. package/src/maps/model/constants.js +6 -0
  64. package/src/maps/model/export-image.d.ts +2 -4
  65. package/src/maps/model/export-image.js +34 -33
  66. package/src/maps/model/export-pdf.d.ts +4 -6
  67. package/src/maps/model/export-pdf.js +31 -32
  68. package/src/maps/model/interface.d.ts +34 -26
  69. package/src/maps/model/print.d.ts +2 -5
  70. package/src/maps/model/print.js +32 -18
  71. package/src/maps/model/theme.js +7 -4
  72. package/src/maps/user-interaction/annotation.d.ts +1 -2
  73. package/src/maps/user-interaction/annotation.js +3 -4
  74. package/src/maps/user-interaction/highlight.d.ts +1 -2
  75. package/src/maps/user-interaction/highlight.js +11 -10
  76. package/src/maps/user-interaction/selection.d.ts +1 -2
  77. package/src/maps/user-interaction/selection.js +42 -19
  78. package/src/maps/user-interaction/tooltip.d.ts +3 -5
  79. package/src/maps/user-interaction/tooltip.js +27 -14
  80. package/src/maps/user-interaction/zoom.d.ts +3 -8
  81. package/src/maps/user-interaction/zoom.js +282 -162
  82. package/src/maps/utils/enum.d.ts +5 -1
  83. package/src/maps/utils/helper.d.ts +9 -1
  84. package/src/maps/utils/helper.js +82 -33
@@ -248,11 +248,18 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
248
248
  */
249
249
  loaded: EmitType<ILoadedEventArgs>;
250
250
  /**
251
- * Triggers when clicking an element in maps.
251
+ * Triggers when a user clicks on an element in Maps.
252
252
  *
253
253
  * @event click
254
+ * @deprecated
254
255
  */
255
256
  click: EmitType<IMouseEventArgs>;
257
+ /**
258
+ * Triggers when a user clicks on an element in Maps.
259
+ *
260
+ * @event onclick
261
+ */
262
+ onclick: EmitType<IMouseEventArgs>;
256
263
  /**
257
264
  * Triggers when performing the double click operation on an element in maps.
258
265
  *
@@ -281,13 +288,13 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
281
288
  * Triggers before the legend gets rendered.
282
289
  *
283
290
  * @event legendRendering
284
-
291
+ * @deprecated
285
292
  */
286
293
  legendRendering: EmitType<ILegendRenderingEventArgs>;
287
294
  /**
288
295
  * Triggers after the maps tooltip gets rendered.
289
296
  *
290
-
297
+ * @deprecated
291
298
  * @event tooltipRenderComplete
292
299
  */
293
300
  tooltipRenderComplete: EmitType<ITooltipRenderCompleteEventArgs>;
@@ -437,6 +444,12 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
437
444
  * @private
438
445
  */
439
446
  availableSize: Size;
447
+ /**
448
+ * whether it is layer add or not.
449
+ *
450
+ * @private
451
+ */
452
+ isAddLayer: boolean;
440
453
  /**
441
454
  * Specifies the localization object.
442
455
  *
@@ -818,6 +831,8 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
818
831
  * @param {PointerEvent} e - Specifies the pointer event on maps.
819
832
  */
820
833
  mapsOnClick(e: PointerEvent): void;
834
+ private clickHandler;
835
+ private triggerShapeSelection;
821
836
  private getClickLocation;
822
837
  /**
823
838
  * This method is used to perform operations when mouse click on maps.
@@ -1023,6 +1038,13 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
1023
1038
  * @returns {Promise<string>} - Returns the string value.
1024
1039
  */
1025
1040
  export(type: ExportType, fileName: string, orientation?: PdfPageOrientation, allowDownload?: boolean): Promise<string>;
1041
+ /**
1042
+ * This method is used to get the Bing maps URL.
1043
+ *
1044
+ * @param {string} url - Specifies the URL of the maps.
1045
+ * @returns {Promise<string>} - Returns the processed Bing URL as Promise.
1046
+ */
1047
+ getBingUrlTemplate(url: string): Promise<string>;
1026
1048
  /**
1027
1049
  * To find visibility of layers and markers for required modules load.
1028
1050
  *
package/src/maps/maps.js CHANGED
@@ -1,22 +1,22 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- };
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
19
+ };
20
20
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
21
21
  /* eslint-disable @typescript-eslint/no-unused-vars */
22
22
  /* eslint-disable radix */
@@ -35,8 +35,8 @@ import { createStyle } from './utils/helper';
35
35
  import { ZoomSettings, LegendSettings } from './model/base';
36
36
  import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';
37
37
  import { Marker } from './layers/marker';
38
- import { load, click, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
39
- import { getThemeStyle } from './model/theme';
38
+ import { load, click, onclick, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
39
+ import { getThemeStyle, Theme } from './model/theme';
40
40
  import { BingMap } from './layers/bing-map';
41
41
  import { LayerPanel } from './layers/layer-panel';
42
42
  import { Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';
@@ -75,6 +75,10 @@ var Maps = /** @class */ (function (_super) {
75
75
  * Resize the map
76
76
  */
77
77
  _this.isResize = false;
78
+ /**
79
+ * @private
80
+ */
81
+ _this.isReset = false;
78
82
  /** @private */
79
83
  _this.baseSize = new Size(0, 0);
80
84
  /** @public */
@@ -232,6 +236,7 @@ var Maps = /** @class */ (function (_super) {
232
236
  this.renderArea();
233
237
  this.processRequestJsonData();
234
238
  this.renderComplete();
239
+ this.isAddLayer = !this.isTileMap ? false : this.isAddLayer;
235
240
  };
236
241
  /**
237
242
  * To Initialize the control rendering.
@@ -374,16 +379,7 @@ var Maps = /** @class */ (function (_super) {
374
379
  };
375
380
  Maps.prototype.renderMap = function () {
376
381
  if (this.legendModule && this.legendSettings.visible) {
377
- if (!this.isTileMap) {
378
- this.legendModule.renderLegend();
379
- }
380
- else {
381
- var layerCount = this.layersCollection.length - 1;
382
- if (!this.layersCollection[layerCount].isBaseLayer) {
383
- this.isTileMapSubLayer = true;
384
- this.legendModule.renderLegend();
385
- }
386
- }
382
+ this.legendModule.renderLegend();
387
383
  }
388
384
  this.createTile();
389
385
  if (this.zoomSettings.enable && this.zoomModule) {
@@ -394,7 +390,9 @@ var Maps = /** @class */ (function (_super) {
394
390
  this.dataLabelShape = [];
395
391
  }
396
392
  this.mapLayerPanel.measureLayerPanel();
397
- this.element.appendChild(this.svgObject);
393
+ if (!isNullOrUndefined(this.svgObject)) {
394
+ this.element.appendChild(this.svgObject);
395
+ }
398
396
  var position = this.getExtraPosition();
399
397
  for (var i = 0; i < this.layers.length; i++) {
400
398
  if (position.x !== 0 || position.y !== 0) {
@@ -417,12 +415,14 @@ var Maps = /** @class */ (function (_super) {
417
415
  this.checkInitialRender = false;
418
416
  }
419
417
  }
420
- for (var k = 0; k < this.layers[i].markerSettings.length; k++) {
421
- if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
422
- && this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
423
- var markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
424
- for (var j = 0; j < markerSelectionValues.length; j++) {
425
- this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
418
+ if (!this.isResize) {
419
+ for (var k = 0; k < this.layers[i].markerSettings.length; k++) {
420
+ if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
421
+ && this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
422
+ var markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
423
+ for (var j = 0; j < markerSelectionValues.length; j++) {
424
+ this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
425
+ }
426
426
  }
427
427
  }
428
428
  }
@@ -464,12 +464,16 @@ var Maps = /** @class */ (function (_super) {
464
464
  bottom = svg.bottom - tile.bottom - element.offsetTop;
465
465
  top_1 = parseFloat(tileElement.style.top) + element.offsetTop;
466
466
  }
467
- top_1 = (bottom <= 11) ? top_1 : (top_1 * 2);
468
- left = (bottom <= 11) ? left : (left * 2);
467
+ top_1 = (bottom <= 11) ? top_1 : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top_1 * 2);
468
+ left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
469
469
  tileElement.style.top = top_1 + 'px';
470
470
  tileElement.style.left = left + 'px';
471
471
  tileElement1.style.top = top_1 + 'px';
472
472
  tileElement1.style.left = left + 'px';
473
+ if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
474
+ tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
475
+ tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
476
+ }
473
477
  }
474
478
  this.arrangeTemplate();
475
479
  if (this.annotationsModule) {
@@ -500,7 +504,8 @@ var Maps = /** @class */ (function (_super) {
500
504
  Maps.prototype.markerSelection = function (selectionSettings, map, targetElement, data) {
501
505
  var border = {
502
506
  color: selectionSettings.border.color,
503
- width: selectionSettings.border.width / map.scale
507
+ width: selectionSettings.border.width / map.scale,
508
+ opacity: selectionSettings.border.opacity
504
509
  };
505
510
  var markerSelectionProperties = {
506
511
  opacity: selectionSettings.opacity,
@@ -520,9 +525,11 @@ var Maps = /** @class */ (function (_super) {
520
525
  if (this.selectedMarkerElementId.length === 0 || selectionSettings.enableMultiSelect) {
521
526
  if (targetElement.tagName === 'g') {
522
527
  targetElement.children[0].setAttribute('class', 'MarkerselectionMapStyle');
528
+ this.selectedMarkerElementId.push(targetElement.children[0].id);
523
529
  }
524
530
  else {
525
531
  targetElement.setAttribute('class', 'MarkerselectionMapStyle');
532
+ this.selectedMarkerElementId.push(targetElement.id);
526
533
  }
527
534
  }
528
535
  };
@@ -574,6 +581,7 @@ var Maps = /** @class */ (function (_super) {
574
581
  */
575
582
  Maps.prototype.addTabIndex = function () {
576
583
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
584
+ this.element.setAttribute('role', '');
577
585
  this.element.setAttribute('tabindex', this.tabIndex.toString());
578
586
  };
579
587
  // private setSecondaryElementPosition(): void {
@@ -592,12 +600,21 @@ var Maps = /** @class */ (function (_super) {
592
600
  this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
593
601
  }
594
602
  if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
595
- var tileRect = getElementByID(this.element.id + '_tile_parent').getBoundingClientRect();
596
- var tileSvgRect = getElementByID(this.element.id + '_Tile_SVG').getBoundingClientRect();
603
+ var tileElement = getElementByID(this.element.id + '_tile_parent');
604
+ var tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
605
+ var tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
606
+ var tileRect = tileElement.getBoundingClientRect();
607
+ var tileSvgRect = tileSvgElement.getBoundingClientRect();
597
608
  left = (tileRect.left - tileSvgRect.left);
598
609
  top = (tileRect.top - tileSvgRect.top);
599
- getElementByID(this.element.id + '_Tile_SVG_Parent').style.left = left + 'px';
600
- getElementByID(this.element.id + '_Tile_SVG_Parent').style.top = top + 'px';
610
+ tileSvgParentElement.style.left = left + 'px';
611
+ tileSvgParentElement.style.top = top + 'px';
612
+ if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
613
+ tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
614
+ tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
615
+ tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
616
+ tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
617
+ }
601
618
  var markerTemplateElements = document.getElementsByClassName('template');
602
619
  if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
603
620
  for (var i = 0; i < markerTemplateElements.length; i++) {
@@ -615,7 +632,7 @@ var Maps = /** @class */ (function (_super) {
615
632
  if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
616
633
  for (var i = 0; i < elements.childNodes.length; i++) {
617
634
  var childElement = elements.childNodes[i];
618
- if (childElement.tagName === 'g') {
635
+ if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
619
636
  var layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
620
637
  for (var j = 0; j < childElement.childNodes.length; j++) {
621
638
  var childNode = childElement.childNodes[j];
@@ -629,7 +646,7 @@ var Maps = /** @class */ (function (_super) {
629
646
  }
630
647
  }
631
648
  if (this.zoomModule && (this.previousScale !== this.scale)) {
632
- this.zoomModule.applyTransform(true);
649
+ this.zoomModule.applyTransform(this, true);
633
650
  }
634
651
  }
635
652
  };
@@ -652,7 +669,7 @@ var Maps = /** @class */ (function (_super) {
652
669
  }
653
670
  var templateElements = document.getElementsByClassName(this.element.id + '_template');
654
671
  if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
655
- getElementByID(this.element.id + '_Layer_Collections') && this.layers[this.layers.length - 1].layerType !== 'OSM') {
672
+ getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
656
673
  for (var i = 0; i < templateElements.length; i++) {
657
674
  var offSetLetValue = 0;
658
675
  var offSetTopValue = 0;
@@ -687,10 +704,7 @@ var Maps = /** @class */ (function (_super) {
687
704
  var mainLayer = this.layersCollection[0];
688
705
  var padding = 0;
689
706
  if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
690
- mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
691
- if (mainLayer.layerType === 'Google') {
692
- mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
693
- }
707
+ mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
694
708
  removeElement(this.element.id + '_tile_parent');
695
709
  removeElement(this.element.id + '_tiles');
696
710
  removeElement('animated_tiles');
@@ -738,7 +752,7 @@ var Maps = /** @class */ (function (_super) {
738
752
  var baseLayer = mainLayers[i];
739
753
  if (baseLayer.visible && baseIndex === i) {
740
754
  baseLayer.isBaseLayer = true;
741
- this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
755
+ this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
742
756
  this.layersCollection.push(baseLayer);
743
757
  break;
744
758
  }
@@ -785,12 +799,19 @@ var Maps = /** @class */ (function (_super) {
785
799
  * @private
786
800
  */
787
801
  Maps.prototype.renderTitle = function (title, type, bounds, groupEle) {
788
- var style = title.textStyle;
802
+ var style = {
803
+ size: title.textStyle.size,
804
+ color: title.textStyle.color,
805
+ fontFamily: title.textStyle.fontFamily,
806
+ fontWeight: title.textStyle.fontWeight,
807
+ fontStyle: title.textStyle.fontStyle,
808
+ opacity: title.textStyle.opacity
809
+ };
789
810
  var height;
790
811
  var width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
791
- style.fontFamily = this.themeStyle.fontFamily || style.fontFamily;
812
+ style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
792
813
  style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
793
- style.size = this.themeStyle.titleFontSize || style.size;
814
+ style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
794
815
  if (title.text) {
795
816
  if (isNullOrUndefined(groupEle)) {
796
817
  groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
@@ -803,6 +824,7 @@ var Maps = /** @class */ (function (_super) {
803
824
  var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
804
825
  var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
805
826
  element.setAttribute('aria-label', this.description || title.text);
827
+ element.setAttribute('role', '');
806
828
  if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
807
829
  height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
808
830
  this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
@@ -960,6 +982,7 @@ var Maps = /** @class */ (function (_super) {
960
982
  var id = event.target['id'];
961
983
  event.preventDefault();
962
984
  if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
985
+ this.mapAreaRect = this.legendModule.initialMapAreaRect;
963
986
  this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
964
987
  (this.legendModule.currentPage + 1);
965
988
  this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
@@ -1024,33 +1047,47 @@ var Maps = /** @class */ (function (_super) {
1024
1047
  latitude: latitude, longitude: longitude,
1025
1048
  isShapeSelected: this.SelectedElement(targetEle)
1026
1049
  };
1027
- this.trigger('click', eventArgs_1, function (mouseArgs) {
1028
- if (targetEle.id.indexOf('shapeIndex') > -1) {
1029
- _this.mergeCluster();
1030
- if (getElement(_this.element.id + '_mapsTooltip') &&
1031
- _this.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
1032
- removeElement(_this.element.id + '_mapsTooltip');
1033
- }
1034
- }
1035
- if (_this.markerModule) {
1036
- _this.markerModule.markerClusterClick(e);
1037
- }
1038
- if (!eventArgs_1.cancel) {
1039
- _this.notify(click, targetEle);
1040
- }
1041
- if (!eventArgs_1.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
1042
- var layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
1043
- var shapeSelectedEventArgs = triggerShapeEvent(targetId, _this.layers[layerIndex].selectionSettings, _this, shapeSelected);
1044
- if (!shapeSelectedEventArgs.cancel && _this.selectionModule && !isNullOrUndefined(_this.shapeSelected)) {
1045
- customizeStyle(_this.selectionModule.selectionType + 'selectionMap', _this.selectionModule.selectionType + 'selectionMapStyle', shapeSelectedEventArgs);
1046
- }
1047
- else if (shapeSelectedEventArgs.cancel && _this.selectionModule
1048
- && isNullOrUndefined(shapeSelectedEventArgs['data'])) {
1049
- removeClass(targetEle);
1050
- _this.selectionModule.removedSelectionList(targetEle);
1051
- }
1052
- }
1053
- });
1050
+ if (this.onclick) {
1051
+ eventArgs_1.name = onclick;
1052
+ this.trigger('onclick', eventArgs_1, function (mouseArgs) {
1053
+ _this.clickHandler(e, eventArgs_1, targetEle);
1054
+ });
1055
+ }
1056
+ else {
1057
+ this.trigger('click', eventArgs_1, function (mouseArgs) {
1058
+ _this.clickHandler(e, eventArgs_1, targetEle);
1059
+ });
1060
+ }
1061
+ }
1062
+ };
1063
+ Maps.prototype.clickHandler = function (e, eventArgs, targetEle) {
1064
+ if (targetEle.id.indexOf('shapeIndex') > -1) {
1065
+ this.mergeCluster();
1066
+ if (getElement(this.element.id + '_mapsTooltip') &&
1067
+ this.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
1068
+ removeElement(this.element.id + '_mapsTooltip');
1069
+ }
1070
+ }
1071
+ if (this.markerModule) {
1072
+ this.markerModule.markerClusterClick(e);
1073
+ }
1074
+ if (!eventArgs.cancel) {
1075
+ this.notify(click, targetEle);
1076
+ }
1077
+ if (!eventArgs.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
1078
+ this.triggerShapeSelection(targetEle);
1079
+ }
1080
+ };
1081
+ Maps.prototype.triggerShapeSelection = function (targetEle) {
1082
+ var layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
1083
+ var shapeSelectedEventArgs = triggerShapeEvent(targetEle.id, this.layers[layerIndex].selectionSettings, this, shapeSelected);
1084
+ if (!shapeSelectedEventArgs.cancel && this.selectionModule && !isNullOrUndefined(this.shapeSelected)) {
1085
+ customizeStyle(this.selectionModule.selectionType + 'selectionMap', this.selectionModule.selectionType + 'selectionMapStyle', shapeSelectedEventArgs);
1086
+ }
1087
+ else if (shapeSelectedEventArgs.cancel && this.selectionModule
1088
+ && isNullOrUndefined(shapeSelectedEventArgs['data'])) {
1089
+ removeClass(targetEle);
1090
+ this.selectionModule.removedSelectionList(targetEle);
1054
1091
  }
1055
1092
  };
1056
1093
  Maps.prototype.getClickLocation = function (targetId, pageX, pageY, targetElement, x, y) {
@@ -1138,13 +1175,6 @@ var Maps = /** @class */ (function (_super) {
1138
1175
  latitude = latLongValue.latitude;
1139
1176
  longitude = latLongValue.longitude;
1140
1177
  }
1141
- var eventArgs = {
1142
- cancel: false, name: click, target: targetId, x: e.clientX, y: e.clientY,
1143
- latitude: latitude, longitude: longitude, isShapeSelected: this.SelectedElement(targetEle)
1144
- };
1145
- // eslint-disable-next-line @typescript-eslint/no-empty-function
1146
- this.trigger('click', eventArgs, function (mouseArgs) {
1147
- });
1148
1178
  }
1149
1179
  this.titleTooltip(e, pageX, pageY, true);
1150
1180
  if (!isNullOrUndefined(this.legendModule)) {
@@ -1152,7 +1182,7 @@ var Maps = /** @class */ (function (_super) {
1152
1182
  }
1153
1183
  }
1154
1184
  this.notify(Browser.touchEndEvent, e);
1155
- if (e.cancelable) {
1185
+ if (e.cancelable && !this.isTouch) {
1156
1186
  e.preventDefault();
1157
1187
  }
1158
1188
  return false;
@@ -1178,6 +1208,9 @@ var Maps = /** @class */ (function (_super) {
1178
1208
  var markerModule = this.markerModule;
1179
1209
  if (element.id.indexOf('shapeIndex') > -1 || element.id.indexOf('Tile') > -1) {
1180
1210
  this.mergeCluster();
1211
+ if (element.id.indexOf('shapeIndex') > -1) {
1212
+ this.triggerShapeSelection(element);
1213
+ }
1181
1214
  }
1182
1215
  if (markerModule) {
1183
1216
  markerModule.markerClick(e);
@@ -1315,14 +1348,14 @@ var Maps = /** @class */ (function (_super) {
1315
1348
  removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
1316
1349
  }
1317
1350
  if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
1318
- showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
1351
+ showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size || this.themeStyle.titleFontSize, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
1319
1352
  }
1320
1353
  else {
1321
1354
  removeElement(this.element.id + '_EJ2_Title_Tooltip');
1322
1355
  }
1323
1356
  };
1324
1357
  /*
1325
-
1358
+
1326
1359
  /**
1327
1360
  * This method is used to perform operations while resizing the window.
1328
1361
  *
@@ -1350,6 +1383,7 @@ var Maps = /** @class */ (function (_super) {
1350
1383
  _this.refreshing = true;
1351
1384
  _this.wireEVents();
1352
1385
  _this.render();
1386
+ _this.refreshing = false;
1353
1387
  }, 500);
1354
1388
  }
1355
1389
  }
@@ -1380,7 +1414,7 @@ var Maps = /** @class */ (function (_super) {
1380
1414
  this.scale = zoomFactor;
1381
1415
  this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
1382
1416
  this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
1383
- this.zoomModule.applyTransform();
1417
+ this.zoomModule.applyTransform(this);
1384
1418
  }
1385
1419
  else {
1386
1420
  position = { x: size.width / 2, y: size.height / 2 };
@@ -1426,8 +1460,10 @@ var Maps = /** @class */ (function (_super) {
1426
1460
  * @param {Object} layer - Specifies the layer for the maps.
1427
1461
  */
1428
1462
  Maps.prototype.addLayer = function (layer) {
1429
- this.layers.push(new LayerSettings(this.layers[0], 'layers', layer));
1430
- this.refresh();
1463
+ var mapsLayer = this.layers;
1464
+ mapsLayer.push(layer);
1465
+ this.isAddLayer = true;
1466
+ this.layers = mapsLayer;
1431
1467
  };
1432
1468
  /**
1433
1469
  * This method is used to remove a layer from map.
@@ -1436,8 +1472,9 @@ var Maps = /** @class */ (function (_super) {
1436
1472
  * @returns {void}
1437
1473
  */
1438
1474
  Maps.prototype.removeLayer = function (index) {
1439
- this.layers.splice(index, 1);
1440
- this.refresh();
1475
+ var mapsLayer = this.layers;
1476
+ mapsLayer.splice(index, 1);
1477
+ this.layers = mapsLayer;
1441
1478
  };
1442
1479
  /**
1443
1480
  * This method is used to add markers dynamically in the maps.
@@ -1456,7 +1493,7 @@ var Maps = /** @class */ (function (_super) {
1456
1493
  this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
1457
1494
  }
1458
1495
  var markerModule = new Marker(this);
1459
- markerModule.markerRender(layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
1496
+ markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
1460
1497
  this.arrangeTemplate();
1461
1498
  }
1462
1499
  };
@@ -1663,7 +1700,8 @@ var Maps = /** @class */ (function (_super) {
1663
1700
  Zoom: 'Zoom',
1664
1701
  ZoomOut: 'Zoom out',
1665
1702
  Pan: 'Pan',
1666
- Reset: 'Reset'
1703
+ Reset: 'Reset',
1704
+ ImageNotFound: 'Image Not Found'
1667
1705
  };
1668
1706
  };
1669
1707
  /**
@@ -1671,6 +1709,7 @@ var Maps = /** @class */ (function (_super) {
1671
1709
  */
1672
1710
  Maps.prototype.destroy = function () {
1673
1711
  this.unWireEVents();
1712
+ _super.prototype.destroy.call(this);
1674
1713
  this.shapeSelectionItem = [];
1675
1714
  this.toggledShapeElementId = [];
1676
1715
  this.toggledLegendId = [];
@@ -1685,11 +1724,14 @@ var Maps = /** @class */ (function (_super) {
1685
1724
  this.zoomLabelPositions = [];
1686
1725
  this.mouseDownEvent = { x: null, y: null };
1687
1726
  this.mouseClickEvent = { x: null, y: null };
1727
+ this.formatFunction = null;
1728
+ //TODO: Calling the below code throws spec issue.
1729
+ //this.renderer = null;
1730
+ this.availableSize = new Size(0, 0);
1688
1731
  if (document.getElementById('mapsmeasuretext')) {
1689
1732
  document.getElementById('mapsmeasuretext').remove();
1690
1733
  }
1691
1734
  this.removeSvg();
1692
- _super.prototype.destroy.call(this);
1693
1735
  };
1694
1736
  /**
1695
1737
  * Gets component name
@@ -1722,6 +1764,7 @@ var Maps = /** @class */ (function (_super) {
1722
1764
  Maps.prototype.onPropertyChanged = function (newProp, oldProp) {
1723
1765
  var render = false;
1724
1766
  var isMarker = false;
1767
+ var isLayer = false;
1725
1768
  var isStaticMapType = false;
1726
1769
  var layerEle;
1727
1770
  if (newProp['layers']) {
@@ -1742,13 +1785,18 @@ var Maps = /** @class */ (function (_super) {
1742
1785
  case 'legendSettings':
1743
1786
  case 'baseLayerIndex':
1744
1787
  if (prop === 'layers') {
1788
+ isLayer = true;
1745
1789
  var layerPropLength = Object.keys(newProp.layers).length;
1746
1790
  for (var x = 0; x < layerPropLength; x++) {
1747
1791
  if (!isNullOrUndefined(newProp.layers[x])) {
1748
1792
  var collection = Object.keys(newProp.layers[x]);
1749
1793
  for (var _b = 0, collection_1 = collection; _b < collection_1.length; _b++) {
1750
1794
  var collectionProp = collection_1[_b];
1751
- if (collectionProp === 'markerSettings') {
1795
+ if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
1796
+ && !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
1797
+ this.isReset = true;
1798
+ }
1799
+ else if (collectionProp === 'markerSettings') {
1752
1800
  isMarker = true;
1753
1801
  }
1754
1802
  else if (collectionProp === 'staticMapType') {
@@ -1762,7 +1810,7 @@ var Maps = /** @class */ (function (_super) {
1762
1810
  break;
1763
1811
  case 'zoomSettings':
1764
1812
  if (!isNullOrUndefined(oldProp.zoomSettings)) {
1765
- if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor) {
1813
+ if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor && !isLayer) {
1766
1814
  render = false;
1767
1815
  }
1768
1816
  else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
@@ -1999,7 +2047,7 @@ var Maps = /** @class */ (function (_super) {
1999
2047
  */
2000
2048
  Maps.prototype.print = function (id) {
2001
2049
  if ((this.allowPrint) && (this.printModule)) {
2002
- this.printModule.print(id);
2050
+ this.printModule.print(this, id);
2003
2051
  }
2004
2052
  };
2005
2053
  /**
@@ -2018,16 +2066,38 @@ var Maps = /** @class */ (function (_super) {
2018
2066
  }
2019
2067
  if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
2020
2068
  return new Promise(function (resolve, reject) {
2021
- resolve(_this.imageExportModule.export(type, fileName, allowDownload));
2069
+ resolve(_this.imageExportModule.export(_this, type, fileName, allowDownload));
2022
2070
  });
2023
2071
  }
2024
2072
  else if ((this.allowPdfExport) && (this.pdfExportModule)) {
2025
2073
  return new Promise(function (resolve, reject) {
2026
- resolve(_this.pdfExportModule.export(type, fileName, allowDownload, orientation));
2074
+ resolve(_this.pdfExportModule.export(_this, type, fileName, allowDownload, orientation));
2027
2075
  });
2028
2076
  }
2029
2077
  return null;
2030
2078
  };
2079
+ /**
2080
+ * This method is used to get the Bing maps URL.
2081
+ *
2082
+ * @param {string} url - Specifies the URL of the maps.
2083
+ * @returns {Promise<string>} - Returns the processed Bing URL as Promise.
2084
+ */
2085
+ Maps.prototype.getBingUrlTemplate = function (url) {
2086
+ var promise = new Promise(function (resolve, reject) {
2087
+ var ajax = new Ajax({
2088
+ url: url
2089
+ });
2090
+ ajax.onSuccess = function (json) {
2091
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2092
+ var jsonObject = JSON.parse(json);
2093
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2094
+ var resource = jsonObject['resourceSets'][0]['resources'][0];
2095
+ resolve(resource['imageUrl']);
2096
+ };
2097
+ ajax.send();
2098
+ });
2099
+ return promise;
2100
+ };
2031
2101
  /**
2032
2102
  * To find visibility of layers and markers for required modules load.
2033
2103
  *
@@ -2236,6 +2306,9 @@ var Maps = /** @class */ (function (_super) {
2236
2306
  __decorate([
2237
2307
  Event()
2238
2308
  ], Maps.prototype, "click", void 0);
2309
+ __decorate([
2310
+ Event()
2311
+ ], Maps.prototype, "onclick", void 0);
2239
2312
  __decorate([
2240
2313
  Event()
2241
2314
  ], Maps.prototype, "doubleClick", void 0);