1

I'm developing an android app and I have a route path generated from Google Directions API like this example here

I want to check whether a location X falls on the route or not.

How i can possibly do this ?

NOTE: After searching on Stackoverflow i found this question and it's similar to what i want to do but it is in JavaScript and from the answers i found a method in Google maps JavaScript APIs here that do what i want but it's not available for the Android API Library ,How can i use it on Android ?

Community
  • 1
  • 1
Ahmed Elshaer
  • 364
  • 7
  • 21
  • Its a PITA, but you can use direct HTTP calls just like the javascript api does. – Gabe Sechan Feb 08 '17 at 21:42
  • i have posted a wrong link of the javascript solution method and i have edited the question please check it again and if it is the same how can i accomplish the HTTP call like the API do i can't find a link to create a request on – Ahmed Elshaer Feb 08 '17 at 21:47

2 Answers2

0

I found my answer here it an API for android from Google Maps utility API contain method containLocation()

com.google.maps.android.PolyUtil.containsLocation()

from Google Maps Android API utility library.

Ahmed Elshaer
  • 364
  • 7
  • 21
  • What if I want to use this on server side not on client side? – hrushilok Nov 18 '20 at 04:33
  • @hrushilok depending on the server side stack, there is a lot of ports for google maps utilities but more awesome alternative you could use Turf more advanced one and would help you a lot with everything map/location related and have a lot of ports https://turfjs.org – Ahmed Elshaer Dec 14 '20 at 13:11
0

You can use isLocationOnPath() from android-maps-utils library.