@syncfusion/ej2-maps 31.1.17 → 31.2.12
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.
- package/README.md +11 -2
- package/dist/ej2-maps.min.js +3 -3
- package/dist/ej2-maps.umd.min.js +3 -3
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +84 -53
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +87 -56
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +3 -3
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +18 -53
- package/src/maps/layers/layer-panel.js +86 -55
- package/dist/ts/index.d.ts +0 -4
- package/dist/ts/index.ts +0 -4
- package/dist/ts/maps/index.d.ts +0 -28
- package/dist/ts/maps/index.ts +0 -28
- package/dist/ts/maps/layers/bing-map.d.ts +0 -21
- package/dist/ts/maps/layers/bing-map.ts +0 -51
- package/dist/ts/maps/layers/bubble.d.ts +0 -77
- package/dist/ts/maps/layers/bubble.ts +0 -304
- package/dist/ts/maps/layers/color-mapping.d.ts +0 -36
- package/dist/ts/maps/layers/color-mapping.ts +0 -230
- package/dist/ts/maps/layers/data-label.d.ts +0 -45
- package/dist/ts/maps/layers/data-label.ts +0 -457
- package/dist/ts/maps/layers/layer-panel.d.ts +0 -144
- package/dist/ts/maps/layers/layer-panel.ts +0 -1455
- package/dist/ts/maps/layers/legend.d.ts +0 -173
- package/dist/ts/maps/layers/legend.ts +0 -2465
- package/dist/ts/maps/layers/marker.d.ts +0 -105
- package/dist/ts/maps/layers/marker.ts +0 -632
- package/dist/ts/maps/layers/navigation-selected-line.d.ts +0 -33
- package/dist/ts/maps/layers/navigation-selected-line.ts +0 -171
- package/dist/ts/maps/layers/polygon.d.ts +0 -30
- package/dist/ts/maps/layers/polygon.ts +0 -68
- package/dist/ts/maps/maps-model.d.ts +0 -409
- package/dist/ts/maps/maps.d.ts +0 -1247
- package/dist/ts/maps/maps.ts +0 -3416
- package/dist/ts/maps/model/base-model.d.ts +0 -2107
- package/dist/ts/maps/model/base.d.ts +0 -1840
- package/dist/ts/maps/model/base.ts +0 -2257
- package/dist/ts/maps/model/constants.d.ts +0 -225
- package/dist/ts/maps/model/constants.ts +0 -226
- package/dist/ts/maps/model/export-image.d.ts +0 -39
- package/dist/ts/maps/model/export-image.ts +0 -194
- package/dist/ts/maps/model/export-pdf.d.ts +0 -40
- package/dist/ts/maps/model/export-pdf.ts +0 -183
- package/dist/ts/maps/model/interface.d.ts +0 -892
- package/dist/ts/maps/model/interface.ts +0 -929
- package/dist/ts/maps/model/print.d.ts +0 -45
- package/dist/ts/maps/model/print.ts +0 -125
- package/dist/ts/maps/model/theme.d.ts +0 -98
- package/dist/ts/maps/model/theme.ts +0 -919
- package/dist/ts/maps/user-interaction/annotation.d.ts +0 -27
- package/dist/ts/maps/user-interaction/annotation.ts +0 -133
- package/dist/ts/maps/user-interaction/highlight.d.ts +0 -63
- package/dist/ts/maps/user-interaction/highlight.ts +0 -272
- package/dist/ts/maps/user-interaction/selection.d.ts +0 -85
- package/dist/ts/maps/user-interaction/selection.ts +0 -342
- package/dist/ts/maps/user-interaction/tooltip.d.ts +0 -78
- package/dist/ts/maps/user-interaction/tooltip.ts +0 -500
- package/dist/ts/maps/user-interaction/zoom.d.ts +0 -334
- package/dist/ts/maps/user-interaction/zoom.ts +0 -2523
- package/dist/ts/maps/utils/enum.d.ts +0 -328
- package/dist/ts/maps/utils/enum.ts +0 -343
- package/dist/ts/maps/utils/helper.d.ts +0 -1318
- package/dist/ts/maps/utils/helper.ts +0 -3811
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { Maps } from '../../index';
|
|
2
|
-
import { LayerSettings, convertTileLatLongToPoint } from '../index';
|
|
3
|
-
import { convertGeoToPoint, Point, PathOption, maintainSelection } from '../utils/helper';
|
|
4
|
-
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
5
|
-
/**
|
|
6
|
-
* navigation-selected-line
|
|
7
|
-
*/
|
|
8
|
-
export class NavigationLine {
|
|
9
|
-
private maps: Maps;
|
|
10
|
-
constructor(maps: Maps) {
|
|
11
|
-
this.maps = maps;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* To render navigation line for maps.
|
|
15
|
-
*
|
|
16
|
-
* @param {LayerSettings} layer - Specifies the layer instance to which the navigation line is to be rendered.
|
|
17
|
-
* @param {number} factor - Specifies the current zoom factor of the Maps.
|
|
18
|
-
* @param {number} layerIndex -Specifies the index of current layer.
|
|
19
|
-
* @returns {Element} - Returns the navigation line element.
|
|
20
|
-
* @private
|
|
21
|
-
*/
|
|
22
|
-
public renderNavigation(layer: LayerSettings, factor: number, layerIndex: number): Element {
|
|
23
|
-
let group: Element;
|
|
24
|
-
if (!isNullOrUndefined(this.maps)) {
|
|
25
|
-
let navigationEle: Element;
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
const navigation: any[] = layer.navigationLineSettings;
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
-
let longitude: any;
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
-
let point: any[] = [];
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
-
let latitude: any;
|
|
34
|
-
let visible: boolean;
|
|
35
|
-
let angle: number;
|
|
36
|
-
let width: number;
|
|
37
|
-
let color: string;
|
|
38
|
-
let dashArray: string;
|
|
39
|
-
let pathOption: PathOption;
|
|
40
|
-
let direction: number;
|
|
41
|
-
let showArrow: boolean;
|
|
42
|
-
let arrowColor: string;
|
|
43
|
-
let arrowSize: number;
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
-
let arrowSettings: any;
|
|
46
|
-
let arrowPosition: string;
|
|
47
|
-
let startArrow: string;
|
|
48
|
-
let endArrow: string;
|
|
49
|
-
let offSet: number;
|
|
50
|
-
let offSetValue: number;
|
|
51
|
-
let navigationGroup: Element;
|
|
52
|
-
let d: string;
|
|
53
|
-
group = (this.maps.renderer.createGroup({
|
|
54
|
-
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_line_Group'
|
|
55
|
-
}));
|
|
56
|
-
for (let i: number = 0; i < navigation.length; i++) {
|
|
57
|
-
latitude = navigation[i as number].latitude;
|
|
58
|
-
longitude = navigation[i as number].longitude;
|
|
59
|
-
visible = !isNullOrUndefined(navigation[i as number].visible) ? navigation[i as number].visible : false;
|
|
60
|
-
angle = !isNullOrUndefined(navigation[i as number].angle) ? navigation[i as number].angle : 0;
|
|
61
|
-
width = navigation[i as number].width || 1;
|
|
62
|
-
color = navigation[i as number].color;
|
|
63
|
-
dashArray = navigation[i as number].dashArray;
|
|
64
|
-
arrowSettings = navigation[i as number].arrowSettings;
|
|
65
|
-
showArrow = !isNullOrUndefined(arrowSettings) ? arrowSettings.showArrow : false;
|
|
66
|
-
if (!isNullOrUndefined(longitude) && !isNullOrUndefined(latitude) && longitude.length === latitude.length && visible) {
|
|
67
|
-
for (let i: number = 0; i < longitude.length; i++) {
|
|
68
|
-
const location: Point = (this.maps.isTileMap) ? convertTileLatLongToPoint(
|
|
69
|
-
new Point(longitude[i as number], latitude[i as number]), factor, this.maps.tileTranslatePoint, true
|
|
70
|
-
) : convertGeoToPoint(latitude[i as number], longitude[i as number], factor, layer, this.maps);
|
|
71
|
-
point.push(location);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
navigationGroup = (this.maps.renderer.createGroup({
|
|
75
|
-
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationGroup' + i + ''
|
|
76
|
-
}));
|
|
77
|
-
for (let j: number = 0; j < point.length - 1; j++) {
|
|
78
|
-
angle = (-1 > angle) ? -1 : angle;
|
|
79
|
-
angle = (1 < angle) ? 1 : angle;
|
|
80
|
-
const arcId: string = this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationIndex_' + i + '_Line' + j + '';
|
|
81
|
-
const radius: number = this.convertRadius(point[j as number], point[j + 1]);
|
|
82
|
-
if (angle <= 1 && angle > 0) {
|
|
83
|
-
direction = 0;
|
|
84
|
-
if (point[j as number]['x'] > point[j + 1]['x']) {
|
|
85
|
-
direction = 1;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (angle >= -1 && angle < 0) {
|
|
89
|
-
direction = 1;
|
|
90
|
-
if (point[j as number]['x'] > point[j + 1]['x']) {
|
|
91
|
-
direction = 0;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (showArrow) {
|
|
95
|
-
arrowColor = arrowSettings.color;
|
|
96
|
-
arrowSize = !isNullOrUndefined(arrowSettings.size) ? arrowSettings.size : 0;
|
|
97
|
-
offSetValue = !isNullOrUndefined(arrowSettings.offSet) ? arrowSettings.offSet : 0;
|
|
98
|
-
const divide: number = (Math.round(arrowSize / 2));
|
|
99
|
-
arrowPosition = arrowSettings.position;
|
|
100
|
-
startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
|
|
101
|
-
endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
|
|
102
|
-
if (offSet !== 0 && angle === 0) {
|
|
103
|
-
offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
|
|
104
|
-
}
|
|
105
|
-
offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
|
|
106
|
-
const triId: string = this.maps.element.id + '_triangle';
|
|
107
|
-
const defElement: Element = this.maps.renderer.createDefs();
|
|
108
|
-
defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
|
|
109
|
-
const markerEle: Element = defElement.querySelector('#' + 'triangle' + i);
|
|
110
|
-
markerEle.setAttribute('markerWidth', (arrowSize.toString()));
|
|
111
|
-
markerEle.setAttribute('markerHeight', (arrowSize.toString()));
|
|
112
|
-
markerEle.setAttribute('refX', (divide - offSet).toString());
|
|
113
|
-
markerEle.setAttribute('refY', divide.toString());
|
|
114
|
-
markerEle.setAttribute('orient', 'auto');
|
|
115
|
-
const d2: string = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
|
|
116
|
-
pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
|
|
117
|
-
navigationEle = this.maps.renderer.drawPath(pathOption);
|
|
118
|
-
markerEle.appendChild(navigationEle);
|
|
119
|
-
defElement.appendChild(markerEle);
|
|
120
|
-
navigationGroup.appendChild(defElement);
|
|
121
|
-
}
|
|
122
|
-
angle = Math.abs(angle);
|
|
123
|
-
d = (angle === 0) ? 'M ' + point[j as number]['x'] + ',' + point[j as number]['y'] + 'L ' + point[j + 1]['x']
|
|
124
|
-
+ ',' + point[j + 1]['y'] + ' ' :
|
|
125
|
-
'M ' + point[j as number]['x'] + ',' + point[j as number]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
|
|
126
|
-
' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
|
|
127
|
-
+ direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
|
|
128
|
-
pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
|
|
129
|
-
navigationEle = this.maps.renderer.drawPath(pathOption) as SVGLineElement;
|
|
130
|
-
if (!isNullOrUndefined(arrowPosition)) {
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
132
|
-
const position: void = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
|
|
133
|
-
: navigationEle.setAttribute('marker-end', endArrow);
|
|
134
|
-
}
|
|
135
|
-
maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle,
|
|
136
|
-
'navigationlineselectionMapStyle');
|
|
137
|
-
navigationGroup.appendChild(navigationEle);
|
|
138
|
-
group.appendChild(navigationGroup);
|
|
139
|
-
}
|
|
140
|
-
point = [];
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return group;
|
|
144
|
-
}
|
|
145
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
146
|
-
private convertRadius(point1: any, point2: any): number {
|
|
147
|
-
const value1: number = point2['x'] - point1['x'];
|
|
148
|
-
const value2: number = point2['y'] - point1['y'];
|
|
149
|
-
const value: number = Math.sqrt((Math.pow(value1, 2) + Math.pow(value2, 2)));
|
|
150
|
-
return value;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Get module name.
|
|
155
|
-
*
|
|
156
|
-
* @returns {string} - Returns the module name
|
|
157
|
-
*/
|
|
158
|
-
protected getModuleName(): string {
|
|
159
|
-
return 'NavigationLine';
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* To destroy the layers.
|
|
164
|
-
*
|
|
165
|
-
* @returns {void}
|
|
166
|
-
* @private
|
|
167
|
-
*/
|
|
168
|
-
public destroy(): void {
|
|
169
|
-
this.maps = null;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
constructor(maps: Maps);
|
|
7
|
-
/**
|
|
8
|
-
* To render polygon for maps.
|
|
9
|
-
*
|
|
10
|
-
* @param {Maps} maps - Specifies the layer instance to which the polygon is to be rendered.
|
|
11
|
-
* @param {number} layerIndex -Specifies the index of current layer.
|
|
12
|
-
* @param {number} factor - Specifies the current zoom factor of the Maps.
|
|
13
|
-
* @returns {Element} - Returns the polygon element.
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
16
|
-
polygonRender(maps: Maps, layerIndex: number, factor: number): Element;
|
|
17
|
-
/**
|
|
18
|
-
* Get module name.
|
|
19
|
-
*
|
|
20
|
-
* @returns {string} - Returns the module name
|
|
21
|
-
*/
|
|
22
|
-
protected getModuleName(): string;
|
|
23
|
-
/**
|
|
24
|
-
* To destroy the layers.
|
|
25
|
-
*
|
|
26
|
-
* @returns {void}
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
|
-
destroy(): void;
|
|
30
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
|
-
import { Maps, PolygonSettingModel } from '../../index';
|
|
3
|
-
import { Coordinate, LayerSettings} from '../index';
|
|
4
|
-
import { PathOption, calculatePolygonPath, maintainSelection } from '../utils/helper';
|
|
5
|
-
/**
|
|
6
|
-
* When injected, this module will be used to render polygon shapes over the Maps.
|
|
7
|
-
*/
|
|
8
|
-
export class Polygon {
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
10
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
11
|
-
constructor(maps: Maps) {
|
|
12
|
-
}
|
|
13
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
14
|
-
/* eslint-enable @typescript-eslint/no-empty-function */
|
|
15
|
-
/**
|
|
16
|
-
* To render polygon for maps.
|
|
17
|
-
*
|
|
18
|
-
* @param {Maps} maps - Specifies the layer instance to which the polygon is to be rendered.
|
|
19
|
-
* @param {number} layerIndex -Specifies the index of current layer.
|
|
20
|
-
* @param {number} factor - Specifies the current zoom factor of the Maps.
|
|
21
|
-
* @returns {Element} - Returns the polygon element.
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
public polygonRender(maps: Maps, layerIndex: number, factor: number): Element {
|
|
25
|
-
const currentLayer: LayerSettings = <LayerSettings>maps.layersCollection[layerIndex as number];
|
|
26
|
-
const polygonsSVGObject: Element = maps.renderer.createGroup({
|
|
27
|
-
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group'
|
|
28
|
-
});
|
|
29
|
-
currentLayer.polygonSettings.polygons.map((polygonSetting: PolygonSettingModel, polygonIndex: number) => {
|
|
30
|
-
const polygonSVGObject: Element = maps.renderer.createGroup({
|
|
31
|
-
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group_' + polygonIndex
|
|
32
|
-
});
|
|
33
|
-
const polygonData: Coordinate[] = polygonSetting.points;
|
|
34
|
-
if (!isNullOrUndefined(polygonSetting.points) && polygonSetting.points.length > 0) {
|
|
35
|
-
const path: string = calculatePolygonPath(maps, factor, currentLayer, polygonData);
|
|
36
|
-
const pathOptions: PathOption = new PathOption(
|
|
37
|
-
maps.element.id + '_LayerIndex_' + layerIndex + '_PolygonIndex_' + polygonIndex,
|
|
38
|
-
polygonSetting.fill, (polygonSetting.borderWidth / factor), polygonSetting.borderColor,
|
|
39
|
-
polygonSetting.opacity, polygonSetting.borderOpacity, '', path);
|
|
40
|
-
const polygonEle: Element = maps.renderer.drawPath(pathOptions) as SVGPathElement;
|
|
41
|
-
maintainSelection(maps.selectedPolygonElementId, maps.polygonSelectionClass, polygonEle,
|
|
42
|
-
'PolygonselectionMapStyle');
|
|
43
|
-
polygonSVGObject.appendChild(polygonEle);
|
|
44
|
-
polygonsSVGObject.appendChild(polygonSVGObject);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
return polygonsSVGObject;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Get module name.
|
|
52
|
-
*
|
|
53
|
-
* @returns {string} - Returns the module name
|
|
54
|
-
*/
|
|
55
|
-
protected getModuleName(): string {
|
|
56
|
-
return 'Polygon';
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* To destroy the layers.
|
|
61
|
-
*
|
|
62
|
-
* @returns {void}
|
|
63
|
-
* @private
|
|
64
|
-
*/
|
|
65
|
-
//eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
66
|
-
public destroy(): void {
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,409 +0,0 @@
|
|
|
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, getProcessedMarginValue } 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, doubleClick, resize, shapeSelected, zoomIn, mouseMove } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle, Theme } from './model/theme';import { ILoadEventArgs, ILoadedEventArgs, IMinMaxLatitudeLongitude, IMouseEventArgs, IMouseMoveEventArgs, 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, BingMap } 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
|
-
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Interface for a class Maps
|
|
6
|
-
*/
|
|
7
|
-
export interface MapsModel extends ComponentModel{
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Gets or sets the background color of the maps container.
|
|
11
|
-
*
|
|
12
|
-
* @default null
|
|
13
|
-
*/
|
|
14
|
-
background?: string;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Enables or disables the visibility state of the separator for grouping.
|
|
18
|
-
*
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
useGroupingSeparator?: boolean;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Gets or sets the format to apply internationalization for the text in the maps.
|
|
25
|
-
*
|
|
26
|
-
* @default null
|
|
27
|
-
*/
|
|
28
|
-
format?: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Gets or sets the width in which the maps is to be rendered.
|
|
32
|
-
*
|
|
33
|
-
* @default null
|
|
34
|
-
*/
|
|
35
|
-
width?: string;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Gets or sets the height in which the maps is to be rendered.
|
|
39
|
-
*
|
|
40
|
-
* @default null
|
|
41
|
-
*/
|
|
42
|
-
height?: string;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Gets or sets the mode in which the tooltip is to be displayed.
|
|
46
|
-
* The tooltip can be rendered on mouse move, click or double clicking on the
|
|
47
|
-
* element on the map.
|
|
48
|
-
*
|
|
49
|
-
* @default 'MouseMove'
|
|
50
|
-
*/
|
|
51
|
-
tooltipDisplayMode?: TooltipGesture;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Enables or disables the print functionality in maps.
|
|
55
|
-
*
|
|
56
|
-
* @default false
|
|
57
|
-
*/
|
|
58
|
-
allowPrint?: boolean;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Enables or disables the export to image functionality in maps.
|
|
62
|
-
*
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
allowImageExport?: boolean;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Enables or disables the export to PDF functionality in maps.
|
|
69
|
-
*
|
|
70
|
-
* @default false
|
|
71
|
-
*/
|
|
72
|
-
allowPdfExport?: boolean;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Gets or sets the options to customize the title of the maps.
|
|
76
|
-
*/
|
|
77
|
-
titleSettings?: TitleSettingsModel;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Gets or sets the options to customize the zooming operations in maps.
|
|
81
|
-
*/
|
|
82
|
-
zoomSettings?: ZoomSettingsModel;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Gets or sets the options to customize the legend of the maps.
|
|
86
|
-
*/
|
|
87
|
-
legendSettings?: LegendSettingsModel;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Gets or sets the options to customize the layers of the maps.
|
|
91
|
-
*/
|
|
92
|
-
layers?: LayerSettingsModel[];
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Gets or sets the options for customizing the annotations in the maps.
|
|
96
|
-
*/
|
|
97
|
-
annotations?: AnnotationModel[];
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Gets or sets the options to customize the margin of the maps.
|
|
101
|
-
*/
|
|
102
|
-
margin?: MarginModel;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Gets or sets the options for customizing the style properties of the maps border.
|
|
106
|
-
*/
|
|
107
|
-
border?: BorderModel;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Gets or sets the theme styles supported for maps. When the theme is set, the styles associated with the theme will be set in the maps.
|
|
111
|
-
*
|
|
112
|
-
* @default Material
|
|
113
|
-
*/
|
|
114
|
-
theme?: MapsTheme;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Gets or sets the projection with which the maps will be rendered to show the two-dimensional curved surface of a globe on a plane.
|
|
118
|
-
*
|
|
119
|
-
* @default Mercator
|
|
120
|
-
*/
|
|
121
|
-
projectionType?: ProjectionType;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Gets or sets the index of the layer of maps which will be the base layer. It provides the option to select which layer to be visible in the maps.
|
|
125
|
-
*
|
|
126
|
-
* @default 0
|
|
127
|
-
*/
|
|
128
|
-
baseLayerIndex?: number;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Gets or sets the description of the maps for assistive technology.
|
|
132
|
-
*
|
|
133
|
-
* @default null
|
|
134
|
-
*/
|
|
135
|
-
description?: string;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Gets or sets the tab index value for the maps.
|
|
139
|
-
*
|
|
140
|
-
* @default 0
|
|
141
|
-
*/
|
|
142
|
-
tabIndex?: number;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Gets or sets the center position of the maps.
|
|
146
|
-
*/
|
|
147
|
-
centerPosition?: CenterPositionModel;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Gets or sets the options to customize the area around the map.
|
|
151
|
-
*/
|
|
152
|
-
mapsArea?: MapsAreaSettingsModel;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Triggers before the maps gets rendered.
|
|
156
|
-
*
|
|
157
|
-
* @event load
|
|
158
|
-
*/
|
|
159
|
-
load?: EmitType<ILoadEventArgs>;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Triggers before the print gets started.
|
|
163
|
-
*
|
|
164
|
-
* @event beforePrint
|
|
165
|
-
*/
|
|
166
|
-
beforePrint?: EmitType<IPrintEventArgs>;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Triggers after the maps gets rendered.
|
|
170
|
-
*
|
|
171
|
-
* @event loaded
|
|
172
|
-
*/
|
|
173
|
-
loaded?: EmitType<ILoadedEventArgs>;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Triggers when a user clicks on an element in Maps.
|
|
177
|
-
*
|
|
178
|
-
* @event click
|
|
179
|
-
* @deprecated
|
|
180
|
-
*/
|
|
181
|
-
click?: EmitType<IMouseEventArgs>;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Triggers when a user clicks on an element in Maps.
|
|
185
|
-
*
|
|
186
|
-
* @event onclick
|
|
187
|
-
*/
|
|
188
|
-
onclick?: EmitType<IMouseEventArgs>;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Triggers when performing the double click operation on an element in maps.
|
|
192
|
-
*
|
|
193
|
-
* @event doubleClick
|
|
194
|
-
*/
|
|
195
|
-
doubleClick?: EmitType<IMouseEventArgs>;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Triggers when performing the right click operation on an element in maps.
|
|
199
|
-
*
|
|
200
|
-
* @event rightClick
|
|
201
|
-
*/
|
|
202
|
-
rightClick?: EmitType<IMouseEventArgs>;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Triggers to notify the resize of the maps when the window is resized.
|
|
206
|
-
*
|
|
207
|
-
* @event resize
|
|
208
|
-
*/
|
|
209
|
-
resize?: EmitType<IResizeEventArgs>;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Triggers before the maps tooltip gets rendered.
|
|
213
|
-
*
|
|
214
|
-
* @event tooltipRender
|
|
215
|
-
*/
|
|
216
|
-
tooltipRender?: EmitType<ITooltipRenderEventArgs>;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Triggers before the legend gets rendered.
|
|
220
|
-
*
|
|
221
|
-
* @event legendRendering
|
|
222
|
-
* @deprecated
|
|
223
|
-
*/
|
|
224
|
-
legendRendering?: EmitType<ILegendRenderingEventArgs>;
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Triggers after the maps tooltip gets rendered.
|
|
228
|
-
*
|
|
229
|
-
* @deprecated
|
|
230
|
-
* @event tooltipRenderComplete
|
|
231
|
-
*/
|
|
232
|
-
tooltipRenderComplete?: EmitType<ITooltipRenderCompleteEventArgs>;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Triggers when a shape is selected in the maps.
|
|
236
|
-
*
|
|
237
|
-
* @event shapeSelected
|
|
238
|
-
*/
|
|
239
|
-
shapeSelected?: EmitType<IShapeSelectedEventArgs>;
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Triggers before the shape, bubble or marker gets selected.
|
|
243
|
-
*
|
|
244
|
-
* @event itemSelection
|
|
245
|
-
*/
|
|
246
|
-
itemSelection?: EmitType<ISelectionEventArgs>;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Trigger before the shape, bubble or marker gets highlighted.
|
|
250
|
-
*
|
|
251
|
-
* @event itemHighlight
|
|
252
|
-
*/
|
|
253
|
-
itemHighlight?: EmitType<ISelectionEventArgs>;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Triggers before the shape gets highlighted.
|
|
257
|
-
*
|
|
258
|
-
* @event shapeHighlight
|
|
259
|
-
*/
|
|
260
|
-
shapeHighlight?: EmitType<IShapeSelectedEventArgs>;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Triggers before the maps layer gets rendered.
|
|
264
|
-
*
|
|
265
|
-
* @event layerRendering
|
|
266
|
-
*/
|
|
267
|
-
layerRendering?: EmitType<ILayerRenderingEventArgs>;
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Triggers before the maps shape gets rendered.
|
|
271
|
-
*
|
|
272
|
-
* @event shapeRendering
|
|
273
|
-
*/
|
|
274
|
-
shapeRendering?: EmitType<IShapeRenderingEventArgs>;
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Triggers before the maps marker gets rendered.
|
|
278
|
-
*
|
|
279
|
-
* @event markerRendering
|
|
280
|
-
*/
|
|
281
|
-
markerRendering?: EmitType<IMarkerRenderingEventArgs>;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Triggers before the maps marker cluster gets rendered.
|
|
285
|
-
*
|
|
286
|
-
* @event markerClusterRendering
|
|
287
|
-
*/
|
|
288
|
-
markerClusterRendering?: EmitType<IMarkerClusterRenderingEventArgs>;
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Triggers when clicking on a marker element.
|
|
292
|
-
*
|
|
293
|
-
* @event markerClick
|
|
294
|
-
*/
|
|
295
|
-
markerClick?: EmitType<IMarkerClickEventArgs>;
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* When the marker begins to drag on the map, this event is triggered.
|
|
299
|
-
*
|
|
300
|
-
* @event markerDragStart
|
|
301
|
-
*/
|
|
302
|
-
markerDragStart?: EmitType<IMarkerDragEventArgs>;
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* When the marker has stopped dragging on the map, this event is triggered.
|
|
306
|
-
*
|
|
307
|
-
* @event markerDragEnd
|
|
308
|
-
*/
|
|
309
|
-
markerDragEnd?: EmitType<IMarkerDragEventArgs>;
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Triggers when clicking the marker cluster in maps.
|
|
313
|
-
*
|
|
314
|
-
* @event markerClusterClick
|
|
315
|
-
*/
|
|
316
|
-
markerClusterClick?: EmitType<IMarkerClusterClickEventArgs>;
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Triggers when moving the mouse over the marker cluster element in maps.
|
|
320
|
-
*
|
|
321
|
-
* @event markerClusterMouseMove
|
|
322
|
-
*/
|
|
323
|
-
markerClusterMouseMove?: EmitType<IMarkerClusterMoveEventArgs>;
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Triggers when moving the mouse over the marker element in maps.
|
|
327
|
-
*
|
|
328
|
-
* @event markerMouseMove
|
|
329
|
-
*/
|
|
330
|
-
markerMouseMove?: EmitType<IMarkerMoveEventArgs>;
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* This event is triggered when the mouse pointer moves over the map.
|
|
334
|
-
*
|
|
335
|
-
* @event mouseMove
|
|
336
|
-
*/
|
|
337
|
-
mouseMove?: EmitType<IMouseMoveEventArgs>;
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Triggers before the data-label gets rendered.
|
|
341
|
-
*
|
|
342
|
-
* @event dataLabelRendering
|
|
343
|
-
*/
|
|
344
|
-
dataLabelRendering?: EmitType<ILabelRenderingEventArgs>;
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Triggers before the bubble element gets rendered on the map.
|
|
348
|
-
*
|
|
349
|
-
* @event bubbleRendering
|
|
350
|
-
*/
|
|
351
|
-
bubbleRendering?: EmitType<IBubbleRenderingEventArgs>;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Triggers when performing the click operation on the bubble element in maps.
|
|
355
|
-
*
|
|
356
|
-
* @event bubbleClick
|
|
357
|
-
*/
|
|
358
|
-
bubbleClick?: EmitType<IBubbleClickEventArgs>;
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* Triggers when hovering the mouse on the bubble element in maps.
|
|
362
|
-
*
|
|
363
|
-
* @event bubbleMouseMove
|
|
364
|
-
*/
|
|
365
|
-
bubbleMouseMove?: EmitType<IBubbleMoveEventArgs>;
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Triggers after the animation is completed in the maps.
|
|
369
|
-
*
|
|
370
|
-
* @event animationComplete
|
|
371
|
-
*/
|
|
372
|
-
animationComplete?: EmitType<IAnimationCompleteEventArgs>;
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* Triggers before rendering an annotation in the maps.
|
|
376
|
-
*
|
|
377
|
-
* @event annotationRendering
|
|
378
|
-
*/
|
|
379
|
-
annotationRendering?: EmitType<IAnnotationRenderingEventArgs>;
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Triggers before the zoom operations such as zoom in and zoom out in the maps.
|
|
383
|
-
*
|
|
384
|
-
* @event zoom
|
|
385
|
-
*/
|
|
386
|
-
zoom?: EmitType<IMapZoomEventArgs>;
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Triggers before performing the panning operation.
|
|
390
|
-
*
|
|
391
|
-
* @event pan
|
|
392
|
-
*/
|
|
393
|
-
pan?: EmitType<IMapPanEventArgs>;
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* This event is triggered after performing the panning action.
|
|
397
|
-
*
|
|
398
|
-
* @event panComplete
|
|
399
|
-
*/
|
|
400
|
-
panComplete?: EmitType<IMapPanEventArgs>;
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* This event is triggered after the zooming operation is completed.
|
|
404
|
-
*
|
|
405
|
-
* @event zoomComplete
|
|
406
|
-
*/
|
|
407
|
-
zoomComplete?: EmitType<IMapPanEventArgs>;
|
|
408
|
-
|
|
409
|
-
}
|