Yarrow Map Flutter SDK

Flutter SDK for integrating Yarrow maps in mobile apps, with an API aligned to the Yarrow web SDK.

Features

  • Render Yarrow map tiles via YarrowMapView.
  • Programmatic map control with YarrowMapController and YarrowMap.
  • Add/remove custom layers, explicit sources, and markers.
  • Route building and route rendering helpers.
  • Search highlighting and live bus route rendering helpers.
  • 6-way controls placement: left, leftTop, leftBottom, right, rightTop, rightBottom.
  • Automatic controls inset when controls and brand badge share the same corner.

Installation

flutter pub add yarrow_map_flutter_sdk

Controls and Badge

const YarrowMapConfig(
  center: (lng: 69.2401, lat: 41.2995),
  controls: YarrowControlsConfig(
    enabled: true,
    position: YarrowControlsPosition.rightBottom,
  ),
  brandBadgePosition: BrandBadgePosition.bottomRight,
)

When controls and badge are placed in the same corner, the Flutter SDK automatically applies spacing to avoid overlap.

Layer and Source APIs

YarrowMap now supports source-level operations aligned with web SDK:

  • addSource(sourceId, data)
  • updateSourceData(sourceId, data)
  • addLayer(..., options: YarrowAddLayerOptions(sourceId: ..., filter: ...))
  • queryRenderedFeatures(point: ..., options: ...)
  • queryRenderedFeatures(rect: ..., options: ...)

Quick Start

import 'package:flutter/material.dart';
import 'package:yarrow_map_flutter_sdk/yarrow_map_flutter_sdk.dart';

class MapScreen extends StatefulWidget {
  const MapScreen({super.key});

  @override
  State<MapScreen> createState() => _MapScreenState();
}

class _MapScreenState extends State<MapScreen> {
  final controller = YarrowMapController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: YarrowMapView(
        config: const YarrowMapConfig(
          center: (lng: 69.2401, lat: 41.2995),
          zoom: 12,
        ),
        controller: controller,
        onReady: (map) async {
          await map.zoomTo(41.2995, 69.2401, 14);
        },
      ),
    );
  }
}

Notes

  • This package uses maplibre_gl under the hood.
  • Ensure platform setup for Flutter + MapLibre is completed in your app.