makes get_directions function return an array of polylines