Skip to content

Similar Packages

maplibre_gl

The maplibre_gl package, or flutter-maplibre-gl on GitHub, is a fork of mapbox_gl, a community effort to provide Mapbox bindings for Mapbox SDKs whose development has stopped in favor of the first-party Mapbox package mapbox_maps_flutter. maplibre_gl got eventually transferred to the MapLibre organization as a hosted project, " a project that the MapLibre Organization does not allocate any resources to."

In my opinion, maplibre_gl had, and still has to this day, several issues:

  • Lack of Stability: When I tried to include maplibre_gl in a project, I experienced a variety of bugs and even app crashes. A User Survey showed that 44% of package users experienced app crashes using maplibre_gl.
  • Platform-specific Behavior: When including the package in a project myself, I noticed different behaviors across iOS and Android. As a Flutter developer, I'd prefer to write code once and have the same behavior across all targeted platforms. The User Survey mentioned earlier revealed that 46% of package users experience platform-specific behavior.
  • Legacy Code and Workarounds: Like most libraries, maplibre_gl contains workaround code that sometimes isn't needed anymore. These workarounds are often not well-documented and date back to the early days of Dart-JavaScript interoperability or from before null safety was added to Dart.
  • WebAssembly: As Flutter for Web can now be compiled to WebAssembly, its web interoperability has changed, requiring the web implementation to be revised and partially rewritten.
  • License Compliance: 31 files in maplibre_gl contain a copyright header mentioning "The Chromium Authors" with a "BSD-style license." However, this license isn't included in the LICENSE file. Looking at the Git history reveals that these files were merged in along with code years ago.
  • Example App: Some sample implementations in the example app are broken or don't work across all platforms.
  • Performance: As maplibre_gl relies solely on platform channels, sending or receiving large objects and data can lead to bottlenecks and performance issues.

Considering all these problems and the cumbersome development of maplibre_gl, I decided to start fresh and started a new package.

  • maplibre is a complete rewrite of maplibre_gl, built from the ground up to eliminate licensing issues and legacy implementations.
  • To ensure greater stability, maplibre aims to reduce platform-specific code and employs code generation for better type safety. It uses a combination of unit tests, widget tests, and integration tests.
  • An example app showcasing a variety of features and use cases is available as a hosted example application.
  • To avoid bottlenecks caused by platform channels, the package utilizes FFI interoperability with Objective-C and Swift, as well as a combination of JNI and FFI for Java and Kotlin.
  • Desktop platforms are supported by rendering the map in a WebView. This is a relatively simple solution that allows to support Windows and macOS with a single implementation.

mapbox_maps_flutter

mapbox_maps_flutter is the official Mapbox package for Flutter. It is a wrapper around the native Mapbox SDKs for Android and iOS, providing a Flutter interface to access the features of the Mapbox SDKs. However, it is not vendor-free and is published under the Mapbox Terms of Service, which may not be suitable for all projects.

MapLibre SDKs are a fork of the Mapbox SDKs when MapBox stopped with their open source efforts. The MapLibre SDKs are still very similar to the Mapbox SDKs.

flutter_map

flutter_map likely offers the best cross-platform experience and is published under a permissive license. Written in pure Dart, it can be used on every platform supported by Flutter and has an active community on GitHub and Discord.

The package has seamless integration into Flutter and a plugin system to extend its functionality through other plugin packages. However, this sometimes limits the package’s capabilities, as a built-in feature might offer better integration than relying on third-party plugin authors. Vector tile support is not built-in but basic support can be added using the vector_map_tiles package.

The advantage of being 100% written in Dart can sometimes be a drawback, as it is not as performant as a lower-level renderer. This limitation is especially noticeable when rendering large amounts of data or using vector tiles.

Learning from flutter_map, the maplibre package aims a have a similar integration into Flutter and allows to set and update map annotations in a declarative way, just like any other Flutter widget.