@wemap/providers 3.2.1 → 3.2.3

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 (58) hide show
  1. package/debug/dist/absolute-attitude.html +19 -0
  2. package/{dist → debug/dist}/absolute-position.html +5 -2
  3. package/{dist → debug/dist}/gnss-wifi.html +5 -2
  4. package/{dist → debug/dist}/imu.html +5 -2
  5. package/debug/dist/inclination.html +19 -0
  6. package/debug/dist/index.html +20 -0
  7. package/debug/dist/positioning-legacy.html +19 -0
  8. package/debug/dist/relative-attitude.html +19 -0
  9. package/debug/dist/step-detection.html +19 -0
  10. package/debug/index.js +7 -9
  11. package/debug/{components → src}/AbsolutePositionComponent.jsx +4 -4
  12. package/debug/{components → src}/GnssWifiComponent.jsx +5 -5
  13. package/debug/{components → src}/Utils.js +2 -4
  14. package/debug/src/map/SimpleMap.jsx +47 -0
  15. package/index.js +1 -3
  16. package/package.json +12 -36
  17. package/src/ProvidersInterface.js +4 -1
  18. package/src/providers/attitude/absolute/AbsoluteAttitudeFromBrowserProvider.js +3 -3
  19. package/src/providers/attitude/relative/RelativeAttitudeFromBrowserProvider.js +2 -0
  20. package/src/providers/imu/ImuProvider.js +2 -2
  21. package/src/providers/position/absolute/AbsolutePositionProvider.js +4 -2
  22. package/src/providers/position/absolute/GnssWifiProvider.js +2 -2
  23. package/babel.config.json +0 -16
  24. package/config.json +0 -4
  25. package/debug/MainComponent.jsx +0 -51
  26. package/debug/css/App.css +0 -128
  27. package/debug/css/UserOnMapHandler.css +0 -43
  28. package/debug/details/DetailsAttitudeComponent.jsx +0 -128
  29. package/debug/details/DetailsComponent.jsx +0 -31
  30. package/debug/details/DetailsPositionComponent.jsx +0 -134
  31. package/debug/details/ItineraryComponent.jsx +0 -264
  32. package/debug/map/MapComponent.jsx +0 -85
  33. package/debug/map/MapHandler.js +0 -44
  34. package/debug/map/helpers/ItineraryMapHandler.js +0 -283
  35. package/debug/map/helpers/MapClickHandler.js +0 -121
  36. package/debug/map/helpers/UserOnMapHandler.js +0 -76
  37. package/debug/stores/ItineraryStore.js +0 -198
  38. package/dist/absolute-attitude.html +0 -16
  39. package/dist/assets/indoor-maps/bureaux-wemap-montpellier.geojson +0 -7270
  40. package/dist/inclination.html +0 -16
  41. package/dist/index.html +0 -19
  42. package/dist/js/providers-components.js +0 -2361
  43. package/dist/logger.html +0 -58
  44. package/dist/positioning-legacy.html +0 -16
  45. package/dist/relative-attitude.html +0 -16
  46. package/dist/step-detection.html +0 -16
  47. package/src/logger/NavigationLogger.js +0 -131
  48. package/src/logger/NavigationLoggerConverter.js +0 -228
  49. package/webpack/webpack.common.cjs +0 -26
  50. package/webpack/webpack.dev.cjs +0 -25
  51. package/webpack/webpack.prod.cjs +0 -15
  52. /package/debug/{components → src}/AbsoluteAttitudeComponent.jsx +0 -0
  53. /package/debug/{components → src}/ImuComponent.jsx +0 -0
  54. /package/debug/{components → src}/InclinationComponent.jsx +0 -0
  55. /package/debug/{components → src}/NavigationConfig.js +0 -0
  56. /package/debug/{components → src}/RelativeAttitudeComponent.jsx +0 -0
  57. /package/debug/{components → src}/StartStopComponent.jsx +0 -0
  58. /package/debug/{components → src}/StepDetectionComponent.jsx +0 -0
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, user-scalable=no">
7
+ <title>Debug Absolute Attitude</title>
8
+ <script src="/js/providers-lib.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+ <script>
14
+ /* global createReactElement, AbsoluteAttitudeComponent */
15
+ createReactElement(AbsoluteAttitudeComponent, document.getElementById('app'));
16
+ </script>
17
+ </body>
18
+
19
+ </html>
@@ -5,12 +5,15 @@
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width, user-scalable=no">
7
7
  <title>Debug Absolute Attitude</title>
8
- <script src="js/providers-components.js"></script>
8
+ <script src="/js/providers-lib.js"></script>
9
9
  </head>
10
10
 
11
11
  <body style="margin: 0">
12
12
  <div id="app"></div>
13
- <script>createReactElement(AbsolutePositionComponent, document.getElementById('app'));</script>
13
+ <script>
14
+ /* global createReactElement, AbsolutePositionComponent */
15
+ createReactElement(AbsolutePositionComponent, document.getElementById('app'));
16
+ </script>
14
17
  </body>
15
18
 
16
19
  </html>
@@ -5,12 +5,15 @@
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width, user-scalable=no">
7
7
  <title>Debug Positioning</title>
8
- <script src="js/providers-components.js"></script>
8
+ <script src="/js/providers-lib.js"></script>
9
9
  </head>
10
10
 
11
11
  <body>
12
12
  <div id="app"></div>
13
- <script>createReactElement(GnssWifiComponent, document.getElementById('app'));</script>
13
+ <script>
14
+ /* global createReactElement, GnssWifiComponent */
15
+ createReactElement(GnssWifiComponent, document.getElementById('app'));
16
+ </script>
14
17
  </body>
15
18
 
16
19
  </html>
@@ -5,12 +5,15 @@
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width, user-scalable=no">
7
7
  <title>Debug Imu</title>
8
- <script src="js/providers-components.js"></script>
8
+ <script src="/js/providers-lib.js"></script>
9
9
  </head>
10
10
 
11
11
  <body>
12
12
  <div id="app"></div>
13
- <script>createReactElement(ImuComponent, document.getElementById('app'));</script>
13
+ <script>
14
+ /* global createReactElement, ImuComponent */
15
+ createReactElement(ImuComponent, document.getElementById('app'));
16
+ </script>
14
17
  </body>
15
18
 
16
19
  </html>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, user-scalable=no">
7
+ <title>Debug Inclination</title>
8
+ <script src="/js/providers-lib.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+ <script>
14
+ /* global createReactElement, InclinationComponent */
15
+ createReactElement(InclinationComponent, document.getElementById('app'));
16
+ </script>
17
+ </body>
18
+
19
+ </html>
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, user-scalable=no">
7
+ <title>AR debug</title>
8
+ </head>
9
+
10
+ <body>
11
+ <a href="./imu.html">IMU</a><br />
12
+ <a href="./inclination.html">Inclination</a><br />
13
+ <a href="./relative-attitude.html">Relative Attitude</a><br />
14
+ <a href="./absolute-attitude.html">Absolute Attitude</a><br />
15
+ <a href="./gnss-wifi.html">GNSS-Wifi</a><br />
16
+ <a href="./step-detection.html">Step Detection</a><br />
17
+ <a href="./absolute-position.html">Absolute Position</a>
18
+ </body>
19
+
20
+ </html>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, user-scalable=no">
7
+ <title>Debug Positioning</title>
8
+ <script src="/js/providers-lib.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+ <script>
14
+ /* global createReactElement, PositioningComponent */
15
+ createReactElement(PositioningComponent, document.getElementById('app'));
16
+ </script>
17
+ </body>
18
+
19
+ </html>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, user-scalable=no">
7
+ <title>Debug Relative Attitude</title>
8
+ <script src="/js/providers-lib.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+ <script>
14
+ /* global createReactElement, RelativeAttitudeComponent */
15
+ createReactElement(RelativeAttitudeComponent, document.getElementById('app'));
16
+ </script>
17
+ </body>
18
+
19
+ </html>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, user-scalable=no">
7
+ <title>Debug Step Detection</title>
8
+ <script src="/js/providers-lib.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+ <script>
14
+ /* global createReactElement, StepDetectionComponent */
15
+ createReactElement(StepDetectionComponent, document.getElementById('app'));
16
+ </script>
17
+ </body>
18
+
19
+ </html>
package/debug/index.js CHANGED
@@ -1,14 +1,13 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
3
 
4
- import AbsoluteAttitudeComponent from './components/AbsoluteAttitudeComponent.jsx';
5
- import AbsolutePositionComponent from './components/AbsolutePositionComponent.jsx';
6
- import GnssWifiComponent from './components/GnssWifiComponent.jsx';
7
- import ImuComponent from './components/ImuComponent.jsx';
8
- import InclinationComponent from './components/InclinationComponent.jsx';
9
- import MainComponent from './MainComponent.jsx';
10
- import RelativeAttitudeComponent from './components/RelativeAttitudeComponent.jsx';
11
- import StepDetectionComponent from './components/StepDetectionComponent.jsx';
4
+ import AbsoluteAttitudeComponent from './src/AbsoluteAttitudeComponent.jsx';
5
+ import AbsolutePositionComponent from './src/AbsolutePositionComponent.jsx';
6
+ import GnssWifiComponent from './src/GnssWifiComponent.jsx';
7
+ import ImuComponent from './src/ImuComponent.jsx';
8
+ import InclinationComponent from './src/InclinationComponent.jsx';
9
+ import RelativeAttitudeComponent from './src/RelativeAttitudeComponent.jsx';
10
+ import StepDetectionComponent from './src/StepDetectionComponent.jsx';
12
11
 
13
12
  const createReactElement = (component, container) => ReactDOM.render(
14
13
  React.createElement(component, {}, null),
@@ -21,7 +20,6 @@ export {
21
20
  ImuComponent,
22
21
  InclinationComponent,
23
22
  GnssWifiComponent,
24
- MainComponent,
25
23
  RelativeAttitudeComponent,
26
24
  StepDetectionComponent,
27
25
  createReactElement
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { AbsolutePosition, AbsoluteAttitude } from '../../src/Providers.js';
4
4
  import Utils from './Utils.js';
5
5
  import NavigationConfig from './NavigationConfig.js';
6
- import MapComponent from '../map/MapComponent.jsx';
6
+ import SimpleMap from './map/SimpleMap.jsx';
7
7
 
8
8
 
9
9
  class AbsolutePositionComponent extends React.Component {
@@ -16,8 +16,7 @@ class AbsolutePositionComponent extends React.Component {
16
16
  componentDidMount() {
17
17
  this.providerId = AbsolutePosition.addEventListener(
18
18
  events => this.onNewPosition(events[0]),
19
- error => this.setState({ absolutePosition: error }),
20
- false
19
+ error => this.setState({ absolutePosition: error })
21
20
  );
22
21
  }
23
22
 
@@ -26,6 +25,7 @@ class AbsolutePositionComponent extends React.Component {
26
25
  }
27
26
 
28
27
  onNewPosition = position => {
28
+ this.map.updatePosition(position.data);
29
29
  this.setState({ absolutePosition: position });
30
30
  };
31
31
 
@@ -64,7 +64,7 @@ class AbsolutePositionComponent extends React.Component {
64
64
  flexBasis: 'auto',
65
65
  minHeight: '300px'
66
66
  }}>
67
- <MapComponent
67
+ <SimpleMap
68
68
  ref={map => (this.map = map)}
69
69
  />
70
70
  </div>
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
3
  import Utils from './Utils.js';
4
- import MapComponent from '../map/MapComponent.jsx';
4
+ import SimpleMap from './map/SimpleMap.jsx';
5
5
  import ProvidersLoggerOld from '../../src/events/ProvidersLoggerOld.js';
6
6
  import { GnssWifi } from '../../src/Providers.js';
7
7
 
@@ -28,9 +28,7 @@ class GnssWifiComponent extends React.Component {
28
28
 
29
29
  onNewPosition = position => {
30
30
  this.setState({ position });
31
- if (this.map) {
32
- this.map.updatePosition(position.data);
33
- }
31
+ this.map.updatePosition(position.data);
34
32
  };
35
33
 
36
34
  onError = error => {
@@ -43,7 +41,9 @@ class GnssWifiComponent extends React.Component {
43
41
  <h3>Position</h3>
44
42
  {Utils.renderPositionEvent(this.state.position)}
45
43
  <h3>Map</h3>
46
- <MapComponent ref={map => (this.map = map)} />
44
+ <div style={{ height: '300px' }}>
45
+ <SimpleMap ref={map => (this.map = map)} />
46
+ </div>
47
47
  </div>
48
48
  );
49
49
  }
@@ -140,10 +140,8 @@ class Utils {
140
140
  <p>
141
141
  projection: {info.projection.nearestElement.constructor.name}<br />
142
142
  distanceOfProjection: {info.projection.distanceFromNearestElement.toFixed(1)}m<br />
143
- traveledDistance: {info.traveledDistance.toFixed(1)}m
144
- ({(info.traveledPercentage * 100).toFixed(1)}%)<br />
145
- remainingDistance: {info.remainingDistance.toFixed(1)}m
146
- ({(info.remainingPercentage * 100).toFixed(1)}%)<br />
143
+ traveledDistance: {info.traveledDistance.toFixed(1)}m ({(info.traveledPercentage * 100).toFixed(1)}%)<br />
144
+ remainingDistance: {info.remainingDistance.toFixed(1)}m ({(info.remainingPercentage * 100).toFixed(1)}%)<br />
147
145
  nextStep: {nextStepStr}
148
146
  </p>
149
147
  );
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { Map } from 'mapbox-gl';
3
+
4
+ import { GeolocationLayer } from '@wemap/map';
5
+
6
+ import 'mapbox-gl/dist/mapbox-gl.css';
7
+
8
+ const accessToken
9
+ = 'pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53SD2WrJ6tFX7QHmA';
10
+
11
+ class SimpleMap extends React.Component {
12
+
13
+ componentDidMount() {
14
+ this.map = new Map({
15
+ accessToken,
16
+ container: this.mapContainer,
17
+ style: 'mapbox://styles/mapbox/streets-v10'
18
+ });
19
+
20
+ this.map.on('load', () => {
21
+ this.map.geolocationLayer = new GeolocationLayer(this.map);
22
+ this.map.addControl(this.map.geolocationLayer.control);
23
+ });
24
+ }
25
+
26
+ componentWillUnmount() {
27
+ this.map.remove();
28
+ }
29
+
30
+ updatePosition(position) {
31
+ if (this.map && this.map.geolocationLayer) {
32
+ this.map.geolocationLayer.updatePosition(position);
33
+ }
34
+ }
35
+
36
+ render() {
37
+ return (
38
+ <div ref={map => (this.mapContainer = map)}
39
+ style={{
40
+ width: '100%',
41
+ height: '100%'
42
+ }} />
43
+ );
44
+ }
45
+ }
46
+
47
+ export default SimpleMap;
package/index.js CHANGED
@@ -2,9 +2,7 @@ import EventType from './src/events/EventType.js';
2
2
  import PositionSmoother from './src/smoothers/PositionSmoother.js';
3
3
  import ProvidersInterface from './src/ProvidersInterface.js';
4
4
  import ProvidersOptions from './src/ProvidersOptions.js';
5
- import NavigationLogger from './src/logger/NavigationLogger.js';
6
- import NavigationLoggerConverter from './src/logger/NavigationLoggerConverter.js';
7
5
 
8
6
  export {
9
- EventType, PositionSmoother, ProvidersInterface, ProvidersOptions, NavigationLogger, NavigationLoggerConverter
7
+ EventType, PositionSmoother, ProvidersInterface, ProvidersOptions
10
8
  };
package/package.json CHANGED
@@ -8,38 +8,22 @@
8
8
  "Guillaume Pannetier <guillaume.pannetier@getwemap.com>"
9
9
  ],
10
10
  "dependencies": {
11
- "@wemap/geo": "^3.2.1",
12
- "@wemap/graph": "^3.2.1",
13
- "@wemap/logger": "^3.2.1",
14
- "@wemap/maths": "^3.2.1",
15
- "@wemap/osm": "^3.2.1",
16
- "@wemap/utils": "^3.2.1",
17
- "browser-cookies": "^1.2.0",
11
+ "@wemap/geo": "^3.2.3",
12
+ "@wemap/graph": "^3.2.3",
13
+ "@wemap/logger": "^3.2.3",
14
+ "@wemap/maths": "^3.2.3",
15
+ "@wemap/navigation-logger": "^3.2.3",
16
+ "@wemap/utils": "^3.2.3",
18
17
  "geomagnetism": "^0.1.0",
19
18
  "lodash.isempty": "^4.4.0",
20
- "lodash.noop": "^3.0.1",
21
- "uuid": "^8.2.0"
19
+ "lodash.noop": "^3.0.1"
22
20
  },
23
21
  "description": "A package using different geoloc systems",
24
22
  "devDependencies": {
25
- "@babel/core": "^7.11.1",
26
- "@babel/plugin-proposal-class-properties": "^7.10.4",
27
- "@babel/preset-env": "^7.11.0",
28
- "@babel/preset-react": "^7.10.4",
29
- "@wemap/map": "^3.2.1",
30
- "babel-loader": "^8.0.6",
31
- "css-loader": "^3.2.0",
32
- "file-loader": "^5.0.2",
23
+ "@wemap/map": "^3.2.3",
24
+ "@wemap/osm": "^3.2.3",
33
25
  "mapbox-gl": "^1.11.1",
34
- "mapbox-gl-indoor": "0.0.4",
35
- "prop-types": "^15.7.2",
36
- "react": "^16.11.0",
37
- "react-dom": "^16.11.0",
38
- "style-loader": "^1.0.0",
39
- "webpack": "^4.39.3",
40
- "webpack-cli": "^3.3.7",
41
- "webpack-dev-server": "^3.9.0",
42
- "webpack-merge": "^4.2.1"
26
+ "mapbox-gl-indoor": "0.0.4"
43
27
  },
44
28
  "homepage": "https://github.com/wemap/wemap-modules-js#readme",
45
29
  "keywords": [
@@ -59,15 +43,7 @@
59
43
  "type": "git",
60
44
  "url": "git+https://github.com/wemap/wemap-modules-js.git"
61
45
  },
62
- "scripts": {
63
- "build": "webpack --display-modules --config webpack/webpack.prod.cjs",
64
- "build-debug": "webpack --display-modules --config webpack/webpack.dev.cjs",
65
- "stats": "webpack --config webpack/webpack.prod.cjs --profile --json > stats.json",
66
- "start": "webpack-dev-server --config webpack/webpack.dev.cjs --progress --inline --hot --https",
67
- "start-secure": "webpack-dev-server --config webpack/webpack.dev.cjs --progress --inline --hot --https --cert $(grep PEM ../../.env | cut -d '=' -f2) --key $(grep KEY ../../.env | cut -d '=' -f2)",
68
- "lint": "eslint --ext .js,.jsx --quiet src"
69
- },
70
46
  "type": "module",
71
- "version": "3.2.1",
72
- "gitHead": "0d430815358a23068c8473b2c310b2945667b2c1"
47
+ "version": "3.2.3",
48
+ "gitHead": "f7075f59fc3227c7f4cb7f1fa8cc69b98705364e"
73
49
  }
@@ -3,13 +3,13 @@ import {
3
3
  Attitude, AbsoluteHeading, UserPosition
4
4
  } from '@wemap/geo';
5
5
  import { Network } from '@wemap/graph';
6
+ import { NavigationLogger } from '@wemap/navigation-logger';
6
7
 
7
8
  import EventType from './events/EventType.js';
8
9
  import MetaProvider from './providers/MetaProvider.js';
9
10
  import {
10
11
  AbsoluteAttitude, AbsolutePosition, Barcode, CameraNative, CameraProjectionMatrix, Inclination
11
12
  } from './Providers.js';
12
- import NavigationLogger from './logger/NavigationLogger.js';
13
13
  import ProvidersLoggerOld from './events/ProvidersLoggerOld.js';
14
14
 
15
15
  class ProvidersInterface {
@@ -136,6 +136,7 @@ class ProvidersInterface {
136
136
 
137
137
  static set mapMatchingMaxDistance(maxDistance) {
138
138
  AbsolutePosition.mapMatchingMaxDistance = maxDistance;
139
+ NavigationLogger.feedProvidersMM({ mapMatchingMaxDistance: maxDistance });
139
140
  }
140
141
 
141
142
  static get mapMatchingMinDistance() {
@@ -144,6 +145,7 @@ class ProvidersInterface {
144
145
 
145
146
  static set mapMatchingMinDistance(minDistance) {
146
147
  AbsolutePosition.mapMatchingMinDistance = minDistance;
148
+ NavigationLogger.feedProvidersMM({ mapMatchingMinDistance: minDistance });
147
149
  }
148
150
 
149
151
  static get mapMatchingMaxAngleBearing() {
@@ -152,6 +154,7 @@ class ProvidersInterface {
152
154
 
153
155
  static set mapMatchingMaxAngleBearing(maxAngleBearing) {
154
156
  AbsolutePosition.mapMatchingMaxAngleBearing = maxAngleBearing;
157
+ NavigationLogger.feedProvidersMM({ mapMatchingMaxAngleBearing: maxAngleBearing });
155
158
  }
156
159
  }
157
160
 
@@ -6,13 +6,13 @@ import {
6
6
  import {
7
7
  deg2rad, rad2deg, Quaternion, Rotations
8
8
  } from '@wemap/maths';
9
+ import { NavigationLogger } from '@wemap/navigation-logger';
9
10
  import {
10
11
  Browser, BrowserUtils
11
12
  } from '@wemap/utils';
12
13
 
13
14
  import Provider from '../../Provider.js';
14
15
  import EventType from '../../../events/EventType.js';
15
- import NavigationLogger from '../../../logger/NavigationLogger.js';
16
16
  import AskImuOnDesktopError from '../../../errors/AskImuOnDesktopError.js';
17
17
  import MissingMagnetometerError from '../../../errors/MissingMagnetometerError.js';
18
18
  import MissingSensorError from '../../../errors/MissingSensorError.js';
@@ -136,7 +136,7 @@ class AbsoluteAttitudeFromBrowserProvider extends Provider {
136
136
 
137
137
 
138
138
  onDeviceOrientationChromeEvent = e => {
139
- NavigationLogger.feedRawData('deviceorientationabsolute', e);
139
+ NavigationLogger.feedImuData(e);
140
140
 
141
141
  this.magQuaternionTimestamp = e.timeStamp / 1e3;
142
142
 
@@ -153,7 +153,7 @@ class AbsoluteAttitudeFromBrowserProvider extends Provider {
153
153
 
154
154
 
155
155
  onDeviceOrientationSafariEvent = e => {
156
- NavigationLogger.feedRawData('deviceorientation', e);
156
+ NavigationLogger.feedImuData(e);
157
157
 
158
158
  this.magQuaternionTimestamp = e.timeStamp / 1e3;
159
159
 
@@ -1,5 +1,6 @@
1
1
  import { Attitude } from '@wemap/geo';
2
2
  import { Rotations } from '@wemap/maths';
3
+ import { NavigationLogger } from '@wemap/navigation-logger';
3
4
  import { BrowserUtils } from '@wemap/utils';
4
5
 
5
6
  import Provider from '../../Provider.js';
@@ -79,6 +80,7 @@ class RelativeAttitudeFromBrowserProvider extends Provider {
79
80
 
80
81
 
81
82
  onDeviceOrientationEvent = e => {
83
+ NavigationLogger.feedImuData(e);
82
84
 
83
85
  const timestamp = e.timeStamp / 1e3;
84
86
 
@@ -1,4 +1,5 @@
1
1
  import { deg2rad } from '@wemap/maths';
2
+ import { NavigationLogger } from '@wemap/navigation-logger';
2
3
  import {
3
4
  Browser, BrowserUtils
4
5
  } from '@wemap/utils';
@@ -6,7 +7,6 @@ import {
6
7
  import Provider from '../Provider.js';
7
8
  import EventType from '../../events/EventType';
8
9
  import AskImuOnDesktopError from '../../errors/AskImuOnDesktopError.js';
9
- import NavigationLogger from '../../logger/NavigationLogger.js';
10
10
 
11
11
  /**
12
12
  * Imu (Inertial Measurement Unit) provider retrieve acceleration data
@@ -83,7 +83,7 @@ class ImuProvider extends Provider {
83
83
  * @private
84
84
  */
85
85
  parseDeviceMotionEvent = e => {
86
- NavigationLogger.feedRawData('devicemotion', e);
86
+ NavigationLogger.feedImuData(e);
87
87
 
88
88
  const events = [];
89
89
 
@@ -133,7 +133,8 @@ class AbsolutePositionProvider extends MetaProvider {
133
133
  this.notify(this.createEvent(
134
134
  EventType.AbsolutePosition,
135
135
  newPosition,
136
- newPositionEvent
136
+ newPositionEvent.timestamp,
137
+ [newPositionEvent]
137
138
  ));
138
139
 
139
140
  }
@@ -165,7 +166,8 @@ class AbsolutePositionProvider extends MetaProvider {
165
166
  this.notify(this.createEvent(
166
167
  EventType.AbsolutePosition,
167
168
  newPosition,
168
- newPositionEvent
169
+ newPositionEvent.timestamp,
170
+ [newPositionEvent]
169
171
  ));
170
172
  }
171
173
 
@@ -1,5 +1,6 @@
1
1
  import { deg2rad } from '@wemap/maths';
2
2
  import { UserPosition } from '@wemap/geo';
3
+ import { NavigationLogger } from '@wemap/navigation-logger';
3
4
  import { TimeUtils } from '@wemap/utils';
4
5
 
5
6
  import EventType from '../../../events/EventType.js';
@@ -8,7 +9,6 @@ import Provider from '../../Provider.js';
8
9
  import GeolocationPermissionDeniedError from '../../../errors/GeolocationPermissionDeniedError.js';
9
10
  import GeolocationPositionUnavailableError from '../../../errors/GeolocationPositionUnavailableError.js';
10
11
  import Constants from '../../Constants.js';
11
- import NavigationLogger from '../../../logger/NavigationLogger.js';
12
12
 
13
13
  const POSITION_OPTIONS = {
14
14
  enableHighAccuracy: true,
@@ -73,7 +73,7 @@ class GnssWifiProvider extends Provider {
73
73
  * @private
74
74
  */
75
75
  onNewPosition = geolocation => {
76
- NavigationLogger.feedRawData('geolocation', geolocation);
76
+ NavigationLogger.feedGeolocation(geolocation);
77
77
 
78
78
  const { coords } = geolocation;
79
79
  if (!coords) {
package/babel.config.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- {
6
- "targets": {
7
- "node": "current"
8
- }
9
- }
10
- ],
11
- "@babel/preset-react"
12
- ],
13
- "plugins": [
14
- "@babel/plugin-proposal-class-properties"
15
- ]
16
- }
package/config.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "distFolder": "dist",
3
- "distFileName": "wemap-providers.min.js"
4
- }
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
-
3
- import { ProvidersInterface } from '../index.js';
4
-
5
- import MapComponent from './map/MapComponent.jsx';
6
- import DetailsComponent from './details/DetailsComponent.jsx';
7
-
8
- import './css/App.css';
9
-
10
- class MainComponent extends React.Component {
11
-
12
- started = false;
13
-
14
- constructor(props, context) {
15
- super(props, context);
16
- this.state = {
17
- details: false,
18
- mapHandler: null
19
- };
20
-
21
- ProvidersInterface.logger = false;
22
- }
23
-
24
-
25
- render() {
26
- return (
27
- <>
28
- <div id='map-container'>
29
- <MapComponent
30
- ref={map => (this.map = map)}
31
- onMapLoaded={mapHandler => this.setState({ mapHandler })}
32
- indoorMaps={['assets/indoor-maps/bureaux-wemap-montpellier.geojson']}
33
- />
34
- </div>
35
- <div id='menu-container'>
36
- <span id='show-hide-details'
37
- onClick={() => this.setState({ details: !this.state.details })}>
38
- {this.state.details ? 'Hide details' : 'Show details'}
39
- </span>
40
- {this.state.details ? (
41
- <div id='details-container'>
42
- <DetailsComponent mapHandler={this.state.mapHandler} />
43
- </div>
44
- ) : null}
45
- </div>
46
- </>
47
- );
48
- }
49
- }
50
-
51
- export default MainComponent;