@mapsindoors/react-native-maps-indoors-mapbox 1.0.9 → 1.1.0

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 (57) hide show
  1. package/README.md +14 -2
  2. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  3. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  6. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  8. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  9. package/android/.gradle/file-system.probe +0 -0
  10. package/android/.idea/misc.xml +0 -1
  11. package/android/.idea/vcs.xml +1 -0
  12. package/android/build.gradle +2 -2
  13. package/android/libs/core-4.3.0.aar +0 -0
  14. package/android/libs/mapbox-4.3.0.aar +0 -0
  15. package/android/src/main/AndroidManifest.xml +1 -1
  16. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/MapboxMapView.java +4 -4
  17. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/MapsIndoorsPackage.java +7 -7
  18. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/MapsIndoorsViewManager.java +1 -1
  19. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/DirectionsRendererModule.java +2 -2
  20. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/DirectionsServiceModule.java +24 -2
  21. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +1486 -0
  22. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/MapControlModule.java +32 -5
  23. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/MapsIndoorsModule.java +6 -6
  24. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/RCMapView.java +3 -3
  25. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/UtilsModule.java +11 -2
  26. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/Bounds.java +1 -1
  27. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/Filter.java +1 -1
  28. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/Location.java +1 -1
  29. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/MPCameraPosition.java +1 -1
  30. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/MPCameraUpdate.java +1 -1
  31. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/MPError.java +1 -1
  32. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/PositionProvider.java +1 -1
  33. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/PositionResult.java +1 -1
  34. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/Query.java +1 -1
  35. package/index.ts +10 -0
  36. package/ios/core/DirectionsServiceBridge.m +9 -0
  37. package/ios/core/DirectionsServiceModule.swift +25 -0
  38. package/ios/core/MPDisplayRuleBridge.m +198 -1
  39. package/ios/core/MPDisplayRuleModule.swift +603 -33
  40. package/ios/core/MapControlBridge.m +8 -0
  41. package/ios/core/MapControlModule.swift +24 -0
  42. package/ios/core/UtilsBridge.m +4 -0
  43. package/ios/core/UtilsModule.swift +5 -0
  44. package/package.json +1 -1
  45. package/react-native-maps-indoors-mapbox.podspec +2 -2
  46. package/src/core/MPBadgePosition.ts +12 -0
  47. package/src/core/MPDirectionsService.ts +25 -0
  48. package/src/core/MPDisplayRule.ts +574 -7
  49. package/src/core/MPHighlightBehavior.ts +95 -0
  50. package/src/core/MPIconPlacement.ts +13 -0
  51. package/src/core/MPLabelType.ts +10 -0
  52. package/src/core/MPSolutionConfig.ts +17 -0
  53. package/src/core/MPSolutionDisplayRule.ts +2 -0
  54. package/src/core/MPUtils.ts +12 -0
  55. package/src/core/MapControl.ts +23 -1
  56. package/android/src/main/java/com/reactlibrary/core/MPDisplayRuleModule.java +0 -816
  57. /package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/README.md +0 -0
