public class RouteSearch
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static class |
RouteSearch.BusRouteQuery
此类定义了公交路径规划查询路径的起终点、计算路径的模式、城市和是否计算夜班车。
|
static class |
RouteSearch.DrivePlanQuery
此类定义了驾车未来路径查询规划,最大支持未来七天的规划。
|
static class |
RouteSearch.DriveRouteQuery
此类定义了驾车路径查询规划。
|
static class |
RouteSearch.FromAndTo
构造路径规划的起点和终点坐标。
|
static interface |
RouteSearch.OnRoutePlanSearchListener
未来路径规划回调方法
|
static interface |
RouteSearch.OnRouteSearchListener
本类为路径搜索结果的异步处理回调接口。
|
static interface |
RouteSearch.OnTruckRouteSearchListener
货车路径规划回调方法
|
static class |
RouteSearch.RideRouteQuery
此类定义了骑行路径的起终点和计算路径的模式。
|
static class |
RouteSearch.TruckRouteQuery
此类定义了货车路径的起终点和计算路径的模式。
|
static class |
RouteSearch.WalkRouteQuery
此类定义了步行路径的起终点和计算路径的模式。
|
限定符和类型 | 字段和说明 |
---|---|
static int |
BUS_COMFORTABLE
最舒适。
|
static int |
BUS_DEFAULT
最快捷模式。
|
static int |
BUS_LEASE_CHANGE
最少换乘。
|
static int |
BUS_LEASE_WALK
最少步行。
|
static int |
BUS_NO_SUBWAY
不乘地铁。
|
static int |
BUS_SAVE_MONEY
最经济模式。
|
static int |
BusComfortable
已过时。
自V4.0.0以后,请参考
RouteSearch.BUS_COMFORTABLE |
static int |
BusDefault
已过时。
自V4.0.0以后,请参考
RouteSearch.BUS_DEFAULT |
static int |
BusLeaseChange
已过时。
自V4.0.0以后,请参考
RouteSearch.BUS_LEASE_CHANGE |
static int |
BusLeaseWalk
已过时。
自V4.0.0以后,请参考
RouteSearch.BUS_LEASE_WALK |
static int |
BusNoSubway
已过时。
自V4.0.0以后,请参考
RouteSearch.BUS_NO_SUBWAY |
static int |
BusSaveMoney
已过时。
自V4.0.0以后,请参考
RouteSearch.BUS_SAVE_MONEY |
static int |
DRIVEING_PLAN_AVOID_CONGESTION_CHOICE_HIGHWAY
返回的结果会优先考虑高速路,并且会考虑路况躲避拥堵,与高德地图的“躲避拥堵&高速优先”策略一致
|
static int |
DRIVEING_PLAN_AVOID_CONGESTION_FASTEST_SAVE_MONEY
避让拥堵&速度优先&避免收费
|
static int |
DRIVEING_PLAN_AVOID_CONGESTION_NO_HIGHWAY
返回的结果考虑路况,尽量躲避拥堵而规划路径,并且不走高速,与高德地图的“躲避拥堵&不走高速”策略一致
|
static int |
DRIVEING_PLAN_AVOID_CONGESTION_SAVE_MONEY
返回路径规划结果会尽量的躲避拥堵,并且规划收费较低甚至免费的路径结果,与高德地图的“躲避拥堵&避免收费”策略一致
|
static int |
DRIVEING_PLAN_AVOID_CONGESTION_SAVE_MONEY_NO_HIGHWAY
返回的结果尽量躲避拥堵,规划收费较低甚至免费的路径结果,并且尽量不走高速路,与高德地图的“避免拥堵&避免收费&不走高速”策略一致
|
static int |
DRIVEING_PLAN_CHOICE_HIGHWAY
返回的结果会优先选择高速路,与高德地图的“高速优先”策略一致
|
static int |
DRIVEING_PLAN_DEFAULT
返回的结果考虑路况,尽量躲避拥堵而规划路径,与高德地图的“躲避拥堵”策略一致
|
static int |
DRIVEING_PLAN_FASTEST_SHORTEST
不考虑路况,返回速度最优、耗时最短的路
|
static int |
DRIVEING_PLAN_NO_HIGHWAY
返回的结果不走高速,与高德地图“不走高速”策略一致
|
static int |
DRIVEING_PLAN_SAVE_MONEY
返回的结果尽可能规划收费较低甚至免费的路径,与高德地图“避免收费”策略一致
|
static int |
DRIVEING_PLAN_SAVE_MONEY_NO_HIGHWAY
返回的结果尽量不走高速,并且尽量规划收费较低甚至免费的路径结果,与高德地图的“避免收费&不走高速”策略一致
|
static java.lang.String |
DRIVING_EXCLUDE_FERRY
海外生效 规避道路类型-渡船
|
static java.lang.String |
DRIVING_EXCLUDE_MOTORWAY
海外生效 规避道路类型-高速路
|
static java.lang.String |
DRIVING_EXCLUDE_TOLL
海外生效 规避道路类型-收费道路
|
static int |
DRIVING_MULTI_CHOICE_AVOID_CONGESTION
多备选,躲避拥堵(考虑路况)
|
static int |
DRIVING_MULTI_CHOICE_AVOID_CONGESTION_NO_HIGHWAY
多备选,躲避拥堵,不走高速(考虑路况)
|
static int |
DRIVING_MULTI_CHOICE_AVOID_CONGESTION_NO_HIGHWAY_SAVE_MONEY
多备选,躲避拥堵,不走高速,费用优先(考虑路况)
|
static int |
DRIVING_MULTI_CHOICE_AVOID_CONGESTION_SAVE_MONEY
多备选,躲避拥堵,费用优先(考虑路况)
|
static int |
DRIVING_MULTI_CHOICE_HIGHWAY
多备选,高速优先
|
static int |
DRIVING_MULTI_CHOICE_HIGHWAY_AVOID_CONGESTION
多备选,高速优先,躲避拥堵(考虑路况)
|
static int |
DRIVING_MULTI_CHOICE_NO_HIGHWAY
多备选,不走高速
|
static int |
DRIVING_MULTI_CHOICE_SAVE_MONEY
多备选,费用优先
|
static int |
DRIVING_MULTI_CHOICE_SAVE_MONEY_NO_HIGHWAY
多备选,费用有限,不走高速
|
static int |
DRIVING_MULTI_STRATEGY_FASTEST_SAVE_MONEY_SHORTEST
同时使用速度优先、费用优先、距离优先三个策略计算路径。
|
static int |
DRIVING_MULTI_STRATEGY_FASTEST_SHORTEST
多备选,时间最短,距离最短
|
static int |
DRIVING_MULTI_STRATEGY_FASTEST_SHORTEST_AVOID_CONGESTION
多备选,时间最短,距离最短,躲避拥堵(考虑路况)
|
static int |
DRIVING_NORMAL_CAR
普通汽车
|
static int |
DRIVING_PLUGIN_HYBRID_CAR
插电混动车
|
static int |
DRIVING_PURE_ELECTRIC_VEHICLE
纯电动车
|
static int |
DRIVING_SINGLE_AVOID_CONGESTION
避免拥堵。
|
static int |
DRIVING_SINGLE_DEFAULT
速度优先
|
static int |
DRIVING_SINGLE_NO_EXPRESSWAYS
不走快速路。
|
static int |
DRIVING_SINGLE_NO_HIGHWAY
不走高速。
|
static int |
DRIVING_SINGLE_NO_HIGHWAY_SAVE_MONEY
不走高速且避免收费。
|
static int |
DRIVING_SINGLE_NO_HIGHWAY_SAVE_MONEY_AVOID_CONGESTION
不走高速且躲避收费和拥堵。
|
static int |
DRIVING_SINGLE_SAVE_MONEY
费用优先(不走收费路的最快道路)。
|
static int |
DRIVING_SINGLE_SAVE_MONEY_AVOID_CONGESTION
避免收费与拥堵。
|
static int |
DRIVING_SINGLE_SHORTEST
距离优先。
|
static int |
DrivingAvoidCongestion
已过时。
自V4.0.0以后,请参考
RouteSearch.DRIVING_SINGLE_AVOID_CONGESTION |
static int |
DrivingDefault
已过时。
自V4.0.0以后,请参考
RouteSearch.DRIVING_SINGLE_DEFAULT |
static int |
DrivingMultiStrategy
已过时。
|
static int |
DrivingNoExpressways
已过时。
自V4.0.0以后,请参考
RouteSearch.DRIVING_SINGLE_NO_EXPRESSWAYS |
static int |
DrivingNoHighAvoidCongestionSaveMoney
已过时。
|
static int |
DrivingNoHighWay
已过时。
自V4.0.0以后,请参考
RouteSearch.DRIVING_SINGLE_NO_HIGHWAY |
static int |
DrivingNoHighWaySaveMoney
已过时。
自V4.0.0以后,请参考
RouteSearch.DRIVING_SINGLE_NO_HIGHWAY_SAVE_MONEY |
static int |
DrivingSaveMoney
已过时。
自V4.0.0以后,请参考
RouteSearch.DRIVING_SINGLE_SAVE_MONEY |
static int |
DrivingSaveMoneyAvoidCongestion
已过时。
自V4.0.0以后,请参考
RouteSearch.DRIVING_SINGLE_SAVE_MONEY_AVOID_CONGESTION |
static int |
DrivingShortDistance
已过时。
自V4.0.0以后,请参考
RouteSearch.DRIVING_SINGLE_SHORTEST |
static java.lang.String |
EXTENSIONS_ALL
扩展字段all,会返回完整参数
|
static java.lang.String |
EXTENSIONS_BASE
扩展字段base,会返回部分参数
|
static int |
RIDING_DEFAULT
已过时。
骑行不再提供模式相关设置
|
static int |
RIDING_FAST
已过时。
骑行不再提供模式相关设置
|
static int |
RIDING_RECOMMEND
已过时。
骑行不再提供骑行相关设置
|
static int |
RidingDefault
已过时。
自V4.0.0以后,请参考
RouteSearch.RIDING_DEFAULT |
static int |
RidingFast
已过时。
自V4.0.0以后,请参考
RouteSearch.RIDING_FAST |
static int |
RidingRecommend
已过时。
自V4.0.0以后,请参考
RouteSearch.RIDING_RECOMMEND |
static int |
TRUCK_AVOID_CONGESTION
结果考虑路况,尽量躲避拥堵而规划路径,与高德地图的“躲避拥堵”策略一致
|
static int |
TRUCK_AVOID_CONGESTION__SAVE_MONEY
结果会尽量的躲避拥堵,并且规划收费较低甚至免费的路径结果,与高德地图的“躲避拥堵&避免收费”策略一致
|
static int |
TRUCK_AVOID_CONGESTION__SAVE_MONEY_NO_HIGHWAY
结果尽量躲避拥堵,规划收费较低甚至免费的路径结果,并且尽量不走高速路,与高德地图的“避免拥堵&避免收费&不走高速”策略一致
|
static int |
TRUCK_AVOID_CONGESTION_CHOICE_HIGHWAY
结果会优先考虑高速路,并且会考虑路况躲避拥堵,与高德地图的“躲避拥堵&高速优先”策略一致
|
static int |
TRUCK_AVOID_CONGESTION_NO_HIGHWAY
结果考虑路况,尽量躲避拥堵而规划路径,并且不走高速,与高德地图的“躲避拥堵&不走高速”策略一致
|
static int |
TRUCK_CHOICE_HIGHWAY
结果会优先选择高速路,与高德地图的“高速优先”策略一致
|
static int |
TRUCK_NO_HIGHWAY
结果不走高速,与高德地图“不走高速”策略一致
|
static int |
TRUCK_SAVE_MONEY
结果尽可能规划收费较低甚至免费的路径,与高德地图“避免收费”策略一致
|
static int |
TRUCK_SAVE_MONEY_NO_HIGHWAY
结果尽量不走高速,并且尽量规划收费较低甚至免费的路径结果,与高德地图的“避免收费&不走高速”策略一致
|
static int |
TRUCK_SIZE_HEAVY
重型车
|
static int |
TRUCK_SIZE_LIGHT
轻型车
|
static int |
TRUCK_SIZE_MEDIUM
中型车
|
static int |
TRUCK_SIZE_MINI
微型车
|
static int |
WALK_DEFAULT
已过时。
步行不再提供模式相关设置
|
static int |
WALK_MULTI_PATH
已过时。
步行不再提供模式相关设置
|
static int |
WalkDefault
已过时。
自V4.0.0以后,请参考
RouteSearch.WALK_DEFAULT |
static int |
WalkMultipath
已过时。
自V4.0.0以后,请参考
RouteSearch.WALK_MULTI_PATH |
构造器和说明 |
---|
RouteSearch(Context context)
根据给定的参数来构造一个RouteSearch的新对象。
|
public static final int BusDefault
RouteSearch.BUS_DEFAULT
public static final int BusSaveMoney
RouteSearch.BUS_SAVE_MONEY
public static final int BusLeaseChange
RouteSearch.BUS_LEASE_CHANGE
public static final int BusLeaseWalk
RouteSearch.BUS_LEASE_WALK
public static final int BusComfortable
RouteSearch.BUS_COMFORTABLE
public static final int BusNoSubway
RouteSearch.BUS_NO_SUBWAY
public static final int DrivingDefault
RouteSearch.DRIVING_SINGLE_DEFAULT
public static final int DrivingSaveMoney
RouteSearch.DRIVING_SINGLE_SAVE_MONEY
public static final int DrivingShortDistance
RouteSearch.DRIVING_SINGLE_SHORTEST
public static final int DrivingNoExpressways
RouteSearch.DRIVING_SINGLE_NO_EXPRESSWAYS
public static final int DrivingAvoidCongestion
RouteSearch.DRIVING_SINGLE_AVOID_CONGESTION
public static final int DrivingMultiStrategy
RouteSearch.DRIVING_MULTI_STRATEGY_FASTEST_SAVE_MONEY_SHORTEST
public static final int DrivingNoHighWay
RouteSearch.DRIVING_SINGLE_NO_HIGHWAY
public static final int DrivingNoHighWaySaveMoney
RouteSearch.DRIVING_SINGLE_NO_HIGHWAY_SAVE_MONEY
public static final int DrivingSaveMoneyAvoidCongestion
RouteSearch.DRIVING_SINGLE_SAVE_MONEY_AVOID_CONGESTION
public static final int DrivingNoHighAvoidCongestionSaveMoney
RouteSearch.DRIVING_SINGLE_NO_HIGHWAY_SAVE_MONEY_AVOID_CONGESTION
public static final int WalkDefault
RouteSearch.WALK_DEFAULT
public static final int WalkMultipath
RouteSearch.WALK_MULTI_PATH
public static final int RidingDefault
RouteSearch.RIDING_DEFAULT
public static final int RidingRecommend
RouteSearch.RIDING_RECOMMEND
public static final int RidingFast
RouteSearch.RIDING_FAST
public static final int BUS_DEFAULT
public static final int BUS_SAVE_MONEY
public static final int BUS_LEASE_CHANGE
public static final int BUS_LEASE_WALK
public static final int BUS_COMFORTABLE
public static final int BUS_NO_SUBWAY
public static final int WALK_DEFAULT
public static final int WALK_MULTI_PATH
public static final int RIDING_DEFAULT
public static final int RIDING_RECOMMEND
public static final int RIDING_FAST
public static final int DRIVING_SINGLE_DEFAULT
public static final int DRIVING_SINGLE_SAVE_MONEY
public static final int DRIVING_SINGLE_SHORTEST
public static final int DRIVING_SINGLE_NO_EXPRESSWAYS
public static final int DRIVING_SINGLE_AVOID_CONGESTION
public static final int DRIVING_MULTI_STRATEGY_FASTEST_SAVE_MONEY_SHORTEST
public static final int DRIVING_SINGLE_NO_HIGHWAY
public static final int DRIVING_SINGLE_NO_HIGHWAY_SAVE_MONEY
public static final int DRIVING_SINGLE_SAVE_MONEY_AVOID_CONGESTION
public static final int DRIVING_SINGLE_NO_HIGHWAY_SAVE_MONEY_AVOID_CONGESTION
public static final int DRIVING_MULTI_STRATEGY_FASTEST_SHORTEST_AVOID_CONGESTION
public static final int DRIVING_MULTI_STRATEGY_FASTEST_SHORTEST
public static final int DRIVING_MULTI_CHOICE_AVOID_CONGESTION
public static final int DRIVING_MULTI_CHOICE_NO_HIGHWAY
public static final int DRIVING_MULTI_CHOICE_SAVE_MONEY
public static final int DRIVING_MULTI_CHOICE_AVOID_CONGESTION_NO_HIGHWAY
public static final int DRIVING_MULTI_CHOICE_SAVE_MONEY_NO_HIGHWAY
public static final int DRIVING_MULTI_CHOICE_AVOID_CONGESTION_SAVE_MONEY
public static final int DRIVING_MULTI_CHOICE_AVOID_CONGESTION_NO_HIGHWAY_SAVE_MONEY
public static final int DRIVING_MULTI_CHOICE_HIGHWAY
public static final int DRIVING_MULTI_CHOICE_HIGHWAY_AVOID_CONGESTION
public static final int DRIVING_NORMAL_CAR
public static final int DRIVING_PURE_ELECTRIC_VEHICLE
public static final int DRIVING_PLUGIN_HYBRID_CAR
public static final int TRUCK_AVOID_CONGESTION
public static final int TRUCK_NO_HIGHWAY
public static final int TRUCK_SAVE_MONEY
public static final int TRUCK_AVOID_CONGESTION_NO_HIGHWAY
public static final int TRUCK_SAVE_MONEY_NO_HIGHWAY
public static final int TRUCK_AVOID_CONGESTION__SAVE_MONEY
public static final int TRUCK_AVOID_CONGESTION__SAVE_MONEY_NO_HIGHWAY
public static final int TRUCK_CHOICE_HIGHWAY
public static final int TRUCK_AVOID_CONGESTION_CHOICE_HIGHWAY
public static final int TRUCK_SIZE_MINI
public static final int TRUCK_SIZE_LIGHT
public static final int TRUCK_SIZE_MEDIUM
public static final int TRUCK_SIZE_HEAVY
public static final int DRIVEING_PLAN_DEFAULT
public static final int DRIVEING_PLAN_NO_HIGHWAY
public static final int DRIVEING_PLAN_SAVE_MONEY
public static final int DRIVEING_PLAN_AVOID_CONGESTION_NO_HIGHWAY
public static final int DRIVEING_PLAN_SAVE_MONEY_NO_HIGHWAY
public static final int DRIVEING_PLAN_AVOID_CONGESTION_SAVE_MONEY
public static final int DRIVEING_PLAN_AVOID_CONGESTION_SAVE_MONEY_NO_HIGHWAY
public static final int DRIVEING_PLAN_CHOICE_HIGHWAY
public static final int DRIVEING_PLAN_AVOID_CONGESTION_CHOICE_HIGHWAY
public static final int DRIVEING_PLAN_FASTEST_SHORTEST
public static final int DRIVEING_PLAN_AVOID_CONGESTION_FASTEST_SAVE_MONEY
public static final java.lang.String DRIVING_EXCLUDE_TOLL
public static final java.lang.String DRIVING_EXCLUDE_MOTORWAY
public static final java.lang.String DRIVING_EXCLUDE_FERRY
public static final java.lang.String EXTENSIONS_ALL
public static final java.lang.String EXTENSIONS_BASE
public RouteSearch(Context context) throws AMapException
context
- 对应的Context。AMapException
public void setRouteSearchListener(RouteSearch.OnRouteSearchListener listener)
listener
- 路径搜索结果监听接口。public void setOnTruckRouteSearchListener(RouteSearch.OnTruckRouteSearchListener onTruckRouteSearchListener)
onTruckRouteSearchListener
- 货车路径搜索结果监听接口。public void setOnRoutePlanSearchListener(RouteSearch.OnRoutePlanSearchListener onRoutePlanSearchListener)
onRoutePlanSearchListener
- 货车路径搜索结果监听接口。public WalkRouteResult calculateWalkRoute(RouteSearch.WalkRouteQuery walkQuery) throws AMapException
RouteSearchV2.calculateWalkRoute(com.amap.api.services.route.RouteSearchV2.WalkRouteQuery)
walkQuery
- 查询参数。AMapException
public void calculateWalkRouteAsyn(RouteSearch.WalkRouteQuery walkQuery)
RouteSearchV2.calculateWalkRouteAsyn(com.amap.api.services.route.RouteSearchV2.WalkRouteQuery)
walkQuery
- 查询参数。public BusRouteResult calculateBusRoute(RouteSearch.BusRouteQuery busQuery) throws AMapException
RouteSearchV2.calculateBusRoute(com.amap.api.services.route.RouteSearchV2.BusRouteQuery)
busQuery
- 查询参数。AMapException
public void calculateBusRouteAsyn(RouteSearch.BusRouteQuery busQuery)
RouteSearchV2.calculateBusRouteAsyn(com.amap.api.services.route.RouteSearchV2.BusRouteQuery)
busQuery
- 查询参数。public DriveRouteResult calculateDriveRoute(RouteSearch.DriveRouteQuery driveQuery) throws AMapException
RouteSearchV2.calculateDriveRoute(com.amap.api.services.route.RouteSearchV2.DriveRouteQuery)
driveQuery
- 查询参数。AMapException
- 途经点太多或避让区域太大会返回非法参数public void calculateDriveRouteAsyn(RouteSearch.DriveRouteQuery driveQuery)
RouteSearchV2.calculateDriveRouteAsyn(com.amap.api.services.route.RouteSearchV2.DriveRouteQuery)
driveQuery
- 查询参数。public void calculateRideRouteAsyn(RouteSearch.RideRouteQuery rideQuery)
RouteSearchV2.calculateRideRouteAsyn(com.amap.api.services.route.RouteSearchV2.RideRouteQuery)
rideQuery
- 查询参数。public RideRouteResult calculateRideRoute(RouteSearch.RideRouteQuery rideQuery) throws AMapException
RouteSearchV2.calculateRideRoute(com.amap.api.services.route.RouteSearchV2.RideRouteQuery)
rideQuery
- 查询参数。AMapException
public TruckRouteRestult calculateTruckRoute(RouteSearch.TruckRouteQuery truckQuery) throws AMapException
truckQuery
- 查询参数。AMapException
- 途经点太多会返回非法参数public void calculateTruckRouteAsyn(RouteSearch.TruckRouteQuery truckQuery)
truckQuery
- 查询参数。public DriveRoutePlanResult calculateDrivePlan(RouteSearch.DrivePlanQuery driveQuery) throws AMapException
driveQuery
- 查询参数。AMapException
public void calculateDrivePlanAsyn(RouteSearch.DrivePlanQuery driveQuery)
driveQuery
- 查询参数。