Follow

Truck settings example

Description

In this sample code you can see how to set truck attributes with the API function ChangeApplicationOptions. The dimensions are passed in millimeters and weight in kilograms.

Java

import com.sygic.sdk.remoteapi.Api;
import com.sygic.sdk.remoteapi.ApiOptions;
import com.sygic.sdk.remoteapi.exception.GeneralException;
import com.sygic.sdk.remoteapi.model.Options;

try
{
    Options truckOptions = new Options();
    int maxTime = 0;

    //setting up truck attributes
    truckOptions.bUseTruckAtt = 1; //1 for using truck attributes, else -1
    truckOptions.nTruckHeight = 3500; //mm
    truckOptions.nTruckWidth = 2300; //mm
    truckOptions.nTruckLenght = 9000; //mm
    truckOptions.nTruckWeightTotal = 16000; //kg

    //calling API function

    ApiOptions.changeApplicationOptions(truckOptions, maxTime);
}
catch (GeneralException e) {
    e.printStackTrace();
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments