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

[FEATURE] Add support for platform views on android with `Hybrid Composition` #27

Closed josxha closed 2 weeks ago

josxha commented 2 months ago

Feature Description

There are two platform view types for flutter on android, the "Hybrid Composition" and the "Texture Layer" (or Texture Layer Hybrid Composition). In case users need to maximize the performance of the map, the Hybrid Composition would be the preferred solution.

Describe alternatives you've considered

No response

Additional context

Platform Views are rendered as they are normally. Flutter content is rendered into a texture. SurfaceFlinger composes the Flutter content and the platform views.

Pros:

Cons:

For more information, see https://docs.flutter.dev/platform-integration/android/platform-views#hybrid-composition

josxha commented 1 month ago

Some documentation from flutter-maplibre-gl:

  /// Set `MapLibreMap.useHybridComposition` to `false` in order use Virtual-Display
  /// (better for Android 9 and below but may result in errors on Android 12)
  /// or leave it `true` (default) to use Hybrid composition (Slower on Android 9 and below).