Such a task, there is a map, a path is laid on it. I need to determine whether I am on a paved path, that is, the point of my location touches the path. By "do I" - I mean the GPS data. How to do it?
1 answer
You can use isLocationOnEdge :
To determine whether it is a polygon, or a polygon, or a polygon, it can be used to google.maps.geometry.poly.isLocationOnEdge () . Returns to the point where the line returns to the specified tolerance.
Free translation:
To determine whether a point lies on a curve or near the edge of a polygon, pass a point, a curve / polygon, and optionally an error value in degrees to google.maps.geometry.poly.isLocationOnEdge (). The function returns true if the distance between the transferred point and a point on the line or edge of the polygon satisfies the condition with the specified error.
|