I have a map with buttons that I can click on but want to add a graphic layer over top. The problem is (even though everything I'm reading says it shouldn't do this), when clicking on any part of the topLayer png that has pixels, it doesn't let me click on the buttons underneath. I basically want to make the topLayer not clickable, I've tried every variation of pointerEvents with all kinds of names....the only thing I've been able to manipulate with the drawImage is the globalAlpha.
How in the world do I prevent this from covering up my clicks?
this.addTopLayer = function(){
// load topLayer.png and display it
var TopLayer = new Image();
TopLayer.onload = function() {
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
context.drawImage(TopLayer, 0, 0);
};
TopLayer.src = projpath+'/'+spath+'/'+topLayerFilename+'.png';
}