mapbox-maps-flutter
mapbox-maps-flutter copied to clipboard
Can we have a nicer way to add click listener for annotations?
- Instead of straight up doing the java way, implementing abstract classes for listener for annotations, why don't just use lambda since dart already supported much shorter syntax? Why would it have to be extra mile?
- It should be able to setup click listener on the annotation class itself. For example: It can be like this
final annotation = await circleAnnotationManager?.create(
CircleAnnotationOptions(
geometry: coordinate.toPoint().toJson(),
circleRadius: 10,
circleColor: Colors.orange.value,
),
);
annotation.setClickListener(() {
//...
})
or like this:
final annotation = await circleAnnotationManager?.create(
CircleAnnotationOptions(
geometry: coordinate.toPoint().toJson(),
circleRadius: 10,
circleColor: Colors.orange.value,
onClick: () {}
),
);
annotation.setClickListener(() {
//...
})
This way it would be much nicer.
Same point! Looking forward to smth like this!!!!
@fufylev and @bakaemon , is there a way you properly render widgets on screen on annotation clicks?
If possible it would also be amazing to be able to store some basic information either in the annotations or in an object attached to the annotations