Any way to touch/tap a mapView map and drop a marker at the touched location?

Perhaps I’m missing this. I reviewed all the API docs and samples and could not find the answer. 

Is it possible to addMarker to a location the user touches/taps on the map? As far as I can tell we get touch / tap events on the markers we add through our code but we don’t get a touch event on the mapView itself. If I get a touch event on the mapView which returns coordinates touched then I could use this information to addMarker but I don’t see how it can be done. 

Am I missing the painfully obvious or is this a current shortcoming of the mapView implementation?

Thanks for your help. 

– This is returned as a mapLocation event

    local function mapLocationListener(event)

        print("map tapped latitude: ", event.latitude)

        print("map tapped longitude: ", event.longitude)

    end

    myMap:addEventListener(“mapLocation”, mapLocationListener)

They were accidentally erased from the docs but will be added back with the next daily build.

This is great!!! Thank you so much for this update. Most appreciated. 

Tried it and found to be working perfectly. Thank you very much!!!

In reality, I’m not using this listener to put new pins on the map but to detect when an existing marker popup bubble is closed. You see, currently we get a marker event when the markers are tapped but not when someone taps an empty spot and closes the marker bubble. So this listener can be used to detect that situation. Most useful. Thanks. 

– This is returned as a mapLocation event

    local function mapLocationListener(event)

        print("map tapped latitude: ", event.latitude)

        print("map tapped longitude: ", event.longitude)

    end

    myMap:addEventListener(“mapLocation”, mapLocationListener)

They were accidentally erased from the docs but will be added back with the next daily build.

This is great!!! Thank you so much for this update. Most appreciated. 

Tried it and found to be working perfectly. Thank you very much!!!

In reality, I’m not using this listener to put new pins on the map but to detect when an existing marker popup bubble is closed. You see, currently we get a marker event when the markers are tapped but not when someone taps an empty spot and closes the marker bubble. So this listener can be used to detect that situation. Most useful. Thanks. 

Hi guys,

I am trying to also detect when a user closes the marker-bubble.

When using mapLocation (myMap:addEventListener( “mapLocation”, mapTapListener )), it does not get any event or trigger when :

  1. bubble is closed

  2. marker is touched

  3. map is being scrolled

It only gives off an event when the map is only tapped. 

Is there a way to detect when a user closes a marker-bubble ?

Thanks

Hi guys,

I am trying to also detect when a user closes the marker-bubble.

When using mapLocation (myMap:addEventListener( “mapLocation”, mapTapListener )), it does not get any event or trigger when :

  1. bubble is closed

  2. marker is touched

  3. map is being scrolled

It only gives off an event when the map is only tapped. 

Is there a way to detect when a user closes a marker-bubble ?

Thanks