A.Doszhanov A.Doszhanov - 1 year ago 64
iOS Question

Google Maps Kit. Whether some external point lieing on the drawn route from A to B

For example, in the Google Map Kit for iOS I have a two points, those are start point A, and destination point B and route drawn between them. Suppose that there is some external point C. I need to know whether point C lieing(included) on the route between A and B or not.

Answer Source

Yes, thanks to all of you. I'have already found the solution. When you make a request like a draw route between A and B, GMapKit returns json, with the following format routes[legs[steps[...]]]. So steps[] contains each step existing in the route, it is straight line actually from one point to another. https://developers.google.com/maps/documentation/directions/intro?hl=ru#Steps. So, my solution is to compare sought point's lat and long with lat and longs of each step in the route.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download