Closed ivensgoncalves closed 1 year ago
@ivensgoncalves Thanks for the question.
There is currently no way to achieve achieve what you are asking for in a smooth way. With the Street
camera controls the Viewer always centers the Viewpoint when moving to a new image.
It is possible to change the viewpoint non-smoothly programatically using the Viewer.setCenter
method method (see the Viewer - Core Functionality - Viewpoint example), e.g. every time after a new image has been selected and the viewer has stopped moving (see the image
and moveend
events). For your use case I do not think that would result in a particularly nice behavior though. Also, with the Street
camera controls active there is always the "risk" that it will bounce back towards the center depending on the undistortion model for the current image as well as the aspect ratio of the current image and the viewer container.
The proper solution (which is significantly more time consuming) is to add a new type of freer camera control that does not bounce towards the center of the image and maintains a lookat vector relative to the center of the image when transitioning between images. That camera control would be implemented as a new state next to the TraversingState
which is the backing implementation for the Street
camera controls.
@oscarlorentzon Thank you for your detailed explanation.
I will try to follow your suggestion.
Basic information
MapillaryJS version:
4.1.1
When Mapillary instance dimension has larger width size compared to height size, image does apply "css cover effect" and street gets hidden for some images, having the impression camera is pointing to the sky.And when user "corrects" the camera position, when he/she clicks the forward arrow, mapillary does re-center vertically the camera again. Is there a way to "keep" the angle of the camera when you move forward or backward?
I am aware of the
LetterBox
RenderMode, but I was trying to find a solution for full width render.So, basically my 2 questions are:
Thanks in advance.
Steps to Reproduce Behavior
Code Sample
https://codesandbox.io/s/zealous-shadow-mwcrp9 (Open in new window to visualize it better)
Additional information