flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.03k stars 498 forks source link

Circle not draggable on web when accessed through mobile device #1419

Closed javezbak closed 1 week ago

javezbak commented 2 months ago

Reproducible Example:

import 'package:flutter/material.dart';
import 'package:mapbox_gl/mapbox_gl.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  final point = const LatLng(33.7871154, -116.4050358);

  @override
  Widget build(BuildContext context) {
    late MapboxMapController mapController;

    return MaterialApp(
      title: 'Drag Issue',
      home: MapboxMap(
        initialCameraPosition: CameraPosition(target: point, zoom: 15),
        accessToken: <token-here>,
        onMapCreated: (MapboxMapController controller) {
          mapController = controller;
        },
        onStyleLoadedCallback: () async {
          await mapController.addCircles(
            [
              CircleOptions(
                circleRadius: 35,
                circleColor: '#f00',
                circleOpacity: 1,
                circleStrokeColor: '#f88',
                circleStrokeWidth: 1,
                geometry: point,
                draggable: true,
              ),
            ],
          );
        },
      ),
    );
  }
}

This code is hosted as a web app, not as a native application. I can drag the red circle successfully on Firefox and Chrome when accessed through a Desktop. On Android phones and tablets, real or emulated, the circle does not drag. The map ends up dragging instead.

stale[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.