liodali / osm_flutter

OpenStreetMap plugin for flutter
https://pub.dev/packages/flutter_osm_plugin
MIT License
218 stars 91 forks source link

Disable OSMFLUTTER tap/drag #538

Open natig3 opened 2 weeks ago

natig3 commented 2 weeks ago

I would like to disable touch and drag on the map, as I only use it as a viewer, and I am having a problem showing dialogs in front of the map, as the focus remains on the map and not on the dialogs so I can click on their buttons, if you can help me Help me resolve this, I'd be grateful!

I've used many things to disable the touch on the map, but I wasn't successful, I used GestureDetector to capture the touches and disable it, I used Positioned to position the dialog on the map, I used IgnorePointer, Listener, Positioned.fill...

Example of my code:

Container( height: 300, margin: EdgeInsets.only(top: 20), width: MediaQuery.of(context).size.width - 40, child: Stack( children: [ OSMFlutter( controller: Controller.to.mapController, osmOption: OSMOption( enableRotationByGesture: false, zoomOption: ZoomOption( initZoom: 14, maxZoomLevel: 19, ), staticPoints: Controller.to.staticPoints, ), ), ], ), )


flutter doctor -v

[√] Flutter (Channel stable, 3.22.2 • Flutter version 3.22.2 • Dart version 3.4.3 • DevTools version 2.34.3

flutter_osm_plugin: ^1.0.5 Captura de tela 2024-07-04 095650 b92500e0-8ff9-4b68-889c-fc94023bfe98

liodali commented 2 weeks ago

i will add that feature soon

natig3 commented 2 weeks ago

If it's not too much to ask, can you tell me how long this option will be available?

I'm waiting for this issue...

liodali commented 2 weeks ago

i will work on small feature for custom tile and this one it should not be so difficult so probably this weekend or beginning of next week

natig3 commented 2 weeks ago

Excellent, I look forward to hearing from you, thank you!!

liodali commented 1 week ago

sorry for being late the new version will published today or tomorrow at maximum

liodali commented 6 days ago

the release will up in one hour preparing just the docs I created new map widget called as you can see in this example you should use with that widget SimpleMapController

       OSMViewer(
             controller: SimpleMapController(
               initPosition: GeoPoint(
                 latitude: 47.4358055,
                 longitude: 8.4737324,
                ),
                  markerHome: const MarkerIcon(
                    icon: Icon(Icons.home),
                  ),
                ),
                zoomOption: const ZoomOption(
                  initZoom: 16,
                  minZoomLevel: 11,
                ),
              )