JavaScript pan and zoom library

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

JavaScript pan and zoom library

Postby somebody already took it » Thu Mar 08, 2012 6:56 am UTC

Does anyone know of a JavaScript library that makes it possible to pan and zoom over a webpage it's used on? Bonus points if it has event-handlers that indicate where the viewport is.
somebody already took it
 
Posts: 310
Joined: Wed Jul 01, 2009 3:03 am UTC

Re: JavaScript pan and zoom library

Postby phlip » Thu Mar 08, 2012 7:09 am UTC

Google Maps, maybe? Or do you need something more fancy than plain images?
While no one overhear you quickly tell me not cow cow.
but how about watch phone?
User avatar
phlip
Restorer of Worlds
 
Posts: 6779
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia

Re: JavaScript pan and zoom library

Postby somebody already took it » Thu Mar 08, 2012 7:17 am UTC

Yes, I want to be able to pan and zoom across arbitrary html.
somebody already took it
 
Posts: 310
Joined: Wed Jul 01, 2009 3:03 am UTC

Re: JavaScript pan and zoom library

Postby sourmìlk » Thu Mar 08, 2012 8:37 am UTC

I think that's something you should be able to do on your own. Or at least make a simplistic version. Maybe iterate through all the page's elements and resize them according to zoom level, for example?
Terry Pratchett wrote:The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.
User avatar
sourmìlk
If I can't complain, can I at least express my fear?
 
Posts: 6405
Joined: Mon Dec 22, 2008 10:53 pm UTC
Location: permanently in the wrong

Re: JavaScript pan and zoom library

Postby Steax » Thu Mar 08, 2012 10:07 am UTC

You can reroute everything through a javascript/SVG/canvas system and manipulate them from that. Alternatively, toss everything into a container element, then move that around through css transforms. Anything beyond simple things could easily break, however, and transforms are quite hard on computers.
In Minecraft, I use the username Rirez.
User avatar
Steax
SecondTalon's Goon Squad
 
Posts: 2770
Joined: Sat Jan 12, 2008 12:18 pm UTC


Return to Coding

Who is online

Users browsing this forum: No registered users and 10 guests