Coder Social home page Coder Social logo

camerash / flutter_map_tappable_polyline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ownweb/flutter_map_tappable_polyline

0.0 0.0 0.0 161 KB

A tappable Polyline plugin for flutter_map

Home Page: https://pub.dev/packages/flutter_map_tappable_polyline

License: MIT License

Objective-C 0.07% Kotlin 0.23% Dart 98.93% Swift 0.76%

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: ^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());
          }
        )
      ],
    );
  }

flutter_map_tappable_polyline's People

Contributors

fafre avatar fieldinrain avatar hugoheneault avatar jaffaketchup avatar jtthrillson avatar k5924 avatar katutxakurra avatar mkohm avatar s-man42 avatar sbu-wbt avatar tuarrep avatar zeitspacetyler 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.