maimaps_flutter library

Official Maimaps SDK for Flutter.

Initialize once, then use the typed clients and the MaimapsMap widget:

Maimaps.initialize(MaimapsOptions(apiKey: 'mk_test_…'));
final results = await Maimaps.instance.search.search('garki market');

Classes

LatLng
An immutable geographic coordinate (latitude / longitude, WGS84).
Layer<G extends Feature<Geometry>>
This class is the base for all annotation layer classes.
LoccodeClient
Client for the Maimaps Loccode APIs.
LoccodeGeometry
GeoJSON LineString geometry for a Loccode street.
LoccodeResult
Result from the loccode APIs.
Maimaps
Entry point of the Maimaps SDK.
MaimapsApiClient
Thin HTTP layer over Dio for the Maimaps gateway ({apiBaseUrl}/sdk/v1).
MaimapsMap
A MapLibre GL map rendering the Maimaps published style.
MaimapsOptions
Configuration for the Maimaps SDK.
MaimapsWordmark
The Maimaps wordmark — the pin icon and wordmark lockup — overlaid on a MaimapsMap as part of the service branding (attribution stays in the opposite bottom corner). Movable between corners via position; shown by default and hideable per map via MaimapsMap.showWordmark.
MapController
The MapController can be used to control, update and manipulate a rendered MapLibreMap.
MapEvent
Base class for all the events emitted by the MapLibreMap.
PlaceCategory
A place category from GET /sdk/v1/place-categories.
PlaceCategoryClient
Client for GET /sdk/v1/place-categories.
PointDetails
Result from GET /sdk/v1/point-details.
PointDetailsClient
Client for GET /sdk/v1/point-details.
PointPlace
The place/address portion of a point-details response.
PolylineDecoder
Decodes a Google-style encoded polyline string into a list of LatLng.
ResolvedWordmark
What the widget needs: safe art now, better art to try, and the geometry.
ReverseGeocodeClient
Client for the Maimaps reverse-geocode API.
ReverseGeocodeResult
Result from GET /sdk/v1/reverse-geocode.
RouteInfo
The result of a routing / directions request.
RouteLeg
A single leg (origin → waypoint, or waypoint → destination).
RouteStep
A single maneuver/instruction in the route.
RoutingClient
Client for the Maimaps routing API.
SearchClient
Client for the Maimaps place-search API.
SearchResult
A single result returned by GET /sdk/v1/search.
SearchResultGeometry
GeoJSON LineString geometry for loccode results.
StyleController
The StyleController can be used to manipulate the style of a MapLibreMap. It can be accessed via MapController.style.
WordmarkAsset
One resolved image plus the geometry needed to lay it out.
WordmarkLayout
Layout knobs for the map wordmark, all overridable by the manifest.
WordmarkManifest
The /sdk/wordmark.json document. Every field is optional.

Enums

MaimapsEnvironment
The Maimaps backend environment a MaimapsOptions instance targets.
WordmarkPosition
Corner anchor for the Maimaps wordmark.

Functions

buildStyleUrl({required String mapBaseUrl, required String apiKey, String styleFamily = 'default', String mode = 'light'}) String
Builds the Maimaps published-style URL: {mapBaseUrl}/sdk/styles/{styleFamily}/style.json?mode={mode}&key={apiKey}
exceptionForCode({int? statusCode, String? code, String? message, Duration? retryAfter}) MaimapsException
Builds the typed exception for a backend error code / HTTP status, per the v1 SDK error contract:
mapDioException(DioException e) MaimapsException
Maps a DioException to the corresponding typed MaimapsException.
styleModeForBrightness(Brightness brightness) String
Published-style mode string for a Flutter Brightness: light for the light theme, dark for the dark theme.

Typedefs

MapCreatedCallback = void Function(MapController controller)
Callback that fires once the native MapLibre map has been created for a MapLibreMap widget. It provides the MapController to the user.
MapEventCallback = void Function(MapEvent event)
Callback that fires every time a MapEvent gets emitted by the map.
StyleLoadedCallback = void Function(StyleController style)
Callback that fires once the map style has successfully loaded. It provides the StyleController to the user.

Exceptions / Errors

InvalidApiKeyException
401 invalid_api_key — the key is missing, malformed, revoked, or minted for a different product.
MaimapsException
Base class for all errors thrown by the Maimaps SDK.
MaimapsNetworkException
The request never produced a usable response: connection failure, timeout, TLS problem, or cancellation.
MaimapsServerException
The backend answered with an unexpected error (5xx, including 503 auth_unavailable, or any unmapped 4xx).
QuotaExceededException
429 quota_exceeded — the key's monthly cap for this dimension is exhausted. Retrying will not help until the period resets or the plan is upgraded.
RateLimitException
429 rate_limited — the per-key rate limit was hit. Honor retryAfter before retrying.