Code Monkey home page Code Monkey logo

flutter_map_tappable_polyline's Introduction

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(
          polylines: [
            TaggedPolyline(
              tag: "My Polyline", // An optional tag to distinguish polylines in callback
              // ...all other Polyline options
            ),
          ],
          onTap: (TaggedPolyline polyline) => print(polyline.tag))
      ],
    );
  }

flutter_map_tappable_polyline's People

Contributors

fieldinrain avatar katutxakurra avatar tuarrep avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.