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?