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

OnMapReadyCallback invoked when view is unmeasured #6999

Closed
tobrun opened this issue Nov 10, 2016 · 1 comment
Closed

OnMapReadyCallback invoked when view is unmeasured #6999

tobrun opened this issue Nov 10, 2016 · 1 comment
Labels
Android Mapbox Maps SDK for Android bug

Comments

@tobrun
Copy link
Member

tobrun commented Nov 10, 2016

Since the 4.2.0 release we are using DID_FINISH_LOADING_STYLE as event to invoke the OnMapReadyCallback. An issue noticed is that there are situations that the DID_FINISH_LOADING_STYLE event is emitted before the MapView is even measured. This currently results in using width 0 in some calculations (eg. #6769). I think we should take in account if the view is actually measured before providing the user the MapboxMap.

A way to listen if a View is measured is using a OnGlobalLayoutListener.

@tobrun
Copy link
Member Author

tobrun commented Jan 19, 2017

Picking this up as part of #7736, for that refactor I'm required to move initialization of the map object and postpone other initializations. I'm hoping that as a side effect this will result in the view being already measured when we initialize, else we need to look into including OnGlobalLayoutListener as part of the initialization.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android bug
Projects
None yet
Development

No branches or pull requests

1 participant