@syncfusion/ej2-maps 20.3.56 → 20.4.40

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 +11 -1
  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 +961 -730
  8. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  9. package/dist/es6/ej2-maps.es5.js +947 -720
  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 +5 -12
  23. package/src/maps/layers/layer-panel.d.ts +7 -7
  24. package/src/maps/layers/layer-panel.js +98 -53
  25. package/src/maps/layers/legend.js +63 -26
  26. package/src/maps/layers/marker.d.ts +13 -0
  27. package/src/maps/layers/marker.js +124 -107
  28. package/src/maps/layers/navigation-selected-line.d.ts +5 -0
  29. package/src/maps/layers/navigation-selected-line.js +111 -104
  30. package/src/maps/maps-model.d.ts +1 -1
  31. package/src/maps/maps.d.ts +17 -0
  32. package/src/maps/maps.js +448 -364
  33. package/src/maps/model/base.js +1 -1
  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 +0 -2
  42. package/src/maps/user-interaction/highlight.js +4 -3
  43. package/src/maps/user-interaction/selection.js +4 -2
  44. package/src/maps/user-interaction/tooltip.js +5 -5
  45. package/src/maps/user-interaction/zoom.d.ts +5 -0
  46. package/src/maps/user-interaction/zoom.js +9 -8
  47. package/src/maps/utils/helper.d.ts +2 -0
  48. 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)) ? 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,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.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 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
258
- : this.maps.mapScaleValue;
259
- if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
260
- this.maps.tileTranslatePoint.x = 0;
261
- 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
+ }
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 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
+ }
81
82
  }
82
- }
83
- if (showArrow) {
84
- arrowColor = arrowSettings['properties']['color'];
85
- arrowSize = arrowSettings['properties']['size'];
86
- offSetValue = (arrowSettings['properties']['offSet'] === undefined) ? 0 : arrowSettings['properties']['offSet'];
87
- var divide = (Math.round(arrowSize / 2));
88
- arrowPosition = arrowSettings['properties']['position'];
89
- startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
90
- endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
91
- if (offSet !== 0 && angle === 0) {
92
- offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
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
- offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
95
- var triId = this.maps.element.id + '_triangle';
96
- var defElement = this.maps.renderer.createDefs();
97
- defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
98
- var markerEle = defElement.querySelector('#' + 'triangle' + i);
99
- markerEle.setAttribute('markerWidth', (arrowSize.toString()));
100
- markerEle.setAttribute('markerHeight', (arrowSize.toString()));
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
- markerEle.appendChild(navigationEle);
108
- defElement.appendChild(markerEle);
109
- navigationGroup.appendChild(defElement);
110
- }
111
- angle = Math.abs(angle);
112
- d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
113
- + ',' + point[j + 1]['y'] + ' ' :
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
- maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
124
- navigationGroup.appendChild(navigationEle);
125
- group.appendChild(navigationGroup);
133
+ point = [];
126
134
  }
127
- point = [];
128
135
  }
129
136
  return group;
130
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
  /**