Skip to content

Commit

Permalink
graphHopperGeocode: Set location bias scale
Browse files Browse the repository at this point in the history
Tweak the location_bias_scale parameter.
See: komoot/photon#600
  • Loading branch information
mlundblad committed Jun 10, 2022
1 parent e00e043 commit 45a55c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/graphHopperGeocode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 45a55c1

Please sign in to comment.