Search in sources :

Example 1 with ZendriveExtrapolationDetails

use of com.zendrive.sdk.ZendriveExtrapolationDetails in project zendrive-sdk-android-sample by zendrive.

the class MapActivity method getExtrapolatedLatLngPoints.

private List<LatLng> getExtrapolatedLatLngPoints(DriveInfo driveInfo) {
    List<LatLng> extrapolatedWaypoints = new ArrayList<>();
    ZendriveExtrapolationDetails extrapolationDetails = driveInfo.extrapolationDetails;
    if (extrapolationDetails != null && extrapolationDetails.estimatedStartLocation != null) {
        LocationPoint estimatedStartLocation = extrapolationDetails.estimatedStartLocation;
        LatLng estimatedStartLatLng = new LatLng(estimatedStartLocation.latitude, estimatedStartLocation.longitude);
        extrapolatedWaypoints.add(estimatedStartLatLng);
        LocationPoint actualStartLocation = driveInfo.waypoints.get(0).location;
        LatLng actualStartLocationLatLng = new LatLng(actualStartLocation.latitude, actualStartLocation.longitude);
        extrapolatedWaypoints.add(actualStartLocationLatLng);
    }
    return extrapolatedWaypoints;
}
Also used : ArrayList(java.util.ArrayList) LocationPoint(com.zendrive.sdk.LocationPoint) LatLng(com.google.android.gms.maps.model.LatLng) ZendriveExtrapolationDetails(com.zendrive.sdk.ZendriveExtrapolationDetails)

Aggregations

LatLng (com.google.android.gms.maps.model.LatLng)1 LocationPoint (com.zendrive.sdk.LocationPoint)1 ZendriveExtrapolationDetails (com.zendrive.sdk.ZendriveExtrapolationDetails)1 ArrayList (java.util.ArrayList)1