0

This question is specifically for Android, but I understand JavaScript as well.
In the image below, A,B and C are known Google Maps coordinates.
I need to find out the coordinate of point X.
The coordinate of point X is the place where the line between A and B is closest to point C.

Is there a way to find X?

enter image description here

George I.
  • 560
  • 2
  • 7
  • 26
  • take a look at this, seems like what you are asking https://stackoverflow.com/questions/35746224/google-map-api-v-3-find-nearest-point-from-one-point-to-point-on-polyline – Angel Koh Aug 11 '17 at 03:12

1 Answers1

0

Use 'google.maps.geometry.poly.isLocationOnEdge()' to find out if X is close or on a polyline or polygon.
Pass the C coordinate, A-B points as polyline and a tolerance value - which sets the maximum distance from the polyline is X. It returns true or false.
The actual coordinate of X is not found, but this is what I was actually looking for.

https://developers.google.com/maps/documentation/javascript/geometry

George I.
  • 560
  • 2
  • 7
  • 26