Skip to content

Commit

Permalink
graphHopperGeocode: Use English as fallback language
Browse files Browse the repository at this point in the history
Explicitly set 'en' when using a language not specifically
supported by GraphHopper instead of relying on leaving out
the parameter, as this has some issues.
See: komoot/photon#746
  • Loading branch information
mlundblad committed Aug 23, 2024
1 parent f273798 commit 813f2a8
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 @@ -45,7 +45,12 @@ export class GraphHopperGeocode {

const language = Utils.getLanguage();

this._language = SUPPORTED_LANGUAGES.includes(language) ? language : null;
/* for now fallback to English as language when not using a language
* supported by GraphHopper, as leaving out language to fallback to
* default is currently not working as expected:
* https://github.com/komoot/photon/issues/746
*/
this._language = SUPPORTED_LANGUAGES.includes(language) ? language : 'en';
}

search(string, latitude, longitude, cancellable, callback) {
Expand Down

0 comments on commit 813f2a8

Please sign in to comment.