MapMetrics Flutter SDK
Available
The MapMetrics Flutter SDK is available on pub.dev as the mapmetrics package. API documentation can be found here.
Overview
mapmetrics is a Flutter wrapper around MapLibre Native — it renders MapMetrics Atlas vector tile styles on iOS and Android through a single MapMetricsView widget. It gives you camera control, gesture configuration, style/layer manipulation, feature querying, user location, navigation-route snapping, and offline region downloads.
There is no MapMetrics(...) widget, no MapMetricsController, no CameraPosition, and no LatLng in the shipped package — those types belong to a different (fictional) API and will not compile. The real widget is MapMetricsView, the real controller type is MapController, and coordinates are a Position from the geotypes package (re-exported by mapmetrics), which is longitude first.
Install
dependencies:
mapmetrics: ^1.0.6import 'package:mapmetrics/mapmetrics.dart';A minimal working map
import 'package:flutter/material.dart';
import 'package:mapmetrics/mapmetrics.dart';
class MapScreen extends StatefulWidget {
const MapScreen({super.key});
@override
State<MapScreen> createState() => _MapScreenState();
}
class _MapScreenState extends State<MapScreen> {
MapController? _controller;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('MapMetrics Map')),
body: MapMetricsView(
options: MapOptions(
// Position(longitude, latitude) — lng FIRST. Amsterdam:
initCenter: Position(4.8952, 52.3702),
initZoom: 12,
initStyle:
'https://gateway.mapmetrics-atlas.net/styles/?fileName=YOUR_STYLE_ID/YOUR_STYLE.json&token=YOUR_API_KEY',
),
onMapCreated: (controller) => _controller = controller,
),
);
}
}MapMetricsView is the MapMetrics-branded widget — prefer it over the underlying MapLibreMap widget it wraps (same options, same callbacks, plus the MapMetrics attribution mark rendered in the corner).
Where to go next
- Getting Started — pubspec dependency, Android/iOS platform setup, a full runnable
main.dart - MapOptions reference — every field, with the coordinate-order warning
- MapController reference — camera, projection, querying, location, navigation, style methods
- Location & Permissions —
PermissionManagerwired to the controller's location methods - Offline maps —
OfflineManager,OfflineRegion,DownloadProgress
Other SDKs
- iOS SDK - For native iOS applications
- Android SDK - For native Android applications
- Web SDK - For web and hybrid applications
Questions?
If you have specific requirements or questions about Flutter support, please reach out to our team.