The combination of encryption and digital watermarking technologies is an increasingly popular approach to achieve full lifecycle data protection. Recently, reversible data hiding in the encrypted domain (RDHED) has greatly aroused the interest of many scholars. However, the fixed order of first encryption and then watermarking makes these algorithms unsuitable for many applications. Commutative encryption and watermarking (CEW) technology realizes the flexible combination of encryption and watermarking, and suits more applications. However, most existing CEW schemes for vector maps are not reversible and are unsuitable for high-precision maps. To solve this problem, here, we propose a commutative encryption and reversible watermarking (CERW) algorithm for vector maps based on virtual coordinates that are uniformly distributed on the number axis. The CERW algorithm consists of a virtual interval step-based encryption scheme and a coordinate difference-based reversible watermarking scheme. In the encryption scheme, the map coordinates are moved randomly by multiples of virtual interval steps defined as the distance between two adjacent virtual coordinates. In the reversible watermarking scheme, the difference expansion (DE) technique is used to embed the watermark bit into the coordinate difference, computed based on the relative position of a map coordinate in a virtual interval. As the relative position of a map coordinate in a virtual interval remains unchanged during the coordinate scrambling encryption process, the watermarking and encryption operations do not interfere with each other, and commutativity between encryption and watermarking is achieved. The results show that the proposed method has high security, high capacity, and good invisibility. In addition, the algorithm applies not only to polyline and polygon vector data, but also to sparsely distributed point data, which traditional DE watermarking algorithms often fail to watermark.