Update geohash (location services) logic to improve time to first hit
This commit is contained in:
@@ -7,10 +7,16 @@ class NearestStationsState {
|
|||||||
loading = $state(true);
|
loading = $state(true);
|
||||||
error = $state<string | null>(null);
|
error = $state<string | null>(null);
|
||||||
|
|
||||||
|
private initGeoConfig: PositionOptions = {
|
||||||
|
enableHighAccuracy: false,
|
||||||
|
timeout: 500,
|
||||||
|
maximumAge: Infinity,
|
||||||
|
}
|
||||||
|
|
||||||
private geoConfig: PositionOptions = {
|
private geoConfig: PositionOptions = {
|
||||||
enableHighAccuracy: false,
|
enableHighAccuracy: false,
|
||||||
timeout: 30000,
|
timeout: 20000,
|
||||||
maximumAge: 120000
|
maximumAge: 30000,
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -24,7 +30,7 @@ class NearestStationsState {
|
|||||||
navigator.geolocation.getCurrentPosition(
|
navigator.geolocation.getCurrentPosition(
|
||||||
(pos) => this.handleUpdate(pos.coords.latitude, pos.coords.longitude),
|
(pos) => this.handleUpdate(pos.coords.latitude, pos.coords.longitude),
|
||||||
(err) => this.handleError(err),
|
(err) => this.handleError(err),
|
||||||
this.geoConfig
|
this.initGeoConfig
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user