@@ -0,0 +1,95 @@
1
+ import MapControl from "../../index";
2
+
3
+ /**
4
+ * Sets a behavior for the map when calling {@link MapControl#setHighlight}.
5
+ *
6
+ * Has a default behavior:
7
+ * * MoveCamera = false
8
+ * * ShowInfoWindow = false
9
+ * * AnimationDuration = 0
10
+ * * AllowFloorChange = false
11
+ * * ZoomToFit = true
12
+ *
13
+ * @export
14
+ * @class MPFilterBehavior
15
+ * @typedef {MPHighlightBehavior}
16
+ */
17
+ export default class MPHighlightBehavior {
18
+
19
+ /**
20
+ * Creates an instance of MPHighlightBehavior.
21
+ *
22
+ * @constructor
23
+ * @private
24
+ * @param {boolean} allowFloorChange Whether the highlighting is allowed to change the floor if no results are visible on the current floor.
25
+ * @param {boolean} moveCamera Whether the highlighting should move the camera to encompass the results.
26
+ * @param {number} animationDuration How long the camera movement should be animated for, set to 0 disables animation.
27
+ * @param {boolean} showInfoWindow Whether to open the info window if a single result is returned.
28
+ * @param {boolean} zoomToFit Whether the highlighting is allowed to zoom in/out the camera.
29
+ */
30
+ private constructor(
31
+ public allowFloorChange: boolean,
32
+ public moveCamera: boolean,
33
+ public animationDuration: number,
34
+ public showInfoWindow: boolean,
35
+ public zoomToFit: boolean,
36
+ ) { }
37
+
38
+ /**
39
+ * Creator for MPHighlightBehavior, invoke with 0 parameters to use default behavior.
40
+ *
41
+ * @public
42
+ * @static
43
+ * @param {MPFilterBehaviorParams} object
44
+ * @returns {MPFilterBehavior}
45
+ */
46
+ public static create(object?: MPHighlightBehaviorParams): MPHighlightBehavior {
47
+ return new MPHighlightBehavior(
48
+ object?.allowFloorChange ? object.allowFloorChange : false,
49
+ object?.moveCamera ? object.moveCamera : false,
50
+ object?.animationDuration ? object.animationDuration : 0,
51
+ object?.showInfoWindow ? object.showInfoWindow : false,
52
+ object?.zoomToFit ? object?.zoomToFit : true
53
+ );
54
+ };
55
+ }
56
+
57
+ /**
58
+ * Parameter interface for {@link MPHighlightBehavior}.
59
+ *
60
+ * @export
61
+ * @interface MPHighlightBehaviorParams
62
+ * @typedef {MPHighlightBehaviorParams}
63
+ */
64
+ export interface MPHighlightBehaviorParams {
65
+ /**
66
+ * Whether the highlight is allowed to change the floor if no results are visible on the current floor.
67
+ *
68
+ * @type {?boolean}
69
+ */
70
+ allowFloorChange?: boolean,
71
+ /**
72
+ * Whether the Highlight should move the camera to encompass the results.
73
+ *
74
+ * @type {?boolean}
75
+ */
76
+ moveCamera?: boolean,
77
+ /**
78
+ * How long the camera movement should be animated for, set to 0 disables animation.
79
+ *
80
+ * @type {?number}
81
+ */
82
+ animationDuration?: number,
83
+ /**
84
+ * Whether to open the info window if a single result is returned.
85
+ *
86
+ * @type {?boolean}
87
+ */
88
+ showInfoWindow?: boolean,
89
+ /**
90
+ * Whether the Highlight is allowed to zoom in/out the camera.
91
+ *
92
+ * @type {?boolean}
93
+ */
94
+ zoomToFit?: boolean,
95
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The possible position of Icons based on the location Anchor.
3
+ *
4
+ * @export
5
+ * @enum {number}
6
+ */
7
+ export enum MPIconPlacement {
8
+ center,
9
+ above,
10
+ below,
11
+ left,
12
+ right
13
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The type of label
3
+ *
4
+ * @export
5
+ * @enum {number}
6
+ */
7
+ export enum MPLabelType {
8
+ flat,
9
+ floating,
10
+ }
@@ -29,6 +29,7 @@ export default class MPSolutionConfig {
29
29
  public readonly settings3D: MPSettings3D,
30
30
  private _enableClustering?: boolean,
31
31
  private _mpCollisionHandling?: MPCollisionHandling,
32
+ private _isNewSelection?: boolean,
32
33
  ) { }
33
34
 
34
35
 
@@ -46,6 +47,7 @@ export default class MPSolutionConfig {
46
47
  MPSettings3D.create(object?.settings3D),
47
48
  object?.enableClustering,
48
49
  object?.collisionHandling,
50
+ object?.isNewSelection,
49
51
  );
50
52
  }
51
53
 
@@ -90,6 +92,15 @@ export default class MPSolutionConfig {
90
92
  public get enableClustering(): boolean {
91
93
  return this._enableClustering ? this._enableClustering : true;
92
94
  }
95
+
96
+ public set isNewSelection(enable: boolean) {
97
+ this._isNewSelection = enable;
98
+ MPUtils.setNewSelection(enable);
99
+ }
100
+
101
+ public get isNewSelection(): boolean {
102
+ return this._isNewSelection ? this._isNewSelection : true;
103
+ }
93
104
  }
94
105
 
95
106
  /**
@@ -124,4 +135,10 @@ export interface MPSolutionConfigParams {
124
135
  * @type {?MPCollisionHandling}
125
136
  */
126
137
  collisionHandling?: MPCollisionHandling,
138
+ /**
139
+ * New selection setting
140
+ *
141
+ * @type {?boolean}
142
+ */
143
+ isNewSelection?: boolean,
127
144
  }
@@ -10,4 +10,6 @@ export enum MPSolutionDisplayRule {
10
10
  buildingOutline = "buildingOutline",
11
11
  selectionHighlight = "selectionHighlight",
12
12
  positionIndicator = "positionIndicator",
13
+ selection = "selection",
14
+ highlight = "highlight"
13
15
  }
@@ -131,6 +131,18 @@ export default class MPUtils {
131
131
  return UtilsModule.enableClustering(enableClustering);
132
132
  }
133
133
 
134
+ /**
135
+ * Internal - Documentation will follow.
136
+ *
137
+ * @static
138
+ * @async
139
+ * @param {boolean} enableClustering
140
+ * @returns {Promise<void>}
141
+ */
142
+ static async setNewSelection(isNewSelection: boolean): Promise<void> {
143
+ return Promise.resolve(UtilsModule.setNewSelection(isNewSelection));
144
+ }
145
+
134
146
  /**
135
147
  * Internal - Documentation will follow.
136
148
  *
@@ -9,6 +9,7 @@ import {
9
9
  OnLiveLocationUpdateListener, MPCameraEvent, MPMapStyle, MPCameraUpdate, MPCameraPosition, MPEntity,
10
10
  } from "../../index"
11
11
  import { EventNames } from './EventNames';
12
+ import MPHighlightBehavior from './MPHighlightBehavior';
12
13
 
13
14
 
14
15
  const { MapControlModule } = NativeModules;
@@ -260,8 +261,9 @@ export default class MapControl {
260
261
  * @returns {Promise<boolean>} True if any locations are available.
261
262
  */
262
263
  public async setFilter(filter: MPFilter, filterBehavior: MPFilterBehavior): Promise<boolean>;
264
+
263
265
  /**
264
- * Use this method to display temporary locations, not points of interests location. Use [clearFilter()] to exit this state.
266
+ * Use this method to display temporary locations. Use [clearFilter()] to exit this state.
265
267
  *
266
268
  * @public
267
269
  * @async
@@ -281,6 +283,26 @@ export default class MapControl {
281
283
  }
282
284
  }
283
285
 
286
+ /**
287
+ *
288
+ * Use this method to highlight a list of locations. Use [clearHighlight()] to exit this state.
289
+ *
290
+ * @param locations the locations to highlight
291
+ * @param highlightBehavior How the map should show the applied highlight
292
+ * @returns
293
+ */
294
+ public async setHighlight(locations: MPLocation[], highlightBehavior: MPHighlightBehavior): Promise<void> {
295
+ const locationIds: string[] = new Array();
296
+ locations.forEach((location => {
297
+ locationIds.push(location.id);
298
+ }));
299
+ return Promise.resolve(MapControlModule.setHighlight(JSON.stringify(locationIds), JSON.stringify(highlightBehavior)));
300
+ }
301
+
302
+ public async clearHighlight(): Promise<void> {
303
+ return MapControlModule.clearHighlight();
304
+ }
305
+
284
306
  /**
285
307
  * Focus the map on the given {@link MPEntity}.
286
308
  *