How to create a 2D minimap?

Hello again guys!

Having trouble figuring out how to create a 2D minimap.

So far I have an idea of how the minimap works, which is the following:

A texture that consists of the layout of the map and moves according to the player position (with some math behind it of course), but the whole map is showing. So to only get a section of the map, there will be another layer on top of the map and make it somehow transparent, with only one small rectangle or circle of a window to show the current position of the map.

So my question is, is this the right way to do it? If yes (I already have a moving map texture), how can I produce the layer with a small opening, showing the current location?

If there is a better way to do this, what would it be?

Any hints or answers would be awesome, thanks in advance!