Skip to content
pubscout

flutter_map_dragmarker

8.0.3, released 2 years ago by an unverified publisher

A draggable marker layer for flutter_map

WASM-ready
$ flutter pub add flutter_map_dragmarker
Source repository

What it does

Provides a DragMarkers layer and DragMarker class for flutter_map, allowing users to drag map markers around. It supports features like long-press to drag, map scrolling near edges, and marker rotation settings.

AI-written summary of version 8.0.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using flutter_map and need interactive markers that users can drag across the map.
  • You need features like map auto-scrolling when dragging near the edge of the map.

Skip it when

  • you are not using flutter_map (e.g. using Google Maps instead).
  • Markers only need to be tapped rather than dragged.

Strengths

  • Integrates seamlessly with flutter_map.
  • Supports long-press activation and edge-scrolling.

Weaknesses

  • Tied strictly to the flutter_map ecosystem.
  • Documentation outside the basic README example is minimal.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Requires adding the dependency and setting up flutter_map and latlong2.

FlutterMap(
    options: MapOptions(center: LatLng(45.5231, -122.6765), zoom: 9),
    children: [
      TileLayer(
        urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
      ),
      DragMarkers(
        markers: [
          DragMarker(
            point: LatLng(45.535, -122.675),
            offset: const Offset(0.0, -8.0),
            builder: (ctx) => const Icon(Icons.location_on, size: 50),
            onDragUpdate: (details, latLng) => print(latLng),
          ),
        ],
      ),
    ],
  )

Alternatives

Packages that do the same job and could replace flutter_map_dragmarker.

Works with

Packages commonly used together with flutter_map_dragmarker: ones it builds on, ones built on it, and its own family.