Merge remote-tracking branch 'origin/dev_robotaxi-d-app-module_265_220329_2.6.5' into dev_robotaxi-d-app-module_265_220329_2.6.5
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 导航监听
|
||||
*/
|
||||
public interface IMogoNaviListener {
|
||||
|
||||
/**
|
||||
* 导航初始化失败
|
||||
*/
|
||||
default void onInitNaviFailure(){}
|
||||
|
||||
/**
|
||||
* 导航初始化成功
|
||||
*/
|
||||
default void onInitNaviSuccess(){}
|
||||
|
||||
/**
|
||||
* 导航引导信息
|
||||
*
|
||||
* @param naviinfo
|
||||
*/
|
||||
default void onNaviInfoUpdate( MogoNaviInfo naviinfo ){}
|
||||
|
||||
/**
|
||||
* 导航开始回调
|
||||
*/
|
||||
default void onStartNavi(){}
|
||||
|
||||
/**
|
||||
* 导航停止:包括到达目的地和主动停止导航
|
||||
*/
|
||||
default void onStopNavi(){}
|
||||
|
||||
/**
|
||||
* 路径规划成功
|
||||
*/
|
||||
default void onCalculateSuccess(){}
|
||||
|
||||
/**
|
||||
* 路径规划失败
|
||||
*/
|
||||
default void onoCalculateFailed(){}
|
||||
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 导航引导信息
|
||||
*/
|
||||
public class MogoNaviInfo implements Parcelable {
|
||||
|
||||
/**
|
||||
* 当前路线名称
|
||||
*/
|
||||
private String currentRoadName;
|
||||
|
||||
/**
|
||||
* 导航过程中当前的车速
|
||||
*/
|
||||
private int currentSpeed;
|
||||
|
||||
/**
|
||||
* 当前路段剩余距离
|
||||
*/
|
||||
private int curStepRetainDistance;
|
||||
|
||||
/**
|
||||
* 当前路段剩余时间
|
||||
*/
|
||||
private int curStepRetainTime;
|
||||
|
||||
/**
|
||||
* 导航转向图标资源ID
|
||||
*/
|
||||
@DrawableRes
|
||||
private int iconResId;
|
||||
|
||||
/**
|
||||
* 下条路名
|
||||
*/
|
||||
private String nextRoadName;
|
||||
|
||||
/**
|
||||
* 剩余时间(秒)
|
||||
*/
|
||||
private int pathRetainTime;
|
||||
|
||||
/**
|
||||
* 剩余距离
|
||||
*/
|
||||
private int pathRetainDistance;
|
||||
|
||||
/**
|
||||
* 当前限速
|
||||
*/
|
||||
private float currentLimitSpeed;
|
||||
|
||||
public String getCurrentRoadName() {
|
||||
return currentRoadName;
|
||||
}
|
||||
|
||||
public void setCurrentRoadName(String currentRoadName) {
|
||||
this.currentRoadName = currentRoadName;
|
||||
}
|
||||
|
||||
public int getCurrentSpeed() {
|
||||
return currentSpeed;
|
||||
}
|
||||
|
||||
public void setCurrentSpeed(int currentSpeed) {
|
||||
this.currentSpeed = currentSpeed;
|
||||
}
|
||||
|
||||
public int getCurStepRetainDistance() {
|
||||
return curStepRetainDistance;
|
||||
}
|
||||
|
||||
public void setCurStepRetainDistance(int curStepRetainDistance) {
|
||||
this.curStepRetainDistance = curStepRetainDistance;
|
||||
}
|
||||
|
||||
public int getCurStepRetainTime() {
|
||||
return curStepRetainTime;
|
||||
}
|
||||
|
||||
public void setCurStepRetainTime(int curStepRetainTime) {
|
||||
this.curStepRetainTime = curStepRetainTime;
|
||||
}
|
||||
|
||||
public int getIconResId() {
|
||||
return iconResId;
|
||||
}
|
||||
|
||||
public void setIconResId(int iconResId) {
|
||||
this.iconResId = iconResId;
|
||||
}
|
||||
|
||||
public String getNextRoadName() {
|
||||
return nextRoadName;
|
||||
}
|
||||
|
||||
public void setNextRoadName(String nextRoadName) {
|
||||
this.nextRoadName = nextRoadName;
|
||||
}
|
||||
|
||||
public int getPathRetainTime() {
|
||||
return pathRetainTime;
|
||||
}
|
||||
|
||||
public void setPathRetainTime(int pathRetainTime) {
|
||||
this.pathRetainTime = pathRetainTime;
|
||||
}
|
||||
|
||||
public int getPathRetainDistance() {
|
||||
return pathRetainDistance;
|
||||
}
|
||||
|
||||
public String getVoiceRetainDistance() {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (pathRetainDistance >= 1000) {
|
||||
builder.append(String.format("%.1f公里", pathRetainDistance / 1000f));
|
||||
} else {
|
||||
builder.append(pathRetainDistance).append("米");
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public String getVoiceRetainTime() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int seconds = pathRetainTime;
|
||||
int days = seconds / (24 * 60 * 60);
|
||||
if (days > 0) {
|
||||
builder.append(days).append("天");
|
||||
}
|
||||
seconds -= days * 24 * 60 * 60;
|
||||
int hours = seconds / (60 * 60);
|
||||
if (hours > 0) {
|
||||
builder.append(hours).append("小时");
|
||||
}
|
||||
seconds -= hours * 60 * 60;
|
||||
int min = seconds / 60;
|
||||
builder.append(min > 1 ? min : 1).append("分钟");
|
||||
return builder.toString();
|
||||
|
||||
}
|
||||
|
||||
public void setPathRetainDistance(int pathRetainDistance) {
|
||||
this.pathRetainDistance = pathRetainDistance;
|
||||
}
|
||||
|
||||
public float getCurrentLimitSpeed() {
|
||||
return currentLimitSpeed;
|
||||
}
|
||||
|
||||
public void setCurrentLimitSpeed(float currentLimitSpeed) {
|
||||
this.currentLimitSpeed = currentLimitSpeed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.currentRoadName);
|
||||
dest.writeInt(this.currentSpeed);
|
||||
dest.writeInt(this.curStepRetainDistance);
|
||||
dest.writeInt(this.curStepRetainTime);
|
||||
dest.writeInt(this.iconResId);
|
||||
dest.writeString(this.nextRoadName);
|
||||
dest.writeInt(this.pathRetainTime);
|
||||
dest.writeInt(this.pathRetainDistance);
|
||||
dest.writeFloat(this.currentLimitSpeed);
|
||||
}
|
||||
|
||||
public MogoNaviInfo() {
|
||||
}
|
||||
|
||||
protected MogoNaviInfo(Parcel in) {
|
||||
this.currentRoadName = in.readString();
|
||||
this.currentSpeed = in.readInt();
|
||||
this.curStepRetainDistance = in.readInt();
|
||||
this.curStepRetainTime = in.readInt();
|
||||
this.iconResId = in.readInt();
|
||||
this.nextRoadName = in.readString();
|
||||
this.pathRetainTime = in.readInt();
|
||||
this.pathRetainDistance = in.readInt();
|
||||
this.currentLimitSpeed = in.readFloat();
|
||||
}
|
||||
|
||||
public static final Creator<MogoNaviInfo> CREATOR = new Creator<MogoNaviInfo>() {
|
||||
@Override
|
||||
public MogoNaviInfo createFromParcel(Parcel source) {
|
||||
return new MogoNaviInfo(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviInfo[] newArray(int size) {
|
||||
return new MogoNaviInfo[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void onStopLineInfo(@androidx.annotation.Nullable StopLine stopLine) {
|
||||
MogoLocation carLoc = CallerMapLocationListenerManager.INSTANCE.getCurrentLocation();
|
||||
if (stopLine != null && !TextUtils.isEmpty(stopLine.road_id) && stopLine.points != null && stopLine.points.size() > 0) {
|
||||
if (stopLine != null && stopLine.road_id != null && !stopLine.road_id.isEmpty() && stopLine.points != null && stopLine.points.size() > 0) {
|
||||
ArrayList<LonLatPoint> points = stopLine.points;
|
||||
if (carLoc != null) {
|
||||
/**
|
||||
|
||||
@@ -509,19 +509,21 @@ public class ObjectUtils {
|
||||
resultCenterLine.setRoad_id(centerLine.road_id);
|
||||
resultCenterLine.setTile_id(centerLine.tile_id);
|
||||
ArrayList<com.mogo.eagle.core.data.map.LonLatPoint> arrayList = new ArrayList<>();
|
||||
for (com.zhidaoauto.map.sdk.open.query.LonLatPoint point : centerLine.points) {
|
||||
com.mogo.eagle.core.data.map.LonLatPoint lonLatPoint = new com.mogo.eagle.core.data.map.LonLatPoint();
|
||||
lonLatPoint.setAltitude(point.altitude);
|
||||
lonLatPoint.setAngle(point.angle);
|
||||
lonLatPoint.setDistance(point.distance);
|
||||
lonLatPoint.setLatitude(point.latitude);
|
||||
lonLatPoint.setLongitude(point.longitude);
|
||||
lonLatPoint.setProvider(point.provider);
|
||||
lonLatPoint.setSpeed(point.speed);
|
||||
lonLatPoint.setDuration(point.duration);
|
||||
arrayList.add(lonLatPoint);
|
||||
if (centerLine.points != null) {
|
||||
for (com.zhidaoauto.map.sdk.open.query.LonLatPoint point : centerLine.points) {
|
||||
com.mogo.eagle.core.data.map.LonLatPoint lonLatPoint = new com.mogo.eagle.core.data.map.LonLatPoint();
|
||||
lonLatPoint.setAltitude(point.altitude);
|
||||
lonLatPoint.setAngle(point.angle);
|
||||
lonLatPoint.setDistance(point.distance);
|
||||
lonLatPoint.setLatitude(point.latitude);
|
||||
lonLatPoint.setLongitude(point.longitude);
|
||||
lonLatPoint.setProvider(point.provider);
|
||||
lonLatPoint.setSpeed(point.speed);
|
||||
lonLatPoint.setDuration(point.duration);
|
||||
arrayList.add(lonLatPoint);
|
||||
}
|
||||
resultCenterLine.setPoints(arrayList);
|
||||
}
|
||||
resultCenterLine.setPoints(arrayList);
|
||||
}
|
||||
return resultCenterLine;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user