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

fixes #1969: support for marker tapping in Android #2201

Merged
merged 1 commit into from
Aug 28, 2015

Conversation

incanus
Copy link
Contributor

@incanus incanus commented Aug 28, 2015

Just logs the marker ID to console right now.

@bleege @ljbade give it a whirl and let me know how it could be better, in particular this routine feels a little wasteful, but I wasn't sure of the best way to make use of ArrayList.contains() otherwise given a long[].

We can tune this up possibly, then merge and pick up work in #894 for popups connecting to this.

Another weirdness is a 60x80 top two-thirds-weighted hit region felt best on Android as opposed to the 40x60 we use on iOS. I am making sure to take MapView.mScreenDensity into account.

@incanus incanus added feature Android Mapbox Maps SDK for Android labels Aug 28, 2015
@incanus incanus added this to the android-v0.1.0 milestone Aug 28, 2015
@incanus incanus changed the title support for marker tapping in Android fixes #1969: support for marker tapping in Android Aug 28, 2015
@incanus incanus added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Aug 28, 2015
@incanus
Copy link
Contributor Author

incanus commented Aug 28, 2015

You know what? Marker picking isn't performance-constrained, so if we can find improvements to the existing annotation iteration in future, feel free to change them. But for now I am going to squash + force push + merge this so we can build on it.

@incanus incanus force-pushed the android-bind-annotation-bounds branch from 6632660 to bcfce80 Compare August 28, 2015 22:29
@incanus incanus removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Aug 28, 2015
@incanus incanus merged commit bcfce80 into master Aug 28, 2015
@incanus incanus deleted the android-bind-annotation-bounds branch August 28, 2015 23:01
@ljbade
Copy link
Contributor

ljbade commented Aug 31, 2015

@ljbade
Copy link
Contributor

ljbade commented Aug 31, 2015

Ah can't use it anyway because of long vs Long. Isn't Java neat?

if (annotation instanceof Marker && idsList.contains(annotation.getId())) {
annotations.add(annotation);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since mAnnotations is defined using Generics List<Annotation> it can be iterated easier and safer via:

for (Annotation annotation : mAnnotations) {
...
}

@bleege
Copy link
Contributor

bleege commented Aug 31, 2015

Ah can't use it anyway because of long vs Long. Isn't Java neat?

Sure it can. Autoboxing. 😃

@ljbade
Copy link
Contributor

ljbade commented Sep 1, 2015

@bleege Ah yeah but apparently autoboxing does not happen with arrays.

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

Successfully merging this pull request may close these issues.

3 participants