# \[SOLVED\] Convert "event" from "onMarkerPress" to a String or text

**URL:** <https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [March 4, 2020, 10:05pm UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777 "2020-03-04T22:05:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlschmidt1224zf](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jlschmidt1224zf](https://community.thunkable.com/u/jlschmidt1224zf)\
**Post date:** [March 4, 2020, 10:05pm UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/1 "2020-03-04T22:05:20Z")

</div>

I am making a map app with many markers. I am trying to make it so when the user clicks on a marker, that location opens in Google Maps. To do so, I need the latitude and longitude as text to add to a link to Google Maps. How can I convert the “event” block, the output of “onMarkerPress”, to a String?

[http://community.thunkable.com/t/solved-how-do-the-event-blocks-for-the-map-component-work/73742/3](http://community.thunkable.com/t/solved-how-do-the-event-blocks-for-the-map-component-work/73742/3)

This article shows someone who did so with the function “makeCoordinateText” but I do not understand how to create the function.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 5, 2020, 4:25am UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/2 "2020-03-05T04:25:23Z")

</div>

Does this help?

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [March 5, 2020, 9:23am UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/3 "2020-03-05T09:23:59Z")

</div>

This is great - thanks for sharing @tatiang

---

<div class="post-metadata">

**Author:** ![jlschmidt1224zf](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jlschmidt1224zf](https://community.thunkable.com/u/jlschmidt1224zf)\
**Post date:** [March 9, 2020, 6:23pm UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/4 "2020-03-09T18:23:12Z")

</div>

Thanks so much for that awesome video! I tried it out by setting the output to an alert so that I could see what the output is and I seem to have gotten an empty String:

 ![image0](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/67eedf09ade39efab6d8e6728d878fb99f4809a7.jpeg)

Here is my code:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/1/a113780d09d2613c7facbd7830bd83f8d3c08659.png)

Any idea what is wrong? Thanks again for the help!

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [March 9, 2020, 6:44pm UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/5 "2020-03-09T18:44:04Z")

</div>

Those blocks look ok @jlschmidt1224zf - I’d just get the values from the event first, store them in a new variable and then display this new value in your alert.

There’s something similar in this tutorial:

> [@Cartographr: How to work with the Map Component](http://community.thunkable.com/t/cartographr-how-to-work-with-the-map-component/230549):
>
> Click to Add Markers One request we hear from Thunkers is the ability to tap on the map component and then add a marker to the location that was just tapped. In this first example we’ll learn how to do just that. Map1.onPress This is the event we need to understand to make everything work. The onPress event has two outputs, coordinate and position - but other than the names of these outputs we don’t know much more about them. Since coordinate seems like the most promising, let’s take a closer l…

---

<div class="post-metadata">

**Author:** ![jlschmidt1224zf](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jlschmidt1224zf](https://community.thunkable.com/u/jlschmidt1224zf)\
**Post date:** [March 9, 2020, 7:00pm UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/6 "2020-03-09T19:00:31Z")

</div>

That article is exactly what I’m looking for! However, still when I try what it says to do, it does not show the coordinate. Here is my code and the corresponding screen that is shown:

(1) I did not include the “get property latitude” in this one

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/7/27d7a70b4808c0cd646bbc5d85a5e390353f2450.png)  
 ![IMG_1134](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/b/3b8a91261e24771f621a953f44a5a0d1d2ba91e3.jpeg)

(2) I added the block to get the latitude and that is when it returned another empty String

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/e/7e2354955ecd137ce6f6ba11701cc901f3f2ca9d.png)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [March 9, 2020, 7:06pm UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/7 "2020-03-09T19:06:05Z")

</div>

You just need to omit the “get object properties” block since you want the values _of_ the properties, and not the properties themselves.

---

<div class="post-metadata">

**Author:** ![jlschmidt1224zf](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jlschmidt1224zf](https://community.thunkable.com/u/jlschmidt1224zf)\
**Post date:** [March 9, 2020, 7:12pm UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/8 "2020-03-09T19:12:30Z")

</div>

It worked! Thanks so much! For future reference, here is the final code I used:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/5/e586454dff91467968cd718d14e0aac588d7d662.png)

Thanks SO much!

---

<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, 11:40am UTC](https://community.thunkable.com/t/solved-convert-event-from-onmarkerpress-to-a-string-or-text/498777/9 "2024-11-08T11:40:28Z")

</div>


