# Trying to show extra data related to a marker

**URL:** <https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333>\
**Category:** Questions about Thunkable X\
**Tags:** googlemaps, marker, realtimedb, json\
**Created:** [September 9, 2019, 9:50pm UTC](https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333 "2019-09-09T21:50:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ollie\_pellingy3d3](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@ollie\_pellingy3d3](https://community.thunkable.com/u/ollie_pellingy3d3)\
**Post date:** [September 9, 2019, 9:50pm UTC](https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333/1 "2019-09-09T21:50:20Z")

</div>

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.

 ![pin-details](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/4/14eb3cb8227fa8d0b498a5016938f04baf70bcab.png)

Thanks!  
Ollie

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [September 12, 2019, 1:18pm UTC](https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333/2 "2019-09-12T13:18:56Z")

</div>

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](https://x.thunkable.com/copy/979b3627e132927f8dae52969cb5d475) 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!

---

<div class="post-metadata">

**Author:** ![ollie\_pellingy3d3](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@ollie\_pellingy3d3](https://community.thunkable.com/u/ollie_pellingy3d3)\
**Post date:** [September 18, 2019, 9:16pm UTC](https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333/3 "2019-09-18T21:16:53Z")

</div>

Thank you so much for replying to me. I followed your instructions up to get getting the onMakerPress event created, which I can deffo see being the solution.

> [@jane](#):
>
> From there, you can set **j** to be the corresponding object from PINS, and display its data.

I get stuck here with my lack of knowledge, I see you are making a comparison in your example, but I don’t know how to go through the Cloud Variable and find the corresponding object based on the unique values in the Lat and Long, If you have time to point me in the right direction or share an example that would be amazing.

Thanks again!

Ollie

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [September 19, 2019, 11:00am UTC](https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333/4 "2019-09-19T11:00:57Z")

</div>

It might be easier for you to make a new variable called ‘thisMarker’.

From the ‘onMarkerPress’ event, you will have a latitude and a longitude value. Store these as variables called ‘thisLat’ and ‘thisLong’.

You can use the ‘for each item **j** in list [cloud PINS]’ loop again.  
This time, the blocks will say:  
‘if (([get property “lat” of object **j**] = thisLat) AND (get [get property “long” of object **j**] = thisLong)), set **thisMarker** to **j** ’.

Then you can use the same ‘from Label PinName set text’ block, except you will refer to **thisMarker** rather than **j**.

Hope that helps!

Jane

---

<div class="post-metadata">

**Author:** ![ollie\_pellingy3d3](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@ollie\_pellingy3d3](https://community.thunkable.com/u/ollie_pellingy3d3)\
**Post date:** [September 19, 2019, 9:05pm UTC](https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333/5 "2019-09-19T21:05:41Z")

</div>

Hi Jane

That extra bit of detail really helped me and I got it working by following those additional instructions.  
Thanks for taking the time to reply again, I feel like I can get back into it now that I am over this hurdle 😃

Cheers  
Ollie

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [September 20, 2019, 12:56pm UTC](https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333/6 "2019-09-20T12:56:13Z")

</div>

I’m glad you found it helpful! 😀

I hope your app with info about locations is awesome 🎉

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:08pm UTC](https://community.thunkable.com/t/trying-to-show-extra-data-related-to-a-marker/218333/7 "2024-11-08T12:08:55Z")

</div>


