This paper presents a new monocular SLAM algorithm that uses straight lines extracted from images to represent the environment. A line is parametrized by two pairs of azimuth and elevation angles together with the two corresponding camera centres as anchors making the feature initialization relatively straightforward. There is no redundancy in the state vector as this is a minimal representation. A bundle adjustment (BA) algorithm that minimizes the reprojection error of the line features is developed for solving the monocular SLAM problem with only line features. A new map joining algorithm which can automatically optimize the relative scales of the local maps is used to combine the local maps generated using BA. Results from both simulations and experimental datasets are used to demonstrate the accuracy and consistency of the proposed BA and map joining algorithms.