Skip to content
Make with

Flutter MapLibre GL (Official)Official

Official Flutter plugin for MapLibre

Maintained by MapLibre

The official Flutter MapLibre GL plugin maintained by the MapLibre organization. This is the established and widely-used Flutter binding for MapLibre Native.

Quick start

flutter pub add maplibre_gl
import 'package:flutter/material.dart';
import 'package:maplibre_gl/maplibre_gl.dart';

class MapPage extends StatelessWidget {
  const MapPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: MapLibreMap(
        styleString: 'https://tiles.openfreemap.org/styles/liberty',
        initialCameraPosition: const CameraPosition(
          target: LatLng(20.0, 0.0), // latitude, longitude
          zoom: 2,
        ),
      ),
    );
  }
}
›Setup noteschecked with v0.27.1

maplibre_gl 0.27.1 on pub.dev. The pubspec line is maplibre_gl: ^0.27.1. It requires Flutter 3.29+ and Dart 3.7+, JDK 21 for Android builds, Android 5.0 (API 21)+, iOS 13+, and a WebGL2 browser for web. Platforms: Android, iOS and Web (no desktop). LatLng takes latitude first. The map needs bounded constraints (for example a Scaffold body). Location permissions are only needed if you show the user's location. On web, since 0.27.0 the plugin loads MapLibre GL JS 6 itself: add nothing to web/index.html, and remove old maplibre-gl.js/.css tags if your index.html has them. Add sources and layers in onStyleLoadedCallback.

More platforms on Get started.

Used by 2 products