Molecular representation learning is an essential component of many molecule-oriented tasks, such as molecular property prediction and molecule generation. In recent years, graph neural networks (GNNs) have shown great promise in this area, representing a molecule as a graph composed of nodes and edges. There are increasing studies showing that coarse-grained or multiview molecular graphs are important for molecular representation learning. Most of their models, however, are too complex and lack flexibility in learning different granular information for different tasks. Here, we proposed a flexible and simple graph transformation layer (i.e., LineEvo), a plug-and-use module for GNNs, which enables molecular representation learning from multiple perspectives. The LineEvo layer transforms fine-grained molecular graphs into coarse-grained ones based on the line graph transformation strategy. Especially, it treats the edges as nodes and generates the new connected edges, atom features, and atom positions. By stacking LineEvo layers, GNNs can learn multilevel information, from atom-level to triple-atoms level and coarser level. Experimental results show that the LineEvo layers can improve the performance of traditional GNNs on molecular property prediction benchmarks on average by 7%. Additionally, we show that the LineEvo layers can help GNNs have more expressive power than the Weisfeiler-Lehman graph isomorphism test.