He did not leave the map. They just stupidly call it the map to Luke over and over in TFA (so dumb audience remembers why what BB-8 has is important).
It’s really just the map to the first temple, which is hidden, and where people, assume he is. Not the best place to hide therefore, but he assumes correctly (for a while) that people won’t find him.
R2 had the whole map from the empire, except for the tiny piece that had been hidden away (that BB8 gets to start the movie) that contains the exact location of the temple, but the context of the rest of the galaxy is needed.
I'm more confused then ever
How did R2 get the large portion of the map