Z
Z
zlodiak2018-07-29 23:21:08
JavaScript
zlodiak, 2018-07-29 23:21:08

How to calculate panorama view direction?

There is a marker on the map, according to some event, the panorama closest to it is searched. Let's say the panorama was found and opened. But there is no guarantee that the user will see the house that matches the marker. Most likely, for this he will have to independently rotate the panorama.
5b5e218d8b514506739548.png
The documentation has an example of setting the panorama view direction. But it's not clear to me what mathematical formula can be used to calculate the direction I need (so that the panorama looks in the direction of the marker for which it was searched).
Please teach me how to do it. Or at least give links to similar examples.
pS:
As far as I understand, it is not enough to substitute the value of the marker coordinates in the direction. You need to calculate the rotation in azimuth.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Moskus, 2018-07-30
@Moskus

Azimuth: https://en.wikipedia.org/wiki/Azimuth
But it will not help you much, because the house can be quite large, and you probably do not know exactly which part of the house to point to.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question