0

I'm trying to draw a bezier curve between two locations on the map.

Here is what I draw but something wrong with the position of bezier control points for some cases. make bezier curve control points at right place on the map

Following the link below, Letting users draw curved lines on a google map?

How do I make the bezier control points dynamically (lat2, long2, lat3, long3) depending on the scale of map?

Any help would be appreciated!

Otani Shuzo
  • 734
  • 1
  • 9
  • 16
  • 2
    Can you show an example of what you want to achieve? – Nico Schertler May 23 '19 at 15:25
  • 1
    Also, can you [better describe](/help/how-to-ask) what you need to do, what you tried, what you thought that would do (and why), what it did instead, and why you think that was wrong? Bonus points for adding images to further illustrate details. – Mike 'Pomax' Kamermans May 23 '19 at 20:40
  • @NicoSchertler sorry, I added my stackoverflow link to the question that I posted yesterday which doesn't get solved yet. What I'm trying to do is drawing a bezier curve between two location points. What I'm struggling with is setting two bezier control points for making bezier curve. – Otani Shuzo May 23 '19 at 20:49
  • Why do you need two control points? It seems as if a quadratic Bezier curve with a single control point in the middle is all you need. Anyway, you should probably calculate all the angle-related stuff in screen space and not in latitude/longitude as the projection can distort angles (depending on what projection is used). Anyway, please make your question self-contained. Try to figure out why your other question did not attract an answer and try to improve your question. – Nico Schertler May 24 '19 at 00:08
  • 1
    I think you want interpolation instead of approximation... See [Interpolation cubic vs. Bezier cubic](https://stackoverflow.com/a/22582447/2521214) you simply convert your `(Xi,Yi)` points into BEZIER control points `(xi,yi)` with the formulas on the end of that answer (formatted as code). Another option is to duplicate your control points. – Spektre May 24 '19 at 07:08

0 Answers0