eagle 930 车前引导线
This commit is contained in:
@@ -39,20 +39,16 @@ public class OCHTaxiOverlayManager {
|
|||||||
/**
|
/**
|
||||||
* 绘制最优路线
|
* 绘制最优路线
|
||||||
*
|
*
|
||||||
* @param polylinePoint 要绘制的经纬度度集合
|
* @param routelist 要绘制的经纬度度集合
|
||||||
*/
|
*/
|
||||||
public IMogoPolyline draw(MogoLocation carLocal, List<MogoLatLng> polylinePoint) {
|
public IMogoPolyline draw(MogoLocation carLocal, List<MogoLatLng> routelist) {
|
||||||
if (mMoGoPolyline != null) {
|
clearMogoRouteOverlay();
|
||||||
mMoGoPolyline.remove();
|
if (routelist != null) {
|
||||||
mPolylinePointList.clear();
|
|
||||||
mPolylineColors.clear();
|
|
||||||
}
|
|
||||||
if (polylinePoint != null) {
|
|
||||||
|
|
||||||
// 将当前车辆位置放进去
|
// 将当前车辆位置放进去
|
||||||
mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude()));
|
mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude()));
|
||||||
// 过滤后台推送的推荐路线集合
|
// 过滤后台推送的推荐路线集合
|
||||||
for (MogoLatLng polyline : polylinePoint) {
|
for (MogoLatLng polyline : routelist) {
|
||||||
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
|
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
|
||||||
if (LocationUtils.isPointOnCarFront(carLocal, polyline)) {
|
if (LocationUtils.isPointOnCarFront(carLocal, polyline)) {
|
||||||
mPolylinePointList.add(polyline);
|
mPolylinePointList.add(polyline);
|
||||||
@@ -69,4 +65,12 @@ public class OCHTaxiOverlayManager {
|
|||||||
return mMoGoPolyline;
|
return mMoGoPolyline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearMogoRouteOverlay(){
|
||||||
|
if (mMoGoPolyline != null) {
|
||||||
|
mMoGoPolyline.remove();
|
||||||
|
mPolylinePointList.clear();
|
||||||
|
mPolylineColors.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -358,23 +358,22 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Location mLocation;
|
private Location mLocation;
|
||||||
private MogoLocation mogoLocation;
|
|
||||||
@Override
|
@Override
|
||||||
public void onCarLocationChanged2( Location location ) {
|
public void onCarLocationChanged2( Location location ) {
|
||||||
OCHTaxiUiController.getInstance().runOnUIThread( () -> {
|
OCHTaxiUiController.getInstance().runOnUIThread( () -> {
|
||||||
calculateTravelDistance( location );
|
calculateTravelDistance( location );
|
||||||
} );
|
} );
|
||||||
// //坐标转换
|
//坐标转换
|
||||||
// MogoLocation loc = new MogoLocation();
|
MogoLocation loc = new MogoLocation();
|
||||||
// loc.setTime(loc.getTime());
|
loc.setTime(loc.getTime());
|
||||||
// loc.setAccuracy(location.getAccuracy());
|
loc.setAccuracy(location.getAccuracy());
|
||||||
// loc.setSpeed(location.getSpeed());
|
loc.setSpeed(location.getSpeed());
|
||||||
// loc.setLongitude(location.getLongitude());
|
loc.setLongitude(location.getLongitude());
|
||||||
// loc.setLatitude(location.getLatitude());
|
loc.setLatitude(location.getLatitude());
|
||||||
// loc.setAltitude(location.getAltitude());
|
loc.setAltitude(location.getAltitude());
|
||||||
// loc.setBearing(location.getBearing());
|
loc.setBearing(location.getBearing());
|
||||||
// loc.setProvider(location.getProvider());
|
loc.setProvider(location.getProvider());
|
||||||
// mogoLocation = loc;
|
drawRouteOverlay(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -478,24 +477,24 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
private OCHTaxiOverlayManager ochTaxiOverlayManager;
|
private OCHTaxiOverlayManager ochTaxiOverlayManager;
|
||||||
|
private List<MogoLatLng> mRouteList;
|
||||||
@Override
|
@Override
|
||||||
public void routeResult(List<MogoLatLng> routeList) {
|
public void routeResult(List<MogoLatLng> routeList) {
|
||||||
if (routeList == null ) return;
|
mRouteList = routeList;
|
||||||
// double distance = calculateTravelDistance(mogoLocation,routeList);
|
}
|
||||||
// if ( MogoOCHTaxiModel.getInstance().checkCurrentOCHOrder() ) {
|
|
||||||
// MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().decreaseTravelDistance( distance );
|
private void drawRouteOverlay(MogoLocation location){
|
||||||
// updateOrderBaseStatusInfo();
|
if (mRouteList == null && ochTaxiOverlayManager!= null){
|
||||||
// }
|
ochTaxiOverlayManager.clearMogoRouteOverlay();
|
||||||
// Logger.d("lianglihui","routeResult 剩余导航距离:"+distance);
|
return;
|
||||||
// if (routeList != null && routeList.size() >0){
|
}
|
||||||
// Logger.d("lianglihui","routeResult:"+routeList.size());
|
if (mRouteList.size() >0){
|
||||||
// //adas回调导航路径 绘制引导线
|
//adas回调导航路径 绘制引导线
|
||||||
// if ( ochTaxiOverlayManager == null){
|
if ( ochTaxiOverlayManager == null){
|
||||||
// ochTaxiOverlayManager = new OCHTaxiOverlayManager(this.getContext());
|
ochTaxiOverlayManager = new OCHTaxiOverlayManager(this.getContext());
|
||||||
// }
|
}
|
||||||
// ochTaxiOverlayManager.draw(mogoLocation,routeList);
|
ochTaxiOverlayManager.draw(location,mRouteList);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public double calculateTravelDistance(MogoLocation carLocation,List<MogoLatLng> routeList){
|
public double calculateTravelDistance(MogoLocation carLocation,List<MogoLatLng> routeList){
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ ext {
|
|||||||
androidxjunit : "androidx.test.ext:junit:1.1.2",
|
androidxjunit : "androidx.test.ext:junit:1.1.2",
|
||||||
androidxespressocore : "androidx.test.espresso:espresso-core:3.3.0",
|
androidxespressocore : "androidx.test.espresso:espresso-core:3.3.0",
|
||||||
// 地图
|
// 地图
|
||||||
amapnavi3dmap : "com.amap.api:navi-3dmap:7.2.0_3dmap7.2.0",
|
amapnavi3dmap : "com.amap.api:navi-3dmap:8.0.1_3dmap8.0.1",
|
||||||
amapsearch : "com.amap.api:search:7.1.0",
|
amapsearch : "com.amap.api:search:7.9.0",
|
||||||
amaplocation : "com.amap.api:location:5.3.1",
|
amaplocation : "com.amap.api:location:5.5.0",
|
||||||
// json 转换
|
// json 转换
|
||||||
gson : "com.google.code.gson:gson:2.8.4",
|
gson : "com.google.code.gson:gson:2.8.4",
|
||||||
// 内存泄漏检测
|
// 内存泄漏检测
|
||||||
|
|||||||
Reference in New Issue
Block a user