In this paper, the Maccari system is investigated, which is viewed as a two‐dimensional extension of nonlinear Schrödinger equation. We derive doubly localized two‐dimensional rogue waves on the dark solitons of the Maccari system with Kadomtsev–Petviashvili hierarchy reduction method. The two‐dimensional rogue waves include line segment rogue waves and rogue‐lump waves, which are localized in two‐dimensional space and time. These rogue waves are generated by the resonant collision of rational solitary waves and dark solitons, the whole process of transforming elastic collision into resonant collision is analytically studied. Furthermore, we also discuss the local characteristics and asymptotic properties of these rogue waves. Simultaneously, the generating conditions of the line segment rogue wave and rogue‐lump wave are also given, which provides the possibility to predict rogue wave. Finally, a new way to obtain the high‐order rogue waves of the nonlinear Schrödinger equation are given by proper reduction from the semi‐rational solutions of the Maccari system.