Waypoint Optimization API Service

Hello,

I would like to try and use Waypoint Optimization API Service.
Is there already a HTML/Javascript available? If so I would appriciate that.
Also I dont’ see a working example of the Service. Is that because it’s in Public View?

Thnxs so far,
Fred

Current SDK do not support this service.
So you need to use axios/XMLHttpRequest to send the request.

axios example:

let data = {
  "waypoints": [
	{
	  "point": {
		"latitude": 45.458546,
		"longitude": 9.15049
	  }
	},
	{
	  "point": {
		"latitude": 50.033688,
		"longitude": 14.8226
	  }
	},
	{
	  "point": {
		"latitude": 50.033688,
		"longitude": 14.538226
	  }
	},
	{
	  "point": {
		"latitude": 50.033688,
		"longitude": 13.538226
	  }
	}
  ],
  "options": {
	"travelMode": "truck",
	"vehicleMaxSpeed": 110
  }
}
axios.post('https://api.tomtom.com/routing/waypointoptimization/1/best?key=apikey', data)
  .then(response => {
  console.log(response)
  })

Hello Maloleps,

Thnxs for your answer.
However I don’t have any idea how to start implementing this code.
Question: Can this code be “translated” to HTML/Javascript like all the other SDK examples?
I would appriciate that!

Fred

Currently we don’t have a full example.
I just noticed that this short one doesn’t have import for axios statement.

To have a full working example for this we should have a concept of how to display the result, etc.