Why does nothing show up? (SOLVED) | SoloLearn: Learn to code for FREE!


Why does nothing show up? (SOLVED)

This canvas is empty, why is map.draw() not working? https://code.sololearn.com/WJMnUAM0Fb0e/?ref=app

7/25/2020 12:54:36 PM


5 Answers

New Answer


Your canvas is too small for it. Remove position: absolute from css to verify


console.log(canv.height) and you'll see 150 you cannot enlarge canvas size by setting CSS width and height to 100%, that will only stretch the canvas. You can enlarge canvas size with JS canvas canv.height = (new value) canv.width = (new value)


Out of canvas Try initiate with y of 100


You can use canvas at full screen. canv.width = window.innerWidth; canv.height = window.innerHeight;


Ok thanks to all :) I'm kinda upset now because I need the canvas to be 100% full screen...