I tried to handle the canvas inside the iframe but I could not handle it.
It is rendered by webgl and I want to move and scroll automatically.
In order to do it, I tried to catch the mouse click event firstly. But it is not working.
Especially, I could not change the contents of the iframe because it is received dynamically.
- Is it possible?
- If it could be possible, please share the solution.
This is my challenge.
let iframe = document.getElementById("childFrame");
let childDocument = iframe.contentWindow.document;
let canvas = childDocument.getElementById("map-canvas");
canvas.addEventListener('click', function (e) {
console.log('#### DEBUG EVENT: ', e);
});
But it does not work.