Search packages, repositories and app categories

Package detailsv6.0.0

flutter_map_tappable_polyline

A flutter_map plugin that adds Polyline class with onTap event

AndroidiOSWebmacOSWindowsLinux
30-day downloads
346
Likes
51
Pub points
130

Install package

flutter pub add flutter_map_tappable_polyline

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter plugin extending flutter_map with a tappable Polyline class that supports onTap events, enabling interactive map routes. It allows users to detect when a polyline on a map is tapped, enhancing user engagement for navigation or route visualization. Built for compatibility across Android, iOS, Web, macOS, Windows, and Linux, it integrates seamlessly into existing flutter_map projects. The package is lightweight and focused, providing only the essential functionality for touch interaction on polylines.

Use cases

  • Interactive route selection
  • Map-based navigation highlights
  • User-triggered polyline actions
  • Visualizing dynamic paths with feedback
  • Enhancing map UX with tap interactions

Key features

  • OnTap event support for polylines
  • Seamless integration with flutter_map
  • Cross-platform compatibility
  • Lightweight and focused design
  • Supports all major Flutter platforms

Suitable for

  • Developers building interactive maps
  • Apps requiring user input on map lines
  • Navigation or routing applications
  • Projects using flutter_map with enhanced interactivity

Considerations

  • Requires flutter_map to be installed
  • Limited to polyline tap detection
  • No built-in styling customization
  • May require additional handling for complex tap logic
  • Depends on upstream flutter_map updates

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flutter Map Tappable Polyline

pub package

A Polyline with onTap event listener
This is a plugin for flutter_map package

Usage

Add flutter_map and flutter_map_tappable_polyline to your pubspec:

dependencies:
  flutter_map: ^6.0.1
  flutter_map_tappable_polyline: any # take latest version on Pub

Add it in you FlutterMap and configure it using TappablePolylineLayerOptions.

  Widget build(BuildContext context) {
    return FlutterMap(
      options: new MapOptions(
        plugins: [
          TappablePolylineMapPlugin(),
        ],
      ),
      layers: [
        TileLayerOptions(
          urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
          subdomains: ['a', 'b', 'c'],
        ),
        TappablePolylineLayerOptions(
          // Will only render visible polylines, increasing performance
          polylineCulling: true,
          polylines: [
            TaggedPolyline(
              tag: "My Polyline", // An optional tag to distinguish polylines in `onTap` callback
              // ...all other Polyline options
            ),
          ],
          onTap: (polylines, tapPosition) => print('Tapped: ' +
            polylines.map((polyline) => polyline.tag).join(',') +
            ' at ' +
            tapPosition.globalPosition.toString()),
          onMiss: (tapPosition) {
            print('No polyline was tapped at position ' +
                tapPosition.globalPosition.toString());
          }
        )
      ],
    );
  }

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.