Long click or tap and hold map trigger

1,127 views
Skip to first unread message

Steven Vance

unread,
Sep 22, 2012, 6:24:15 PM9/22/12
to leafl...@googlegroups.com
The Google-powered Maps app for iOS lets you tap and hold the map to drop a pin. (I don't know what Apple Maps does.) Can this functionality be implemented in Leaflet?

Right now users of my map can tap/click to add a marker (which then leads to a bookmark function), but the marker also appears when you double click/tap. I don't want this to happen. 

Steven Vance

unread,
Sep 26, 2012, 11:42:16 AM9/26/12
to leafl...@googlegroups.com
Can an event like this, from jQueryMobile, be attached to my map?
It has a tap and hold event. 

Jordan B

unread,
Dec 14, 2012, 6:50:01 PM12/14/12
to leafl...@googlegroups.com
I have this working with hammer js (http://eightmedia.github.com/hammer.js/ ) except it intercepts leaflet's events, so click and drag no longer works. Looking into a solution.

Steven Vance

unread,
Dec 15, 2012, 6:12:06 AM12/15/12
to leafl...@googlegroups.com
I've changed how the marker is added. Instead of tapping the map (or tapping and holding which is what I wanted), users tap a button that drops a marker in the center of the screen.

Vladimir Agafonkin

unread,
May 26, 2013, 11:36:37 AM5/26/13
to leafl...@googlegroups.com
Hi guys,

For those cases when this thread comes out in search... This feature is already there in Leaflet, you just subscribe to "contextmenu" event and it works like tap and hold on mobile.
Reply all
Reply to author
Forward
0 new messages