mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 01:19:49 +00:00
use stop finder if available for auto-completion
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@559 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
db6d9b4337
commit
cdc3ef140c
68 changed files with 1206 additions and 238 deletions
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -34,6 +36,11 @@ public class TlseProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "www.travelinesoutheast.org.uk";
|
||||
private final static String API_BASE = "http://www.travelinesoutheast.org.uk/se/";
|
||||
|
||||
public TlseProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -54,13 +61,10 @@ public class TlseProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue