@syncfusion/ej2-maps 20.3.49 → 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.
Files changed (48) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +65 -51
  4. package/dist/ej2-maps.min.js +2 -2
  5. package/dist/ej2-maps.umd.min.js +2 -2
  6. package/dist/ej2-maps.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-maps.es2015.js +1030 -781
  8. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  9. package/dist/es6/ej2-maps.es5.js +1017 -772
  10. package/dist/es6/ej2-maps.es5.js.map +1 -1
  11. package/dist/global/ej2-maps.min.js +2 -2
  12. package/dist/global/ej2-maps.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +34 -21
  15. package/src/maps/layers/bing-map.d.ts +1 -0
  16. package/src/maps/layers/bing-map.js +1 -0
  17. package/src/maps/layers/bubble.d.ts +4 -0
  18. package/src/maps/layers/bubble.js +7 -3
  19. package/src/maps/layers/color-mapping.d.ts +5 -0
  20. package/src/maps/layers/color-mapping.js +5 -3
  21. package/src/maps/layers/data-label.d.ts +0 -1
  22. package/src/maps/layers/data-label.js +13 -14
  23. package/src/maps/layers/layer-panel.d.ts +7 -7
  24. package/src/maps/layers/layer-panel.js +119 -72
  25. package/src/maps/layers/legend.js +30 -25
  26. package/src/maps/layers/marker.d.ts +13 -0
  27. package/src/maps/layers/marker.js +133 -115
  28. package/src/maps/layers/navigation-selected-line.d.ts +5 -0
  29. package/src/maps/layers/navigation-selected-line.js +70 -65
  30. package/src/maps/maps-model.d.ts +1 -1
  31. package/src/maps/maps.d.ts +19 -0
  32. package/src/maps/maps.js +469 -382
  33. package/src/maps/model/base.js +2 -2
  34. package/src/maps/model/export-image.d.ts +4 -3
  35. package/src/maps/model/export-image.js +7 -6
  36. package/src/maps/model/export-pdf.d.ts +6 -6
  37. package/src/maps/model/export-pdf.js +8 -7
  38. package/src/maps/model/interface.d.ts +2 -2
  39. package/src/maps/model/print.d.ts +4 -2
  40. package/src/maps/model/print.js +6 -3
  41. package/src/maps/user-interaction/annotation.js +2 -3
  42. package/src/maps/user-interaction/highlight.js +37 -13
  43. package/src/maps/user-interaction/selection.js +4 -2
  44. package/src/maps/user-interaction/tooltip.js +8 -8
  45. package/src/maps/user-interaction/zoom.d.ts +5 -0
  46. package/src/maps/user-interaction/zoom.js +39 -29
  47. package/src/maps/utils/helper.d.ts +2 -0
  48. package/src/maps/utils/helper.js +58 -45
