I have a large html5 canvas (much larger than the screen), and I want to implement a "google-maps" dragging. I want the canvas to be dragable by mouse, and I want it to render only the part we can see on the screen each time I drag it. Does someone have a good idea?
I solved this problem by using the jQuery UI draggable component on the canvas element. I enclosed it in a div - with overflow set to hidden, and made the canvas as large as I need it to be. Works a charm
http://jqueryui.com/demos/draggable/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With