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

Add getAnnotationsInBounds in NativeMapView.java #1969

Closed
erf opened this issue Jul 30, 2015 · 11 comments
Closed

Add getAnnotationsInBounds in NativeMapView.java #1969

erf opened this issue Jul 30, 2015 · 11 comments
Assignees
Labels
Android Mapbox Maps SDK for Android feature

Comments

@erf
Copy link
Contributor

erf commented Jul 30, 2015

I'm looking at implementing annotation selection in Android but i need the getAnnotationsInBounds method.

@ljbade ljbade added feature Android Mapbox Maps SDK for Android labels Jul 30, 2015
@ljbade
Copy link
Contributor

ljbade commented Jul 30, 2015

@incanus How does this relate to your long press pin drop stuff?

@incanus
Copy link
Contributor

incanus commented Jul 30, 2015

Not related.

@incanus
Copy link
Contributor

incanus commented Jul 30, 2015

Eventually it will relate to selection of dropped pins, but that's cart before horse right now.

@incanus incanus self-assigned this Jul 31, 2015
@incanus incanus added this to the Android b1 milestone Jul 31, 2015
@ljbade
Copy link
Contributor

ljbade commented Aug 12, 2015

@incanus some feedback on how to design this:

First you should implement #1998
This will require you to keep a shadow of the Annotation objects in a local LinkedList as a private member of MapView. Basically each time you handle add* or remove* you update the Java list as well as call the JNI function.

Then the getAnnotations will simply return this as a List.

You can then change the JNI nativeGetAnnotationsInBounds to return a long[] of annotation IDs. In the Java implementation of getAnnotationsInBounds you then use this array of IDs to build an ArrayList of Annotation objects as a List.

@incanus
Copy link
Contributor

incanus commented Aug 12, 2015

I think I follow, but does this account for needing to query an arbitrary bounding box? That's why I want to pass down to the C++ routine.

@ljbade
Copy link
Contributor

ljbade commented Aug 12, 2015

@incanus Oh yes you still pass down to the C++ routine the bounding box. But you return the list of annotation ID numbers, which is then used to find the actual Annotation object created with that ID.

@incanus
Copy link
Contributor

incanus commented Aug 12, 2015

Ah I gotcha — yes, thanks for the help outlining the Java side of the API. Once I get there! 😄

@ljbade
Copy link
Contributor

ljbade commented Aug 17, 2015

@incanus After #2094 and #2088 all that's left now is this. I might be able to pick this up tomorrow.

@incanus
Copy link
Contributor

incanus commented Aug 28, 2015

👉 #2201

@erf
Copy link
Contributor Author

erf commented Aug 29, 2015

nice! 👍

@bleege
Copy link
Contributor

bleege commented Aug 31, 2015

Fixed by #2201

@bleege bleege closed this as completed Aug 31, 2015
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

No branches or pull requests

4 participants