flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.04k stars 503 forks source link

onFeatureTapped doesn't work on ios #1288

Closed Tristan-2021 closed 1 year ago

Tristan-2021 commented 1 year ago

someone had problems with it, on android it works correctly but on IOS never " apController.onFeatureTapped.add(id, point, coordinates){ } "

ibrarBashir commented 1 year ago

I facing the same issue, how did you resolve this issue?.

jlukas99 commented 1 year ago

same problem :/

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Letalus commented 10 months ago

We also received this error lately in our application

aardrop commented 8 months ago

Same issue in web as well

aardrop commented 8 months ago

I did find a workaround. I see that the event is triggering, although no feature is being passed. So, I used the onFeatureTapped event to trigger a method that queries the rendered features by layerIds.

 List features = await mapController.queryRenderedFeaturesInRect(
            Rect.fromCenter(
                center: Offset(point.x, point.y), width: 5, height: 5),
           layerIds,
            null);
        I haven't had success adding filters to this method but this works for me on web and mobile.
fdewannemaeker commented 6 months ago

Make sure your feature has an id ... on Android, if your feature does not have an id, and you click on it, the onFeatureTapped is triggered. On IOS, the onMapClick is triggered. Hope this helps...