You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Symbol data is null in onTap, symbol tap doesn't consume click event #332
Hello
i have some problem
1 - the symbol's center is placed at the target not the bottom edge of it
2 - on symbol tap i get null data
3 - on symbol tap also onMapClick is triggered
4 - symbol draggable is not working
@hussenIbrahim Thank you for reporting it.
1 This is the expected behaviour, you can specify the iconOffset in SymbolOptions to adjust the symbol's position.
2 & 3 are indeed bugs
4 is a known issue on Android, tracked at #130, it's an issue with the Mapbox SDK upstream (tracked there at mapbox/mapbox-plugins-android#863)
Could you also tell us what version of the plugin and flutter you're using and on which platform these bugs occur, please?
@hussenIbrahim I haven't been able to reproduce 2.
I did some research regarding 3 and this has been fixed upstream (see mapbox/mapbox-plugins-android#1124), so we'll have to wait for the next release of the Annotation plugin.
changed the title [-]Symbol geometry , on symbol tapped data[/-][+]Symbol data is null in onTap, symbol tap doesn't consume click event[/+]on Jun 16, 2020
So, since the onSymbolTap is still not consuming the onMapTap yet, here is a very simple fix.
use a class bool, default to false,
onSymbolTap sets this to true
onMarkerTap checks for bool and if it's true set it to false and return.
(DON'T use setState. It is unnecessary and only impacts Performance)
Sorry if this is the wrong issue to post this on, but I still hope it helps someone
I can confirm that this is not fixed in 0.10.0 ... I think the issue is that the getter is not set for Symbol.
This breakpoint is on the controller changeNotifier.
Activity
m0nac0 commentedon Jun 15, 2020
@hussenIbrahim Thank you for reporting it.
1 This is the expected behaviour, you can specify the
iconOffsetin SymbolOptions to adjust the symbol's position.2 & 3 are indeed bugs
4 is a known issue on Android, tracked at #130, it's an issue with the Mapbox SDK upstream (tracked there at mapbox/mapbox-plugins-android#863)
Could you also tell us what version of the plugin and flutter you're using and on which platform these bugs occur, please?
hussenIbrahim commentedon Jun 15, 2020
Flutter 1.19.0-4.0pre
plugin version 0.7.0
Android platform
m0nac0 commentedon Jun 16, 2020
@hussenIbrahim I haven't been able to reproduce 2.
I did some research regarding 3 and this has been fixed upstream (see mapbox/mapbox-plugins-android#1124), so we'll have to wait for the next release of the Annotation plugin.
[-]Symbol geometry , on symbol tapped data[/-][+]Symbol data is null in onTap, symbol tap doesn't consume click event[/+]luiscavanillas commentedon Jun 24, 2020
Regarding 2: addSymbol() function does not use [this.data] parameter at all. It is actually skipped (not implemented).
By comparing mapbox 0.7.0 plugin and the mapbox example code you can see that "data" is only assigned to the symbol in the second one.
m0nac0 commentedon Jun 25, 2020
@luiscavanillas @saily-io @hussenIbrahim Could you please try using the latest version from Github with this dependency in pubspec.yaml:
I think this should be fixed on master.
luiscavanillas commentedon Jun 25, 2020
@m0nac0 Just did and it works.
hussenIbrahim commentedon Jun 25, 2020
TimothySealy commentedon Jul 1, 2020
As I understand it the status of these this issue is:
Can we may close this issue and open a separate one for tracking nr 3?
m0nac0 commentedon Jul 2, 2020
@TimothySealy Sounds good. I haven't tested this but I think data will likely also be null for circles and lines right now, as the data parameter is ignored here:
https://github.com/tobrun/flutter-mapbox-gl/blob/4ce26231f3250b598060063d1b8b65950694754e/lib/src/controller.dart#L507-L515
This was only fixed for symbols with the symbol batch editing. So we might want to track that as well.
IcyTv commentedon Nov 7, 2020
So, since the
onSymbolTapis still not consuming theonMapTapyet, here is a very simple fix.use a class bool, default to false,
onSymbolTap sets this to true
onMarkerTap checks for bool and if it's true set it to false and return.
(DON'T use setState. It is unnecessary and only impacts Performance)
Sorry if this is the wrong issue to post this on, but I still hope it helps someone
Khader-1 commentedon Mar 4, 2021
I think this issue is present in the current version 0.10.0

leeprobert commentedon Mar 14, 2021
I can confirm that this is not fixed in 0.10.0 ... I think the issue is that the getter is not set for Symbol.

This breakpoint is on the controller
changeNotifier.m0nac0 commentedon Mar 15, 2021
@Khader-1 In your code,
datawould be expected to be null. You have to explicitly pass the optional parameterdatatoaddSymbol(...), otherwise it defaults to null (see https://pub.dev/documentation/mapbox_gl/latest/mapbox_gl/MapboxMapController/addSymbol.html).delajose90 commentedon Jul 11, 2022
It works for me @m0nac0 thanks