@wemap/providers 6.1.3 → 6.1.4
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
CHANGED
|
@@ -8,6 +8,7 @@ import MapMatchingHandler from '../../../mapmatching/MapMatchingHandler.js';
|
|
|
8
8
|
import GnssWifi from './GnssWifi.js';
|
|
9
9
|
import { default as GeoRelativePositionProvider } from '../relative/GeoRelativePosition.js';
|
|
10
10
|
import ProvidersOptions from '../../../ProvidersOptions.js';
|
|
11
|
+
import ProviderState from '../../ProviderState.js';
|
|
11
12
|
import Vps from '../../vision/Vps.js';
|
|
12
13
|
|
|
13
14
|
class AbsolutePosition extends Provider {
|
|
@@ -212,15 +213,16 @@ class AbsolutePosition extends Provider {
|
|
|
212
213
|
/** @type {ProviderEvent<UserPosition>} */
|
|
213
214
|
let newPositionEvent;
|
|
214
215
|
|
|
215
|
-
if (eventType === EventType.ForceVps
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
216
|
+
if (eventType === EventType.ForceVps) {
|
|
217
|
+
if (!this._vpsProviderId && this.state === ProviderState.STARTED) {
|
|
218
|
+
this._waitUntilNextVpsPosition = true;
|
|
219
|
+
this._vpsProviderId = Vps.addEventListener(events => {
|
|
220
|
+
this._waitUntilNextVpsPosition = false;
|
|
221
|
+
this._onAbsolutePosition(events.find(event => event.dataType === EventType.AbsolutePosition));
|
|
222
|
+
Vps.removeEventListener(this._vpsProviderId);
|
|
223
|
+
this._vpsProviderId = null;
|
|
224
|
+
});
|
|
225
|
+
}
|
|
224
226
|
|
|
225
227
|
return;
|
|
226
228
|
|