I know that you can load an image directly in a canvas with
drawImage()
, but I'm wondering if it is possible to overlay a canvas
over another div with images in it.
Specifically, I want to overlay a <canvas>
element ove开发者_JAVA百科r a Google map.
I'd like to draw polylines and do animations over the map in the
<canvas>
context instead of using the Google Map APIs for this
purpose.
Yes. It should work just fine. Simply have your canvas be positioned over the div, similar to how the multiple canvases are positioned over each other in the example you linked.
You could probably just have tried it and not had to wait for an answer on SO :)
精彩评论