@syncfusion/ej2-maps 30.2.4 → 31.2.2
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/.eslintrc.json +263 -0
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/index.d.ts +2 -2
- package/dist/ts/index.d.ts +4 -0
- package/dist/ts/index.ts +4 -0
- package/dist/ts/maps/index.d.ts +28 -0
- package/dist/ts/maps/index.ts +28 -0
- package/dist/ts/maps/layers/bing-map.d.ts +21 -0
- package/dist/ts/maps/layers/bing-map.ts +51 -0
- package/dist/ts/maps/layers/bubble.d.ts +77 -0
- package/dist/ts/maps/layers/bubble.ts +304 -0
- package/dist/ts/maps/layers/color-mapping.d.ts +36 -0
- package/dist/ts/maps/layers/color-mapping.ts +230 -0
- package/dist/ts/maps/layers/data-label.d.ts +45 -0
- package/dist/ts/maps/layers/data-label.ts +457 -0
- package/dist/ts/maps/layers/layer-panel.d.ts +144 -0
- package/dist/ts/maps/layers/layer-panel.ts +1455 -0
- package/dist/ts/maps/layers/legend.d.ts +173 -0
- package/dist/ts/maps/layers/legend.ts +2465 -0
- package/dist/ts/maps/layers/marker.d.ts +105 -0
- package/dist/ts/maps/layers/marker.ts +632 -0
- package/dist/ts/maps/layers/navigation-selected-line.d.ts +33 -0
- package/dist/ts/maps/layers/navigation-selected-line.ts +171 -0
- package/dist/ts/maps/layers/polygon.d.ts +30 -0
- package/dist/ts/maps/layers/polygon.ts +68 -0
- package/dist/ts/maps/maps-model.d.ts +409 -0
- package/dist/ts/maps/maps.d.ts +1247 -0
- package/dist/ts/maps/maps.ts +3416 -0
- package/dist/ts/maps/model/base-model.d.ts +2107 -0
- package/dist/ts/maps/model/base.d.ts +1840 -0
- package/dist/ts/maps/model/base.ts +2257 -0
- package/dist/ts/maps/model/constants.d.ts +225 -0
- package/dist/ts/maps/model/constants.ts +226 -0
- package/dist/ts/maps/model/export-image.d.ts +39 -0
- package/dist/ts/maps/model/export-image.ts +194 -0
- package/dist/ts/maps/model/export-pdf.d.ts +40 -0
- package/dist/ts/maps/model/export-pdf.ts +183 -0
- package/dist/ts/maps/model/interface.d.ts +892 -0
- package/dist/ts/maps/model/interface.ts +929 -0
- package/dist/ts/maps/model/print.d.ts +45 -0
- package/dist/ts/maps/model/print.ts +125 -0
- package/dist/ts/maps/model/theme.d.ts +98 -0
- package/dist/ts/maps/model/theme.ts +919 -0
- package/dist/ts/maps/user-interaction/annotation.d.ts +27 -0
- package/dist/ts/maps/user-interaction/annotation.ts +133 -0
- package/dist/ts/maps/user-interaction/highlight.d.ts +63 -0
- package/dist/ts/maps/user-interaction/highlight.ts +272 -0
- package/dist/ts/maps/user-interaction/selection.d.ts +85 -0
- package/dist/ts/maps/user-interaction/selection.ts +342 -0
- package/dist/ts/maps/user-interaction/tooltip.d.ts +78 -0
- package/dist/ts/maps/user-interaction/tooltip.ts +500 -0
- package/dist/ts/maps/user-interaction/zoom.d.ts +334 -0
- package/dist/ts/maps/user-interaction/zoom.ts +2523 -0
- package/dist/ts/maps/utils/enum.d.ts +328 -0
- package/dist/ts/maps/utils/enum.ts +343 -0
- package/dist/ts/maps/utils/helper.d.ts +1318 -0
- package/dist/ts/maps/utils/helper.ts +3811 -0
- package/package.json +53 -18
- package/tslint.json +111 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { Maps } from '../../index';
|
|
2
|
+
import { SelectionSettingsModel, click, ISelectionEventArgs, itemSelection } from '../index';
|
|
3
|
+
import { getElement, createStyle, customizeStyle, removeClass, getTargetElement, getElementByID} from '../utils/helper';
|
|
4
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
5
|
+
import { BorderModel } from '../model/base-model';
|
|
6
|
+
/**
|
|
7
|
+
* Selection module class
|
|
8
|
+
*/
|
|
9
|
+
export class Selection {
|
|
10
|
+
private maps: Maps;
|
|
11
|
+
/**
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
public selectionsettings: SelectionSettingsModel;
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
public selectionType: string;
|
|
19
|
+
constructor(maps: Maps) {
|
|
20
|
+
this.maps = maps;
|
|
21
|
+
this.addEventListener();
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* For binding events to selection module.
|
|
25
|
+
*
|
|
26
|
+
* @returns {void}
|
|
27
|
+
*/
|
|
28
|
+
private addEventListener(): void {
|
|
29
|
+
if (!this.maps.isDestroyed) {
|
|
30
|
+
this.maps.on(click, this.mouseClick, this);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* For removing events from selection module.
|
|
35
|
+
*
|
|
36
|
+
* @returns {void}
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
public removeEventListener(): void {
|
|
40
|
+
if (this.maps.isDestroyed) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.maps.off(click, this.mouseClick);
|
|
44
|
+
}
|
|
45
|
+
private mouseClick(targetElement: Element): void {
|
|
46
|
+
if (!isNullOrUndefined(targetElement['type']) && targetElement['type'].indexOf('touch') !== -1 &&
|
|
47
|
+
isNullOrUndefined(targetElement.id)) {
|
|
48
|
+
targetElement = targetElement['target'];
|
|
49
|
+
}
|
|
50
|
+
if (!isNullOrUndefined(targetElement.id) && (targetElement.id.indexOf('LayerIndex') > -1 ||
|
|
51
|
+
targetElement.id.indexOf('NavigationIndex') > -1)) {
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
let shapeData: any;
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
let data: any;
|
|
56
|
+
let shapeIndex: number;
|
|
57
|
+
let dataIndex: number;
|
|
58
|
+
const layerIndex: number = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
59
|
+
if (targetElement.id.indexOf('shapeIndex') > -1) {
|
|
60
|
+
shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
61
|
+
shapeData = !isNullOrUndefined(this.maps.layers[layerIndex as number].shapeData['features'])
|
|
62
|
+
&& this.maps.layers[layerIndex as number].shapeData['features']['length'] > shapeIndex ?
|
|
63
|
+
this.maps.layers[layerIndex as number].shapeData['features'][shapeIndex as number]['properties'] :
|
|
64
|
+
!isNullOrUndefined(this.maps.layers[layerIndex as number].shapeData['geometries'])
|
|
65
|
+
&& this.maps.layers[layerIndex as number].shapeData['geometries']['length'] > shapeIndex ?
|
|
66
|
+
this.maps.layers[layerIndex as number].shapeData['geometries'][shapeIndex as number]['properties'] : null ;
|
|
67
|
+
dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
68
|
+
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex as number].dataSource[dataIndex as number];
|
|
69
|
+
this.selectionsettings = this.maps.layers[layerIndex as number].selectionSettings;
|
|
70
|
+
this.selectionType = 'Shape';
|
|
71
|
+
} else if (targetElement.id.indexOf('BubbleIndex') > -1) {
|
|
72
|
+
const bubbleIndex: number = parseInt(targetElement.id.split('_BubbleIndex_')[1].split('_')[0], 10);
|
|
73
|
+
dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
74
|
+
data = this.maps.layers[layerIndex as number].bubbleSettings[bubbleIndex as number].dataSource[dataIndex as number];
|
|
75
|
+
this.selectionsettings = this.maps.layers[layerIndex as number].bubbleSettings[bubbleIndex as number].selectionSettings;
|
|
76
|
+
this.selectionType = 'Bubble';
|
|
77
|
+
} else if (targetElement.id.indexOf('MarkerIndex') > -1) {
|
|
78
|
+
const markerIndex: number = parseInt(targetElement.id.split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
79
|
+
dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
80
|
+
data = this.maps.layers[layerIndex as number].markerSettings[markerIndex as number].dataSource[dataIndex as number];
|
|
81
|
+
this.selectionsettings = this.maps.layers[layerIndex as number].markerSettings[markerIndex as number].selectionSettings;
|
|
82
|
+
this.selectionType = 'Marker';
|
|
83
|
+
} else if (targetElement.id.indexOf('_PolygonIndex_') > -1) {
|
|
84
|
+
dataIndex = parseInt(targetElement.id.split('_PolygonIndex_')[1].split('_')[0], 10);
|
|
85
|
+
data = this.maps.layers[layerIndex as number].polygonSettings.polygons[dataIndex as number].points;
|
|
86
|
+
this.selectionsettings = this.maps.layers[layerIndex as number].polygonSettings.selectionSettings;
|
|
87
|
+
this.selectionType = 'Polygon';
|
|
88
|
+
} else if (targetElement.id.indexOf('NavigationIndex') > -1){
|
|
89
|
+
const index: number = parseInt(targetElement.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
90
|
+
shapeData = null;
|
|
91
|
+
data = {
|
|
92
|
+
latitude: this.maps.layers[layerIndex as number].navigationLineSettings[index as number].latitude,
|
|
93
|
+
longitude: this.maps.layers[layerIndex as number].navigationLineSettings[index as number].longitude
|
|
94
|
+
};
|
|
95
|
+
this.selectionsettings = this.maps.layers[layerIndex as number].navigationLineSettings[index as number].selectionSettings;
|
|
96
|
+
this.selectionType = 'navigationline';
|
|
97
|
+
}
|
|
98
|
+
if (!isNullOrUndefined(this.selectionsettings) && this.selectionsettings.enable) {
|
|
99
|
+
this.selectElement(targetElement, layerIndex, data, shapeData);
|
|
100
|
+
}
|
|
101
|
+
} else if ((this.maps.legendSettings.visible && !this.maps.legendSettings.toggleLegendSettings.enable && this.maps.legendModule) &&
|
|
102
|
+
!isNullOrUndefined(targetElement.id) && targetElement.id.indexOf('_Text') === -1 &&
|
|
103
|
+
(targetElement.id.indexOf(this.maps.element.id + '_Legend_Shape_Index') > -1 ||
|
|
104
|
+
targetElement.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1)) {
|
|
105
|
+
this.maps.legendModule.legendHighLightAndSelection(targetElement, 'selection');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Selects the element in the map.
|
|
111
|
+
*
|
|
112
|
+
* @param {Element} targetElement - Specifies the target element.
|
|
113
|
+
* @param {number} layerIndex - Specifies the index of the layer.
|
|
114
|
+
* @param {object} data - Specifies the data for the map.
|
|
115
|
+
* @param {object} shapeData - Specifies the data for the map to render.
|
|
116
|
+
* @returns {void}
|
|
117
|
+
* @private
|
|
118
|
+
*/
|
|
119
|
+
public selectElement(targetElement: Element, layerIndex: number, data: object, shapeData: object): void {
|
|
120
|
+
this.maps.mapSelect = targetElement ? true : false;
|
|
121
|
+
if (this.maps.legendModule && this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1) {
|
|
122
|
+
this.maps.legendModule.shapeHighLightAndSelection(
|
|
123
|
+
targetElement, data, this.selectionsettings, 'selection', layerIndex);
|
|
124
|
+
}
|
|
125
|
+
const shapeToggled: boolean = (targetElement.id.indexOf('shapeIndex') > -1 && this.maps.legendSettings.visible && this.maps.legendModule) ?
|
|
126
|
+
this.maps.legendModule.shapeToggled : true;
|
|
127
|
+
if (shapeToggled) {
|
|
128
|
+
this.selectMap(targetElement, shapeData, data);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Public method for selection.
|
|
134
|
+
*
|
|
135
|
+
* @param {number} layerIndex - Specifies the index of the layer.
|
|
136
|
+
* @param {string} name - Specifies the name.
|
|
137
|
+
* @param {boolean} enable - Specifies the enabling of selection in map.
|
|
138
|
+
* @returns {void}
|
|
139
|
+
* @private
|
|
140
|
+
*/
|
|
141
|
+
public addSelection(layerIndex: number, name: string, enable: boolean): void {
|
|
142
|
+
const targetElement: Element = getTargetElement(layerIndex, name, enable, this.maps);
|
|
143
|
+
if (enable) {
|
|
144
|
+
this.selectMap(targetElement, null, null);
|
|
145
|
+
} else {
|
|
146
|
+
removeClass(targetElement);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Method for selection.
|
|
151
|
+
*
|
|
152
|
+
* @param {Element} targetElement - Specifies the target element
|
|
153
|
+
* @param {any} shapeData - Specifies the shape data
|
|
154
|
+
* @param {any} data - Specifies the data
|
|
155
|
+
* @returns {void}
|
|
156
|
+
*/
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
|
+
private selectMap(targetElement: Element, shapeData: any, data: any): void {
|
|
159
|
+
const isLineStringShape: boolean = targetElement.parentElement.id.indexOf('LineString') > -1;
|
|
160
|
+
const border: BorderModel = {
|
|
161
|
+
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) :
|
|
162
|
+
this.selectionsettings.border.color,
|
|
163
|
+
width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
|
|
164
|
+
(this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
|
|
165
|
+
opacity: this.selectionsettings.border.opacity
|
|
166
|
+
};
|
|
167
|
+
const eventArgs: ISelectionEventArgs = {
|
|
168
|
+
opacity: this.selectionsettings.opacity,
|
|
169
|
+
fill: isLineStringShape ? 'transparent' : (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none'),
|
|
170
|
+
border: border,
|
|
171
|
+
name: itemSelection,
|
|
172
|
+
target: targetElement.id,
|
|
173
|
+
cancel: false,
|
|
174
|
+
shapeData: shapeData,
|
|
175
|
+
data: data,
|
|
176
|
+
maps: this.maps
|
|
177
|
+
};
|
|
178
|
+
//eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
179
|
+
this.maps.trigger('itemSelection', eventArgs, (observedArgs: ISelectionEventArgs) => {
|
|
180
|
+
eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ?
|
|
181
|
+
this.selectionsettings.opacity : this.selectionsettings.border.opacity;
|
|
182
|
+
if (!eventArgs.cancel) {
|
|
183
|
+
if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
|
|
184
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
185
|
+
removeClass(targetElement);
|
|
186
|
+
this.removedSelectionList(targetElement);
|
|
187
|
+
for (let m: number = 0; m < this.maps.shapeSelectionItem.length; m++) {
|
|
188
|
+
if (this.maps.shapeSelectionItem[m as number] === eventArgs.shapeData) {
|
|
189
|
+
this.maps.shapeSelectionItem.splice(m, 1);
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (targetElement.id.indexOf('NavigationIndex') > -1) {
|
|
194
|
+
const index: number = parseInt(targetElement.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
195
|
+
const layerIndex: number = parseInt(targetElement.parentElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
196
|
+
targetElement.setAttribute(
|
|
197
|
+
'stroke-width', this.maps.layers[layerIndex as number].navigationLineSettings[index as number].width.toString()
|
|
198
|
+
);
|
|
199
|
+
targetElement.setAttribute('stroke', this.maps.layers[layerIndex as number].navigationLineSettings[index as number].color);
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
const layetElement: Element = getElementByID(this.maps.element.id + '_Layer_Collections');
|
|
203
|
+
if (!this.selectionsettings.enableMultiSelect &&
|
|
204
|
+
(layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0 ||
|
|
205
|
+
layetElement.getElementsByClassName('LineselectionMapStyle').length > 0)) {
|
|
206
|
+
let eleCount : number = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length;
|
|
207
|
+
let ele : Element;
|
|
208
|
+
for (let k : number = 0 ; k < eleCount; k++) {
|
|
209
|
+
ele = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle')[0];
|
|
210
|
+
removeClass(ele);
|
|
211
|
+
this.removedSelectionList(ele);
|
|
212
|
+
}
|
|
213
|
+
if (layetElement.getElementsByClassName('LineselectionMapStyle').length > 0) {
|
|
214
|
+
eleCount = layetElement.getElementsByClassName('LineselectionMapStyle').length;
|
|
215
|
+
for (let k : number = 0 ; k < eleCount; k++) {
|
|
216
|
+
ele = layetElement.getElementsByClassName('LineselectionMapStyle')[0];
|
|
217
|
+
removeClass(ele);
|
|
218
|
+
this.removedSelectionList(ele);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (this.selectionType === 'Shape') {
|
|
222
|
+
this.maps.shapeSelectionItem = [];
|
|
223
|
+
const selectionLength: number = this.maps.selectedElementId.length;
|
|
224
|
+
for (let i: number = 0; i < selectionLength; i++) {
|
|
225
|
+
ele = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle')[0];
|
|
226
|
+
removeClass(ele);
|
|
227
|
+
const selectedElementIdIndex: number = this.maps.selectedElementId.indexOf(ele.getAttribute('id'));
|
|
228
|
+
this.maps.selectedElementId.splice(selectedElementIdIndex, 1);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (ele.id.indexOf('NavigationIndex') > -1) {
|
|
232
|
+
const index: number = parseInt(targetElement.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
233
|
+
const layerIndex: number = parseInt(targetElement.parentElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
234
|
+
ele.setAttribute('stroke-width', this.maps.layers[layerIndex as number].navigationLineSettings[index as number].width.toString());
|
|
235
|
+
ele.setAttribute('stroke', this.maps.layers[layerIndex as number].navigationLineSettings[index as number].color);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (!isLineStringShape) {
|
|
239
|
+
if (!getElement(this.selectionType + 'selectionMap')) {
|
|
240
|
+
document.body.appendChild(createStyle(this.selectionType + 'selectionMap',
|
|
241
|
+
this.selectionType + 'selectionMapStyle', eventArgs));
|
|
242
|
+
} else {
|
|
243
|
+
customizeStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs);
|
|
244
|
+
}
|
|
245
|
+
targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
|
|
246
|
+
} else {
|
|
247
|
+
if (!getElement('LineselectionMap')) {
|
|
248
|
+
document.body.appendChild(createStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs));
|
|
249
|
+
} else {
|
|
250
|
+
customizeStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs);
|
|
251
|
+
}
|
|
252
|
+
targetElement.setAttribute('class', 'LineselectionMapStyle');
|
|
253
|
+
}
|
|
254
|
+
if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
|
|
255
|
+
this.maps.shapeSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
256
|
+
this.maps.selectedElementId.push(targetElement.getAttribute('id'));
|
|
257
|
+
this.maps.shapeSelectionItem.push(eventArgs.shapeData);
|
|
258
|
+
}
|
|
259
|
+
if (targetElement.getAttribute('class') === 'MarkerselectionMapStyle') {
|
|
260
|
+
this.maps.markerSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
261
|
+
this.maps.selectedMarkerElementId.push(targetElement.getAttribute('id'));
|
|
262
|
+
}
|
|
263
|
+
if (targetElement.getAttribute('class') === 'BubbleselectionMapStyle') {
|
|
264
|
+
this.maps.bubbleSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
265
|
+
this.maps.selectedBubbleElementId.push(targetElement.getAttribute('id'));
|
|
266
|
+
}
|
|
267
|
+
if (targetElement.getAttribute('class') === 'navigationlineselectionMapStyle') {
|
|
268
|
+
this.maps.navigationSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
269
|
+
this.maps.selectedNavigationElementId.push(targetElement.getAttribute('id'));
|
|
270
|
+
}
|
|
271
|
+
if (targetElement.getAttribute('class') === 'PolygonselectionMapStyle') {
|
|
272
|
+
this.maps.polygonSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
273
|
+
this.maps.selectedPolygonElementId.push(targetElement.getAttribute('id'));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Remove legend selection
|
|
281
|
+
*/
|
|
282
|
+
// private removeLegendSelection(legendCollection: Object[], targetElement: Element): void {
|
|
283
|
+
// let shape: Element;
|
|
284
|
+
// if (!this.selectionsettings.enableMultiSelect) {
|
|
285
|
+
// for (let i: number = 0; i < legendCollection.length; i++) {
|
|
286
|
+
// for (let data of legendCollection[i]['data']) {
|
|
287
|
+
// shape = getElement(this.maps.element.id + '_LayerIndex_' + data['layerIndex'] +
|
|
288
|
+
// '_shapeIndex_' + data['shapeIndex'] + '_dataIndex_' + data['dataIndex']);
|
|
289
|
+
// removeClass(shape);
|
|
290
|
+
// }
|
|
291
|
+
// }
|
|
292
|
+
// }
|
|
293
|
+
// }
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Get module name.
|
|
297
|
+
*
|
|
298
|
+
* @param {Element} targetElement - Specifies the target element
|
|
299
|
+
* @returns {void}
|
|
300
|
+
* @private
|
|
301
|
+
*/
|
|
302
|
+
public removedSelectionList(targetElement: Element): void {
|
|
303
|
+
if (this.selectionType === 'Shape') {
|
|
304
|
+
this.maps.selectedElementId.splice(this.maps.selectedElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
305
|
+
}
|
|
306
|
+
if (this.selectionType === 'Bubble') {
|
|
307
|
+
this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
308
|
+
}
|
|
309
|
+
if (this.selectionType === 'Marker') {
|
|
310
|
+
this.maps.selectedMarkerElementId.splice(this.maps.selectedMarkerElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
311
|
+
}
|
|
312
|
+
if (this.selectionType === 'navigationline') {
|
|
313
|
+
this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
314
|
+
}
|
|
315
|
+
if (this.selectionType === 'Polygon') {
|
|
316
|
+
this.maps.selectedPolygonElementId.splice(this.maps.selectedPolygonElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Get module name.
|
|
322
|
+
*
|
|
323
|
+
* @returns {string} - Returns the module name
|
|
324
|
+
*/
|
|
325
|
+
protected getModuleName(): string {
|
|
326
|
+
return 'Selection';
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* To destroy the selection.
|
|
331
|
+
*
|
|
332
|
+
* @returns {void}
|
|
333
|
+
* @private
|
|
334
|
+
*/
|
|
335
|
+
public destroy(): void {
|
|
336
|
+
this.selectionsettings = null;
|
|
337
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
338
|
+
if (!(this.maps as any).refreshing) {
|
|
339
|
+
this.maps = null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Maps } from '../index';
|
|
2
|
+
import { Tooltip } from '@syncfusion/ej2-svg-base';
|
|
3
|
+
/**
|
|
4
|
+
* Map Tooltip
|
|
5
|
+
*/
|
|
6
|
+
export declare class MapsTooltip {
|
|
7
|
+
private maps;
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
svgTooltip: Tooltip;
|
|
12
|
+
private isTouch;
|
|
13
|
+
private tooltipId;
|
|
14
|
+
private tooltipTimer;
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
tooltipTargetID: string;
|
|
19
|
+
constructor(maps: Maps);
|
|
20
|
+
/**
|
|
21
|
+
* @param {PointerEvent} e - Specifies the event.
|
|
22
|
+
* @returns {void}
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
renderTooltip(e: PointerEvent): void;
|
|
26
|
+
/**
|
|
27
|
+
* To get content for the current toolitp.
|
|
28
|
+
*
|
|
29
|
+
* @param {TooltipSettingsModel} options - Specifies the options for rendering tooltip
|
|
30
|
+
* @param {any} templateData - Specifies the template data
|
|
31
|
+
* @returns {any} - Returns the local data
|
|
32
|
+
*/
|
|
33
|
+
private setTooltipContent;
|
|
34
|
+
private formatter;
|
|
35
|
+
/**
|
|
36
|
+
* Handles the mouse up.
|
|
37
|
+
*
|
|
38
|
+
* @param {PointerEvent} e - Specifies the event
|
|
39
|
+
* @returns {void}
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
mouseUpHandler(e: PointerEvent): void;
|
|
43
|
+
/**
|
|
44
|
+
* Removes the tooltip.
|
|
45
|
+
*
|
|
46
|
+
* @returns {boolean} - Returns the boolean whether tooltip is removed or not.
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
removeTooltip(): boolean;
|
|
50
|
+
private clearTooltip;
|
|
51
|
+
/**
|
|
52
|
+
* To bind events for tooltip module.
|
|
53
|
+
*
|
|
54
|
+
* @returns {void}
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
57
|
+
addEventListener(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Removes the event listeners.
|
|
60
|
+
*
|
|
61
|
+
* @returns {void}
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
removeEventListener(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Get module name.
|
|
67
|
+
*
|
|
68
|
+
* @returns {string} Returns the module name
|
|
69
|
+
*/
|
|
70
|
+
protected getModuleName(): string;
|
|
71
|
+
/**
|
|
72
|
+
* To destroy the tooltip.
|
|
73
|
+
*
|
|
74
|
+
* @returns {void}
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
destroy(): void;
|
|
78
|
+
}
|