mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 00:09:55 +00:00
use ajax for autocomplete
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@597 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
bcd07f256f
commit
679543a68c
1 changed files with 11 additions and 0 deletions
|
@ -63,6 +63,17 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
return true;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE + "ajax-getstop.exe/dn?getstop=1&REQ0JourneyStopsS0A=255&S=%s?&js=true&";
|
||||
private static final String ENCODING = "ISO-8859-1";
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
final String uri = String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), ENCODING));
|
||||
|
||||
return ajaxGetStops(uri);
|
||||
}
|
||||
|
||||
private final static Pattern P_NEARBY_STATIONS_BY_COORDINATE = Pattern
|
||||
.compile("<a class=\"uLine\" href=\".+?!X=(\\d+)!Y=(\\d+)!id=(\\d+)!dist=(\\d+).*?\">(.+?)</a>");
|
||||
private final static Pattern P_NEARBY_STATIONS_BY_STATION = Pattern
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue