void HandleGpsfix(GPSFix fix) { ; if (double.IsNaN(fix.latitude) || fix.latitude > 90 || fix.latitude < -90) { // Garbage coordinate. Ignore this reading; return; } else if (double.IsNaN(fix.longitude) || fix.longitude < -180 || fix.longitude > 180) { // Garbage coordinate. Ignore this reading; return; } lastLat = fix.latitude; lastLon = fix.longitude; }