Hi all
I have a GoogleMap with a certain zoom level and bearing. I also have a marker with specific coordinates that must appear visually at 50% of the screen width (horizontally centered) and 25% from the bottom (vertically). The marker represents a moving vehicle, and its position must remain fixed at that exact point on the screen, while the map is allowed to rotate to always show the driving direction, and the zoom level can change freely.
How can I determine, at each location update, the correct CameraPosition to achieve this result?
With a bearing of 0, I managed to get it right, but at other angles, complex trigonometric calculations come into play. After three days of pure madness with ChatGPT, I only got approximate results, not the precise behavior I need.
Is there anyone here with solid expertise in this area?
I have a GoogleMap with a certain zoom level and bearing. I also have a marker with specific coordinates that must appear visually at 50% of the screen width (horizontally centered) and 25% from the bottom (vertically). The marker represents a moving vehicle, and its position must remain fixed at that exact point on the screen, while the map is allowed to rotate to always show the driving direction, and the zoom level can change freely.
How can I determine, at each location update, the correct CameraPosition to achieve this result?
With a bearing of 0, I managed to get it right, but at other angles, complex trigonometric calculations come into play. After three days of pure madness with ChatGPT, I only got approximate results, not the precise behavior I need.
Is there anyone here with solid expertise in this area?