@syncfusion/ej2-maps 20.3.56 → 20.4.38
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 +16 -1
- package/CHANGELOG.md +9 -1
- package/README.md +65 -51
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +915 -722
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +901 -712
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +33 -20
- package/src/maps/layers/bing-map.d.ts +1 -0
- package/src/maps/layers/bing-map.js +1 -0
- package/src/maps/layers/bubble.d.ts +4 -0
- package/src/maps/layers/bubble.js +7 -3
- package/src/maps/layers/color-mapping.d.ts +5 -0
- package/src/maps/layers/color-mapping.js +5 -3
- package/src/maps/layers/data-label.d.ts +0 -1
- package/src/maps/layers/data-label.js +5 -12
- package/src/maps/layers/layer-panel.d.ts +7 -7
- package/src/maps/layers/layer-panel.js +98 -53
- package/src/maps/layers/legend.js +19 -19
- package/src/maps/layers/marker.d.ts +13 -0
- package/src/maps/layers/marker.js +124 -107
- package/src/maps/layers/navigation-selected-line.d.ts +5 -0
- package/src/maps/layers/navigation-selected-line.js +111 -104
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +17 -0
- package/src/maps/maps.js +448 -364
- package/src/maps/model/base.js +1 -1
- package/src/maps/model/export-image.d.ts +4 -3
- package/src/maps/model/export-image.js +7 -6
- package/src/maps/model/export-pdf.d.ts +6 -6
- package/src/maps/model/export-pdf.js +8 -7
- package/src/maps/model/interface.d.ts +2 -2
- package/src/maps/model/print.d.ts +4 -2
- package/src/maps/model/print.js +6 -3
- package/src/maps/user-interaction/annotation.js +0 -2
- package/src/maps/user-interaction/highlight.js +4 -3
- package/src/maps/user-interaction/selection.js +4 -2
- package/src/maps/user-interaction/tooltip.js +5 -5
- package/src/maps/user-interaction/zoom.d.ts +5 -0
- package/src/maps/user-interaction/zoom.js +7 -7
- package/src/maps/utils/helper.d.ts +2 -0
- package/src/maps/utils/helper.js +37 -30
|
@@ -84,7 +84,8 @@ var Marker = /** @class */ (function () {
|
|
|
84
84
|
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
85
85
|
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
86
86
|
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
87
|
-
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
87
|
+
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
88
|
+
maps.markerNullCount + 1 : maps.markerNullCount;
|
|
88
89
|
var markerDataLength = markerData.length - maps.markerNullCount;
|
|
89
90
|
if (_this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
90
91
|
layerElement.appendChild(_this.markerSVGObject);
|
|
@@ -142,129 +143,137 @@ var Marker = /** @class */ (function () {
|
|
|
142
143
|
};
|
|
143
144
|
/**
|
|
144
145
|
* To calculate center position and factor value dynamically
|
|
146
|
+
*
|
|
147
|
+
* @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
|
|
148
|
+
* @returns {void}
|
|
145
149
|
*/
|
|
146
150
|
Marker.prototype.calculateZoomCenterPositionAndFactor = function (layersCollection) {
|
|
147
|
-
if (this.maps
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
151
|
+
if (!isNullOrUndefined(this.maps)) {
|
|
152
|
+
if (this.maps.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
|
|
153
|
+
var minLong_1;
|
|
154
|
+
var maxLat_1;
|
|
155
|
+
var minLat_1;
|
|
156
|
+
var maxLong_1;
|
|
157
|
+
var latZoom = void 0;
|
|
158
|
+
var lngZoom = void 0;
|
|
159
|
+
var result = void 0;
|
|
160
|
+
var zoomLevel = void 0;
|
|
161
|
+
var centerLat = void 0;
|
|
162
|
+
var centerLong = void 0;
|
|
163
|
+
var maxZoomFact = this.maps.zoomSettings.maxZoom;
|
|
164
|
+
var mapWidth = this.maps.mapAreaRect.width;
|
|
165
|
+
var mapHeight = this.maps.mapAreaRect.height;
|
|
166
|
+
this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState :
|
|
167
|
+
isNullOrUndefined(this.maps.markerZoomFactor) ? !this.maps.markerZoomedState :
|
|
168
|
+
this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
|
|
169
|
+
this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
|
|
170
|
+
Array.prototype.forEach.call(layersCollection, function (currentLayer) {
|
|
171
|
+
var isMarker = currentLayer.markerSettings.length !== 0;
|
|
172
|
+
if (isMarker) {
|
|
173
|
+
Array.prototype.forEach.call(currentLayer.markerSettings, function (markerSetting) {
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
175
|
+
var markerData = markerSetting.dataSource;
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
177
|
+
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
178
|
+
var latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
|
|
179
|
+
!isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
180
|
+
var longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
|
|
181
|
+
!isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
182
|
+
minLong_1 = isNullOrUndefined(minLong_1) && dataIndex === 0 ?
|
|
183
|
+
longitude : minLong_1;
|
|
184
|
+
maxLat_1 = isNullOrUndefined(maxLat_1) && dataIndex === 0 ?
|
|
185
|
+
latitude : maxLat_1;
|
|
186
|
+
minLat_1 = isNullOrUndefined(minLat_1) && dataIndex === 0 ?
|
|
187
|
+
latitude : minLat_1;
|
|
188
|
+
maxLong_1 = isNullOrUndefined(maxLong_1) && dataIndex === 0 ?
|
|
189
|
+
longitude : maxLong_1;
|
|
190
|
+
if (minLong_1 > longitude) {
|
|
191
|
+
minLong_1 = longitude;
|
|
192
|
+
}
|
|
193
|
+
if (minLat_1 > latitude) {
|
|
194
|
+
minLat_1 = latitude;
|
|
195
|
+
}
|
|
196
|
+
if (maxLong_1 < longitude) {
|
|
197
|
+
maxLong_1 = longitude;
|
|
198
|
+
}
|
|
199
|
+
if (maxLat_1 < latitude) {
|
|
200
|
+
maxLat_1 = latitude;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
196
203
|
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
if (!isNullOrUndefined(minLat_1) && !isNullOrUndefined(minLong_1) &&
|
|
207
|
+
!isNullOrUndefined(maxLong_1) && !isNullOrUndefined(maxLat_1)) {
|
|
208
|
+
// To find the center position
|
|
209
|
+
centerLat = (minLat_1 + maxLat_1) / 2;
|
|
210
|
+
centerLong = (minLong_1 + maxLong_1) / 2;
|
|
211
|
+
this.maps.markerCenterLatitude = centerLat;
|
|
212
|
+
this.maps.markerCenterLongitude = centerLong;
|
|
213
|
+
if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
|
|
214
|
+
this.maps.markerZoomCenterPoint = {
|
|
215
|
+
latitude: centerLat,
|
|
216
|
+
longitude: centerLong
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
var markerFactor = void 0;
|
|
220
|
+
if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
|
|
221
|
+
zoomLevel = calculateZoomLevel(minLat_1, maxLat_1, minLong_1, maxLong_1, mapWidth, mapHeight, this.maps);
|
|
222
|
+
if (this.maps.isTileMap) {
|
|
223
|
+
markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
|
|
224
|
+
zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
|
|
225
|
+
zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
|
|
226
|
+
this.maps.mapScaleValue : zoomLevel;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
230
|
+
(Math.floor(this.maps.scale) !== 1 &&
|
|
231
|
+
this.maps.mapScaleValue !== zoomLevel)
|
|
232
|
+
&&
|
|
233
|
+
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
234
|
+
? this.maps.mapScaleValue : zoomLevel;
|
|
235
|
+
if (((markerFactor === this.maps.mapScaleValue &&
|
|
236
|
+
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
237
|
+
&& (!this.maps.enablePersistence))) {
|
|
238
|
+
markerFactor = zoomLevel;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
221
241
|
}
|
|
222
242
|
else {
|
|
243
|
+
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
223
244
|
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
224
|
-
(
|
|
225
|
-
this.maps.mapScaleValue !== zoomLevel)
|
|
226
|
-
&&
|
|
227
|
-
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
245
|
+
(this.maps.mapScaleValue !== zoomLevel)
|
|
228
246
|
? this.maps.mapScaleValue : zoomLevel;
|
|
229
|
-
if (((markerFactor === this.maps.mapScaleValue &&
|
|
230
|
-
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
231
|
-
&& (!this.maps.enablePersistence))) {
|
|
232
|
-
markerFactor = zoomLevel;
|
|
233
|
-
}
|
|
234
247
|
}
|
|
248
|
+
this.maps.markerZoomFactor = markerFactor;
|
|
235
249
|
}
|
|
236
|
-
else {
|
|
237
|
-
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
238
|
-
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
239
|
-
(this.maps.mapScaleValue !== zoomLevel)
|
|
240
|
-
? this.maps.mapScaleValue : zoomLevel;
|
|
241
|
-
}
|
|
242
|
-
this.maps.markerZoomFactor = markerFactor;
|
|
243
250
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
else {
|
|
252
|
+
this.maps.markerZoomedState = false;
|
|
253
|
+
if (this.maps.markerZoomFactor > 1) {
|
|
254
|
+
this.maps.markerCenterLatitude = null;
|
|
255
|
+
this.maps.markerCenterLongitude = null;
|
|
256
|
+
this.maps.markerZoomFactor = 1;
|
|
257
|
+
if (!this.maps.enablePersistence) {
|
|
258
|
+
this.maps.mapScaleValue = 1;
|
|
259
|
+
}
|
|
253
260
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
261
|
+
if (this.maps.isTileMap && !this.maps.enablePersistence
|
|
262
|
+
&& this.maps.mapScaleValue <= 1) {
|
|
263
|
+
this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
|
|
264
|
+
: this.maps.mapScaleValue;
|
|
265
|
+
if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
|
|
266
|
+
this.maps.tileTranslatePoint.x = 0;
|
|
267
|
+
this.maps.tileTranslatePoint.y = 0;
|
|
268
|
+
}
|
|
262
269
|
}
|
|
263
270
|
}
|
|
264
271
|
}
|
|
265
272
|
};
|
|
266
273
|
/**
|
|
267
274
|
* To check and trigger marker click event
|
|
275
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
276
|
+
* @returns {void}
|
|
268
277
|
*/
|
|
269
278
|
Marker.prototype.markerClick = function (e) {
|
|
270
279
|
var target = e.target.id;
|
|
@@ -286,6 +295,8 @@ var Marker = /** @class */ (function () {
|
|
|
286
295
|
};
|
|
287
296
|
/**
|
|
288
297
|
* To check and trigger Cluster click event
|
|
298
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
299
|
+
* @returns {void}
|
|
289
300
|
*/
|
|
290
301
|
Marker.prototype.markerClusterClick = function (e) {
|
|
291
302
|
var target = e.target.id;
|
|
@@ -377,6 +388,9 @@ var Marker = /** @class */ (function () {
|
|
|
377
388
|
};
|
|
378
389
|
/**
|
|
379
390
|
* To check and trigger marker move event
|
|
391
|
+
*
|
|
392
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
393
|
+
* @returns {void}
|
|
380
394
|
*/
|
|
381
395
|
Marker.prototype.markerMove = function (e) {
|
|
382
396
|
var targetId = e.target.id;
|
|
@@ -395,6 +409,9 @@ var Marker = /** @class */ (function () {
|
|
|
395
409
|
};
|
|
396
410
|
/**
|
|
397
411
|
* To check and trigger cluster move event
|
|
412
|
+
*
|
|
413
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
414
|
+
* @returns {void}
|
|
398
415
|
*/
|
|
399
416
|
Marker.prototype.markerClusterMouseMove = function (e) {
|
|
400
417
|
var targetId = e.target.id;
|
|
@@ -8,6 +8,11 @@ export declare class NavigationLine {
|
|
|
8
8
|
constructor(maps: Maps);
|
|
9
9
|
/**
|
|
10
10
|
* To render navigation line for maps
|
|
11
|
+
*
|
|
12
|
+
* @param {LayerSettings} layer - Specifies the layer instance to which the navigation line is to be rendered.
|
|
13
|
+
* @param {number} factor - Specifies the current zoom factor of the Maps.
|
|
14
|
+
* @param {number} layerIndex -Specifies the index of current layer.
|
|
15
|
+
* @returns {Element} - Returns the navigation line element.
|
|
11
16
|
*/
|
|
12
17
|
renderNavigation(layer: LayerSettings, factor: number, layerIndex: number): Element;
|
|
13
18
|
private convertRadius;
|
|
@@ -8,123 +8,130 @@ var NavigationLine = /** @class */ (function () {
|
|
|
8
8
|
function NavigationLine(maps) {
|
|
9
9
|
this.maps = maps;
|
|
10
10
|
}
|
|
11
|
-
// eslint-disable-next-line valid-jsdoc
|
|
12
11
|
/**
|
|
13
12
|
* To render navigation line for maps
|
|
13
|
+
*
|
|
14
|
+
* @param {LayerSettings} layer - Specifies the layer instance to which the navigation line is to be rendered.
|
|
15
|
+
* @param {number} factor - Specifies the current zoom factor of the Maps.
|
|
16
|
+
* @param {number} layerIndex -Specifies the index of current layer.
|
|
17
|
+
* @returns {Element} - Returns the navigation line element.
|
|
14
18
|
*/
|
|
15
19
|
NavigationLine.prototype.renderNavigation = function (layer, factor, layerIndex) {
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
latitude = navigation[i]['properties']['latitude'];
|
|
49
|
-
longitude = navigation[i]['properties']['longitude'];
|
|
50
|
-
visible = navigation[i]['properties']['visible'];
|
|
51
|
-
angle = navigation[i]['angle'];
|
|
52
|
-
width = navigation[i]['width'] || 1;
|
|
53
|
-
color = navigation[i]['color'];
|
|
54
|
-
dashArray = navigation[i]['properties']['dashArray'];
|
|
55
|
-
arrowSettings = navigation[i]['properties']['arrowSettings'];
|
|
56
|
-
showArrow = (isNullOrUndefined(arrowSettings)) ? false : arrowSettings['properties']['showArrow'];
|
|
57
|
-
if (longitude['length'] === latitude['length'] && visible) {
|
|
58
|
-
for (var i_1 = 0; i_1 < longitude['length']; i_1++) {
|
|
59
|
-
var location_1 = (this.maps.isTileMap) ? convertTileLatLongToPoint(new Point(longitude[i_1], latitude[i_1]), factor, this.maps.tileTranslatePoint, true) : convertGeoToPoint(latitude[i_1], longitude[i_1], factor, layer, this.maps);
|
|
60
|
-
point.push(location_1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
navigationGroup = (this.maps.renderer.createGroup({
|
|
64
|
-
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationGroup' + i + ''
|
|
20
|
+
var group;
|
|
21
|
+
if (!isNullOrUndefined(this.maps)) {
|
|
22
|
+
var navigationEle = void 0;
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
var navigation = layer.navigationLineSettings;
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
+
var longitude = void 0;
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
var point = [];
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
var latitude = void 0;
|
|
31
|
+
var visible = void 0;
|
|
32
|
+
var angle = void 0;
|
|
33
|
+
var width = void 0;
|
|
34
|
+
var color = void 0;
|
|
35
|
+
var dashArray = void 0;
|
|
36
|
+
var pathOption = void 0;
|
|
37
|
+
var direction = void 0;
|
|
38
|
+
var showArrow = void 0;
|
|
39
|
+
var arrowColor = void 0;
|
|
40
|
+
var arrowSize = void 0;
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
var arrowSettings = void 0;
|
|
43
|
+
var arrowPosition = void 0;
|
|
44
|
+
var startArrow = void 0;
|
|
45
|
+
var endArrow = void 0;
|
|
46
|
+
var offSet = void 0;
|
|
47
|
+
var offSetValue = void 0;
|
|
48
|
+
var navigationGroup = void 0;
|
|
49
|
+
var d = void 0;
|
|
50
|
+
group = (this.maps.renderer.createGroup({
|
|
51
|
+
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_line_Group'
|
|
65
52
|
}));
|
|
66
|
-
for (var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
53
|
+
for (var i = 0; i < navigation.length; i++) {
|
|
54
|
+
latitude = navigation[i]['properties']['latitude'];
|
|
55
|
+
longitude = navigation[i]['properties']['longitude'];
|
|
56
|
+
visible = navigation[i]['properties']['visible'];
|
|
57
|
+
angle = navigation[i]['angle'];
|
|
58
|
+
width = navigation[i]['width'] || 1;
|
|
59
|
+
color = navigation[i]['color'];
|
|
60
|
+
dashArray = navigation[i]['properties']['dashArray'];
|
|
61
|
+
arrowSettings = navigation[i]['properties']['arrowSettings'];
|
|
62
|
+
showArrow = (isNullOrUndefined(arrowSettings)) ? false : arrowSettings['properties']['showArrow'];
|
|
63
|
+
if (longitude['length'] === latitude['length'] && visible) {
|
|
64
|
+
for (var i_1 = 0; i_1 < longitude['length']; i_1++) {
|
|
65
|
+
var location_1 = (this.maps.isTileMap) ? convertTileLatLongToPoint(new Point(longitude[i_1], latitude[i_1]), factor, this.maps.tileTranslatePoint, true) : convertGeoToPoint(latitude[i_1], longitude[i_1], factor, layer, this.maps);
|
|
66
|
+
point.push(location_1);
|
|
75
67
|
}
|
|
76
68
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
navigationGroup = (this.maps.renderer.createGroup({
|
|
70
|
+
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationGroup' + i + ''
|
|
71
|
+
}));
|
|
72
|
+
for (var j = 0; j < point['length'] - 1; j++) {
|
|
73
|
+
angle = (-1 > angle) ? -1 : angle;
|
|
74
|
+
angle = (1 < angle) ? 1 : angle;
|
|
75
|
+
var arcId = this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationIndex_' + i + '_Line' + j + '';
|
|
76
|
+
var radius = this.convertRadius(point[j], point[j + 1]);
|
|
77
|
+
if (angle <= 1 && angle > 0) {
|
|
80
78
|
direction = 0;
|
|
79
|
+
if (point[j]['x'] > point[j + 1]['x']) {
|
|
80
|
+
direction = 1;
|
|
81
|
+
}
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
if (angle >= -1 && angle < 0) {
|
|
84
|
+
direction = 1;
|
|
85
|
+
if (point[j]['x'] > point[j + 1]['x']) {
|
|
86
|
+
direction = 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (showArrow) {
|
|
90
|
+
arrowColor = arrowSettings['properties']['color'];
|
|
91
|
+
arrowSize = arrowSettings['properties']['size'];
|
|
92
|
+
offSetValue = (arrowSettings['properties']['offSet'] === undefined) ? 0 : arrowSettings['properties']['offSet'];
|
|
93
|
+
var divide = (Math.round(arrowSize / 2));
|
|
94
|
+
arrowPosition = arrowSettings['properties']['position'];
|
|
95
|
+
startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
|
|
96
|
+
endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
|
|
97
|
+
if (offSet !== 0 && angle === 0) {
|
|
98
|
+
offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
|
|
99
|
+
}
|
|
100
|
+
offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
|
|
101
|
+
var triId = this.maps.element.id + '_triangle';
|
|
102
|
+
var defElement = this.maps.renderer.createDefs();
|
|
103
|
+
defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
|
|
104
|
+
var markerEle = defElement.querySelector('#' + 'triangle' + i);
|
|
105
|
+
markerEle.setAttribute('markerWidth', (arrowSize.toString()));
|
|
106
|
+
markerEle.setAttribute('markerHeight', (arrowSize.toString()));
|
|
107
|
+
markerEle.setAttribute('refX', (divide - offSet).toString());
|
|
108
|
+
markerEle.setAttribute('refY', divide.toString());
|
|
109
|
+
markerEle.setAttribute('orient', 'auto');
|
|
110
|
+
var d2 = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
|
|
111
|
+
pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
|
|
112
|
+
navigationEle = this.maps.renderer.drawPath(pathOption);
|
|
113
|
+
markerEle.appendChild(navigationEle);
|
|
114
|
+
defElement.appendChild(markerEle);
|
|
115
|
+
navigationGroup.appendChild(defElement);
|
|
93
116
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
markerEle.setAttribute('refX', (divide - offSet).toString());
|
|
102
|
-
markerEle.setAttribute('refY', divide.toString());
|
|
103
|
-
markerEle.setAttribute('orient', 'auto');
|
|
104
|
-
var d2 = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
|
|
105
|
-
pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
|
|
117
|
+
angle = Math.abs(angle);
|
|
118
|
+
d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
|
|
119
|
+
+ ',' + point[j + 1]['y'] + ' ' :
|
|
120
|
+
'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
|
|
121
|
+
' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
|
|
122
|
+
+ direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
|
|
123
|
+
pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
|
|
106
124
|
navigationEle = this.maps.renderer.drawPath(pathOption);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
|
|
115
|
-
' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
|
|
116
|
-
+ direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
|
|
117
|
-
pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
|
|
118
|
-
navigationEle = this.maps.renderer.drawPath(pathOption);
|
|
119
|
-
if (!isNullOrUndefined(arrowPosition)) {
|
|
120
|
-
var position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
|
|
121
|
-
: navigationEle.setAttribute('marker-end', endArrow);
|
|
125
|
+
if (!isNullOrUndefined(arrowPosition)) {
|
|
126
|
+
var position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
|
|
127
|
+
: navigationEle.setAttribute('marker-end', endArrow);
|
|
128
|
+
}
|
|
129
|
+
maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
|
|
130
|
+
navigationGroup.appendChild(navigationEle);
|
|
131
|
+
group.appendChild(navigationGroup);
|
|
122
132
|
}
|
|
123
|
-
|
|
124
|
-
navigationGroup.appendChild(navigationEle);
|
|
125
|
-
group.appendChild(navigationGroup);
|
|
133
|
+
point = [];
|
|
126
134
|
}
|
|
127
|
-
point = [];
|
|
128
135
|
}
|
|
129
136
|
return group;
|
|
130
137
|
};
|
package/src/maps/maps-model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Ajax } 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
|
|
1
|
+
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Ajax } 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 } from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs } 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';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|