@wemap/positioning 2.3.7 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/PositioningHandler.js +15 -3
- package/src/components/PositioningInclinationComponent.jsx +1 -1
- package/src/components/PositioningPoseComponent.jsx +5 -3
- package/src/providers/Provider.js +8 -0
- package/src/providers/pose/ArCoreAbsoluteProvider.js +7 -0
- package/src/providers/pose/ArCoreProvider.js +7 -0
package/package.json
CHANGED
|
@@ -16,6 +16,8 @@ import Availability from './events/Availability';
|
|
|
16
16
|
*/
|
|
17
17
|
class PositioningHandler {
|
|
18
18
|
|
|
19
|
+
static CameraUsedNatively = 'camera_used_natively';
|
|
20
|
+
|
|
19
21
|
providerInstances = [];
|
|
20
22
|
|
|
21
23
|
/**
|
|
@@ -44,7 +46,17 @@ class PositioningHandler {
|
|
|
44
46
|
this.providerInstances[provider.id] = provider;
|
|
45
47
|
provider.start();
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
const messages = [];
|
|
50
|
+
|
|
51
|
+
if (provider.useCameraNatively) {
|
|
52
|
+
messages.push(PositioningHandler.CameraUsedNatively);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
id: provider.id,
|
|
57
|
+
name: provider.name,
|
|
58
|
+
messages
|
|
59
|
+
};
|
|
48
60
|
} catch (e) {
|
|
49
61
|
onError(e);
|
|
50
62
|
return null;
|
|
@@ -191,9 +203,9 @@ class PositioningHandler {
|
|
|
191
203
|
}
|
|
192
204
|
if (!provider.getItineraryInfo) {
|
|
193
205
|
Logger.warn('Cannot getItineraryInfo from ' + provider.constructor.name);
|
|
194
|
-
return;
|
|
206
|
+
return null;
|
|
195
207
|
}
|
|
196
|
-
provider.getItineraryInfo();
|
|
208
|
+
return provider.getItineraryInfo();
|
|
197
209
|
}
|
|
198
210
|
|
|
199
211
|
}
|
|
@@ -36,7 +36,7 @@ class PositioningPoseComponent extends React.Component {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
start() {
|
|
39
|
-
|
|
39
|
+
const output = this.props.positioningHandler.start(
|
|
40
40
|
[EventType.AbsolutePosition, EventType.AbsoluteAttitude],
|
|
41
41
|
this.onEvents,
|
|
42
42
|
this.onError,
|
|
@@ -46,10 +46,12 @@ class PositioningPoseComponent extends React.Component {
|
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
if (!
|
|
49
|
+
if (!output) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
this.id = output.id;
|
|
54
|
+
|
|
53
55
|
this.props.positioningHandler.setItinerary(this.id, ITINERARY);
|
|
54
56
|
this.props.positioningHandler.setNetwork(this.id, ITINERARY);
|
|
55
57
|
this.props.positioningHandler.setPosition(this.id, INITIAL_POSITION);
|
|
@@ -88,7 +90,7 @@ class PositioningPoseComponent extends React.Component {
|
|
|
88
90
|
this.setState({
|
|
89
91
|
position: error,
|
|
90
92
|
attitude: error,
|
|
91
|
-
errored:
|
|
93
|
+
errored: true
|
|
92
94
|
});
|
|
93
95
|
}
|
|
94
96
|
|
|
@@ -225,6 +225,14 @@ class Provider {
|
|
|
225
225
|
static get nativeInterface() {
|
|
226
226
|
return global.WemapProvidersAndroid;
|
|
227
227
|
}
|
|
228
|
+
|
|
229
|
+
static get useCameraNatively() {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
get useCameraNatively() {
|
|
234
|
+
return this.constructor.useCameraNatively;
|
|
235
|
+
}
|
|
228
236
|
}
|
|
229
237
|
|
|
230
238
|
export default Provider;
|
|
@@ -155,6 +155,13 @@ class ArCoreAbsoluteProvider extends Provider {
|
|
|
155
155
|
this.position.provider = this.constructor.name;
|
|
156
156
|
this.notify(this.createEvent(EventType.AbsolutePosition, this.position));
|
|
157
157
|
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @override
|
|
161
|
+
*/
|
|
162
|
+
static get useCameraNatively() {
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
158
165
|
}
|
|
159
166
|
|
|
160
167
|
export default ArCoreAbsoluteProvider;
|