# Map resets when button is clicked

**URL:** https://community.thunkable.com/t/map-resets-when-button-is-clicked/33650
**Category:** Questions about Thunkable X
**Created:** [June 29, 2018, 6:29pm UTC](https://community.thunkable.com/t/map-resets-when-button-is-clicked/33650 "2018-06-29T18:29:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![debxsmith](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@debxsmith](https://community.thunkable.com/u/debxsmith)
#### Post date: [June 29, 2018, 6:29pm UTC](https://community.thunkable.com/t/map-resets-when-button-is-clicked/33650/1 "2018-06-29T18:29:37Z")

</div>

I have an app which has a map, a button, and a text field. When the screen opens, the map is initialized to centre on the current location and has an initial zoom level of 1. The text field says “0”. The act of clicking the button, has an action of increasing a counter and updates the text field to show the new value of the counter.

Suppose I open the app and use my fingers to zoom the map closer and to move the map so that it is no longer centred on my location. For some reason, when I then click the button, the map resets back to being centred on my location and having a zoom of 1. There is no map-related code attached to the button. All of the map-related code is in an “onMapReady” event block. Does anyone know how I can avoid the map resetting when the button is clicked?

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [June 30, 2018, 6:00am UTC](https://community.thunkable.com/t/map-resets-when-button-is-clicked/33650/2 "2018-06-30T06:00:58Z")

</div>

Hi,

This is really a problem. The Map component does not retain its current state. By this, the presence and activation of even an empty event processing block of any component results in updating the Map and resetting it to its original state. I did not find a way to avoid this.

---

<div class="post-metadata">

### Author: ![stevemarth](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stevemarth/32/40633_2.png) [@stevemarth](https://community.thunkable.com/u/stevemarth)
#### Post date: [August 19, 2019, 5:44pm UTC](https://community.thunkable.com/t/map-resets-when-button-is-clicked/33650/3 "2019-08-19T17:44:04Z")

</div>

I’m having this same problem. As soon as _any_ button on the Screen is pressed, the map snaps back into whichever position it was in at ‘onMapReady’.

The original post here was a year ago, but I haven’t been able to find any remedy to this. Am I missing something?

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [August 19, 2019, 7:06pm UTC](https://community.thunkable.com/t/map-resets-when-button-is-clicked/33650/4 "2019-08-19T19:06:22Z")

</div>

How do I solve it? I change the coordinates of latitude and longitude in the processing unit of the event of clicking on the map or marker.

---

<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:02pm UTC](https://community.thunkable.com/t/map-resets-when-button-is-clicked/33650/5 "2024-11-08T12:02:19Z")

</div>


