Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Move MapFragment from Test to SDK module #2524

Closed
tobrun opened this issue Oct 5, 2015 · 6 comments
Closed

Move MapFragment from Test to SDK module #2524

tobrun opened this issue Oct 5, 2015 · 6 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@tobrun
Copy link
Member

tobrun commented Oct 5, 2015

Integrating GoogleMaps into a project is generally done using their MapFragment.
See this getting started guide for reference.

In those cases you will extend MapFragment and hook into the getMapAsync callback to get a GoogleMap object and then start customising the map with markers etc. On older implementations they exposed a getMap method but this has been deprecated.

To make it easier for end developers to setup or migrate:

  • move MapFragment up the hierarchy into the SDK itself.
  • expose both getMapAsync and getMap (deprecated)
  • automatically load accessToken through Android resources
@tobrun tobrun added the Android Mapbox Maps SDK for Android label Oct 5, 2015
@ljbade
Copy link
Contributor

ljbade commented Oct 6, 2015

Hmm I'd just implement getMap, until when/if we actually support it (see #2042)

accessToken changes are being discussed in #713

We might want to hit this at the same time we implement the general refactor in #2480

Then we can just make MapView and MapFragment simple shim's to handle the lifecycle methods and both have getMap.

@ljbade
Copy link
Contributor

ljbade commented Oct 6, 2015

At the same time also need to add a SupportMapFragment to support people using Android support library.

@ljbade
Copy link
Contributor

ljbade commented Oct 6, 2015

Another important part of Google Map API is the useViewLifecycleInFragment option. This enables the map to stay loaded in memory when a fragment is detached. It has been requested before in #2042

@tobrun
Copy link
Member Author

tobrun commented Oct 6, 2015

@ljbade 👍

About:

useViewLifecycleInFragment

This will probably be a retained fragment, but to clarify this only will keep the map data in memory, views will always be destroyed/recreated.

@ljbade
Copy link
Contributor

ljbade commented Oct 6, 2015

@tobrun Interesting I guess that's why the GoogleMap object exists. It can out live the View it is attached to.

@tobrun
Copy link
Member Author

tobrun commented Oct 8, 2015

Closing, implemented in #2567

@tobrun tobrun closed this as completed Oct 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

2 participants