Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS support #223

Closed
MehdiGuelloub opened this issue Oct 12, 2016 · 7 comments
Closed

iOS support #223

MehdiGuelloub opened this issue Oct 12, 2016 · 7 comments

Comments

@MehdiGuelloub
Copy link

First of all I want to thank you for this amazing plugin. but i guess that the svg-pan-zoom is not supported by iOS i have tested it on both iphone and ipad and there is the same issue.
The gesture are not working as expected(exp pinch, pan ...) when i try to pan the image moves very very slowly.
PS: same code tested on browser and on android and it works perfectly.

@ariutta
Copy link
Collaborator

ariutta commented Oct 12, 2016

Thanks for the bug report. First thing to check is whether this is a
hammer.js issue.

If not, then could it be we have to use different speed factors just for
iOS?

On Oct 11, 2016 8:40 PM, "Mehdi Guelloub" notifications@github.com wrote:

First of all I want to thank you for this amazing plugin. but i guess that
the svg-pan-zoom is not supported by iOS i have tested it on both iphone
and ipad and there is the same issue.
The gesture are not working as expected(exp pinch, pan ...) when i try to
pan the image moves very very slowly.
PS: same code tested on browser and on android and it works perfectly.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#223, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPJg_emMTviCzGoFF9Kga3hbNHpV-Voks5qzFaWgaJpZM4KUVai
.

@ttupper92618
Copy link

It could also simply be a performance delta between devices or between mobile Safari and Android Browser or Chrome. I've implemented fairly large-scale systems using svg-pan-zoom on mobile with hammer, and had no problems. But I have noted that iOS devices are much less performant at rendering complex SVG; performance drops off markedly as the number of elements rises.

OP it would be helpful if you could identify OS versions, device types, and say something about the complexity of your image.

On Oct 12, 2016, at 5:34 AM, Anders Riutta <notifications@github.commailto:notifications@github.com> wrote:

Thanks for the bug report. First thing to check is whether this is a
hammer.js issue.

If not, then could it be we have to use different speed factors just for
iOS?

On Oct 11, 2016 8:40 PM, "Mehdi Guelloub" <notifications@github.commailto:notifications@github.com> wrote:

First of all I want to thank you for this amazing plugin. but i guess that
the svg-pan-zoom is not supported by iOS i have tested it on both iphone
and ipad and there is the same issue.
The gesture are not working as expected(exp pinch, pan ...) when i try to
pan the image moves very very slowly.
PS: same code tested on browser and on android and it works perfectly.

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#223, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPJg_emMTviCzGoFF9Kga3hbNHpV-Voks5qzFaWgaJpZM4KUVai
.

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/223#issuecomment-253200838, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKxucbmBQG1pfwPnJs9DCjFxh8jfdT1nks5qzNPFgaJpZM4KUVai.

@KiranMantana
Copy link

Team, Is the support for iOS is increased? I am working on a project with big SVG files in WebView, If i use SVG Pan, i am getting issues in Zoom In and Zoom Out

@ariutta
Copy link
Collaborator

ariutta commented Mar 27, 2017

Hi @KiranMantana, I'd suggest forking the lib and changing the zoom speed factor for iOS. If that doesn't work, you may need to lower the refresh rate. I'm not sure exactly where the problem is coming from, but pull requests are welcome!

@bumbu
Copy link
Owner

bumbu commented Mar 27, 2017

You can change the refresh rate by using refreshRate config value. Try setting it to 30 or even less (which will mean 30 frames per second).
But if you have very large SVG files, and the browser is generally slow on rendering those - there is nothing we can do about this.

@rendall
Copy link

rendall commented Aug 29, 2017

I can confirm that pinch & zoom does not work in Safari on the iPad mini. I am happy to work on this issue, @ariutta Has anyone started, as far as you know?

To reproduce:

Go to this jsfiddle with Safari (or Chrome) on iPad Mini: http://jsfiddle.net/bumbu/167usffr/
Try to pinch & zoom the square in the lower right hand corner. Note that it does not zoom. double-tap to zoom does work as expected, as do the controls. It is definitely - only - pinch to zoom.

It does work, however on all other browsers that I have been able to test.

@rendall
Copy link

rendall commented Aug 29, 2017

After further investigation, I see that zooming in this demo does work for iOS. Apparently the trick is to wire it up to hammer.js

this.hammer.on('pinchstart pinchmove', function(ev){
              // On pinch start remember initial zoom
              if (ev.type === 'pinchstart') {
                initialScale = instance.getZoom()
                instance.zoom(initialScale * ev.scale)
              }

              instance.zoom(initialScale * ev.scale)

            })

@ariutta ariutta closed this as completed Aug 31, 2017
Repository owner deleted a comment from rendall Aug 31, 2017
Repository owner deleted a comment from rendall Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants