Routing from point A to point B.
Endpoint
https://sg-maps.track-asia.com/route/v1/{PROFILE}/{COORDINATES}.json
Parameters
| Parameter | Values | Description | Example |
|---|---|---|---|
PROFILE | car, moto, walk (required) | Mode of transportation | car |
COORDINATES | {longitude},{latitude};{longitude},{latitude} (required) | String of coordinates format | 103.1234,1.1234;103.5678,1.5678 |
geometries | polyline (default), polyline6 , geojson | Returned route geometry format (influences overview and per step) | polyline |
steps | true , false (default) | Return route steps for each route leg | true |
overview | simplified (default), full , false | Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. | full |
key | String (required) | API key | public_key |
Polyline tool
Example Code
https://sg-maps.track-asia.com/route/v1/car/103.7884,1.4436;103.8079,1.4453.json?geometries=polyline&steps=true&overview=full&key=public_key
https://sg-maps.track-asia.com/route/v1/moto/103.7884,1.4436;103.8079,1.4453.json?geometries=polyline&overview=full&key=public_key
Response
JSON Response
The response is a JSON object with the following structure:
code: Status of the request (e.g., "Ok").routes: An array of route objects. Each route contains:geometry: The route geometry as a GeoJSONLineStringwith an array of[longitude, latitude]coordinates.legs: An array of leg objects, each representing a segment between waypoints. Each leg contains:steps: An array of step objects, each with:geometry: GeoJSONLineStringfor the step.maneuver: Information about the maneuver (type, location, bearings).mode: Mode of transportation (e.g., "driving").driving_side: Driving side (e.g., "right").name: Name of the street or segment.intersections: Array of intersection objects with details about entry/exit points.weight,duration,distance: Metrics for the step.
summary: Name/summary of the leg.weight,duration,distance: Metrics for the leg.
weight_name: Name of the weight metric used.weight,duration,distance: Metrics for the route.
waypoints: An array of waypoint objects, each with:hint: Internal hint for the routing engine.distance: Distance from the input coordinate to the snapped point.name: Name of the snapped location.location:[longitude, latitude]of the snapped point.