How to Identify Which Marker Was Pressed on the Map in Thunkable

Hello Thunkable Community,

I’m currently facing a challenge with identifying which marker was clicked on a map in my Thunkable project. I have a situation where I display several markers on a map, each corresponding to specific data such as a title, description, photo, and a link to another screen.

Here’s what I’ve done so far:

  • I’ve successfully added markers to the map using coordinates stored in Airtable.

  • I’ve configured a modal to display detailed information when a marker is clicked.

  • I’m using the when Map1 on MarkerPress block to trigger the modal.

Issue: I’m struggling with extracting the specific ID or index of the marker that was clicked. I need this to retrieve the precise data associated with each marker, such as title and description, and update the modal accordingly.

Current Approach:

  • I’ve considered using the latitude and longitude properties from the event, but matching these to my data has been challenging.

  • I’ve set up lists for titles, descriptions, and other data, but without a reliable way to know which marker was clicked, I’m unable to display the correct data.

Questions:

  1. Is there a way to directly obtain an ID or index of the marker within the event object?

  2. What are the best practices for managing and identifying markers on a map in Thunkable?

  3. How can I ensure the modal displays the correct information based on the marker clicked?

Any guidance or examples on how to achieve this would be greatly appreciated! Thank you in advance for your support.

I always wanted this feature to be able to detect a particular pin for an action.

Hi @cic.raf4lhvsr @ubimidia

When the maker is pressed, you can have a loop that runs through the whole list of markers and finds the marker with the same lat lng

Here is an example:

Thanks a lot. I will try!

1 Like

Yeah I guess that’s the only way. I hope there will not be any duplicates :smiley:

Thank you so much.