// 进站进度条var d = train.distanceToNextPlatform();
if (d >= 0 && d < 200) {
drawProgressBar(1 - d / 200);
}
站台列表
方法
返回
说明
getAllPlatforms()
List
全部站台,含跨线路
getThisRoutePlatforms()
List
本线路站台
getNextRoutePlatforms()
List
下一条线路的站台
getAllPlatformsNextIndex()
int
下一站在全部站台里的下标
getThisRoutePlatformsNextIndex()
int
下一站在本线路列表里的下标
getPlatformRelative(offset, allowDifferentRoute)
PlatformInfo
相对当前的第 N 站
size()
int
站台总数
get(index)
PlatformInfo
按下标取
PlatformInfo 的成员
成员
类型
说明
stationName()
String
站名
platformName()
String
站台名
routeName()
String
线路名
routeColor()
int
线路颜色
destinationStationName()
String
该站台方向的终点站
distance
double
沿线距离
reverseAtPlatform
boolean
是否在此站折返
station
StationCompat
车站对象
platform
PlatformCompat
站台对象
route
RouteCompat
线路对象
destinationStation
StationCompat
终点站对象
// 画后续三站var list = train.getThisRoutePlatforms();
var i = train.getThisRoutePlatformsNextIndex();
for (var k = 0; k < 3 && i + k < list.size(); k++) {
var p = list.get(i + k);
draw(p.stationName(), p.routeColor());
}