MGMap is a novel approach for online HD map construction that leverages learned masks to enhance the localization and detail of map elements. The method addresses the challenges of subtle and sparse annotations by incorporating mask-guided features at both the instance and point levels. At the instance level, the Mask-Activated Instance (MAI) decoder integrates global instance and structural information into instance queries using learned masks. At the point level, the Position-Guided Mask Patch Refinement (PG-MPR) module refines point locations by focusing on specific patch regions, enabling the extraction of detailed patch information. The proposed approach significantly improves the performance of HD map construction, achieving a notable 10mAP improvement over baselines on different input modalities. Extensive experiments on the *nuScenes* and *Argoverse2* datasets demonstrate the robustness and generalization capabilities of MGMap, making it a promising solution for real-time and accurate HD map construction in autonomous driving applications.MGMap is a novel approach for online HD map construction that leverages learned masks to enhance the localization and detail of map elements. The method addresses the challenges of subtle and sparse annotations by incorporating mask-guided features at both the instance and point levels. At the instance level, the Mask-Activated Instance (MAI) decoder integrates global instance and structural information into instance queries using learned masks. At the point level, the Position-Guided Mask Patch Refinement (PG-MPR) module refines point locations by focusing on specific patch regions, enabling the extraction of detailed patch information. The proposed approach significantly improves the performance of HD map construction, achieving a notable 10mAP improvement over baselines on different input modalities. Extensive experiments on the *nuScenes* and *Argoverse2* datasets demonstrate the robustness and generalization capabilities of MGMap, making it a promising solution for real-time and accurate HD map construction in autonomous driving applications.