Commit ba6d12de authored by Marcus Lundblad's avatar Marcus Lundblad
Browse files

transitRouter: Use country code from place

Use the country code from places in the query
when avaible, before falling back to using
libgweather to guess country/region based on
coordinates.
parent 72e17855
Pipeline #277891 failed with stage
in 4 minutes and 27 seconds
......@@ -126,8 +126,10 @@ var TransitRouter = class TransitRoute {
return null;
}
_getMatchingProvidersForLocation(location) {
let country = Utils.getCountryCodeForCoordinates(location.latitude,
_getMatchingProvidersForPlace(place) {
let location = place.location;
let country = place.country_code ??
Utils.getCountryCodeForCoordinates(location.latitude,
location.longitude);
let matchingProviders = [];
......@@ -191,14 +193,13 @@ var TransitRouter = class TransitRoute {
* or null if no matching provider was found.
*/
_getBestProviderForQuery() {
let startLocation = this._query.filledPoints[0].place.location;
let endLocation =
this._query.filledPoints.last().place.location;
let startPlace = this._query.filledPoints[0].place;
let endPlace = this._query.filledPoints.last().place;
let matchingProvidersForStart =
this._getMatchingProvidersForLocation(startLocation);
this._getMatchingProvidersForPlace(startPlace);
let matchingProvidersForEnd =
this._getMatchingProvidersForLocation(endLocation);
this._getMatchingProvidersForPlace(endPlace);
let matchingProviders = [];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment