So to make icon smaller while map detail gets bigger we need to invert something. Map scale is 1 when fully zoomed out, and it decreases in value as you zoom in. This is where ctrlMapScale command comes in handy. To make it change with the map you need to somehow connect it with map zoom. If you leave dimensions static, it will draw icon proportionate to your screen and therefore the icon will always be the same size when you zoom in or zoom out the map. This command takes icon dimensions and direction. As you have guessed it also has to be drawn every frame. To draw actual icon there is drawIcon command.
It could be the normal map or any custom map control you create. It will fire every frame when the map is open. Anyway, there is a dedicated event handler for drawing things on map which is called “Draw”.