Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Mapview in a recyclerview item #624

Closed
langsmith opened this issue Feb 12, 2018 · 3 comments
Closed

Mapview in a recyclerview item #624

langsmith opened this issue Feb 12, 2018 · 3 comments

Comments

@langsmith
Copy link
Contributor

An example with a RecyclerView that contains maps and other items, to show how to handle the Map lifecycle events when the Map is in a RecyclerView. Would be good to show a proper way to handle it.

@tkrami
Copy link

tkrami commented Feb 6, 2019

@langsmith is there still a solution for this issue?

@langsmith
Copy link
Contributor Author

Hey @tkrami , thanks for looking into Mapbox. This isn't in the demo app (yet), but there's an example in the Maps SDK test app: mapbox/mapbox-gl-native#13132

@tkrami
Copy link

tkrami commented Mar 5, 2019

Hey @langsmith I still managed to show the map in a RecyclerView item. But now I have another weird issue. When I am using the RecyclerView in a ChildFragment and the mapViews option " app:mapbox_renderTextureMode="true"" is set, the map is blank.

By setting this flag to false the mapView will be created as accepted, but the app crashes when scrolling the recyclerView.

After debugging I find out that the "onSurfaceCreated" function of the MapView class (https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java#L284) was never called and so "onMapReady" in my ViewHolderItem never get fired.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants