Sorry, I made a small change after I copy-and-pasted it, and, as usual, broke the code
. I've corrected the above code so it doesn't appear to have been written by an idiot. Now I have just double, double-checked it and it will work now (sorry!).
Actually, the marker is a bit off-centre on the map you see, but anyway. You can always use an invisible marker so it isn't distracting in-game.
EDIT: I think I worked out why the map "wobbles" about when you are moving or zooming the notepad. As far as I can tell, it is trying to ensure you can always
see the map's focal point (which for you is the marker), regardless of where the notepad is on the screen. Nothing you can do about it I don't think, without making your own map dialog, so stick with this.