@syncfusion/ej2-maps 23.2.7 → 24.1.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.
@@ -357,6 +357,9 @@ var MarkerClusterSettings = /** @class */ (function (_super) {
357
357
  __decorate([
358
358
  Property(false)
359
359
  ], MarkerClusterSettings.prototype, "allowClustering", void 0);
360
+ __decorate([
361
+ Property(true)
362
+ ], MarkerClusterSettings.prototype, "allowDeepClustering", void 0);
360
363
  __decorate([
361
364
  Complex({ color: 'transparent', width: 1 }, Border)
362
365
  ], MarkerClusterSettings.prototype, "border", void 0);
@@ -527,6 +530,56 @@ var HighlightSettings = /** @class */ (function (_super) {
527
530
  return HighlightSettings;
528
531
  }(ChildProperty));
529
532
  export { HighlightSettings };
533
+ /**
534
+ * Defines the properties for a single polygon shape to render over the Maps, such as coordinates, fill, border, and opacity.
535
+ */
536
+ var PolygonSetting = /** @class */ (function (_super) {
537
+ __extends(PolygonSetting, _super);
538
+ function PolygonSetting() {
539
+ return _super !== null && _super.apply(this, arguments) || this;
540
+ }
541
+ __decorate([
542
+ Property(1)
543
+ ], PolygonSetting.prototype, "borderWidth", void 0);
544
+ __decorate([
545
+ Property(1)
546
+ ], PolygonSetting.prototype, "borderOpacity", void 0);
547
+ __decorate([
548
+ Property(1)
549
+ ], PolygonSetting.prototype, "opacity", void 0);
550
+ __decorate([
551
+ Property('#FF471A')
552
+ ], PolygonSetting.prototype, "borderColor", void 0);
553
+ __decorate([
554
+ Property('#FF471A')
555
+ ], PolygonSetting.prototype, "fill", void 0);
556
+ __decorate([
557
+ Property([])
558
+ ], PolygonSetting.prototype, "points", void 0);
559
+ return PolygonSetting;
560
+ }(ChildProperty));
561
+ export { PolygonSetting };
562
+ /**
563
+ * Defines the properties of the polygon shapes that will be rendered on a map layer.
564
+ * The selection and highlight settings for polygon shapes can also be defined.
565
+ */
566
+ var PolygonSettings = /** @class */ (function (_super) {
567
+ __extends(PolygonSettings, _super);
568
+ function PolygonSettings() {
569
+ return _super !== null && _super.apply(this, arguments) || this;
570
+ }
571
+ __decorate([
572
+ Collection([], PolygonSetting)
573
+ ], PolygonSettings.prototype, "polygons", void 0);
574
+ __decorate([
575
+ Complex({}, SelectionSettings)
576
+ ], PolygonSettings.prototype, "selectionSettings", void 0);
577
+ __decorate([
578
+ Complex({}, HighlightSettings)
579
+ ], PolygonSettings.prototype, "highlightSettings", void 0);
580
+ return PolygonSettings;
581
+ }(ChildProperty));
582
+ export { PolygonSettings };
530
583
  /**
531
584
  * Gets or sets the options to customize the navigation lines in maps which is used to connect different locations.
532
585
  */
@@ -1150,6 +1203,9 @@ var LayerSettings = /** @class */ (function (_super) {
1150
1203
  __decorate([
1151
1204
  Collection([], NavigationLineSettings)
1152
1205
  ], LayerSettings.prototype, "navigationLineSettings", void 0);
1206
+ __decorate([
1207
+ Complex({}, PolygonSettings)
1208
+ ], LayerSettings.prototype, "polygonSettings", void 0);
1153
1209
  __decorate([
1154
1210
  Complex({}, TooltipSettings)
1155
1211
  ], LayerSettings.prototype, "tooltipSettings", void 0);
@@ -25,10 +25,31 @@ export interface IPrintEventArgs extends IMapsEventArgs {
25
25
  */
26
26
  htmlContent: Element;
27
27
  }
28
+ /**
29
+ * This class contains the minimum and maximum latitude and longitude coordinates of the map's visible area
30
+ */
31
+ export interface IMinMaxLatitudeLongitude {
32
+ /**
33
+ * Gets the minimum latitude value from the visible map area.
34
+ */
35
+ minLatitude: number;
36
+ /**
37
+ * Gets the maximum latitude value from the visible map area.
38
+ */
39
+ maxLatitude: number;
40
+ /**
41
+ * Gets the minimum longitude value from the visible map area.
42
+ */
43
+ minLongitude: number;
44
+ /**
45
+ * Gets the maximum longitude value from the visible map area.
46
+ */
47
+ maxLongitude: number;
48
+ }
28
49
  /**
29
50
  * Specifies the event arguments for the loaded event in maps.
30
51
  */
31
- export interface ILoadedEventArgs extends IMapsEventArgs {
52
+ export interface ILoadedEventArgs extends IMinMaxLatitudeLongitude, IMapsEventArgs {
32
53
  /**
33
54
  * Defines the current maps instance.
34
55
  *
@@ -692,7 +713,7 @@ export interface IAnnotationRenderingEventArgs extends IMapsEventArgs {
692
713
  /**
693
714
  * Specifies the event arguments for the pan event in maps.
694
715
  */
695
- export interface IMapPanEventArgs extends IMapsEventArgs {
716
+ export interface IMapPanEventArgs extends IMinMaxLatitudeLongitude, IMapsEventArgs {
696
717
  /**
697
718
  * Defines the current maps instance.
698
719
  *
@@ -727,7 +748,7 @@ export interface IMapPanEventArgs extends IMapsEventArgs {
727
748
  /**
728
749
  * Specifies the event arguments for zoom event in maps.
729
750
  */
730
- export interface IMapZoomEventArgs extends IMapsEventArgs {
751
+ export interface IMapZoomEventArgs extends IMinMaxLatitudeLongitude, IMapsEventArgs {
731
752
  /**
732
753
  * Defines the current maps instance.
733
754
  *
@@ -56,6 +56,7 @@ var Highlight = /** @class */ (function () {
56
56
  targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
57
57
  targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
58
58
  targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
59
+ targetEle.getAttribute('class') !== 'PolygonselectionMapStyle' &&
59
60
  targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
60
61
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
61
62
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -85,6 +86,11 @@ var Highlight = /** @class */ (function () {
85
86
  data = this.maps.layers[layerIndex].markerSettings[marker].dataSource[dataIndex];
86
87
  this.highlightSettings = this.maps.layers[layerIndex].markerSettings[marker].highlightSettings;
87
88
  }
89
+ else if (targetEle.id.indexOf('_PolygonIndex_') > -1) {
90
+ dataIndex = parseInt(targetEle.id.split('_PolygonIndex_')[1].split('_')[0], 10);
91
+ data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
92
+ this.highlightSettings = this.maps.layers[layerIndex].polygonSettings.highlightSettings;
93
+ }
88
94
  else {
89
95
  var index = parseInt(targetEle.id.split('_NavigationIndex_')[1].split('_')[0], 10);
90
96
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
@@ -71,6 +71,12 @@ var Selection = /** @class */ (function () {
71
71
  this.selectionsettings = this.maps.layers[layerIndex].markerSettings[markerIndex].selectionSettings;
72
72
  this.selectionType = 'Marker';
73
73
  }
74
+ else if (targetElement.id.indexOf('_PolygonIndex_') > -1) {
75
+ dataIndex = parseInt(targetElement.id.split('_PolygonIndex_')[1].split('_')[0], 10);
76
+ data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
77
+ this.selectionsettings = this.maps.layers[layerIndex].polygonSettings.selectionSettings;
78
+ this.selectionType = 'Polygon';
79
+ }
74
80
  else if (targetElement.id.indexOf('NavigationIndex') > -1) {
75
81
  var index = parseInt(targetElement.id.split('_NavigationIndex_')[1].split('_')[0], 10);
76
82
  shapeData = null;
@@ -249,6 +255,10 @@ var Selection = /** @class */ (function () {
249
255
  _this.maps.navigationSelectionClass = getElement(_this.selectionType + 'selectionMap');
250
256
  _this.maps.selectedNavigationElementId.push(targetElement.getAttribute('id'));
251
257
  }
258
+ if (targetElement.getAttribute('class') === 'PolygonselectionMapStyle') {
259
+ _this.maps.polygonSelectionClass = getElement(_this.selectionType + 'selectionMap');
260
+ _this.maps.selectedPolygonElementId.push(targetElement.getAttribute('id'));
261
+ }
252
262
  }
253
263
  }
254
264
  });
@@ -288,6 +298,9 @@ var Selection = /** @class */ (function () {
288
298
  if (this.selectionType === 'navigationline') {
289
299
  this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(targetElement.getAttribute('id')), 1);
290
300
  }
301
+ if (this.selectionType === 'Polygon') {
302
+ this.maps.selectedPolygonElementId.splice(this.maps.selectedPolygonElementId.indexOf(targetElement.getAttribute('id')), 1);
303
+ }
291
304
  };
292
305
  /**
293
306
  * Get module name.
@@ -1,8 +1,7 @@
1
1
  import { tooltipRender } from '../index';
2
2
  import { Tooltip } from '@syncfusion/ej2-svg-base';
3
- import { createElement, Browser, isNullOrUndefined, extend, remove, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
3
+ import { createElement, Browser, isNullOrUndefined, extend, remove } from '@syncfusion/ej2-base';
4
4
  import { getMousePosition, Internalize, checkPropertyPath, getValueFromObject, formatValue, convertStringToValue } from '../utils/helper';
5
- import { click } from '../model/constants';
6
5
  /**
7
6
  * Map Tooltip
8
7
  */
@@ -22,7 +21,6 @@ var MapsTooltip = /** @class */ (function () {
22
21
  var target;
23
22
  var touchArg;
24
23
  var tooltipArgs;
25
- var tooltipTemplateElement;
26
24
  if (e.type.indexOf('touch') !== -1) {
27
25
  this.isTouch = true;
28
26
  touchArg = e;
@@ -173,7 +171,12 @@ var MapsTooltip = /** @class */ (function () {
173
171
  id: this.maps.element.id + '_mapsTooltip',
174
172
  className: 'EJ2-maps-Tooltip'
175
173
  });
176
- tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
174
+ if (isNullOrUndefined(option.template) || option.template === '' || this.maps.tooltipDisplayMode === 'MouseMove') {
175
+ tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
176
+ }
177
+ else {
178
+ tooltipEle.style.position = 'absolute';
179
+ }
177
180
  document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
178
181
  }
179
182
  if (typeof option.template !== 'function' && option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
@@ -217,8 +220,8 @@ var MapsTooltip = /** @class */ (function () {
217
220
  header: '',
218
221
  data: option['data'],
219
222
  template: option['template'],
220
- content: tooltipArgs.content.toString() !== currentData.toString() ? [SanitizeHtmlHelper.sanitize(tooltipArgs.content.toString())] :
221
- [SanitizeHtmlHelper.sanitize(currentData.toString())],
223
+ content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
224
+ [currentData.toString()],
222
225
  shapes: [],
223
226
  location: option['location'],
224
227
  palette: [markerFill],
@@ -235,8 +238,8 @@ var MapsTooltip = /** @class */ (function () {
235
238
  header: '',
236
239
  data: tooltipArgs.options['data'],
237
240
  template: tooltipArgs.options['template'],
238
- content: tooltipArgs.content.toString() !== currentData.toString() ? [SanitizeHtmlHelper.sanitize(tooltipArgs.content.toString())] :
239
- [SanitizeHtmlHelper.sanitize(currentData.toString())],
241
+ content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
242
+ [currentData.toString()],
240
243
  shapes: [],
241
244
  location: tooltipArgs.options['location'],
242
245
  palette: [markerFill],
@@ -255,13 +258,6 @@ var MapsTooltip = /** @class */ (function () {
255
258
  _this.svgTooltip.appendTo(tooltipEle);
256
259
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
257
260
  _this.maps.renderReactTemplates();
258
- tooltipTemplateElement = document.getElementById(_this.maps.element.id + '_mapsTooltip');
259
- if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
260
- && tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
261
- var templateStyle = tooltipTemplateElement.getAttribute('style');
262
- templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
263
- tooltipTemplateElement.style.cssText = templateStyle;
264
- }
265
261
  }
266
262
  else {
267
263
  _this.clearTooltip(e.target);
@@ -283,12 +279,8 @@ var MapsTooltip = /** @class */ (function () {
283
279
  }
284
280
  }
285
281
  else {
286
- tooltipTemplateElement = document.getElementById(this.maps.element.id + '_mapsTooltip');
287
- if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
288
- && tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
289
- this.maps.notify(click, this);
290
- }
291
- else {
282
+ var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
283
+ if (isNullOrUndefined(tooltipElement)) {
292
284
  this.clearTooltip(e.target);
293
285
  }
294
286
  }