var all_points = [];
var paths = route.getPaths();
var i = 0;
while (paths.get(i) !== null) {
var p = paths.get(i);
var segments = p.getSegments();
$(segments).each(function() {
var pc = this.getCoordinates();
$(pc).each(function() {
all_points.push(this);
});
});
i++;
}