ol2 icon indicating copy to clipboard operation
ol2 copied to clipboard

`buttonclick` event not triggered on Chrome Android

Open pgiraud opened this issue 10 years ago • 18 comments

05de2b5 breaks in Android Chrome. For example, nothing happens when tapping the +/- zoom buttons on a Nexus 10 tablet using Android 4.4.2 and Chrome 36.0.1985.128.

pgiraud avatar Aug 08 '14 09:08 pgiraud

My first investigation show that for that browser a single tap (in place) fires 3 events: touchstart, touchmove, touchend. In other touch capable browsers, the touchmove isn't fired.

pgiraud avatar Aug 08 '14 10:08 pgiraud

According to the below page it should work: http://docs.openlayers.org/library/mobile.html But it not working for most of the android devices. Tested with the below Mobiles and tablets:

  1. Sony Z2 ----Android 4.4.2---Chrome browser----not working
  2. Nexus-lur----Android 4.4.4----Chrome browser----not working
  3. Nexus 7 tablet---Android 4.4.2---Chrome browser---- Openlayer cnotrol button onclick event doesn't fire for the first time.
  4. Nexus 7 tablet---Android 4.3---Chrome browser---- Openlayer cnotrol button onclick event doesn't fire for the first time.

uzzal46bd avatar Aug 25 '14 06:08 uzzal46bd

I have the same issue on Samsung galaxy 4(Android 4.4.2) with chrome 37.0.2062.117. The zoom buttons don't fire any events. @pgiraud: Did you find any solutions(alternatives) to this ?

emilmork avatar Sep 29 '14 13:09 emilmork

@emilmork nope, sorry.

pgiraud avatar Sep 29 '14 13:09 pgiraud

@emilmork @pgiraud something new?

jgleal avatar Oct 24 '14 11:10 jgleal

@jgleal Don't think so. Bu I just created custom buttons and called map.zoomIn() and map.zoomOut() manually.

emilmork avatar Oct 24 '14 12:10 emilmork

@emilmork Can you please provide a working example? For me, the combination of OpenLayers.Control.Button on a OpenLayers.Control.Panel does not work on Android 4.4. What is the workaround?

Xsasan avatar Nov 03 '14 08:11 Xsasan

@Xsasan: I am not using a OpenLayers.Control.Button or OpenLayers.Control.panel, just a custom link Zoom Inn and then calling map.zoomIn() when the link is pressed. The link is styled as a OpenLayers zoom button.

emilmork avatar Nov 05 '14 16:11 emilmork

Do we have any update about that bug? Whether it is possible to solve that problem? Or will it be solved on Openlayers next release? Do we have of any dirty fix about that problem until now before there will be a master update? Thanks in advance.

uzzal46bd avatar Nov 11 '14 09:11 uzzal46bd

I was having the problem, then when I set the "pixelTolerance" variable to 20, it fixed it. Hope this helps. Thanks.

wayofthefuture avatar Nov 13 '14 20:11 wayofthefuture

Hi @scuzzlebuzzle, set the "pixelTolerance" doesn't works for me. Can you show me you code?

jgleal avatar Nov 14 '14 11:11 jgleal

@scuzzlebuzzle @emilmork @Xsasan any news? I need patch this bug.

jgleal avatar Dec 09 '14 16:12 jgleal

Can you guys please check if #1416 fixes the issue? Thanks.

ahocevar avatar Dec 09 '14 17:12 ahocevar

@ahocevar oh! great! It works!

jgleal avatar Dec 10 '14 07:12 jgleal

I couldn't test the pull request earlier. I did this morning and clicking on the buttons still don't have any effect. Same device as previously but with Chrome updated (version 39.0.2171.93). I'm testing a locally installed debug version of OpenLayers. I couldn't test the online version since mobile examples on official site are broken. http://dev.openlayers.org/examples/mobile.html

pgiraud avatar Dec 15 '14 08:12 pgiraud

@pgiraud mmm, I've seen it. Try deleting the line 200 (++this._cancelCount).

jgleal avatar Dec 15 '14 12:12 jgleal

So did we work around something that was fixed in Chrome in the meantime? Then my change can just be reverted.

ahocevar avatar Dec 15 '14 12:12 ahocevar

Nope, the Chrome update doesn't fix the issue. If I revert the change (checkout to a previous commit), the button still behave the same (no action on map). So for the given device, the patch doesn't fix the issue unfortunately.

Finally, with the latest version of the code removing ``++this._cancelCount` as proposed by @jgleal works. https://github.com/pgiraud/openlayers/commit/9ee2619b2c5b59edb6af5afffd570134b55ceaf4

pgiraud avatar Dec 17 '14 12:12 pgiraud