google maps v3 javascript
I have an object that contains an array of all Latlng's within a route (overview_path array) I have a GPS device that is expected to move along that defined route. If this device aparts from the route X meters we can consider it out of route.
I've been thinking that setting a circle around my gps device will intersect the route. Circle radius will be the size of X meters, which are the allowed tollerance distance to consider the device still within the route.
If intersection responses with more than 1 Latlng elements, gps device still in path. If intersection responses with zero, gps device is out of route.
How to intersect a circle and a polyline?
Is there a better way to evaluate this requirement?
Thanks to all!! :)