openlayers/openlayers — pull request #894 by ejn (2013-02-27 09:17:18+00:00)
Title: Add option to Handler.Feature to react on touchend instead of touchstart

In order to allow DragPan navigation on touchscreen devices whilst a Feature handler is active, it is necessary that the Feature handler only produces click/clickout events on touchend. Otherwise, the callback from clicking the feature fires immediately the touch starts, which is probably not what the user was expecting. However, the Feature handler cannot just generally the callback on touchend as for e.g. DragFeature it is necessary that the feature is identified at the start of the touch event.

This change therefore adds an option to the Feature handler that the callback can be fired on touchend instead of touchstart. This option is off by default (current behaviour). My suggestion is that the SelectFeature control should turn it on by default, although this pull request does not currently include this.

Automated tests are included. The behaviour callbackOnTouchend has been manually tested on iOS and Android.

(Note that combining SelectFeature and DragPan controls may also require tinkering with the values for stopClick, stopDown and stopUp in the Feature handler - #891 deals with making it easier to set these)