Tim
Tim

Reputation: 306

Google Map Checking if cooridinate is between 2 points

ANDROID APP

I've use google direction API to get a route from 2 points.

All the routes returned is saved if there is a need to reference to any of that data

Then I decoded the overview_polyline into a list of LatLng and drew the polyline on the google map.

How do I find out if a given coordinate (traffic accident for example) is on/nearby the polyline route , plus minus a constant distance (maybe 100m?)

Upvotes: 2

Views: 950

Answers (1)

Raymond Lukanta
Raymond Lukanta

Reputation: 505

You can use Google Maps Utility Library.

Especially isLocationOnPath(LatLng point, java.util.List<LatLng> polyline, boolean geodesic, double tolerance).

Here's the full documentation.

Upvotes: 3

Related Questions