@syncfusion/ej2-maps 23.2.7 → 24.1.41

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.2.7
3
+ * version : 24.1.41
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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@23.2.4",
3
+ "_id": "@syncfusion/ej2-maps@16.42.7",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-pP7nlBwjL//N7mrbliAsjf2LVrx7Dr+qkj5mHab9ekMu2UR5OwJ3GkSjL0CfYUqaTPAYjxnVXJlh4I6rMn/ZzQ==",
5
+ "_integrity": "sha512-zvzewbDnn/ObhbtffQT1SYCrRK+TPGpGGqdE8M2TrcHfXvu1l4wnqU0RWEMiLz2T3CX2DsifowLKf+kz8dgNSA==",
6
6
  "_location": "/@syncfusion/ej2-maps",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,10 +23,10 @@
23
23
  "/@syncfusion/ej2-react-maps",
24
24
  "/@syncfusion/ej2-vue-maps"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-23.2.4.tgz",
27
- "_shasum": "84a7b5a26630bc3a334b34466283014291a5283e",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-maps/-/ej2-maps-16.42.7.tgz",
27
+ "_shasum": "96564e376b3d8974f9ff4c1ce1bf9f2bb9414d77",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
- "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
29
+ "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~23.2.6",
39
- "@syncfusion/ej2-buttons": "~23.2.7",
40
- "@syncfusion/ej2-compression": "~23.2.4",
41
- "@syncfusion/ej2-data": "~23.2.4",
42
- "@syncfusion/ej2-file-utils": "~23.2.4",
43
- "@syncfusion/ej2-pdf-export": "~23.2.6",
44
- "@syncfusion/ej2-svg-base": "~23.2.5"
38
+ "@syncfusion/ej2-base": "~24.1.41",
39
+ "@syncfusion/ej2-buttons": "~24.1.41",
40
+ "@syncfusion/ej2-compression": "~24.1.41",
41
+ "@syncfusion/ej2-data": "~24.1.41",
42
+ "@syncfusion/ej2-file-utils": "~24.1.41",
43
+ "@syncfusion/ej2-pdf-export": "~24.1.41",
44
+ "@syncfusion/ej2-svg-base": "~24.1.41"
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",
@@ -93,6 +93,6 @@
93
93
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
94
94
  },
95
95
  "typings": "index.d.ts",
96
- "version": "23.2.7",
96
+ "version": "24.1.41",
97
97
  "sideEffects": false
98
98
  }
package/src/global.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import * as index from './index';
2
- index.Maps.Inject(index.Bubble, index.Legend, index.Marker, index.Highlight, index.Selection, index.MapsTooltip, index.Zoom, index.DataLabel, index.NavigationLine, index.Annotations, index.Print, index.PdfExport, index.ImageExport);
2
+ index.Maps.Inject(index.Bubble, index.Legend, index.Marker, index.Highlight, index.Selection, index.MapsTooltip, index.Zoom, index.DataLabel, index.NavigationLine, index.Annotations, index.Print, index.PdfExport, index.ImageExport, index.Polygon);
3
3
  export * from './index';
@@ -13,6 +13,7 @@ export * from './layers/layer-panel';
13
13
  export * from './layers/bubble';
14
14
  export * from './layers/bing-map';
15
15
  export * from './layers/marker';
16
+ export * from './layers/polygon';
16
17
  export * from './layers/color-mapping';
17
18
  export * from './layers/data-label';
18
19
  export * from './layers/navigation-selected-line';
package/src/maps/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './layers/layer-panel';
9
9
  export * from './layers/bubble';
10
10
  export * from './layers/bing-map';
11
11
  export * from './layers/marker';
12
+ export * from './layers/polygon';
12
13
  export * from './layers/color-mapping';
13
14
  export * from './layers/data-label';
14
15
  export * from './layers/navigation-selected-line';