@@ -25,14 +25,21 @@ export declare class Marker {
25
25
  private calculateIndividualLayerMarkerZoomLevel;
26
26
  /**
27
27
  * To calculate center position and factor value dynamically
28
+ *
29
+ * @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
30
+ * @returns {void}
28
31
  */
29
32
  calculateZoomCenterPositionAndFactor(layersCollection: LayerSettings[]): void;
30
33
  /**
31
34
  * To check and trigger marker click event
35
+ * @param {PointerEvent} e - Specifies the pointer event argument.
36
+ * @returns {void}
32
37
  */
33
38
  markerClick(e: PointerEvent): void;
34
39
  /**
35
40
  * To check and trigger Cluster click event
41
+ * @param {PointerEvent} e - Specifies the pointer event argument.
42
+ * @returns {void}
36
43
  */
37
44
  markerClusterClick(e: PointerEvent): void;
38
45
  /**
@@ -44,10 +51,16 @@ export declare class Marker {
44
51
  private getMarker;
45
52
  /**
46
53
  * To check and trigger marker move event
54
+ *
55
+ * @param {PointerEvent} e - Specifies the pointer event argument.
56
+ * @returns {void}
47
57
  */
48
58
  markerMove(e: PointerEvent): void;
49
59
  /**
50
60
  * To check and trigger cluster move event
61
+ *
62
+ * @param {PointerEvent} e - Specifies the pointer event argument.
63
+ * @returns {void}
51
64
  */
52
65
  markerClusterMouseMove(e: PointerEvent): void;
53
66
  /**
@@ -23,18 +23,18 @@ var Marker = /** @class */ (function () {
23
23
  var currentLayer = maps.layersCollection[layerIndex];
24
24
  this.markerSVGObject = maps.renderer.createGroup({
25
25
  id: maps.element.id + '_Markers_Group',
26
- class: 'GroupElement',
27
- style: 'pointer-events: auto;'
26
+ class: 'GroupElement'
28
27
  });
28
+ this.markerSVGObject.style.pointerEvents = 'auto';
29
29
  var markerTemplateEle = createElement('div', {
30
30
  id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
31
- className: maps.element.id + '_template',
32
- styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
33
- 'top:' + maps.mapAreaRect.y + 'px;' +
34
- 'left:' + maps.mapAreaRect.x + 'px;' +
35
- 'height:' + maps.mapAreaRect.height + 'px;' +
36
- 'width:' + maps.mapAreaRect.width + 'px;'
31
+ className: maps.element.id + '_template'
37
32
  });
33
+ markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
34
+ 'top:' + maps.mapAreaRect.y + 'px;' +
35
+ 'left:' + maps.mapAreaRect.x + 'px;' +
36
+ 'height:' + maps.mapAreaRect.height + 'px;' +
37
+ 'width:' + maps.mapAreaRect.width + 'px;';
38
38
  currentLayer.markerSettings.map(function (markerSettings, markerIndex) {
39
39
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
40
  var markerData = markerSettings.dataSource;
@@ -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)) ? maps.markerNullCount + 1 : maps.markerNullCount;
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,128 +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.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
148
- var minLong_1;
149
- var maxLat_1;
150
- var minLat_1;
151
- var maxLong_1;
152
- var latZoom = void 0;
153
- var lngZoom = void 0;
154
- var result = void 0;
155
- var zoomLevel = void 0;
156
- var centerLat = void 0;
157
- var centerLong = void 0;
158
- var maxZoomFact = this.maps.zoomSettings.maxZoom;
159
- var mapWidth = this.maps.mapAreaRect.width;
160
- var mapHeight = this.maps.mapAreaRect.height;
161
- this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState : isNullOrUndefined(this.maps.markerZoomFactor) ?
162
- !this.maps.markerZoomedState : this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
163
- this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
164
- Array.prototype.forEach.call(layersCollection, function (currentLayer, layerIndex) {
165
- var isMarker = currentLayer.markerSettings.length !== 0;
166
- if (isMarker) {
167
- Array.prototype.forEach.call(currentLayer.markerSettings, function (markerSetting, markerIndex) {
168
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
169
- var markerData = markerSetting.dataSource;
170
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
171
- Array.prototype.forEach.call(markerData, function (data, dataIndex) {
172
- var latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
173
- !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
174
- var longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
175
- !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
176
- minLong_1 = isNullOrUndefined(minLong_1) && dataIndex === 0 ?
177
- longitude : minLong_1;
178
- maxLat_1 = isNullOrUndefined(maxLat_1) && dataIndex === 0 ?
179
- latitude : maxLat_1;
180
- minLat_1 = isNullOrUndefined(minLat_1) && dataIndex === 0 ?
181
- latitude : minLat_1;
182
- maxLong_1 = isNullOrUndefined(maxLong_1) && dataIndex === 0 ?
183
- longitude : maxLong_1;
184
- if (minLong_1 > longitude) {
185
- minLong_1 = longitude;
186
- }
187
- if (minLat_1 > latitude) {
188
- minLat_1 = latitude;
189
- }
190
- if (maxLong_1 < longitude) {
191
- maxLong_1 = longitude;
192
- }
193
- if (maxLat_1 < latitude) {
194
- maxLat_1 = latitude;
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
- if (!isNullOrUndefined(minLat_1) && !isNullOrUndefined(minLong_1) &&
201
- !isNullOrUndefined(maxLong_1) && !isNullOrUndefined(maxLat_1)) {
202
- // To find the center position
203
- centerLat = (minLat_1 + maxLat_1) / 2;
204
- centerLong = (minLong_1 + maxLong_1) / 2;
205
- this.maps.markerCenterLatitude = centerLat;
206
- this.maps.markerCenterLongitude = centerLong;
207
- if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
208
- this.maps.markerZoomCenterPoint = {
209
- latitude: centerLat,
210
- longitude: centerLong
211
- };
212
- }
213
- var markerFactor = void 0;
214
- if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
215
- zoomLevel = calculateZoomLevel(minLat_1, maxLat_1, minLong_1, maxLong_1, mapWidth, mapHeight, this.maps);
216
- if (this.maps.isTileMap) {
217
- markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
218
- zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
219
- zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
220
- this.maps.mapScaleValue : zoomLevel;
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
- (Math.floor(this.maps.scale) !== 1 &&
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
- else {
246
- this.maps.markerZoomedState = false;
247
- if (this.maps.markerZoomFactor > 1) {
248
- this.maps.markerCenterLatitude = null;
249
- this.maps.markerCenterLongitude = null;
250
- this.maps.markerZoomFactor = 1;
251
- if (!this.maps.enablePersistence) {
252
- this.maps.mapScaleValue = 1;
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
- if (this.maps.isTileMap && !this.maps.enablePersistence
256
- && this.maps.mapScaleValue <= 1) {
257
- this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? 1 : this.maps.mapScaleValue;
258
- if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
259
- this.maps.tileTranslatePoint.x = 0;
260
- this.maps.tileTranslatePoint.y = 0;
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
+ }
261
269
  }
262
270
  }
263
271
  }
264
272
  };
265
273
  /**
266
274
  * To check and trigger marker click event
275
+ * @param {PointerEvent} e - Specifies the pointer event argument.
276
+ * @returns {void}
267
277
  */
268
278
  Marker.prototype.markerClick = function (e) {
269
279
  var target = e.target.id;
@@ -285,6 +295,8 @@ var Marker = /** @class */ (function () {
285
295
  };
286
296
  /**
287
297
  * To check and trigger Cluster click event
298
+ * @param {PointerEvent} e - Specifies the pointer event argument.
299
+ * @returns {void}
288
300
  */
289
301
  Marker.prototype.markerClusterClick = function (e) {
290
302
  var target = e.target.id;
@@ -376,6 +388,9 @@ var Marker = /** @class */ (function () {
376
388
  };
377
389
  /**
378
390
  * To check and trigger marker move event
391
+ *
392
+ * @param {PointerEvent} e - Specifies the pointer event argument.
393
+ * @returns {void}
379
394
  */
380
395
  Marker.prototype.markerMove = function (e) {
381
396
  var targetId = e.target.id;
@@ -394,6 +409,9 @@ var Marker = /** @class */ (function () {
394
409
  };
395
410
  /**
396
411
  * To check and trigger cluster move event
412
+ *
413
+ * @param {PointerEvent} e - Specifies the pointer event argument.
414
+ * @returns {void}
397
415
  */
398
416
  Marker.prototype.markerClusterMouseMove = function (e) {
399
417
  var targetId = e.target.id;
@@ -402,7 +420,7 @@ var Marker = /** @class */ (function () {
402
420
  }
403
421
  var options = this.getMarker(targetId);
404
422
  if (this.maps.markerClusterExpand) {
405
- e.target.setAttribute('style', 'cursor: pointer');
423
+ e.target.style.cursor = 'pointer';
406
424
  }
407
425
  if (isNullOrUndefined(options)) {
408
426
  return;
@@ -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,79 +8,84 @@ 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 navigationEle;
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
- var navigation = layer.navigationLineSettings;
19
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
- var longitude;
21
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
- var point = [];
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- var latitude;
25
- var visible;
26
- var angle;
27
- var width;
28
- var color;
29
- var dashArray;
30
- var pathOption;
31
- var direction;
32
- var showArrow;
33
- var arrowColor;
34
- var arrowSize;
35
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
- var arrowSettings;
37
- var arrowPosition;
38
- var startArrow;
39
- var endArrow;
40
- var offSet;
41
- var offSetValue;
42
- var navigationGroup;
43
- var d;
44
- var group = (this.maps.renderer.createGroup({
45
- id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_line_Group'
46
- }));
47
- for (var i = 0; i < navigation.length; i++) {
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 j = 0; j < point['length'] - 1; j++) {
67
- angle = (-1 > angle) ? -1 : angle;
68
- angle = (1 < angle) ? 1 : angle;
69
- var arcId = this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationIndex_' + i + '_Line' + j + '';
70
- var radius = this.convertRadius(point[j], point[j + 1]);
71
- if (angle <= 1 && angle > 0) {
72
- direction = 0;
73
- if (point[j]['x'] > point[j + 1]['x']) {
74
- direction = 1;
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
- if (angle >= -1 && angle < 0) {
78
- direction = 1;
79
- if (point[j]['x'] > point[j + 1]['x']) {
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
+ }
82
+ }
83
+ if (angle >= -1 && angle < 0) {
84
+ direction = 1;
85
+ if (point[j]['x'] > point[j + 1]['x']) {
86
+ direction = 0;
87
+ }
81
88
  }
82
- }
83
- if (point[j]['x'] !== point[j + 1]['x']) {
84
89
  if (showArrow) {
85
90
  arrowColor = arrowSettings['properties']['color'];
86
91
  arrowSize = arrowSettings['properties']['size'];
@@ -125,8 +130,8 @@ var NavigationLine = /** @class */ (function () {
125
130
  navigationGroup.appendChild(navigationEle);
126
131
  group.appendChild(navigationGroup);
127
132
  }
133
+ point = [];
128
134
  }
129
- point = [];
130
135
  }
131
136
  return group;
132
137
  };
@@ -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, Tile } 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 { BingMap } from './layers/bing-map';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, convertGeoToPoint, 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';
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
  /**