Pinch & Zoom is also panning left. mobile, javascript

3727
7
08-18-2015 10:36 AM
AndrewGianikas
New Contributor III

I've got an app build for mobile using the Arcgis javascript api... as the title says, there is an issue with the pinch and zoom.  When you pinch to zoom the map zooms in or out but it also seems to pan as well.  Instead of zooming to the center point of your pinch it will zoom WAY off to the left.  Any ideas about what could possible cause this will help me track down the issue.  Thanks in advance.

0 Kudos
7 Replies
AndrewGianikas
New Contributor III

The same thing happens with the mouse wheel. zoom in, zooms in and left.  zoom out, zooms out and right.

0 Kudos
AndrewGianikas
New Contributor III

Also the zoom in and zoom out buttons included with the map are working properly, they do not have the same issue as the pinch & zoom/ mouse wheel.

0 Kudos
AndrewGianikas
New Contributor III

Well i figured it out.  This is an single page app and the map was loading before the page transition was complete.  This seems to have confused the map.  So now that I dont load the map until after the transition is complete the issue is gone.

0 Kudos
DeeO_Driscoll
New Contributor

Andrew can I ask how did you stop the map from loading until after transition is complete?  I'm trying to do this using leaflet but I'm a novice programmer so any ideas how this can be done would be gratefully received!

At the moment I'm removing my layers until after the zoomend event has fired and then re-adding them but the requests for the layers are firing continually as the zooming/panning is ongoing n each request has to be loaded before the layers reload fully which slows the page down a lot.

0 Kudos
AndrewGianikas
New Contributor III

I am using a framework called Ionic, so I was controlling it via Ionic, not Arcgis.  Within Ionic I can trigger the map to load after the "view loaded" event.  Does not seem ideal but it works.

0 Kudos
KenBuja
MVP Esteemed Contributor

Which version of the JS API are you using? If I remember correctly from other discussions, this was fixed with either the map reposition or resize methods. In 3.14, there were some improvements to the resizing.

0 Kudos
AndrewGianikas
New Contributor III

I am using 3.13 compact, but also have the same issue with the full 3.13.  I can try using 3.14, thanks for the tip!

0 Kudos