Multi-touch Iphone mobile browser support?

  • 6
  • Question
  • Updated 10 years ago
  • Answered
How do we support iphone with our pages? I would also like to support the Droid but at basic... http://seadragon.com/ajax/0.8/seadrag.... doesnt work at all...(no touch support?)

it looks possible with http://www.seadragon.com/view/1

Though I would like to use something more controlled than the embed method.
Photo of lancealandyas

lancealandyas

  • 3 Posts
  • 0 Reply Likes

Posted 10 years ago

  • 6
Photo of Daniel Gasienica

Daniel Gasienica

  • 73 Posts
  • 19 Reply Likes
This question has already been asked and you'll find an official statement in the following topic:
http://getsatisfaction.com/livelabs/t...

Cheers,
Daniel
Photo of Aseem Kishore

Aseem Kishore, Former Employee

  • 702 Posts
  • 124 Reply Likes
Indeed, thanks Daniel. But also thanks lancealandyas for the good feedback -- we understand this is a pain point right now for our developers.

I can tell you that part of the issue is that we wouldn't want to release something iPhone-only, as that just doesn't align with the philosophies of the web and Seadragon Ajax (particularly the "cross-platform" part). Maybe in the future we could really develop support for touch input across several platforms (e.g. Android, Windows Phone 7!) and at that point bake the support into Seadragon Ajax.

I can also tell you that we're also now seriously considering focusing on jQuery moving forward. You may have heard the recent announcement that Microsoft as a whole has officially shifted its Ajax focus to jQuery. This would be great news because the jQuery community is already tackling the cross-platform touch problem, and we would be able to leverage that.

We haven't made any decisions yet, but if you have any feedback, let us know. In the meantime, Bill's suggestion in the thread Daniel links to is right-on: you can add touch support yourself easily using the documented iPhone touch APIs.

Good luck!
Photo of lancealandyas

lancealandyas

  • 3 Posts
  • 0 Reply Likes
Safari does indeed expose a set of events I have worked with them before in a straight javascript html context perhaps I am missing the object to listen to isnt the plug-in well swallowing those events?
Photo of Aseem Kishore

Aseem Kishore, Former Employee

  • 702 Posts
  • 124 Reply Likes
Ah, the element to listen to is viewer.drawer.elmt. Note though that viewer.drawer is only non-null when an image is open in the viewer. So here's some code to get you started.


var viewer = new Seadragon.Viewer("container");
var eventsAdded = false;
 
viewer.addEventListener("open", onViewerOpen);
viewer.openDzi("foo.dzi");
 
function onViewerOpen(viewer) {
var drawerElmt = viewer.drawer.elmt;
 
if (eventsAdded) {
return;
}
 
eventsAdded = true;
 
Seadragon.Utils.addEvent(drawerElmt, "touchstart", onTouchStart);
// other events ...
}
 
function onTouchStart(event) {
// ...
}
 
// ...
 

This code has a "once-only" check built in because it turns out we hold on to the same element even if you close the image and open another one later. So multiple "open" events can theoretically fire, but you don't want to duplicate event listeners.

Let us know if you run into any troubles, and hope this helps!

Aseem
Photo of lancealandyas

lancealandyas

  • 3 Posts
  • 0 Reply Likes
Thanks great will let you know...