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

+1

Why does nothing show up?

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

7/25/2020 12:54:36 PM

Spentify

5 Answers

New Answer

+4

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

+3

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)

+2

Out of canvas Try initiate with y of 100

+1

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

+1

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