Select to view content in your preferred language

Zoom and Pan problem on Apple hardware - js api v4.0

3944
2
Jump to solution
06-01-2016 06:29 AM
StéphaneGuignard
Emerging Contributor

I use the last version of js esri javascript 4.0 and I have a problem with the zoom out and pan. so I describe you the problem for each hardware :

  1. IPAD (IOS 9.3) - Safari : Zoom out with two fingers go out of the window (and then you can select an other tab after)
  2. IPHONE 6 (IOS 9.3) - Safari : When you do a Pan, all the screen move (buttons..) and this is bad experience for users
  3. IPHONE 6  (IOS 9.3) - Chrome : Same as 2 and the second problem is when you pan to bottom the page is reloaded.

For testing, you can try with the sample of Developers site :

Get started with MapView - Create a 2D map - 4.0

I tried to change the viewport but I didn't have success, such :

<meta name='viewport' content='initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'>

Someone has an idea to fix it or this is a bug of js api 4?

(This is not a problem for Android mobile and tablet)

0 Kudos
1 Solution

Accepted Solutions
YannCabon
Esri Contributor

Hi Stéphane,

We are looking into having proper touch support in 4.1. In the meantime you can work around the issue by stopping the event to propagate to the browser:

      view.surface.addEventListener("touchmove", function(event) {
        event.preventDefault();
      })

View solution in original post

2 Replies
YannCabon
Esri Contributor

Hi Stéphane,

We are looking into having proper touch support in 4.1. In the meantime you can work around the issue by stopping the event to propagate to the browser:

      view.surface.addEventListener("touchmove", function(event) {
        event.preventDefault();
      })
StéphaneGuignard
Emerging Contributor

Hi Yann,

Thanks a lot, I tried your work around on my IPHONE and it works fine.

Example : http://test.inser.ch/lvej/

BR,

Stéph.

0 Kudos