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

Move shape annotation click handling to core #10267

Merged
merged 1 commit into from
Oct 30, 2017

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Oct 24, 2017

Closes #10234, refs #9984 and #9443.

This moves the logic as shown in #9984 to core.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Oct 24, 2017
@tobrun tobrun added this to the android-v5.2.0 milestone Oct 24, 2017
@tobrun tobrun self-assigned this Oct 24, 2017
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

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

Two minor details.

@Override
public List<Annotation> obtainAllIn(RectF rectangle) {
// convert Rectangle to be density dependant
float pixelRatio = nativeMapView.getPixelRatio();
Copy link
Contributor

Choose a reason for hiding this comment

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

What about extracting // convert Rectangle to be density dependant block of code into a private method?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍, instead of private, I moved it to NativeMapView and refactored similar code for DRY reasons.

rectangle.right / pixelRatio,
rectangle.bottom / pixelRatio);

List<Annotation> shapeAnnotations = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here ☝️ when getting the list of shapeAnnotations.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@tobrun tobrun force-pushed the 10234-query-shape-annotations branch from d787edf to c7a9108 Compare October 26, 2017 16:56
@tobrun tobrun merged commit 5893af7 into release-agua Oct 30, 2017
@tobrun tobrun deleted the 10234-query-shape-annotations branch October 30, 2017 16:34
This was referenced Nov 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants