mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-20 01:10:02 +00:00
Optionally disable sort by weight in JSON getstops (Hafas).
This commit is contained in:
parent
c11a23ba08
commit
8adf98b98e
4 changed files with 23 additions and 2 deletions
|
@ -89,6 +89,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
private String accessId;
|
||||
private String clientType;
|
||||
private Charset jsonGetStopsEncoding;
|
||||
private boolean jsonGetStopsUseWeight = true;
|
||||
private Charset jsonNearbyStationsEncoding;
|
||||
private boolean dominantPlanStopTime = false;
|
||||
private boolean useIso8601 = false;
|
||||
|
@ -183,6 +184,11 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
this.jsonGetStopsEncoding = jsonGetStopsEncoding;
|
||||
}
|
||||
|
||||
protected void setJsonGetStopsUseWeight(final boolean jsonGetStopsUseWeight)
|
||||
{
|
||||
this.jsonGetStopsUseWeight = jsonGetStopsUseWeight;
|
||||
}
|
||||
|
||||
protected void setJsonNearbyStationsEncoding(final Charset jsonNearbyStationsEncoding)
|
||||
{
|
||||
this.jsonNearbyStationsEncoding = jsonNearbyStationsEncoding;
|
||||
|
@ -372,7 +378,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
final String value = suggestion.getString("value");
|
||||
final int lat = suggestion.optInt("ycoord");
|
||||
final int lon = suggestion.optInt("xcoord");
|
||||
final int weight = suggestion.getInt("weight");
|
||||
final int weight = jsonGetStopsUseWeight ? suggestion.getInt("weight") : -i;
|
||||
String localId = null;
|
||||
final Matcher m = P_AJAX_GET_STOPS_ID.matcher(suggestion.getString("id"));
|
||||
if (m.matches())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue