flutter_map_tappable_polyline 1.3.0+1 copy "flutter_map_tappable_polyline: ^1.3.0+1" to clipboard
flutter_map_tappable_polyline: ^1.3.0+1 copied to clipboard

outdated

A flutter_map plugin that adds Polyline class with onTap event

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: any
  flutter_map_tappable_polyline: any # or the 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 callback
              // ...all other Polyline options
            ),
          ],
          onTap: (TaggedPolyline polyline) => print(polyline.tag),
          onMiss: () => print("No polyline tapped"))
      ],
    );
  }
47
likes
0
pub points
90%
popularity

Publisher

verified publisherownweb.fr

A flutter_map plugin that adds Polyline class with onTap event

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_map, latlong

More

Packages that depend on flutter_map_tappable_polyline