Any way to determine tap vs touch vs double tap on mapView Marker or its info bubble?

Hi, 

I’m looking into the feasibility of using the mapView for a project I took on. I need to present a map with a number of markers on it. This part is ok so far. 

I need to allow seeing some brief details when someone taps on a marker. This can also be achieved easily with the current marker. 

I then need to have a way for the user to jump to a detail page about the location / marker which the user tapped on. In other words I need to be able to detect a double tap or something like that to open that detail page. The event that fires when the marker is tapped does not seem to differentiate between the types of taps. 

If I tap on the marker again it does fire the event again but it closes the info bubble so thats the purpose its designed to serve. Ideally I should be able to detect the taps on the info bubble as a separate event so that I can trigger downstream actions from there on. 

Is there any way to achieve what I’m trying to do with the current mapView component? Many thanks for your help.

Regards,

Kerem

While trying to workout the best method to achieve what I need, I discovered something that might be of interest to others and yet is not very clear in the API docs. 

from the API sample, when you call 

local result, errorMessage = myMap:addMarker( 37.331692, -122.030456, options )

you get a return value, in this case allocated to result. 

It should be noted that the return you get after adding the marker is actually the markerId you will get back when the marker is tapped (i.e. event.markerId).

Very important connection that is missed in the API document which I had to discover by trial & error. Hope this helps others in a similar pickle.

PS to Rob. Yes, “I hit the I Hate It Button” already…  :slight_smile:

I had the same problem, although I sort of have a solution.

I put a background behind the map and added a “touch” event listener to the background.

It seems that if you touch the popup that appears above the marker the touch doesn’t get registered by the background touch.

local backtouch=0 local function markerListener(event) print("type: ", event.type) -- event type print("markerId: ", event.markerId) -- id of the marker that was touched print("lat: ", event.latitude) -- latitude of the marker print("long: ", event.longitude) -- longitude of the marker if backtouch\>0 then backtouch=0 else print ("### MARKER POPUP TOUCHED ###") end end function onBackgroundTouch( event ) local phase = event.phase if "began" == phase then backtouch=1 end return true end

ok my solution only works on iOS

While trying to workout the best method to achieve what I need, I discovered something that might be of interest to others and yet is not very clear in the API docs. 

from the API sample, when you call 

local result, errorMessage = myMap:addMarker( 37.331692, -122.030456, options )

you get a return value, in this case allocated to result. 

It should be noted that the return you get after adding the marker is actually the markerId you will get back when the marker is tapped (i.e. event.markerId).

Very important connection that is missed in the API document which I had to discover by trial & error. Hope this helps others in a similar pickle.

PS to Rob. Yes, “I hit the I Hate It Button” already…  :slight_smile:

I had the same problem, although I sort of have a solution.

I put a background behind the map and added a “touch” event listener to the background.

It seems that if you touch the popup that appears above the marker the touch doesn’t get registered by the background touch.

local backtouch=0 local function markerListener(event) print("type: ", event.type) -- event type print("markerId: ", event.markerId) -- id of the marker that was touched print("lat: ", event.latitude) -- latitude of the marker print("long: ", event.longitude) -- longitude of the marker if backtouch\>0 then backtouch=0 else print ("### MARKER POPUP TOUCHED ###") end end function onBackgroundTouch( event ) local phase = event.phase if "began" == phase then backtouch=1 end return true end

ok my solution only works on iOS