# Saving Map Markers to Firebase

**URL:** <https://community.thunkable.com/t/saving-map-markers-to-firebase/602641>\
**Category:** Questions about Thunkable X\
**Tags:** googlemaps, firebase\
**Created:** [June 8, 2020, 2:58pm UTC](https://community.thunkable.com/t/saving-map-markers-to-firebase/602641 "2020-06-08T14:58:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobsunscreen](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bobsunscreen/32/85667_2.png) [@bobsunscreen](https://community.thunkable.com/u/bobsunscreen)\
**Post date:** [June 8, 2020, 2:58pm UTC](https://community.thunkable.com/t/saving-map-markers-to-firebase/602641/1 "2020-06-08T14:58:05Z")

</div>

I’m trying to create an app that, after the user presses a button, saves their current latitude and longitude, as well as what they typed into a text input box, to Firebase - and then use that information to populate map markers. How would I save this information to Firebase in a way that would allow it to be made into map markers? How would I then take that information and turn it into map markers?

---

<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:** [June 8, 2020, 3:22pm UTC](https://community.thunkable.com/t/saving-map-markers-to-firebase/602641/2 "2020-06-08T15:22:27Z")

</div>

Hey @bobsunscreen,

here’s a guide to get you started with adding map markers to a project:

> [@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…

And to save this to Firebase, I’d recommend storing everything [as an Object.](https://docs.thunkable.com/objects)

Hope that helps

---

<div class="post-metadata">

**Author:** ![bobsunscreen](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bobsunscreen/32/85667_2.png) [@bobsunscreen](https://community.thunkable.com/u/bobsunscreen)\
**Post date:** [June 8, 2020, 4:51pm UTC](https://community.thunkable.com/t/saving-map-markers-to-firebase/602641/3 "2020-06-08T16:51:08Z")

</div>

Hi @domhnallohanlon, thanks for your response; I will try that!

---

<div class="post-metadata">

**Author:** ![bobsunscreen](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bobsunscreen/32/85667_2.png) [@bobsunscreen](https://community.thunkable.com/u/bobsunscreen)\
**Post date:** [June 9, 2020, 1:43pm UTC](https://community.thunkable.com/t/saving-map-markers-to-firebase/602641/4 "2020-06-09T13:43:16Z")

</div>

I tried saving the map markers as an object, but now they’re all being saved under the same data key in Firebase. Right now, when I save a new marker, it just replaces the old one. How do I make it so the new markers get saved independently, without replacing old ones? Below is my code:

 ![Screen Shot 2020-06-09 at 9.37.38 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/0/004295a426cbd463c21aa40f257f5ea2b68f8d37.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:** [June 9, 2020, 2:21pm UTC](https://community.thunkable.com/t/saving-map-markers-to-firebase/602641/5 "2020-06-09T14:21:40Z")

</div>

You could create a list and append each new marker to the end of the list?

Or you could dynamically create new key names, and store a list of the keys? (That’s probably more complex than it needs to be)

---

<div class="post-metadata">

**Author:** ![bobsunscreen](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bobsunscreen/32/85667_2.png) [@bobsunscreen](https://community.thunkable.com/u/bobsunscreen)\
**Post date:** [June 9, 2020, 3:10pm UTC](https://community.thunkable.com/t/saving-map-markers-to-firebase/602641/6 "2020-06-09T15:10:55Z")

</div>

Good idea @domhnallohanlon; I’ll try that!

---

<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:27am UTC](https://community.thunkable.com/t/saving-map-markers-to-firebase/602641/7 "2024-11-08T11:27:27Z")

</div>


