liodali / osm_flutter

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

No method to listen click on Marker #376

Open zatovagul opened 1 year ago

zatovagul commented 1 year ago
 await _mapController?.addMarker(
        GeoPoint(latitude: 55.809845, longitude: 37.167080),
        markerIcon: const MarkerIcon(
          key: Key('1'),
          iconWidget: MapClusterIcon(),
        ),
      );
      await _mapController?.addMarker(
        GeoPoint(latitude: 55.751255, longitude: 37.618423),
        markerIcon: const MarkerIcon(
          key: Key('2'),
          iconWidget: MapMarkerIcon(),
        ),
      );

I have already added two markers, but I didn't find any method to listen click on marker. Is it possible to receive click on Marker?

I also can use _mapController?.listenerMapSingleTapping, but it will give me GeoPoints instead of information about marker

liodali commented 1 year ago

we have onGeoPointClicked callback in OSMFlutter or you can use listenerMapSingleTapping it will be trigger when geopoint clicked

liodali commented 1 year ago

what information you want to get from marker click ?

zatovagul commented 1 year ago

Marker Key for example

liodali commented 1 year ago

key of the widget are not propagated to native view because marker are true built by flutter but rendered in native view for now lat,lon are the keys for markers

gouthamrg commented 10 months ago

I am late to this feed, on clicking the icon, I would like to show some meta information. Is there a way to do this, thanks in advance! @liodali

liodali commented 10 months ago

you can for example bottomsheet or use overlay after center the map in future i will work on that but can you provide me more information on what you want to show or if you have specific UI for it