@wemap/providers 10.11.1 → 10.11.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.
package/package.json
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@wemap/camera": "^10.11.1",
|
|
12
|
-
"@wemap/geo": "^10.11.
|
|
12
|
+
"@wemap/geo": "^10.11.2",
|
|
13
13
|
"@wemap/geomagnetism": "^0.1.1",
|
|
14
14
|
"@wemap/logger": "^10.11.1",
|
|
15
|
-
"@wemap/map": "^10.11.
|
|
15
|
+
"@wemap/map": "^10.11.2",
|
|
16
16
|
"@wemap/maths": "^10.10.0",
|
|
17
|
-
"@wemap/osm": "^10.11.
|
|
18
|
-
"@wemap/routers": "^10.11.
|
|
17
|
+
"@wemap/osm": "^10.11.2",
|
|
18
|
+
"@wemap/routers": "^10.11.2",
|
|
19
19
|
"@wemap/utils": "^10.11.1"
|
|
20
20
|
},
|
|
21
21
|
"description": "A package using different geoloc systems",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"url": "git+https://github.com/wemap/wemap-modules-js.git"
|
|
43
43
|
},
|
|
44
44
|
"type": "module",
|
|
45
|
-
"version": "10.11.
|
|
46
|
-
"gitHead": "
|
|
45
|
+
"version": "10.11.3",
|
|
46
|
+
"gitHead": "4a2a21a6c191af13649e84df02fb4cf2fc59a457"
|
|
47
47
|
}
|
|
@@ -25,6 +25,10 @@ class GnssWifi extends Provider {
|
|
|
25
25
|
maximumAge: 0
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
static DEFAULT_DISCARD_POSITIONS_ABOVE = 50;
|
|
29
|
+
|
|
30
|
+
discardPositionsAbove = GnssWifi.DISCARD_POSITIONS_ABOVE;
|
|
31
|
+
|
|
28
32
|
/**
|
|
29
33
|
* @override
|
|
30
34
|
*/
|
|
@@ -99,6 +103,12 @@ class GnssWifi extends Provider {
|
|
|
99
103
|
bearing,
|
|
100
104
|
this.pname);
|
|
101
105
|
|
|
106
|
+
if (typeof this.discardPositionsAbove === 'number'
|
|
107
|
+
&& coords.accuracy > this.discardPositionsAbove
|
|
108
|
+
) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
102
112
|
this.notify(this.createEvent(
|
|
103
113
|
EventType.AbsolutePosition, position
|
|
104
114
|
));
|
|
@@ -111,18 +121,19 @@ class GnssWifi extends Provider {
|
|
|
111
121
|
|
|
112
122
|
let customError;
|
|
113
123
|
switch (error.code) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
case 1:
|
|
125
|
+
customError = new GeolocationPermissionDeniedError(error.message);
|
|
126
|
+
break;
|
|
127
|
+
case 2:
|
|
128
|
+
customError = new GeolocationPositionUnavailableError(error.message);
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
customError = new Error(error.message);
|
|
122
132
|
}
|
|
123
133
|
|
|
124
134
|
this.notifyError(customError);
|
|
125
135
|
};
|
|
136
|
+
|
|
126
137
|
}
|
|
127
138
|
|
|
128
139
|
export default new GnssWifi();
|