The connectivity of vehicular ad hoc networks (VANets) can be affected by the special distribution patterns, usually dependent and non-uniform, of vehicles in a transportation network. In this study, we introduce a new framework for computing the connectivity in a VANet for continuous distribution patterns of communication nodes on a line in a transportation network. Such distribution patterns can be estimated from traffic densities obtained through loop detectors or other detectors. When communication nodes follow homogeneous Poisson distributions, we obtain a new closed-form solution to connectivity; when distribution patterns of communication nodes are given by spatial renewal processes, we derive an approximate closedform solution to the connectivity; and when communication nodes follow non-homogeneous Poisson distributions, we propose a recursive model of connectivity. For a shock-wave traffic, we demonstrate the consistency between analytical results with those simulated with ns-2, acommunication simulator. With the developed models, we also discuss the impacts on connectivity of road-side stations and different distribution patterns of vehicles. Given continuous traffic conditions, the connectivity model could be helpful for designing routing protocols in VANets and implementing vehicle-infrastructure integration systems. Limitations and future research related to this study are discussed in the conclusion section.