Skip to content

Latest commit

 

History

442 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MapLibre Logo

MapLibre Flutter

Pub Version stars likes Pub Points Pub Downloads codecov style: very good analysis

Interactive vector maps for Flutter on Android, iOS, macOS, Windows, Linux and web, built on MapLibre. Show any MapLibre or Mapbox compatible style, from any tile provider or your own server. maplibre needs no API key of its own; keys and fees depend only on the tile provider you choose. maplibre is a hosted project of the MapLibre organization.

A styled map A tilted and rotated map

Get started · Live demo · Documentation · API reference

Features

  • Six platforms, one API: Android, iOS, macOS, Windows, Linux and web, with the same gestures and behavior everywhere.
  • Flutter first: maps render into a Flutter Texture (an HTML element on web), so widgets over and around the map compose like any other widget. Annotations are declarative layers that you update with setState().
  • Fast interop: calls MapLibre through FFI (and maplibre-gl-js through JS interop on web) instead of platform channels, and many values, such as the camera and the style layers, can be read synchronously.
  • The full style spec: typed style layers, sources and expressions, vector and raster tiles, PMTiles, MBTiles, MapLibre Tiles (MLT), hillshading, heatmaps and 3D extrusions.
  • Offline maps: download regions or the tiles along a route.
  • Batteries included: user location, compass, scale bar, attribution, zoom buttons, clustering, feature queries and events for taps, drags and hover.

Quick start

import 'package:maplibre/maplibre.dart';

MapLibreMap(
  options: MapOptions(
    style: MapStyle.url('https://demotiles.maplibre.org/style.json'),
    initCamera: .position(center: Geographic(lon: 9.17, lat: 47.68), zoom: 7),
  ),
  layers: [
    CircleLayer(
      points: [Feature(geometry: Point(Geographic(lon: 9.17, lat: 47.68)))],
      color: const .literal(Colors.blue),
      radius: const .literal(12),
    ),
  ],
)

See Installation and Platform setup for the steps each platform needs.

Platforms

Platform Package Rendering
Android maplibre_native OpenGL ES 3.0 (default) or Vulkan
iOS maplibre_native Metal
macOS maplibre_native Metal
Windows maplibre_native Vulkan, shared with Flutter via D3D11
Linux maplibre_native Vulkan, shared with Flutter via OpenGL
Web maplibre_web WebGL 2 (maplibre-gl-js)

maplibre_native uses the C API of MapLibre Native through the maplibre_native_ffi binding. maplibre_web uses maplibre-gl-js. You only add maplibre to your app.

👀 Preview Images

Globe View Tilted and rotated map Custom Styling Custom styled map Pitch and Rotate Tilted and rotated map
Raster Tiles Fill Layer 3D Building Outlines Fill Extrusion Layer Heatmaps Fill Layer
Polygons Fill Layer Elevation Fill Extrusion Layer Lines Fill Layer
Circles Circle Layer Markers Symbol Layer

maplibre or maplibre_gl?

There are two Flutter packages for MapLibre. They take different approaches:

maplibre (this package) maplibre_gl
Principle What can be done in Dart is done in Dart What the MapLibre SDKs can do is done by the SDKs
Platforms Android, iOS, macOS, Windows, Linux, web Android, iOS, web
Interop FFI, JS interop on web Platform channels, JS interop on web
Map in Flutter Texture, HTML element on web Platform view, HTML element on web
API Declarative annotations and an imperative controller, synchronous where possible Imperative controller, asynchronous

The comparison covers other map packages as well.

❤️ Development & Contributing

All kinds of contributions are welcome. Thanks a lot if you consider to contribute in any way! There are different ways how you can help the development:

😎 A huge thanks to all contributors!

List of contributors

Releases

Sponsor this project

Used by

Contributors

Languages