Question

So I recently found out that an HTML5 canvas has maximum dimensions. This makes sense for memory and efficiency reasons. What would be the smoothest way to scale a context within a canvas element in phone gap. For example, how would I create an infinite pannable and zoomable canvas, similar to google maps?

Was it helpful?

Solution

You can use javascript to handle multi-touch gestures. There are plenty of libraries that make this easier to do. Sencha touch, or Hammer.js being examples of this. Then you would have to scale down your content on your canvas accordingly.

As for something specific to canvas, it will be a little heavier, but I would suggest something like: KineticJS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top