Trying to show extra data related to a marker

Hi there,

I am working on an app that allows the user to click on a pin and this will display a column below with more information regarding the pinned location. The data is saved in a Cloud variable and will include the fields required to make up a pin and the additional info on click. I am struggling to bring these 2 elements together. When I click the pin it shows the final item in the list regardless of which pin I selected. I can’t seem to identify the correct ID from the marker to show the info.

I may be missing a fundamental concept with calling in data here and I really can’t work out what blocks to use to make this happen.


1 Like

Hi there,

From what I can see, you cycle through the list PINS with the variable j.

When this is complete, j will be the final item of PINS.

You never reset j in the ‘onMarkerPress’ block, so the Label PinName will only display the data of the final item of PINS.

You can get the latitude and longitude of the marker that has been pressed using the event output from the ‘onMarkerPress’ block.

From there, you can set j to be the corresponding object from PINS, and display its data.

Here is a sample app that displays 3 markers on a map. If you click a marker, an image will appear. The image that appears depends on the marker that’s clicked.

Hope that helps!