How to Display Map

I was trying to figure out a script that would allow me to display a map image on the screen when I press “m” and then it would go away. I was trying to get the image to be a map of my terrain with a picture I made of it in Photoshop. I have the picture but how do I make it come up on the screen when I press “m”? I am writing it in Javascript.

Attach a script to your camera. Add the variable:

var mapKeyDown : boolean = false;

In your camera's Update function:

    if(Input.GetKeyDown("k")){
        if(mapKeyDown)
            mapKeyDown = false;
        else
            mapKeyDown = true;
    }

Then in your camera's OnGUI function:

    if(mapKeyDown){
        GUI.DrawTexture();
        //see scripting reference for what 
        //attributes to use for this function
    }

[https://docs.unity3d.com/Documentation/ScriptReference/GUI.DrawTexture.html][1]


  [1]: https://docs.unity3d.com/Documentation/ScriptReference/GUI.DrawTexture.html