[OpenLayers-Trac] [OpenLayers] #3091: get cross device touch
dragging while letting click events propagate
OpenLayers
trac-20090302 at openlayers.org
Tue Feb 22 19:35:28 EST 2011
#3091: get cross device touch dragging while letting click events propagate
---------------------+------------------------------------------------------
Reporter: tschaub | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.11 Release
Component: Map | Version: 2.10
Keywords: | State:
---------------------+------------------------------------------------------
We got dragging on touch devices with r11189 and then lost it for Android
with r11207. On iOS, you can call {{{event.preventDefault()}}} on
{{{touchstart}}} or {{{touchmove}}} to keep the browser from scrolling on
a drag. On Android, only preventing the default for {{{touchstart}}}
stops scrolling. On both, preventing {{{touchstart}}} kills the mouse
sequence of events that would otherwise follow. So, if you're listening
for click events on the parent or child of an element that you don't want
to scroll, you're out of luck.
Unless configured otherwise, controls added to the map get appended to the
{{{viewPortDiv}}}. Because we listen to map events on this same element,
we can't both prevent scrolling and listen to click events on controls
across touch enabled devices.
A solution is to create an events target that is a sibling of the controls
instead of a parent.
--
Ticket URL: <http://trac.openlayers.org/ticket/3091>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list