Route for truck

Routing plan optimized for truck

The Routing API will show you how to get where you’re going. With the Routing API, you can:

  • Provide precise instructions to a destination using routing plans for various types of trucks

  • To request directions, call four values: a start point, destination, and car type, and waypoint (optional).

See the API Key Issuance page for information on using keys.

Routing API for Truck

GET https://api.fatos.biz/fatos/api/route

​Example API Call: https://api.fatos.biz/fatos/api/route?key=YOUR_API_KEY&origin=37.483294848898396,126.89654749206602&destination=37.51702306480502,127.0416190159097&angle=-1&rpoption=1&unixtime=1604626833&gmtoffset=32400&cartype=1

Query Parameters

{
  "routes": [
    {
      "rpoption": 1,
      "bounds": {
        "lefttop": {
          "lon": 127.006812,
          "lat": 36.081916
        },
        "rightbottom": {
          "lon": 128.36276,
          "lat": 37.560658
        }
      },
      "legs": [
        {
          "distance": {
            "text": "339.7 km",
            "value": 339760
          },
          "duration": {
            "text": "265 min",
            "value": 15909
          },
          "end_location": {
            "lon": 128.325439,
            "lat": 36.144195
          },
          "start_location": {
            "lon": 127.02298,
            "lat": 37.559692
          },
          "step": [
            {
              "distance": {
                "text": "0 m",
                "value": 0
              },
              "duration": {
                "text": "0 sec",
                "value": 0
              },
              "end_location": {
                "lon": 127.022793,
                "lat": 37.559661
              },
              "start_location": {
                "lon": 127.022793,
                "lat": 37.559661
              },
              "polyline": {
                "points": "{zfdFmchfW"
              },
              "instructions": "starting point",
              "roadcategory": 12,
              "maneuver": 49
            },
            {
              // steps omitted
            },
            {
              "distance": {
                "text": "0.1 km",
                "value": 116
              },
              "duration": {
                "text": "56 sec",
                "value": 56
              },
              "end_location": {
                "lon": 127.023163,
                "lat": 37.560658
              },
              "start_location": {
                "lon": 127.022793,
                "lat": 37.559661
              },
              "polyline": {
                "points": "{zfdFmchfWIEUS]YGEGCWA_BI"
              },
              "instructions": "Destination",
              "roadcategory": 12,
              "maneuver": 3
            }
          ],
          "via_waypoint": [
            {
              "location": {
                "lon": 127.123108,
                "lat": 36.123123
              },
              "step_index": 27
            }
          ]
        }
      ],
      "overview_polyline": {
        "points_count": 3986,
        "points": "{zfdFmchfW??IEUS]YGEGCWA_BI?wBtDCP@Z@lCJ`@C\\G`@ULMx@eARS...."
      }
    }
  ],
  "status": "OK"
}

Display of Directions Results

After you receive the requested results, you must decode the result into a geometry code. Call the Fatos.polyLine() function as the decoded result and display the result on the map.

Last updated