You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
You probably would like to have MapView in a Fragment to reuse map functionality (like google do) and to add it programmatically you need to retrieve the MapView async from the MapFragment when it's added to the view or else it's null if you try to retrieve it just after you've created the MapFragment.
But.. This causes another problem, i describe in #2018 that when i tried to switch from the MapActivity to some other Activity (after moved the maped) and back the app crashes..
Also here is an example how getMap can work, I used to implement GoogleMaps in this fashion before the async method was introduced and getMap was deprecated:
Activity
erf commentedon Aug 12, 2015
I created a pull request for this:
#2043
erf commentedon Aug 12, 2015
The problem i described in #2018 is back after i load the mapview this way
ljbade commentedon Aug 14, 2015
I don't really understand what this does.
It seems you are only changing the way the test app works?
/cc @bleege
erf commentedon Aug 14, 2015
You probably would like to have MapView in a Fragment to reuse map functionality (like google do) and to add it programmatically you need to retrieve the MapView async from the MapFragment when it's added to the view or else it's null if you try to retrieve it just after you've created the MapFragment.
But.. This causes another problem, i describe in #2018 that when i tried to switch from the MapActivity to some other Activity (after moved the maped) and back the app crashes..
tobrun commentedon Oct 7, 2015
@ljbade
I would like to add why Google exposes this async get method:
This would crash because the MapFragment is not created/attached yet, for this reason an async callback was introduced.
cc @bleege
tobrun commentedon Oct 7, 2015
Also here is an example how getMap can work, I used to implement GoogleMaps in this fashion before the async method was introduced and getMap was deprecated:
ljbade commentedon Oct 7, 2015
@tobrun Interesting! Perhaps we should put this on 2.2.0 milestone as part of the refactor.
tobrun commentedon Jan 11, 2016
This will be implemented with #3145
tobrun commentedon Jan 29, 2016
This has landed with #3145. Closing