Check if GPS Lat / Lng is on the road on Google Maps

I am developing a navigation application in Android. I want to invite the user when he goes off-road. So, if I have a GPS Lat / Lng point, is it possible to determine whether this point lies on the road or not? Is there any API support for such checks? This should be done on all roads in general, and not with a specific path / polyline.

+3
source share
1 answer

You can use the isLocationOnPath() function for this. You must add dependency

 dependencies { compile 'com.google.maps.android:android-maps-utils:0.4+' } 

in your gradle application. For more information http://googlemaps.imtqy.com/android-maps-utils/#start

+1
source

Source: https://habr.com/ru/post/1442484/


All Articles