Hi. How i can create a new marker with offset from another point using bearing and distance? I Need ti create a parallelo line. Thanks paolo
Please provide a more detailed explanation about what you hope to do Paolo. You can not create a parallel line to a Map Marker. A Marker is a single point.
You should be able to draw a LineString from one Marker to another Marker (or point). Draw a parallel line to the LineString you just drew by offsetting the end point coordinates of the LineString or something similar.
Why do you want to do this? Are you creating a navigation solution, rhumb line or what?
Perhaps you might benefit from the advice here Calculate distance and bearing between two Latitude/Longitude points using haversine formula in JavaScript
Parallel to what?
- latitude line?
- longitude line?
- other line?
On the map i record 2 point (marker). From the 2 points i can made a line in the map. I Need to make e new line with offset from this line. I can calcolate the bearing of the line. If i can make a point offset from the first and second point adding 90deg ti the bearing i can find the first and the last point of the new line on the map. I think Is most useful the point offset instead of the line offset
You may need to find the equation of one line parallel to another at a given distance, the earth is almost a sphere, but for small distances you can use the plane.
(here is a video in Spanish, I haven't found it in English or Italian)
a possible solution
This solves the bearing calculation of the green to yellow marker by moving the yellow marker 0.00005 deg. at a time until the bearing 'matches'.