public class DistanceItem
extends java.lang.Object
implements android.os.Parcelable
| 限定符和类型 | 字段和说明 |
|---|---|
static android.os.Parcelable.Creator<DistanceItem> |
CREATOR |
int |
ERROR_CODE_NO_DRIVE
指定地点之间没有可以行车的道路
There is no drivable road between the specified locations |
int |
ERROR_CODE_NOT_IN_CHINA
起点/终点不在中国境内
The start/end point is not within China |
int |
ERROR_CODE_TOO_FAR
起点/终点 距离所有道路均距离过远(例如在海洋/矿业)
The start/end point is too far from all roads (e.g., in the ocean/mining area) |
| 构造器和说明 |
|---|
DistanceItem() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
describeContents() |
int |
getDestId()
终点坐标,终点坐标序列号(从1开始)
虽然终点仅支持一个坐标,但为了和起点统一也按照坐标序列号方式返回 End point coordinates, end point sequence number (starting from 1) Although only one coordinate is supported for the end point, it is returned in the sequence number format for consistency with the start point |
float |
getDistance()
路径距离,单位:米
Route distance, unit: meters |
float |
getDuration()
预计行驶时间,单位:秒
Estimated travel time, unit: seconds |
int |
getErrorCode()
仅在出错的时候显示此字段
This field is only displayed when an error occurs. |
java.lang.String |
getErrorInfo()
仅在出错的时候显示该字段
This field is only displayed when an error occurs. |
int |
getOriginId()
起点坐标,起点坐标序列号(从1开始)
如传入4个起点,originId为1则表示第一个点对应的结果 Start point coordinates, start point sequence number (starting from 1) If 4 start points are passed in, originId 1 represents the result corresponding to the first point |
void |
setDestId(int destId)
终点坐标,终点坐标序列号(从1开始)
End point coordinates, end point sequence number (starting from 1) |
void |
setDistance(float distance)
路径距离,单位:米
Route distance, unit: meters |
void |
setDuration(float duration)
预计行驶时间,单位:秒
Estimated travel time, unit: seconds |
void |
setErrorCode(int errorCode)
仅在出错的时候显示此字段
This field is only displayed when an error occurs. |
void |
setErrorInfo(java.lang.String errorInfo)
仅在出错的时候显示该字段。
|
void |
setOriginId(int originId)
起点坐标,起点坐标序列号(从1开始)
Start point coordinates, start point sequence number (starting from 1) |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public final int ERROR_CODE_NO_DRIVE
public final int ERROR_CODE_TOO_FAR
public final int ERROR_CODE_NOT_IN_CHINA
public static final android.os.Parcelable.Creator<DistanceItem> CREATOR
public int getOriginId()
public int getDestId()
public float getDistance()
public float getDuration()
public java.lang.String getErrorInfo()
仅在出错的时候显示该字段。大部分显示“未知错误”
由于此接口支持批量请求,建议不论批量与否用此字段判断请求是否成功
This field is only displayed when an error occurs. Most of the time it shows 'Unknown error'
Since this interface supports batch requests, it is recommended to use this field to determine whether the request is successful, regardless of batch processing.
public int getErrorCode()
错误码,在驾车模式下:
ERROR_CODE_NO_DRIVE 1,指定地点之间没有可以行车的道
ERROR_CODE_TOO_FAR 2,起点/终点 距离所有道路均距离过远(例如在海洋/矿业)
ERROR_CODE_NOT_IN_CHINA 3,起点/终点不在中国境内
Error codes in driving mode:
ERROR_CODE_NO_DRIVE 1. There is no drivable road between the specified locations
ERROR_CODE_TOO_FAR 2. The start/end point is too far from all roads (e.g., in the ocean/mining area)
ERROR_CODE_NOT_IN_CHINA 3. The start/end point is not within China
public void setOriginId(int originId)
originId - 起点坐标,起点坐标序列号(从1开始)
public void setDestId(int destId)
destId - 终点坐标,终点坐标序列号(从1开始)
public void setDistance(float distance)
distance - 路径距离,单位:米
public void setDuration(float duration)
duration - 预计行驶时间,单位:秒
public void setErrorInfo(java.lang.String errorInfo)
public void setErrorCode(int errorCode)
errorCode - 错误码,在驾车模式下:
ERROR_CODE_NO_DRIVE 1,指定地点之间没有可以行车的道ERROR_CODE_TOO_FAR 2,起点/终点 距离所有道路均距离过远(例如在海洋/矿业)ERROR_CODE_NOT_IN_CHINA 3,起点/终点不在中国境内ERROR_CODE_NO_DRIVE 1. There is no drivable road between the specified locationsERROR_CODE_TOO_FAR 2. The start/end point is too far from all roads (e.g., in the ocean/mining area)ERROR_CODE_NOT_IN_CHINA 3. The start/end point is not within Chinapublic int describeContents()
describeContents 在接口中 android.os.Parcelablepublic void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel 在接口中 android.os.Parcelable