@mapsindoors/react-native-maps-indoors-mapbox 2.5.4 → 2.6.1

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 (130) hide show
  1. package/README.md +3 -3
  2. package/android/build.gradle +1 -1
  3. package/package.json +1 -1
  4. package/react-native-maps-indoors-mapbox.podspec +2 -2
  5. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +0 -322
  6. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +0 -166
  7. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +0 -1699
  8. package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +0 -761
  9. package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +0 -410
  10. package/android/src/main/java/com/mapsindoorsrn/core/RCMapView.java +0 -16
  11. package/android/src/main/java/com/mapsindoorsrn/core/README.md +0 -3
  12. package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +0 -227
  13. package/android/src/main/java/com/mapsindoorsrn/core/models/BitmapStopIconConfig.java +0 -22
  14. package/android/src/main/java/com/mapsindoorsrn/core/models/Bounds.java +0 -19
  15. package/android/src/main/java/com/mapsindoorsrn/core/models/Filter.java +0 -77
  16. package/android/src/main/java/com/mapsindoorsrn/core/models/Location.java +0 -17
  17. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraPosition.java +0 -34
  18. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraUpdate.java +0 -68
  19. package/android/src/main/java/com/mapsindoorsrn/core/models/MPError.java +0 -38
  20. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionProvider.java +0 -46
  21. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionResult.java +0 -117
  22. package/android/src/main/java/com/mapsindoorsrn/core/models/Query.java +0 -30
  23. package/android/src/main/java/com/mapsindoorsrn/core/models/RouteStopIconConfigModel.java +0 -35
  24. package/ios/core/CameraPosition.swift +0 -15
  25. package/ios/core/CameraUpdate.swift +0 -19
  26. package/ios/core/CameraUpdateError.swift +0 -11
  27. package/ios/core/DirectionsRendererBridge.m +0 -59
  28. package/ios/core/DirectionsRendererModule.swift +0 -359
  29. package/ios/core/DirectionsServiceBridge.m +0 -55
  30. package/ios/core/DirectionsServiceModule.swift +0 -186
  31. package/ios/core/IconStopUrl.swift +0 -17
  32. package/ios/core/LabelGraphic.swift +0 -15
  33. package/ios/core/MPDisplayRuleBridge.m +0 -696
  34. package/ios/core/MPDisplayRuleModule.swift +0 -1704
  35. package/ios/core/MapControlBridge.m +0 -213
  36. package/ios/core/MapControlModule.swift +0 -702
  37. package/ios/core/MapsIndoorsBridge.m +0 -128
  38. package/ios/core/MapsIndoorsData.swift +0 -288
  39. package/ios/core/MapsIndoorsModule.swift +0 -363
  40. package/ios/core/RCMapView.swift +0 -16
  41. package/ios/core/README.md +0 -3
  42. package/ios/core/ReactPositionProvider.swift +0 -27
  43. package/ios/core/RouteIcon.swift +0 -34
  44. package/ios/core/UtilsBridge.m +0 -73
  45. package/ios/core/UtilsModule.swift +0 -182
  46. package/ios/core/helpers.swift +0 -57
  47. package/src/core/EventNames.ts +0 -21
  48. package/src/core/MPBadgePosition.ts +0 -12
  49. package/src/core/MPBounds.ts +0 -155
  50. package/src/core/MPBuilding.ts +0 -333
  51. package/src/core/MPBuildingCollection.ts +0 -57
  52. package/src/core/MPBuildingInfo.ts +0 -63
  53. package/src/core/MPCameraEvent.ts +0 -17
  54. package/src/core/MPCameraEventListener.ts +0 -17
  55. package/src/core/MPCameraPosition.ts +0 -82
  56. package/src/core/MPCameraUpdate.ts +0 -174
  57. package/src/core/MPCameraViewFitMode.ts +0 -25
  58. package/src/core/MPCategory.ts +0 -76
  59. package/src/core/MPCategoryCollection.ts +0 -62
  60. package/src/core/MPCollection.ts +0 -59
  61. package/src/core/MPCollisionHandling.ts +0 -12
  62. package/src/core/MPDataField.ts +0 -69
  63. package/src/core/MPDirectionsRenderer.ts +0 -238
  64. package/src/core/MPDirectionsService.ts +0 -152
  65. package/src/core/MPDisplayRule.ts +0 -1823
  66. package/src/core/MPEntity.ts +0 -60
  67. package/src/core/MPEntityInfo.ts +0 -28
  68. package/src/core/MPError.ts +0 -122
  69. package/src/core/MPFeatureTypes.ts +0 -8
  70. package/src/core/MPFilter.ts +0 -168
  71. package/src/core/MPFilterBehavior.ts +0 -115
  72. package/src/core/MPFloor.ts +0 -170
  73. package/src/core/MPFloorSelectorInterface.ts +0 -63
  74. package/src/core/MPGeometry.ts +0 -91
  75. package/src/core/MPHighlightBehavior.ts +0 -115
  76. package/src/core/MPHighway.ts +0 -14
  77. package/src/core/MPIconPlacement.ts +0 -13
  78. package/src/core/MPIconSize.ts +0 -39
  79. package/src/core/MPLabelGraphic.ts +0 -24
  80. package/src/core/MPLabelPosition.ts +0 -12
  81. package/src/core/MPLabelType.ts +0 -11
  82. package/src/core/MPLocation.ts +0 -410
  83. package/src/core/MPLocationPropertyNames.ts +0 -30
  84. package/src/core/MPLocationSettings.ts +0 -40
  85. package/src/core/MPLocationType.ts +0 -16
  86. package/src/core/MPMapConfig.ts +0 -280
  87. package/src/core/MPMapStyle.ts +0 -57
  88. package/src/core/MPMultiPolygon.ts +0 -218
  89. package/src/core/MPPOIType.ts +0 -43
  90. package/src/core/MPPoint.ts +0 -169
  91. package/src/core/MPPolygon.ts +0 -219
  92. package/src/core/MPPositionProviderInterface.ts +0 -45
  93. package/src/core/MPPositionResultInterface.ts +0 -42
  94. package/src/core/MPPropertyData.ts +0 -224
  95. package/src/core/MPQuery.ts +0 -69
  96. package/src/core/MPRoute.ts +0 -105
  97. package/src/core/MPRouteCoordinate.ts +0 -95
  98. package/src/core/MPRouteLeg.ts +0 -158
  99. package/src/core/MPRouteProperty.ts +0 -83
  100. package/src/core/MPRouteStep.ts +0 -186
  101. package/src/core/MPRouteStopIconConfig.ts +0 -82
  102. package/src/core/MPSelectionBehavior.ts +0 -114
  103. package/src/core/MPSelectionMode.ts +0 -4
  104. package/src/core/MPSettings3D.ts +0 -107
  105. package/src/core/MPSize.ts +0 -21
  106. package/src/core/MPSolution.ts +0 -189
  107. package/src/core/MPSolutionConfig.ts +0 -188
  108. package/src/core/MPSolutionDisplayRule.ts +0 -15
  109. package/src/core/MPUserRole.ts +0 -60
  110. package/src/core/MPUserRoleCollection.ts +0 -37
  111. package/src/core/MPUtils.ts +0 -178
  112. package/src/core/MPVenue.ts +0 -294
  113. package/src/core/MPVenueCollection.ts +0 -58
  114. package/src/core/MPVenueInfo.ts +0 -62
  115. package/src/core/MapControl.ts +0 -961
  116. package/src/core/MapView.tsx +0 -34
  117. package/src/core/MapsIndoors.ts +0 -571
  118. package/src/core/OnBuildingFoundAtCameraTargetListener.ts +0 -17
  119. package/src/core/OnFloorSelectionChangedListener.ts +0 -17
  120. package/src/core/OnFloorUpdateListener.ts +0 -16
  121. package/src/core/OnLegSelectedListener.ts +0 -17
  122. package/src/core/OnLiveLocationUpdateListener.ts +0 -17
  123. package/src/core/OnLocationSelectedListener.ts +0 -17
  124. package/src/core/OnMapClickListener.ts +0 -20
  125. package/src/core/OnMarkerClickListener.ts +0 -17
  126. package/src/core/OnMarkerInfoWindowClickListener.ts +0 -17
  127. package/src/core/OnPositionUpdateListener.ts +0 -17
  128. package/src/core/OnVenueFoundAtCameraTargetListener.ts +0 -17
  129. package/src/core/README.md +0 -3
  130. package/src/core/RouteStopIconConfig.ts +0 -10
@@ -1,238 +0,0 @@
1
- import { EmitterSubscription, NativeEventEmitter, NativeModules } from 'react-native';
2
- import { MPCameraViewFitMode, MPError, MPRoute, OnLegSelectedListener } from "../../index";
3
- import { EventNames } from './EventNames';
4
- import { RouteStopIconConfig } from './RouteStopIconConfig';
5
-
6
- const { DirectionsRenderer } = NativeModules;
7
-
8
- /**
9
- * Renders a {@link MPRoute} on the map.
10
- *
11
- * @export
12
- * @class MPDirectionsRenderer
13
- * @typedef {MPDirectionsRenderer}
14
- */
15
- export default class MPDirectionsRenderer {
16
-
17
- private _defaultRouteStopIcon?: RouteStopIconConfig
18
- get defaultRouteStopIcon(): RouteStopIconConfig {
19
- return this._defaultRouteStopIcon;
20
- }
21
- /**
22
- * Listener for leg selection events.
23
- *
24
- * @private
25
- * @type {?EmitterSubscription}
26
- */
27
- private onLegSelectedSub?: EmitterSubscription;
28
- /**
29
- * Event handler.
30
- *
31
- * @private
32
- * @type {?NativeEventEmitter}
33
- */
34
- private eventEmitter?: NativeEventEmitter;
35
-
36
- /**
37
- * Creates an instance of MPDirectionsRenderer.
38
- *
39
- * @constructor
40
- * @public
41
- * @param {typeof NativeEventEmitter} nativeEventEmitter
42
- */
43
- public constructor(nativeEventEmitter: typeof NativeEventEmitter) {
44
- this.eventEmitter = new nativeEventEmitter(DirectionsRenderer);
45
- }
46
-
47
- /**
48
- * Clears the route from the map.
49
- *
50
- * @public
51
- * @async
52
- * @returns {Promise<void>}
53
- */
54
- public async clear(): Promise<void> {
55
- await DirectionsRenderer.clear();
56
- }
57
-
58
- /**
59
- * Selects the next leg if possible.
60
- *
61
- * Has no effect if the last leg is selected.
62
- *
63
- * @public
64
- * @async
65
- * @returns {Promise<void>}
66
- */
67
- public async nextLeg(): Promise<void> {
68
- await DirectionsRenderer.nextLeg();
69
- }
70
-
71
- /**
72
- * Selects the previous leg if possible.
73
- *
74
- * Has no effect if the first leg is selected.
75
- *
76
- * @public
77
- * @async
78
- * @returns {Promise<void>}
79
- */
80
- public async previousLeg(): Promise<void> {
81
- await DirectionsRenderer.previousLeg();
82
- }
83
-
84
- /**
85
- * Set a route to be rendered. This also resets the selected leg and step indices to 0.
86
- *
87
- * @public
88
- * @async
89
- * @param {?MPRoute} [route]
90
- * @param {RouteStopIconConfig[]} [stopIcons]
91
- * @param {?number} [legIndex] Overwrites the starting leg index, when rendering the route
92
- * @returns {Promise<void>}
93
- */
94
- public async setRoute(route: MPRoute, stopIcons: Map<number, RouteStopIconConfig> = null, legIndex: number = 0): Promise<void> {
95
- var iconsAsString = new Map<number, string>();
96
- if (stopIcons !== null) {
97
- stopIcons.forEach((icon, index) => {
98
- iconsAsString.set(index, icon.getImage().toString());
99
- });
100
- }
101
- await DirectionsRenderer.setRoute(JSON.stringify(route), JSON.stringify(Object.fromEntries(iconsAsString.entries())), legIndex);
102
- }
103
-
104
- /**
105
- * Set the default icon for route stops.
106
- *
107
- * @public
108
- * @async
109
- * @param {RouteStopIconConfig} icon
110
- * @returns {Promise<void>}
111
- */
112
- public async setDefaultRouteStopIcon(icon: RouteStopIconConfig): Promise<void> {
113
- this._defaultRouteStopIcon = icon;
114
- await DirectionsRenderer.setDefaultRouteStopIcon(icon.getImage().toString());
115
- }
116
-
117
- /**
118
- * Enable/Disable the polyline animation when displaying a route element on the map.
119
- *
120
- * @public
121
- * @async
122
- * @param {boolean} animated
123
- * @param {boolean} repeating
124
- * @param {number} durationMs
125
- * @returns {Promise<void>}
126
- */
127
- public async setAnimatedPolyline(animated: boolean, repeating: boolean, durationMs: number): Promise<void> {
128
- await DirectionsRenderer.setAnimatedPolyline(animated, repeating, durationMs);
129
- }
130
-
131
- /**
132
- * Enable/Disable the route end/start label buttons from showing on the route. Default is true
133
- *
134
- * @public
135
- * @async
136
- * @param {boolean} show
137
- * @returns {Promise<void>}
138
- */
139
- public async showRouteLegButtons(show: boolean): Promise<void> {
140
- await DirectionsRenderer.showRouteLegButtons(show);
141
- }
142
-
143
- /**
144
- * Manually set the selected leg index on the route.
145
- *
146
- * This may reject if the resulting internal state is invalid (parsed index is out of bounds).
147
- *
148
- * @public
149
- * @async
150
- * @param {number} legIndex
151
- * @returns {Promise<void>}
152
- */
153
- public async selectLegIndex(legIndex: number): Promise<void> {
154
- await DirectionsRenderer.selectLegIndex(legIndex).catch((err: Error) => {
155
- return Promise.reject(MPError.create(JSON.parse(err.message)));
156
- });
157
- }
158
-
159
- /**
160
- * Gets the currently selected leg's floor index.
161
- *
162
- * @public
163
- * @async
164
- * @returns {Promise<number>}
165
- */
166
- public async getSelectedLegFloorIndex(): Promise<number> {
167
- return DirectionsRenderer.getSelectedLegFloorIndex();
168
- }
169
-
170
- /**
171
- * Set the duration of camera animations in ms.
172
- *
173
- * If the duration < 0 then camera animations are disabled, and the camera will move instantly.
174
- *
175
- * The value is 1000 ms by default
176
- *
177
- * @public
178
- * @async
179
- * @param {number} durationMs
180
- * @returns {Promise<void>}
181
- */
182
- public async setCameraAnimationDuration(durationMs: number): Promise<void> {
183
- await DirectionsRenderer.setCameraAnimationDuration(durationMs);
184
- }
185
-
186
- /**
187
- * Set the fitmode of the camera, when displaying route elements on the map.
188
- *
189
- * @public
190
- * @async
191
- * @param {MPCameraViewFitMode} fitMode
192
- * @returns {Promise<void>}
193
- */
194
- public async setCameraViewFitMode(fitMode: MPCameraViewFitMode): Promise<void> {
195
- let cameraFitMode: number;
196
- switch (fitMode) {
197
- case MPCameraViewFitMode.northAligned: {
198
- cameraFitMode = 0;
199
- break;
200
- }
201
- case MPCameraViewFitMode.firstStepAligned: {
202
- cameraFitMode = 1;
203
- break;
204
- }
205
- case MPCameraViewFitMode.startToEndAligned: {
206
- cameraFitMode = 2;
207
- break;
208
- }
209
- case MPCameraViewFitMode.none: {
210
- cameraFitMode = 3;
211
- break;
212
- }
213
- }
214
-
215
- return await DirectionsRenderer.setCameraViewFitMode(cameraFitMode);
216
- }
217
-
218
- /**
219
- * Set a listener, which will be invoked when a new leg has been selected.
220
- *
221
- * This is used for when the forward/back markers are selected on the map.
222
- *
223
- * @public
224
- * @async
225
- * @param {?OnLegSelectedListener} [listener]
226
- * @returns {Promise<void>}
227
- */
228
- public async setOnLegSelectedListener(listener?: OnLegSelectedListener): Promise<void> {
229
- await DirectionsRenderer.setOnLegSelectedListener();
230
- this.onLegSelectedSub?.remove();
231
- if (listener !== undefined) {
232
- this.onLegSelectedSub = this.eventEmitter?.addListener(EventNames.onLegSelected, event => {
233
- const leg = event.leg;
234
- listener(leg);
235
- });
236
- }
237
- }
238
- }
@@ -1,152 +0,0 @@
1
- import { NativeModules } from 'react-native';
2
- import { MPError, MPPoint, MPRoute, MPHighway } from "../../index";
3
-
4
- const { DirectionsService } = NativeModules;
5
-
6
- /**
7
- * Service used to generate a route between two {@link MPPoint}s.
8
- *
9
- * @export
10
- * @class MPDirectionsService
11
- * @typedef {MPDirectionsService}
12
- */
13
- export default class MPDirectionsService {
14
- /**
15
- * Creates an instance of MPDirectionsService.
16
- *
17
- * @constructor
18
- * @private
19
- * @param {string} id
20
- */
21
- private constructor(private readonly id: string) { }
22
-
23
- /**
24
- * Creates a new service.
25
- *
26
- * @public
27
- * @static
28
- * @async
29
- * @returns {Promise<MPDirectionsService>}
30
- */
31
- public static async create(): Promise<MPDirectionsService> {
32
- return DirectionsService.create().then((resolve: string) => new MPDirectionsService(resolve));
33
- }
34
-
35
- /**
36
- * Add an avoidWayType, these are based on [OSM highways](https://wiki.openstreetmap.org/wiki/Key:highway).
37
- *
38
- * Supported types are defined in {@link MPHighway}.
39
- *
40
- * @public
41
- * @async
42
- * @param {string} wayType
43
- * @returns {Promise<void>}
44
- */
45
- public async addAvoidWayType(wayType: string): Promise<void> {
46
- return DirectionsService.addAvoidWayType(wayType, this.id);
47
- }
48
-
49
- /**
50
- * Clears all added avoidWayTypes.
51
- *
52
- * @public
53
- * @async
54
- * @returns {Promise<void>}
55
- */
56
- public async clearWayType(): Promise<void> {
57
- return DirectionsService.clearWayType(this.id);
58
- }
59
-
60
- /**
61
- * Add an excludeWayType, these are based on [OSM highways](https://wiki.openstreetmap.org/wiki/Key:highway).
62
- *
63
- * Supported types are defined in {@link MPHighway}.
64
- *
65
- * @public
66
- * @async
67
- * @param {string} wayType
68
- * @returns {Promise<void>}
69
- */
70
- public async addExcludeWayType(wayType: string): Promise<void> {
71
- return DirectionsService.addExcludeWayType(wayType, this.id);
72
- }
73
-
74
- /**
75
- * Clears all added excludeWayType.
76
- *
77
- * @public
78
- * @async
79
- * @returns {Promise<void>}
80
- */
81
- public async clearExcludeWayType(): Promise<void> {
82
- return DirectionsService.clearExcludeWayType(this.id);
83
- }
84
-
85
- /**
86
- * Sets whether routes should use departure time or arrival time when using the transit travel mode.
87
- *
88
- * @public
89
- * @async
90
- * @param {boolean} isDeparture
91
- * @returns {Promise<void>}
92
- */
93
- public async setIsDeparture(isDeparture: boolean): Promise<void> {
94
- return DirectionsService.setIsDeparture(isDeparture, this.id);
95
- }
96
-
97
- /**
98
- * Queries the routing network to generate a route from the origin to the destination.
99
- *
100
- * @public
101
- * @async
102
- * @param {MPPoint} origin
103
- * @param {MPPoint} destination
104
- * @param {MPPoint[]} [stops=null]
105
- * @param {boolean} [optimze=false]
106
- * @returns {Promise<MPRoute>}
107
- */
108
- public async getRoute(origin: MPPoint, destination: MPPoint, stops: MPPoint[] = null, optimze: boolean = false): Promise<MPRoute> {
109
- var res;
110
- if (stops === null) {
111
- res = await DirectionsService.getRoute(JSON.stringify(origin), JSON.stringify(destination), stops, optimze, this.id);
112
- }else {
113
- let stopsAsJson = stops.map(stop => JSON.stringify(stop));
114
- res = await DirectionsService.getRoute(JSON.stringify(origin), JSON.stringify(destination), stopsAsJson, optimze, this.id);
115
- }
116
- if (res.route !== undefined) {
117
- return Promise.resolve(MPRoute.create(JSON.parse(res.route)));
118
- } else {
119
- return Promise.reject(MPError.create(JSON.parse(res.error)));
120
- }
121
- }
122
-
123
- /**
124
- * defines the travel mode for routes, can be one of the following:
125
- * * "walking"
126
- * * "bicycling"
127
- * * "driving"
128
- * * "transit"
129
- *
130
- * @public
131
- * @async
132
- * @param {string} travelMode
133
- * @returns {Promise<void>}
134
- */
135
- public async setTravelMode(travelMode: string): Promise<void> {
136
- return DirectionsService.setTravelMode(travelMode, this.id);
137
- }
138
-
139
- /**
140
- * sets the wanted arrival/departure time for routes generated with this [MPDirectionsService]
141
- *
142
- * this setting is used in conjunction with {@link setIsDeparture} and {@link setTravelMode}.
143
- *
144
- * @public
145
- * @async
146
- * @param {number} time
147
- * @returns {Promise<void>}
148
- */
149
- public async setTime(time: number): Promise<void> {
150
- return DirectionsService.setTime(time, this.id);
151
- }
152
- }