On Android, the Style class can only be access after it has loaded (onStyleLoaded() gets called).
A common problem on maplibre/flutter-maplibre-gl was that users try to add layers in the onMapCreated() callback. This does not work. To guide the user, we can move the style related functions (methods listed in the Style API docs) to an arbitrary StyleController class.
Move style related MapController functions to a nullable StyleController? style object. This object can be used from a getter or accessed as a parameter from onStyleLoaded(style).
On Android, the Style class can only be access after it has loaded (onStyleLoaded() gets called). A common problem on maplibre/flutter-maplibre-gl was that users try to add layers in the
onMapCreated()
callback. This does not work. To guide the user, we can move the style related functions (methods listed in the Style API docs) to an arbitraryStyleController
class.Move style related MapController functions to a nullable
StyleController? style
object. This object can be used from a getter or accessed as a parameter fromonStyleLoaded(style)
.Tasklist
TODO