Java源码示例:com.baidu.mapapi.search.route.MassTransitRoutePlanOption

示例1
public void reRoute(Bundle bundle) {
    if (null != bundle) {
        mPoiStart = bundle.getParcelable("start");
        mPoiEnd = bundle.getParcelable("end");
    }
    if (null == mPoiStart) {
        mPoiStart = BApp.MY_LOCATION;
    }
    if (null != BApp.MY_LOCATION && "我的位置".equals(mPoiStart.getName())) {
        mPoiStart = BApp.MY_LOCATION;
    }

    if (null != mPoiStart && null != mPoiEnd) {
        PlanNode stNode = PlanNode.withLocation(new LatLng(mPoiStart.getLatitude(), mPoiStart.getLongitude()));
        PlanNode enNode = PlanNode.withLocation(new LatLng(mPoiEnd.getLatitude(), mPoiEnd.getLongitude()));
        RoutePlanSearch planSearch = RoutePlanSearch.newInstance();
        planSearch.setOnGetRoutePlanResultListener(this);
        planSearch.masstransitSearch(new MassTransitRoutePlanOption().from(stNode).to(enNode));
    }


}
 
示例2
public void reRoute(Bundle bundle) {
    if (null != bundle) {
        mPoiStart = bundle.getParcelable("start");
        mPoiEnd = bundle.getParcelable("end");
    }
    if (null == mPoiStart) {
        mPoiStart = BApp.MY_LOCATION;
    }
    if (null != BApp.MY_LOCATION && "我的位置".equals(mPoiStart.getName())) {
        mPoiStart = BApp.MY_LOCATION;
    }

    if (null != mPoiStart && null != mPoiEnd) {
        PlanNode stNode = PlanNode.withLocation(new LatLng(mPoiStart.getLatitude(), mPoiStart.getLongitude()));
        PlanNode enNode = PlanNode.withLocation(new LatLng(mPoiEnd.getLatitude(), mPoiEnd.getLongitude()));
        RoutePlanSearch planSearch = RoutePlanSearch.newInstance();
        planSearch.setOnGetRoutePlanResultListener(this);
        planSearch.masstransitSearch(new MassTransitRoutePlanOption().from(stNode).to(enNode));
    }


}