modify navi
This commit is contained in:
@@ -950,7 +950,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
|
||||
/**
|
||||
* 导航路线数据事件 TODO
|
||||
* 导航路线数据事件
|
||||
*/
|
||||
public void getNavigationData() {
|
||||
// Double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
@@ -968,8 +968,8 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
mTanluModelData.getNaviInformation(new NaviCallback() {
|
||||
mTanluModelData.getNaviInformation(mMogoMapService.getNavi(getContext()).getCalculatedPathPos(),
|
||||
new NaviCallback() {
|
||||
@Override
|
||||
public void onSuccess(NaviResult data) {
|
||||
List<Information> informationList = data.getResult().getInformations();
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.ParamsProvider;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.module.tanlu.callback.AlongTheWayCallback;
|
||||
import com.mogo.module.tanlu.callback.NaviCallback;
|
||||
import com.mogo.module.tanlu.callback.RoadLineCallback;
|
||||
@@ -287,21 +288,29 @@ public class TanluModelData {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导航沿途情报 TODO
|
||||
* 组装需要的请求list
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void getNaviInformation(final NaviCallback callback) {
|
||||
private List<String> getLatLngRequest(List<MogoLatLng> latLnglist) {
|
||||
List<String> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < latLnglist.size(); i++) {
|
||||
resultList.add(latLnglist.get(i).lng + "," + latLnglist.get(i).lat);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导航沿途情报
|
||||
*/
|
||||
public void getNaviInformation(List<MogoLatLng> mogoLatLnglist, final NaviCallback callback) {
|
||||
Gson gson = new Gson();
|
||||
double lng = 120.42;
|
||||
double lat = 36.19;
|
||||
if (mogoLatLnglist == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
double lng2 = 120.66;
|
||||
double lat2 = 36.32;
|
||||
|
||||
List<String> coordinates = new ArrayList<>();
|
||||
coordinates.add(lng + "," + lat);
|
||||
coordinates.add(lng2 + "," + lat2);
|
||||
|
||||
NaviRoadRequest naviRoadRequest = new NaviRoadRequest(coordinates, 10);
|
||||
NaviRoadRequest naviRoadRequest = new NaviRoadRequest(getLatLngRequest(mogoLatLnglist), 10);
|
||||
String naviStr = gson.toJson(naviRoadRequest);
|
||||
Log.d(TAG, "getNaviInformation naviStr = " + naviStr);
|
||||
final Map<String, Object> params = new ParamsProvider.Builder(mContext)
|
||||
|
||||
Reference in New Issue
Block a user