I noticed that when dynamically creating a large canvas (6400x6400), which will not be drawn on it for quite some time, and when setting the canvas to a small size, it works in 100% of cases, however, since I do not know anything better, I have no other of choice, except to try to get the large canvas to work correctly.
thisObj.oMapCanvas = jQuery( document.createElement('canvas') ).attr('width', 6400).attr('height', 6400).css('border','1px solid green').prependTo( thisObj.oMapLayer ).get(0);
// getContext and then drawing stuff here...
code>
The purpose of the canvas is to simply draw a line between the two nodes (images) that are in the div container that you can drag and drop (the viewport, which I think people call it).
What I “think” can happen is that when you resize the canvas, it clears the canvas and interferes with drawing the context, as I said earlier, it works all the time when the canvas is much smaller.
Has anyone experienced this before and / or knew any possible solutions?
Steve source
share