You're not dealing with "this" properly. Try the following:
$('button').click(function(){
var arrayOfLines = $('#gps').val().split('\n');
$.each(arrayOfLines, function(index, item) {
console.log(this);
});
});
Note that the "this" variable in the inner function starts with the newline, I believe. But this should get you on the right track.