Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag scrolling on touch devices fails because leaflet.js stops propagation of touchmove events #2031

Closed
votive opened this issue Sep 17, 2013 · 4 comments

Comments

@votive
Copy link

votive commented Sep 17, 2013

I've configured leaflet to display a map with gesture support disabled (drag to move map, pinch to zoom etc.) as I'd like to display the map completely read-only. Even with touch options turned off, the leaflet map still stops propagation of the touch move event, which means the user can't drag the page up and down on a touch screen device, if they start the drag on the map. This is a problem on a mobile phone where the map portion of the page takes up most of the screen, prohibiting the user from scrolling down to the rest of the page.

@mourner
Copy link
Member

mourner commented Sep 17, 2013

Can you please also try setting tap: false in the map options?

@votive
Copy link
Author

votive commented Sep 18, 2013

Fantastic that has worked perfectly, many thanks.


Sent from Mailbox for iPad

On Tue, Sep 17, 2013 at 4:52 PM, Vladimir Agafonkin
notifications@github.com wrote:

Can you please also try setting tap: false in the map options?

Reply to this email directly or view it on GitHub:
#2031 (comment)

@kuntalparbat
Copy link

I know "tap: false" this trick work for many people but not for me.
I am trying to enable move map in mobile devices.
it not let me drag map like desktop browser.

My code is below Please review and let me know how I can solve this.

Or if possible I like to add a direction move button where user can click to move map up down + left right.

`var map = L.map('map', {
layers: [osmMap],
center: new L.LatLng(22.5726, 88.3639),
zoom: 12,
zoomControl: false,
attributionControl: true,
dragging: true,
tap:true
})
//add zoom control with your options
map.attributionControl.setPrefix(geo_link);

L.control.zoom({
position:'bottomleft'
}).addTo(map);

var baseLayers = {
"OSM Mapnik": osmMap,
"Google": googleMap,
"Landscape": landMap,
};

L.control.layers(baseLayers).addTo(map);`

@IvanSanchez
Copy link
Member

@kuntalparbat This issue tracker is used for reporting bugs and discussing new features, not for gratis support reopening 3-year-old bugs. For questions on using Leaflet, please use gis.stackexchange.com or stackoverflow.

@Leaflet Leaflet locked and limited conversation to collaborators Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants