josxha / flutter-maplibre

Permissive and performant mapping library that supports Mapbox Vector Tiles (MVT) powered by MapLibre SDKs.
https://flutter-maplibre.pages.dev
Other
17 stars 3 forks source link

Move style related MapController functions to a nullable `StyleController? style` object. #143

Open josxha opened 1 day ago

josxha commented 1 day ago

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).

Tasklist

TODO