Catalyzes the formation of mannose 6-phosphate (M6P) markers on high mannose type oligosaccharides in the Golgi apparatus. M6P residues are required to bind to the M6P receptors (MPR), which mediate the vesicular transport of lysosomal enzymes to the endosomal/prelysosomal compartment. {ECO:0000269|PubMed:19955174, ECO:0000269|PubMed:23733939, ECO:0000269|PubMed:28918368}. This is the function of GNPTAB (N-acetylglucosamine-1-phosphate transferase subunits alpha and beta, Ensembl gene identifier ENSG00000111670).