openlayers / ol2

OpenLayers v2 - deprecated!
Other
1.47k stars 770 forks source link

Openlayers drag/zoom gestures not very good in Android default browser #841

Open davidmckelvie opened 11 years ago

davidmckelvie commented 11 years ago

I was looking at a openlayers map page on a Samsung Tab running android 4.1.1 in the default web browser and noticed that dragging the map only worked with small increments, ie small drags did move the map, but larger drags only moved the map a small amount and then stopped.

Similarly, zoom in and out gestures did not seem to work reliably.

The dragging and zooming was much better using either chrome or firefox on the samsung tab.

The effect, ie poor dragging performance, was noticable on the OpenLayers demo page at http://openlayers.org/dev/examples/lite.html

The user agent string of the default browser was

Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; GT-P3110 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30

The owner of the Samsung device told me that the dragging performance of Openlayers maps used to be better (ie some time in December 2012), so this may be related to a recent update of the default browser.

ahocevar commented 11 years ago

There are improvements awaiting review (especially #800) that should boost dragging performance and make zooming much nicer (animated). Try http://ahocevar.github.com/openlayers/mobile-wmts-vienna/examples/mobile-wmts-vienna.html and compare it to http://openlayers.org/dev/examples/mobile-wmts-vienna.html. The former has the improvements and should perform better.

robertII commented 11 years ago

No joy, Ahocevar. As "the owner of the Samsung device", I can confirm that neither of those URLs you mention perform properly in the default browser on the Samsung tablet.

When I attempt to pan the map, it moves "a few mm", and then stops. Another drag will get another step... Zooming is "intermittent": sometimes it works just fine, but other times (perhaps after drags), it doesn't.

So, the published demo fails, and your enhancements make no obvious difference.

robertII commented 11 years ago

I've just noticed another problem affecting both these demonstrators (in the current state/release of the native browser on the Galaxy Tab) which may, or may not, be related to the "aborted dragging". If you rotate to "landscape" mode, the map adjusts to fill the screen. If you then rotate back to "portrait", the map again adjusts itself, but (usually) no longer goes to the bottom of the screen. It leaves a grey bar.
This doesn't happen in Firefox

davidmckelvie commented 11 years ago

It begins to appear that the dragging performance difference may be due to different versions of the default Android browser.

Robert is reporting bad performance with Browser build: Build/JRO03C Another colleague is reporting good dragging performance with build: Build/GT-I9300

Philzen commented 11 years ago

Similiar here on a Samsung smartphone running 4.1.2. All touchmove events (at least if i hook into them in js) seem to fire only after the finger releases the screen - so there is no visible move happening, but as touchend happens the map suddenly jumps to where you were supposed to be after your move.

Other js plugins and apps are suffering from this too. Tested with OL 2.12. The only js application i could find that doesn't is Google Maps as used on http://maps.google.de.

What's their workaround for this?