@@ -196,6 +196,12 @@ var LayerPanel = /** @class */ (function () {
196
196
  && panel.mapObject.previousZoomFactor !== panel.mapObject.zoomSettings.zoomFactor) {
197
197
  panel.mapObject.previousZoomFactor = panel.mapObject.zoomSettings.zoomFactor;
198
198
  }
199
+ if (panel.mapObject.polygonModule) {
200
+ var polygonElement = panel.mapObject.polygonModule.polygonRender(this.mapObject, layerIndex, panel.mapObject.tileZoomLevel);
201
+ if (!isNullOrUndefined(polygonElement)) {
202
+ panel.layerObject.appendChild(polygonElement);
203
+ }
204
+ }
199
205
  if (panel.mapObject.navigationLineModule) {
200
206
  var navigationLineElement = panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex);
201
207
  if (!isNullOrUndefined(navigationLineElement)) {
@@ -664,6 +670,9 @@ var LayerPanel = /** @class */ (function () {
664
670
  layerIndex, colors, renderData, labelTemplateEle) {
665
671
  var _this = this;
666
672
  var bubbleG;
673
+ if (this.mapObject.polygonModule) {
674
+ this.groupElements.push(this.mapObject.polygonModule.polygonRender(this.mapObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor) : this.currentFactor)));
675
+ }
667
676
  if (this.currentLayer.bubbleSettings.length && this.mapObject.bubbleModule) {
668
677
  var length_1 = this.currentLayer.bubbleSettings.length;
669
678
  var bubble_1;
@@ -1019,9 +1028,11 @@ var LayerPanel = /** @class */ (function () {
1019
1028
  (!(childNode.id.indexOf('_bubble_Group') > -1)) &&
1020
1029
  (!(childNode.id.indexOf('_dataLableIndex_Group') > -1)) &&
1021
1030
  (!(childNode.id.indexOf('_line_Group') > -1))) {
1022
- var transform = 'scale( ' + this.mapObject.scale + ' ) ' + 'translate( ' + this.mapObject.translatePoint.x
1023
- + ' ' + this.mapObject.translatePoint.y + ' ) ';
1024
- childNode.setAttribute('transform', transform);
1031
+ if (childNode.id.indexOf('_Polygons_Group') === -1) {
1032
+ var transform = 'scale( ' + this.mapObject.scale + ' ) ' + 'translate( ' + this.mapObject.translatePoint.x
1033
+ + ' ' + this.mapObject.translatePoint.y + ' ) ';
1034
+ childNode.setAttribute('transform', transform);
1035
+ }
1025
1036
  }
1026
1037
  }
1027
1038
  }
@@ -1797,7 +1797,7 @@ var Legend = /** @class */ (function () {
1797
1797
  var legendToggleBorderWidth = this.maps.legendSettings.toggleLegendSettings.border.width;
1798
1798
  var legendToggleBorderOpacity = isNullOrUndefined(this.maps.legendSettings.toggleLegendSettings.border.opacity) ?
1799
1799
  this.maps.legendSettings.toggleLegendSettings.opacity : this.maps.legendSettings.toggleLegendSettings.border.opacity;
1800
- if (targetEle.parentNode['id'].indexOf(this.maps.element.id + '_Legend_Index_') > -1) {
1800
+ if (!isNullOrUndefined(targetEle.parentNode) && targetEle.parentNode['id'].indexOf(this.maps.element.id + '_Legend_Index_') > -1) {
1801
1801
  var mapElement = void 0;
1802
1802
  var legendIndex = parseFloat(targetEle.parentElement.id.substr((this.maps.element.id + '_Legend_Index_').length));
1803
1803
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -181,25 +181,27 @@ var Marker = /** @class */ (function () {
181
181
  !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
182
182
  var longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
183
183
  !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
184
- minLong_1 = isNullOrUndefined(minLong_1) && dataIndex === 0 ?
185
- longitude : minLong_1;
186
- maxLat_1 = isNullOrUndefined(maxLat_1) && dataIndex === 0 ?
187
- latitude : maxLat_1;
188
- minLat_1 = isNullOrUndefined(minLat_1) && dataIndex === 0 ?
189
- latitude : minLat_1;
190
- maxLong_1 = isNullOrUndefined(maxLong_1) && dataIndex === 0 ?
191
- longitude : maxLong_1;
192
- if (minLong_1 > longitude) {
193
- minLong_1 = longitude;
194
- }
195
- if (minLat_1 > latitude) {
196
- minLat_1 = latitude;
197
- }
198
- if (maxLong_1 < longitude) {
199
- maxLong_1 = longitude;
200
- }
201
- if (maxLat_1 < latitude) {
202
- maxLat_1 = latitude;
184
+ if (!isNullOrUndefined(latitude) && !isNullOrUndefined(longitude)) {
185
+ minLong_1 = isNullOrUndefined(minLong_1) && dataIndex === 0 ?
186
+ longitude : minLong_1;
187
+ maxLat_1 = isNullOrUndefined(maxLat_1) && dataIndex === 0 ?
188
+ latitude : maxLat_1;
189
+ minLat_1 = isNullOrUndefined(minLat_1) && dataIndex === 0 ?
190
+ latitude : minLat_1;
191
+ maxLong_1 = isNullOrUndefined(maxLong_1) && dataIndex === 0 ?
192
+ longitude : maxLong_1;
193
+ if (minLong_1 > longitude) {
194
+ minLong_1 = longitude;
195
+ }
196
+ if (minLat_1 > latitude) {
197
+ minLat_1 = latitude;
198
+ }
199
+ if (maxLong_1 < longitude) {
200
+ maxLong_1 = longitude;
201
+ }
202
+ if (maxLat_1 < latitude) {
203
+ maxLat_1 = latitude;
204
+ }
203
205
  }
204
206
  });
205
207
  });
@@ -0,0 +1,31 @@
1
+ import { Maps } from '../../index';
2
+ /**
3
+ * When injected, this module will be used to render polygon shapes over the Maps.
4
+ */
5
+ export declare class Polygon {
6
+ private maps;
7
+ constructor(maps: Maps);
8
+ /**
9
+ * To render polygon for maps
10
+ *
11
+ * @param {Maps} maps - Specifies the layer instance to which the polygon is to be rendered.
12
+ * @param {number} layerIndex -Specifies the index of current layer.
13
+ * @param {number} factor - Specifies the current zoom factor of the Maps.
14
+ * @returns {Element} - Returns the polygon element.
15
+ * @private
16
+ */
17
+ polygonRender(maps: Maps, layerIndex: number, factor: number): Element;
18
+ /**
19
+ * Get module name.
20
+ *
21
+ * @returns {string} - Returns the module name
22
+ */
23
+ protected getModuleName(): string;
24
+ /**
25
+ * To destroy the layers.
26
+ *
27
+ * @returns {void}
28
+ * @private
29
+ */
30
+ destroy(): void;
31
+ }
@@ -0,0 +1,58 @@
1
+ import { PathOption, calculatePolygonPath, maintainSelection } from '../utils/helper';
2
+ /**
3
+ * When injected, this module will be used to render polygon shapes over the Maps.
4
+ */
5
+ var Polygon = /** @class */ (function () {
6
+ function Polygon(maps) {
7
+ this.maps = maps;
8
+ }
9
+ /**
10
+ * To render polygon for maps
11
+ *
12
+ * @param {Maps} maps - Specifies the layer instance to which the polygon is to be rendered.
13
+ * @param {number} layerIndex -Specifies the index of current layer.
14
+ * @param {number} factor - Specifies the current zoom factor of the Maps.
15
+ * @returns {Element} - Returns the polygon element.
16
+ * @private
17
+ */
18
+ Polygon.prototype.polygonRender = function (maps, layerIndex, factor) {
19
+ var _this = this;
20
+ var currentLayer = maps.layersCollection[layerIndex];
21
+ var polygonsSVGObject = maps.renderer.createGroup({
22
+ id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group'
23
+ });
24
+ currentLayer.polygonSettings.polygons.map(function (polygonSetting, polygonIndex) {
25
+ var polygonSVGObject = maps.renderer.createGroup({
26
+ id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group_' + polygonIndex
27
+ });
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ var polygonData = polygonSetting.points;
30
+ var path = calculatePolygonPath(maps, factor, currentLayer, polygonData);
31
+ var pathOptions = new PathOption(maps.element.id + '_LayerIndex_' + layerIndex + '_PolygonIndex_' + polygonIndex, polygonSetting.fill, (polygonSetting.borderWidth / factor), polygonSetting.borderColor, polygonSetting.opacity, polygonSetting.borderOpacity, '', path);
32
+ var polygonEle = maps.renderer.drawPath(pathOptions);
33
+ maintainSelection(_this.maps.selectedPolygonElementId, _this.maps.polygonSelectionClass, polygonEle, 'PolygonselectionMapStyle');
34
+ polygonSVGObject.appendChild(polygonEle);
35
+ polygonsSVGObject.appendChild(polygonSVGObject);
36
+ });
37
+ return polygonsSVGObject;
38
+ };
39
+ /**
40
+ * Get module name.
41
+ *
42
+ * @returns {string} - Returns the module name
43
+ */
44
+ Polygon.prototype.getModuleName = function () {
45
+ return 'Polygon';
46
+ };
47
+ /**
48
+ * To destroy the layers.
49
+ *
50
+ * @returns {void}
51
+ * @private
52
+ */
53
+ Polygon.prototype.destroy = function () {
54
+ this.maps = null;
55
+ };
56
+ return Polygon;
57
+ }());
58
+ export { Polygon };
@@ -1,4 +1,4 @@
1
- import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Fetch } from '@syncfusion/ej2-base';import { EventHandler, Browser, EmitType, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';import { ModuleDeclaration } from '@syncfusion/ej2-base';import { SvgRenderer } from '@syncfusion/ej2-svg-base';import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition, calculateSize } from './utils/helper';import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle, querySelector } from './utils/helper';import { createStyle } from './utils/helper';import { ZoomSettings, LegendSettings } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel } from './model/base-model';import { MarkerSettingsModel, SelectionSettingsModel, InitialMarkerSelectionSettingsModel } from './model/base-model';import { TitleSettingsModel, BorderModel, MarginModel, CenterPositionModel, InitialShapeSelectionSettingsModel } from './model/base-model';import { MapsAreaSettingsModel, AnnotationModel } from './model/base-model';import { Bubble } from './layers/bubble';import { Legend } from './layers/legend';import { Marker } from './layers/marker';import { Highlight } from './user-interaction/highlight';import { Selection } from './user-interaction/selection';import { MapsTooltip } from './user-interaction/tooltip';import { Zoom } from './user-interaction/zoom';import { load, click, onclick, rightClick, loaded, doubleClick, resize, shapeSelected, itemSelection, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle, Theme } from './model/theme';import { ILoadEventArgs, ILoadedEventArgs, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';import { GeoPosition, ITooltipRenderCompleteEventArgs, ILegendRenderingEventArgs } from './model/interface';import { ILayerRenderingEventArgs, IShapeRenderingEventArgs, IMarkerRenderingEventArgs, IMarkerClickEventArgs } from './model/interface';import { IMarkerMoveEventArgs, ILabelRenderingEventArgs, IBubbleMoveEventArgs, IBubbleClickEventArgs } from './model/interface';import { IMarkerClusterClickEventArgs, IMarkerClusterMoveEventArgs, IMarkerClusterRenderingEventArgs } from './model/interface';import { ISelectionEventArgs, IShapeSelectedEventArgs, IMapPanEventArgs, IMapZoomEventArgs } from './model/interface';import { IBubbleRenderingEventArgs, IAnimationCompleteEventArgs, IPrintEventArgs, IThemeStyle } from './model/interface';import { LayerPanel } from './layers/layer-panel';import { GeoLocation, Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, calculateZoomLevel, convertTileLatLongToPoint, convertGeoToPoint} from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs, IMarkerDragEventArgs } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';import { DataManager, Query } from '@syncfusion/ej2-data';import { ExportType } from '../maps/utils/enum';import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';import { Print } from './model/print';import { PdfExport } from './model/export-pdf';import { ImageExport } from './model/export-image';
1
+ import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Fetch } from '@syncfusion/ej2-base';import { EventHandler, Browser, EmitType, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';import { ModuleDeclaration } from '@syncfusion/ej2-base';import { SvgRenderer } from '@syncfusion/ej2-svg-base';import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition, calculateSize } from './utils/helper';import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle, querySelector } from './utils/helper';import { createStyle } from './utils/helper';import { ZoomSettings, LegendSettings } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel, PolygonSettingsModel } from './model/base-model';import { MarkerSettingsModel, SelectionSettingsModel, InitialMarkerSelectionSettingsModel } from './model/base-model';import { TitleSettingsModel, BorderModel, MarginModel, CenterPositionModel, InitialShapeSelectionSettingsModel } from './model/base-model';import { MapsAreaSettingsModel, AnnotationModel } from './model/base-model';import { Bubble } from './layers/bubble';import { Legend } from './layers/legend';import { Marker } from './layers/marker';import { Highlight } from './user-interaction/highlight';import { Selection } from './user-interaction/selection';import { MapsTooltip } from './user-interaction/tooltip';import { Zoom } from './user-interaction/zoom';import { load, click, onclick, rightClick, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle, Theme } from './model/theme';import { ILoadEventArgs, ILoadedEventArgs, IMinMaxLatitudeLongitude, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';import { GeoPosition, ITooltipRenderCompleteEventArgs, ILegendRenderingEventArgs } from './model/interface';import { ILayerRenderingEventArgs, IShapeRenderingEventArgs, IMarkerRenderingEventArgs, IMarkerClickEventArgs } from './model/interface';import { IMarkerMoveEventArgs, ILabelRenderingEventArgs, IBubbleMoveEventArgs, IBubbleClickEventArgs } from './model/interface';import { IMarkerClusterClickEventArgs, IMarkerClusterMoveEventArgs, IMarkerClusterRenderingEventArgs } from './model/interface';import { ISelectionEventArgs, IShapeSelectedEventArgs, IMapPanEventArgs, IMapZoomEventArgs } from './model/interface';import { IBubbleRenderingEventArgs, IAnimationCompleteEventArgs, IPrintEventArgs, IThemeStyle } from './model/interface';import { LayerPanel } from './layers/layer-panel';import { GeoLocation, Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, calculateZoomLevel, convertTileLatLongToPoint, convertGeoToPoint} from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs, IMarkerDragEventArgs } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';import { Polygon } from './layers/polygon';import { DataManager, Query } from '@syncfusion/ej2-data';import { ExportType } from '../maps/utils/enum';import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';import { Print } from './model/print';import { PdfExport } from './model/export-pdf';import { ImageExport } from './model/export-image';
2
2
  import {ComponentModel} from '@syncfusion/ej2-base';
3
3
 
4
4
  /**
@@ -21,7 +21,7 @@ import { MapsTooltip } from './user-interaction/tooltip';
21
21
  import { Zoom } from './user-interaction/zoom';
22
22
  import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';
23
23
  import { MapsModel } from './maps-model';
24
- import { ILoadEventArgs, ILoadedEventArgs, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';
24
+ import { ILoadEventArgs, ILoadedEventArgs, IMinMaxLatitudeLongitude, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';
25
25
  import { GeoPosition, ITooltipRenderCompleteEventArgs, ILegendRenderingEventArgs } from './model/interface';
26
26
  import { ILayerRenderingEventArgs, IShapeRenderingEventArgs, IMarkerRenderingEventArgs, IMarkerClickEventArgs } from './model/interface';
27
27
  import { IMarkerMoveEventArgs, ILabelRenderingEventArgs, IBubbleMoveEventArgs, IBubbleClickEventArgs } from './model/interface';
@@ -33,6 +33,7 @@ import { GeoLocation, Rect } from '../maps/utils/helper';
33
33
  import { Annotations } from '../maps/user-interaction/annotation';
34
34
  import { DataLabel, IAnnotationRenderingEventArgs, IMarkerDragEventArgs } from './index';
35
35
  import { NavigationLine } from './layers/navigation-selected-line';
36
+ import { Polygon } from './layers/polygon';
36
37
  import { ExportType } from '../maps/utils/enum';
37
38
  import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';
38
39
  import { Print } from './model/print';
@@ -80,6 +81,12 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
80
81
  * @private
81
82
  */
82
83
  navigationLineModule: NavigationLine;
84
+ /**
85
+ * Gets or sets the module to add the polygon shapes over the maps.
86
+ *
87
+ * @private
88
+ */
89
+ polygonModule: Polygon;
83
90
  /**
84
91
  * Gets or sets the module to add the legend in maps.
85
92
  *
@@ -674,6 +681,10 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
674
681
  /** @private */
675
682
  selectedNavigationElementId: string[];
676
683
  /** @private */
684
+ polygonSelectionClass: Element;
685
+ /** @private */
686
+ selectedPolygonElementId: string[];
687
+ /** @private */
677
688
  legendSelectionClass: SelectionSettingsModel;
678
689
  /** @private */
679
690
  selectedLegendElementId: number[];
@@ -700,6 +711,8 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
700
711
  /** @private */
701
712
  previousTileWidth: number;
702
713
  /** @private */
714
+ isMarkerZoomCompleted: boolean;
715
+ /** @private */
703
716
  markerDragId: string;
704
717
  /** @private */
705
718
  previousTileHeight: number;
@@ -767,6 +780,7 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
767
780
  */
768
781
  processResponseJsonData(processType: string, data?: any | string, layer?: LayerSettings, dataType?: string): void;
769
782
  private renderMap;
783
+ private triggerZoomEvent;
770
784
  /**
771
785
  * To apply color to the initial selected marker
772
786
  *
@@ -805,6 +819,10 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
805
819
  private setSecondaryElementPosition;
806
820
  private zoomingChange;
807
821
  private createSecondaryElement;
822
+ /**
823
+ * @returns {void}
824
+ */
825
+ getMinMaxLatitudeLongitude(): IMinMaxLatitudeLongitude;
808
826
  /**
809
827
  * @returns {void}
810
828
  * @private
@@ -1083,6 +1101,12 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
1083
1101
  * @returns {boolean} - Returns whether the navigation lines are visible or not.
1084
1102
  */
1085
1103
  private isNavigationVisible;
1104
+ /**
1105
+ * To find navigation line visibility
1106
+ *
1107
+ * @returns {boolean} - Returns whether the navigation lines are visible or not.
1108
+ */
1109
+ private isPolygonVisible;
1086
1110
  /**
1087
1111
  * To find marker visibility
1088
1112
  */
package/src/maps/maps.js CHANGED
@@ -29,8 +29,7 @@ import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, merge
29
29
  import { createStyle } from './utils/helper';
30
30
  import { ZoomSettings, LegendSettings } from './model/base';
31
31
  import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';
32
- import { Marker } from './layers/marker';
33
- import { load, click, onclick, rightClick, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
32
+ import { load, click, onclick, rightClick, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
34
33
  import { getThemeStyle, Theme } from './model/theme';
35
34
  import { LayerPanel } from './layers/layer-panel';
36
35
  import { Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';
@@ -120,6 +119,8 @@ var Maps = /** @class */ (function (_super) {
120
119
  /** @private */
121
120
  _this.selectedNavigationElementId = [];
122
121
  /** @private */
122
+ _this.selectedPolygonElementId = [];
123
+ /** @private */
123
124
  _this.selectedLegendElementId = [];
124
125
  /** @private */
125
126
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -137,6 +138,8 @@ var Maps = /** @class */ (function (_super) {
137
138
  /** @private */
138
139
  _this.initialTileTranslate = new Point(0, 0);
139
140
  /** @private */
141
+ _this.isMarkerZoomCompleted = false;
142
+ /** @private */
140
143
  _this.markerDragId = '';
141
144
  /** @private */
142
145
  _this.initialCheck = true;
@@ -503,10 +506,20 @@ var Maps = /** @class */ (function (_super) {
503
506
  this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.mapScaleValue, this.element.id + '_Zooming_');
504
507
  }
505
508
  if (!this.isZoomByPosition && !this.zoomNotApplied) {
506
- this.trigger(loaded, { maps: this, isResized: this.isResize });
509
+ this.triggerZoomEvent();
507
510
  }
508
511
  this.isResize = false;
509
512
  };
513
+ Maps.prototype.triggerZoomEvent = function () {
514
+ var loadedArgs;
515
+ var minMaxLatitudeLongitude = this.getMinMaxLatitudeLongitude();
516
+ loadedArgs = {
517
+ maps: this, isResized: this.isResize, minLatitude: minMaxLatitudeLongitude.minLatitude,
518
+ maxLatitude: minMaxLatitudeLongitude.maxLatitude, minLongitude: minMaxLatitudeLongitude.minLongitude,
519
+ maxLongitude: minMaxLatitudeLongitude.maxLongitude, cancel: false, name: 'Loaded'
520
+ };
521
+ this.trigger('loaded', loadedArgs);
522
+ };
510
523
  /**
511
524
  * To apply color to the initial selected marker
512
525
  *
@@ -678,6 +691,20 @@ var Maps = /** @class */ (function (_super) {
678
691
  this.element.appendChild(secondaryElement);
679
692
  }
680
693
  };
694
+ /**
695
+ * @returns {void}
696
+ */
697
+ Maps.prototype.getMinMaxLatitudeLongitude = function () {
698
+ var element = document.getElementById(this.element.id).getBoundingClientRect();
699
+ var minPosition = this.isTileMap ? this.pointToLatLong((this.mapAreaRect.x - this.margin.left), -this.mapAreaRect.y) : this.getGeoLocation(0, (this.mapAreaRect.x + element.left), this.mapAreaRect.y);
700
+ var maxPosition = this.isTileMap ? this.pointToLatLong(this.mapAreaRect.width, (this.mapAreaRect.height - this.mapAreaRect.y)) :
701
+ this.getGeoLocation(0, (this.mapAreaRect.x + element.left + this.mapAreaRect.width), (this.mapAreaRect.y + this.mapAreaRect.height));
702
+ var MinMaxLatitudeLongitude = {
703
+ minLatitude: minPosition.latitude, maxLatitude: maxPosition.latitude, minLongitude: minPosition.longitude,
704
+ maxLongitude: maxPosition.longitude
705
+ };
706
+ return MinMaxLatitudeLongitude;
707
+ };
681
708
  /**
682
709
  * @returns {void}
683
710
  * @private
@@ -1605,7 +1632,7 @@ var Maps = /** @class */ (function (_super) {
1605
1632
  */
1606
1633
  Maps.prototype.zoomByPosition = function (centerPosition, zoomFactor) {
1607
1634
  if (!this.isDestroyed) {
1608
- this.zoomNotApplied = false;
1635
+ this.zoomNotApplied = this.isMarkerZoomCompleted = false;
1609
1636
  var isRefresh = this.zoomSettings.zoomFactor === zoomFactor;
1610
1637
  this.previousProjection = null;
1611
1638
  if (!this.isTileMap && this.zoomModule) {
@@ -1702,15 +1729,14 @@ var Maps = /** @class */ (function (_super) {
1702
1729
  * @returns {void}
1703
1730
  */
1704
1731
  Maps.prototype.addMarker = function (layerIndex, markerCollection) {
1705
- if (!this.isDestroyed) {
1732
+ if (!this.isDestroyed && !isNullOrUndefined(this.markerModule)) {
1706
1733
  var layerEle = document.getElementById(this.element.id + '_LayerIndex_' + layerIndex);
1707
1734
  if (markerCollection.length > 0 && layerEle) {
1708
1735
  for (var _i = 0, markerCollection_1 = markerCollection; _i < markerCollection_1.length; _i++) {
1709
1736
  var newMarker = markerCollection_1[_i];
1710
1737
  this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
1711
1738
  }
1712
- var markerModule = new Marker(this);
1713
- markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
1739
+ this.markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
1714
1740
  this.arrangeTemplate();
1715
1741
  }
1716
1742
  }
@@ -1836,6 +1862,7 @@ var Maps = /** @class */ (function (_super) {
1836
1862
  Maps.prototype.zoomToCoordinates = function (minLatitude, minLongitude, maxLatitude, maxLongitude) {
1837
1863
  var _a, _b;
1838
1864
  if (!this.isDestroyed) {
1865
+ this.isMarkerZoomCompleted = false;
1839
1866
  var centerLatitude = void 0;
1840
1867
  var centerLongtitude = void 0;
1841
1868
  var isTwoCoordinates = false;
@@ -1874,12 +1901,15 @@ var Maps = /** @class */ (function (_super) {
1874
1901
  this.maxLongOfGivenLocation = maxLongitude;
1875
1902
  this.zoomNotApplied = true;
1876
1903
  this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this, true);
1904
+ var minMaxLatitudeLongitude = this.getMinMaxLatitudeLongitude();
1877
1905
  var zoomArgs = {
1878
1906
  cancel: false, name: 'zoom', type: zoomIn, maps: this,
1879
1907
  tileTranslatePoint: {}, translatePoint: {},
1880
1908
  tileZoomLevel: this.isTileMap ? { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation } : {},
1881
1909
  scale: !this.isTileMap ? { previous: this.scale, current: this.scaleOfGivenLocation } :
1882
- { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation }
1910
+ { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation },
1911
+ minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
1912
+ minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
1883
1913
  };
1884
1914
  this.trigger('zoom', zoomArgs);
1885
1915
  this.refresh();
@@ -2051,6 +2081,9 @@ var Maps = /** @class */ (function (_super) {
2051
2081
  }
2052
2082
  else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
2053
2083
  this.zoomSettings.zoomFactor = 1;
2084
+ this.previousProjection = null;
2085
+ this.scale = this.isMarkerZoomCompleted ? null : this.scale;
2086
+ this.isMarkerZoomCompleted = !newProp.zoomSettings.shouldZoomInitially;
2054
2087
  render = true;
2055
2088
  }
2056
2089
  else if (newProp.zoomSettings.enable !== oldProp.zoomSettings.enable) {
@@ -2149,6 +2182,12 @@ var Maps = /** @class */ (function (_super) {
2149
2182
  args: [this]
2150
2183
  });
2151
2184
  }
2185
+ if (this.isPolygonVisible()) {
2186
+ modules.push({
2187
+ member: 'Polygon',
2188
+ args: [this]
2189
+ });
2190
+ }
2152
2191
  if (isVisible.tooltip) {
2153
2192
  modules.push({
2154
2193
  member: 'MapsTooltip',
@@ -2230,6 +2269,23 @@ var Maps = /** @class */ (function (_super) {
2230
2269
  });
2231
2270
  return isVisible;
2232
2271
  };
2272
+ /**
2273
+ * To find navigation line visibility
2274
+ *
2275
+ * @returns {boolean} - Returns whether the navigation lines are visible or not.
2276
+ */
2277
+ Maps.prototype.isPolygonVisible = function () {
2278
+ var isVisible = false;
2279
+ Array.prototype.forEach.call(this.layers, function (layer) {
2280
+ for (var i = 0; i < layer.polygonSettings.polygons.length; i++) {
2281
+ if (layer.polygonSettings.polygons.length > 0) {
2282
+ isVisible = true;
2283
+ break;
2284
+ }
2285
+ }
2286
+ });
2287
+ return isVisible;
2288
+ };
2233
2289
  /**
2234
2290
  * To find marker visibility
2235
2291
  */
@@ -2343,14 +2399,15 @@ var Maps = /** @class */ (function (_super) {
2343
2399
  if (isHighlight === void 0) { isHighlight = false; }
2344
2400
  var bubbles;
2345
2401
  var markers;
2346
- var navigationLine;
2402
+ var polygonSetting;
2347
2403
  for (var _i = 0, layers_1 = layers; _i < layers_1.length; _i++) {
2348
2404
  var layer = layers_1[_i];
2349
2405
  isLayerVisible = layer.visible || isLayerVisible;
2350
2406
  if (layer.visible) {
2351
2407
  bubbles = layer.bubbleSettings;
2352
2408
  markers = layer.markerSettings;
2353
- navigationLine = layer.navigationLineSettings;
2409
+ polygonSetting = layer.polygonSettings;
2410
+ var navigationLine = layer.navigationLineSettings;
2354
2411
  for (var _a = 0, navigationLine_1 = navigationLine; _a < navigationLine_1.length; _a++) {
2355
2412
  var navigation = navigationLine_1[_a];
2356
2413
  if (navigation.visible) {
@@ -2358,8 +2415,15 @@ var Maps = /** @class */ (function (_super) {
2358
2415
  isHighlight = (!isNullOrUndefined(navigation.selectionSettings) && navigation.selectionSettings.enable) || isHighlight;
2359
2416
  }
2360
2417
  }
2361
- for (var _b = 0, markers_1 = markers; _b < markers_1.length; _b++) {
2362
- var marker = markers_1[_b];
2418
+ for (var _b = 0, _c = polygonSetting.polygons; _b < _c.length; _b++) {
2419
+ var polygon = _c[_b];
2420
+ if (polygon.points.length > 0) {
2421
+ isSelection = layer.polygonSettings.highlightSettings.enable || isSelection;
2422
+ isHighlight = layer.polygonSettings.selectionSettings.enable || isHighlight;
2423
+ }
2424
+ }
2425
+ for (var _d = 0, markers_1 = markers; _d < markers_1.length; _d++) {
2426
+ var marker = markers_1[_d];
2363
2427
  if (marker.visible) {
2364
2428
  istooltipVisible = marker.tooltipSettings.visible || istooltipVisible;
2365
2429
  isSelection = marker.selectionSettings.enable || isSelection;
@@ -2369,8 +2433,8 @@ var Maps = /** @class */ (function (_super) {
2369
2433
  break;
2370
2434
  }
2371
2435
  }
2372
- for (var _c = 0, bubbles_1 = bubbles; _c < bubbles_1.length; _c++) {
2373
- var bubble = bubbles_1[_c];
2436
+ for (var _e = 0, bubbles_1 = bubbles; _e < bubbles_1.length; _e++) {
2437
+ var bubble = bubbles_1[_e];
2374
2438
  if (bubble.visible) {
2375
2439
  istooltipVisible = bubble.tooltipSettings.visible || istooltipVisible;
2376
2440
  isSelection = bubble.selectionSettings.enable || isSelection;
@@ -2454,7 +2518,7 @@ var Maps = /** @class */ (function (_super) {
2454
2518
  Maps.prototype.pointToLatLong = function (pageX, pageY) {
2455
2519
  var latitude = 0;
2456
2520
  var longitude = 0;
2457
- if (!this.isDestroyed) {
2521
+ if (!this.isDestroyed && !isNullOrUndefined(this.translatePoint)) {
2458
2522
  var padding = this.layers[this.layers.length - 1].layerType === 'GoogleStaticMap' ? 0 : 10;
2459
2523
  pageY = pageY + padding;
2460
2524
  var mapSize = 256 * Math.pow(2, this.tileZoomLevel);