-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accurately determine if the user's location is within the visible map region #102
base: master
Are you sure you want to change the base?
Conversation
1. Get map bounds from mapView size 2. Implement better point-in-polygon checking algorithm
&& positionInQuestion.getLatitude() >= latSouth | ||
&& positionInQuestion.getLongitude() <= lonEast | ||
&& positionInQuestion.getLongitude() >= lonWest); | ||
public static boolean contains(Point[] bounds, Point needle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use LatLngBounds.contains()? Less code to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
com.mapbox.mapboxsdk.geometry.LatLngBounds
is also available, if you'd rather go the MapBox way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have to test this & read up on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both contains method are the same and inaccurate. They are not comparable
This was achieved by:
Fixes #43