-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Returns layer Id on Feature Tap #475
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally ok, some code questions
@@ -56,9 +56,9 @@ class MapLibreMapController: NSObject, FlutterPlatformView, MLNMapViewDelegate, | |||
target: self, | |||
action: #selector(handleMapTap(sender:)) | |||
) | |||
for recognizer in mapView.gestureRecognizers! where recognizer is UITapGestureRecognizer { | |||
/*for recognizer in mapView.gestureRecognizers! where recognizer is UITapGestureRecognizer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you comment it out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, this was to enhanced the speed of the callback, with this commented the interaction callback switch from 1s to 0.1s. I was unable to remove all the slow gestureRecognizers
@@ -8,7 +8,7 @@ typedef OnMapClickCallback = void Function( | |||
Point<double> point, LatLng coordinates); | |||
|
|||
typedef OnFeatureInteractionCallback = void Function( | |||
dynamic id, Point<double> point, LatLng coordinates); | |||
dynamic id, Point<double> point, LatLng coordinates, String layerId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My issue with this is that it changes the callback function signature. Fine since the library is not stable yet. But maybe it's type to make a InteractionEvent
class to package all the attributes inside?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not, but I don't think it's necessary, given that functionality is vital.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove workaround
This reverts commit fdc7fa5.
Hello MapLibre Team !
I needed to retrieve the layer Id of the feature tapped, so I've implemented it.
This is much cleaner than using the given Id to have a unique identifier and the layer id.
Best regards,
Louis