[gnome-maps/wip/mlundblad/location-bias-scale: 2/3] graphHopperGeocode: Set location bias scale
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/location-bias-scale: 2/3] graphHopperGeocode: Set location bias scale
- Date: Fri, 10 Jun 2022 08:35:38 +0000 (UTC)
commit 45a55c1c8ecc68a50629818ff0ef0f9b9f2b4a36
Author: Marcus Lundblad <ml dfupdate se>
Date: Fri Jun 10 10:22:07 2022 +0200
graphHopperGeocode: Set location bias scale
Tweak the location_bias_scale parameter.
See: https://github.com/komoot/photon/issues/600
src/graphHopperGeocode.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/graphHopperGeocode.js b/src/graphHopperGeocode.js
index ebd06aad..e4a0bf93 100644
--- a/src/graphHopperGeocode.js
+++ b/src/graphHopperGeocode.js
@@ -30,6 +30,8 @@ import * as Utils from './utils.js';
// HTTP session timeout (in seconds)
const TIMEOUT = 5;
+1
+const LOCATION_BIAS_SCALE = 0.21;
export class GraphHopperGeocode {
constructor() {
@@ -139,8 +141,11 @@ export class GraphHopperGeocode {
locale: this._language,
key: this._apiKey
});
- if (latitude !== null && longitude != null)
+ if (latitude !== null && longitude != null) {
query.add('point', latitude + ',' + longitude);
+ if (string)
+ query.add('location_bias_scale', LOCATION_BIAS_SCALE);
+ }
if (string)
query.add('q', string);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]