mosca1337
mosca1337

Reputation: 2429

Phonegap pinch and zoom to scale canvas

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?

Upvotes: 1

Views: 2298

Answers (1)

Alexander Mistakidis
Alexander Mistakidis

Reputation: 3130

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

Upvotes: 2

Related Questions