Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

onSingleTapConfirmed() logic needs to be updated #3156

Closed

Description

@zugaldia

After implementing the ability to allow multiple InfoWindows to be visible at a time the method onSingleTapConfirmed() to respond to a single tap has to be either updated or simplified.

The current solution covers the basic case (select the first marker) but doesn't seem to include other cases that the previous implementation was handling: https://github.com/mapbox/mapbox-gl-native/blob/master/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java#L2502

Activity

  1. added
    Android
    on Nov 30, 2015
  2. modified the milestones: android-v2.3.0, on Nov 30, 2015
  3. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    After landing bugfixes related to Marker click events in #3573,
    I tried running at this issue and did some manual testing:

    I was able to select the correct marker almost every time in the grey circle:

    device-2016-01-19-082304

  4. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    I have taken a look at the code that was already there and was placed in comment, but I'm not convinced by it. It is not actually calculation chance or distances, it is just taking into account the previous selected marker and iterating over the possible markers.

    I'm going to see if I'm able to improve current experience by calculating the distance between the click event and the marker.

  5. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    I started by visualising current touch area:
    In this image you see 2 already selected areas and an actual down event. I believe current touch area is too big and I think we should limit this to 48dp ->min. requirement width/height touch surface on Android.

    device-2016-01-19-090626

  6. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    I lowered the bounds of the touch area, which automatically improves selection criteria without using an algorithm to determine distance between touch event and marker.

    device-2016-01-19-094201

  7. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    To demonstrate how this improves selection:

    device-2016-01-19-095451

    If I debugged this type of interaction with initial configuration, I would receive a callback with 3 possible touch targets. Now I'm only receiving one!

  8. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    One thing I will implement in singleTapConfirmed is if there are 2 side by side and one marker is already selected, I'm going to select the other marker. That is the only use-case that I'm currently seeing that needs improvement.

  9. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    Going to commit and PR

  10. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    This will land in the release branch of 3.1.0 from #3537

  11. added a commit that references this issue on Jan 19, 2016
  12. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    Landed with 6b3745c in branch mentioned above.

  13. zugaldia commented on Jan 19, 2016

    @zugaldia
    MemberAuthor

    @tobrun Love it, I didn't know our touch area was so wide. By the way, this ticket is a great candidate for the 3.1.0 blog post (#3537).

  14. tobrun commented on Jan 19, 2016

    @tobrun
    Member

    @zugaldia
    yeah that was a surprise for me as well!

    cc @bleege

  15. bleege commented on Jan 19, 2016

    @bleege
    Contributor

    Yep, this is likely technical debt from the original default marker implementation which was bigger than the current red one. Good 👀 to spot this and fix it! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Android

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions