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

Select marker view annotation not working properly #5384

Closed
cammace opened this issue Jun 16, 2016 · 5 comments
Closed

Select marker view annotation not working properly #5384

cammace opened this issue Jun 16, 2016 · 5 comments
Labels
Android Mapbox Maps SDK for Android bug

Comments

@cammace
Copy link
Contributor

cammace commented Jun 16, 2016

When calling MapboxMap.selectMarker() on a view annotation the info window isn't placed above the marker like it is when you click the marker yourself:

2016-06-16 16_56_01

cc: @tobrun @zugaldia @ivovandongen @bleege

@cammace cammace added bug Android Mapbox Maps SDK for Android labels Jun 16, 2016
@zugaldia zugaldia added this to the android-v4.1.0 milestone Jun 16, 2016
@tobrun
Copy link
Member

tobrun commented Jun 17, 2016

@cammace I guess the ViewMarker is not measured yet and thus resulting in a offset of {0,0}.
From end user perspective there are two workarounds:

  • global layout change listener
  • delaying the selectMarker call with something as a Handler

@cammace
Copy link
Contributor Author

cammace commented Jun 17, 2016

delaying the selectMarker call with something as a Handler

selectMarker was already being called after a short delay (in the geocoding onResponse) but I added a handler anyways and the problem still persist.

final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
    @Override
    public void run() {
        map.selectMarker(droppedMarker);
    }
}, 500);

@tobrun
Copy link
Member

tobrun commented Jun 17, 2016

@ivovandongen is investigating this and it's correct that delaying does not resolve it.
We need to migrate code from the internal onClick listener to the selectMarker method.

@ivovandongen
Copy link
Contributor

@cammace Found the problem. Is coming together with #5282

@zugaldia
Copy link
Member

@cammace The PR has now landed via #5391, please reopen if you still observe this issue happening in the release branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android bug
Projects
None yet
Development

No branches or pull requests

4 participants