Using with AI tools
AI assistants often know only older versions of maplibre or confuse it with
maplibre_gl. Point them to the docs below; they follow the
llms.txt format and are rebuilt with the website.
Docs for assistants
| File | Content |
|---|---|
llms.txt |
API summary and an index of all pages. Start here. |
llms-full.txt |
All guides in one file. Large. |
<page>.md |
One page: replace the trailing / of its URL with .md, e.g. docs/map.md. |
Setup
Add this to your assistant's rules file (AGENTS.md, CLAUDE.md,
.cursor/rules or .github/copilot-instructions.md):
This app uses the Flutter package `maplibre` 0.4. Before writing map code,
read https://maplibre.org/flutter-maplibre/llms.txt. Its API differs from
older versions and from maplibre_gl.
For a docs index such as Cursor's @Docs, add
https://maplibre.org/flutter-maplibre/llms-full.txt.
Migration skill
maplibre-migrate
is an Agent Skill that moves an app to maplibre
0.4 from 0.3, maplibre_gl, flutter_map, google_maps_flutter or
mapbox_maps_flutter.
- Copy the
maplibre-migratefolder into your assistant's skills folder, such as.claude/skills/for Claude Code. - Ask the assistant to migrate the app.
Assistants that fetch skills themselves can use
skills/maplibre-migrate/SKILL.md.
Writing code for 0.4
- Code for 0.3 or older doesn't compile. Signs:
featuresAtPoint,MapOptions(initCenter: …),setStyle, styles as strings, and themaplibre_android,maplibre_iosandmaplibre_webviewpackages. See the migration guide. - Declarative:
MapLibreMapparameters and annotation layers (CircleLayer,MarkerLayer,PolylineLayer,PolygonLayer,WidgetLayer); change them withsetState(). - Imperative: sources and style layers, through
style.sourcesandstyle.layers, usually inonStyleLoaded. - Variants are sealed classes with named constructors:
MapStyle.url,CameraUpdate.position,CameraAnimation.fly,QueryGeometry.point,GeoJsonData.featureCollection,MarkerIcon.asset. - Style layer properties and filters take
Expression<T>; write constants asconst .literal(…). - Positions are
Geographic(lon: …, lat: …), bounds areGeoBox(geobase, re-exported). - Feature queries and camera methods return futures;
awaitthem.
More
- API reference: every class and parameter.
- API guidelines: why the API looks the way it does, for extending it or writing plugins.