Skip to content
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

Map takes tap event when tap is performed on marker #29

Open
anuroopsinghal07 opened this issue Feb 18, 2021 · 4 comments
Open

Map takes tap event when tap is performed on marker #29

anuroopsinghal07 opened this issue Feb 18, 2021 · 4 comments

Comments

@anuroopsinghal07
Copy link

Hello,
I have added a feature to add pins on tap of map. Pin also displays info window when tap is performed on pin. When I tap on pin to open info window, map also adds new pin because map takes tap event. I could not find anything to fix it and looks like a defect.

@dev4jam
Copy link

dev4jam commented Aug 22, 2022

I have a similar problem: when I tap on a marker onTap callback is triggered. The second time I tap on the same marker the onTap callback is NOT triggered.

@Tapaniya25
Copy link

I have same issue @dev4jam. Have you found any solution?

@ChrisMarxDev
Copy link

I faced the same issue and found a very hacky workaround for it. I just append a random uuid to the marker id and call setState() when tapping the marker. E.g.

PlatformMap(
                initialCameraPosition: initialCamera,
                markers: locations.map(
                        (location) {
                          return Marker(
                            markerId:
                                MarkerId(location.locationId + uuid.v4()),
                            position: LatLng(
                              location.geoCoordinate.latitude,
                              location.geoCoordinate.longitude,
                            ),
                            consumeTapEvents: true,
                            onTap: () {
                              // handle tap logic
                              setState(() {});
                            },
                          );
                        },
                      ).toSet(),
                gestureRecognizers: const {
                  Factory<OneSequenceGestureRecognizer>(
                    EagerGestureRecognizer.new,
                  ),
                },
)

@SDAChess
Copy link

SDAChess commented Nov 8, 2023

We are still experiencing this issue. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants