polygon_map 0.0.6 copy "polygon_map: ^0.0.6" to clipboard
polygon_map: ^0.0.6 copied to clipboard

A flexible Flutter map widget for creating, editing, and managing polygons with interactive controls.

polygon_map

Pub apk License: MIT Points Donate flutter_map latlong2

polygon_map #

polygon_map — a lightweight and easy-to-use package for working with map polygons. Create, edit, and display geometric areas with flexible customization.
Please star the repository to support the project!

Screenshots #

Getting Started #

To use this package, add it to your pubspec.yaml:

dependencies:
  polygon_map: ^0.0.6

or run the command

flutter pub add polygon_map

Using the player #

class _MyAppState extends State<MyApp> {
  final controller = PolygonMapController();

  @override
  void initState() {
    super.initState();

    controller.addListener(_onControllerChanged);

    controller.setPolygons([
      PolygonModel(
        borderColor: Colors.red,
        points: [
          LatLng(34.0925, -118.2750),
          LatLng(34.0925, -118.2050),
          LatLng(34.0225, -118.1950),
          LatLng(34.0125, -118.2050),
          LatLng(34.0125, -118.2750),
        ],
      ),
    ]);
  }

  void _onControllerChanged() {
    debugPrint("last polygon: ${controller.polygons.last.points}");
  }

  @override
  void dispose() {
    controller.removeListener(_onControllerChanged);
    controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: PolygonMap(
          controller: controller,
          mapType: MapTypeEnum.esriSatellite,
        ),
      ),
    );
  }
}
0
likes
160
points
186
downloads
screenshot

Documentation

API reference

Publisher

verified publisherrony.fun

Weekly Downloads

A flexible Flutter map widget for creating, editing, and managing polygons with interactive controls.

Repository (GitHub)
View/report issues

Topics

#polygon #geospatial #drawing #interactive #geolocation

License

MIT (license)

Dependencies

flutter, flutter_map, latlong2

More

Packages that depend on polygon_map