First of all you need more than one point to work with - otherwise there is no route...
data: [{
location: [20.69, -70.96],
title: "Foo"
},
{
location: [22.69, -77.96],
title: "Next Foo"
},
{
location: [12.69, -67.96],
title: "Next Next Foo"
}],
If you want to draw a line between two point you have to pass two points (markers) to the drawing method... So run your loop up to one-before-the-last elements...
for (var i = 0; i < markers.length - 1; i++) {
linkMarker(map, markers[i], markers[i + 1]);
}
And the drawing function:
function linkMarker(map, marker, nextMarker) {
var data = marker.dataItem;
var nextData = nextMarker.dataItem;
var dataFrom = map.locationToView(marker.location());
var nextDataFrom = map.locationToView(nextMarker.location());
var shapeLayer = map.layers[0];
var line = new kendo.dataviz.drawing.Path({
stroke: {
color: "#aaa",
width: 4,
lineCap: "round"
}
});
line.moveTo(dataFrom).lineTo(nextDataFrom);
shapeLayer.surface.draw(line);
}