mapbox / mapbox-gl-native-ios

Interactive, thoroughly customizable maps for iOS powered by vector tiles and OpenGL
https://www.mapbox.com/mobile/
Other
210 stars 121 forks source link

Annotations removed when resuming app #573

Open nijs9 opened 3 years ago

nijs9 commented 3 years ago

I’m using the latest Mapbox iOS sdk. I’m showing a simple map with some annotation and a couple of polylines on it. When I close the app with the home button (so setting app in background), and reopen the app after a while, I’m seeing the mapview again but all annotations/polylines are removed. Is this a bug?

timwford commented 3 years ago

Not a bug in my understanding. iOS takes liberty in removing backgrounded apps from memory. Your best shot to keep the annotations is to save them on the background lifecycle event and replace them on the foreground.