AbstractNavitiaProvider: When querying for nearby locations always use coordinates if provided by caller.

This commit is contained in:
Andreas Schildbach 2018-10-06 11:39:42 +02:00
parent 967f9b8320
commit 652ff15241

View file

@ -693,10 +693,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider {
// Build url depending of location type. // Build url depending of location type.
final HttpUrl.Builder url = url(); final HttpUrl.Builder url = url();
if (location.type == LocationType.COORD || location.type == LocationType.ADDRESS if (location.hasLocation()) {
|| location.type == LocationType.ANY) {
if (!location.hasLocation())
throw new IllegalArgumentException();
final double lon = location.lon / 1E6; final double lon = location.lon / 1E6;
final double lat = location.lat / 1E6; final double lat = location.lat / 1E6;
url.addPathSegment("coords").addPathSegment(lon + ";" + lat); url.addPathSegment("coords").addPathSegment(lon + ";" + lat);