Closed nexttrack07 closed 1 month ago
Hey @nexttrack07. I incorrectly stated earlier that this is not possible. Sorry about that.
You can recenter the camera programmatically by calling setFollowingPerspective
function of the NavigationViewController
. Which ever perspective you choose, the camera will recenter at the same time.
Let us know if this works for you!
Thanks. We are on 0.3.3-beta and the setFollowingPerspective
function does not cause the camera to follow the user. Is this fixed in the new 1.0.0-beta
release?
@nexttrack07 At least in my testing it seems to work. You can test it with the new version (btw. we changed the version number from 1.0.0-beta
to 0.4.0-beta
) however it's not yet available on the npm. Only here on github for now.
@illuminati1911 - Hey thanks for responding. However, I retested with the old version (0.3.3-beta) and the latest version (0.4.0) and it doesn't seem to work in either one.
Here are the steps to reproduce in the latest example app:
Show Route Overview
- This will cause camera to zoom out and show the entire view but simulation will continuesetFollowingPerspective
(any of the three options) - This does not zoom in to the user and follow simulationThis is a critical bug for and we are eagerly awaiting your response. Our app release is very soon and we'd like to see if this is something we can fix.
Just to re-iterate the request: You can see in the photos that the map is zoomed out and camera doesn't follow simulation. The user will need to manually click on the re-center button in order to achieve this. We want to be able to do this programmatically.
For iOS the camera mode needs to be set back to following:
setFollowingPerspective(CameraPerspective.TOP_DOWN_HEADING_UP);
setCameraMode(CameraMode.FOLLOWING);
I believe that API is specific to the iOS Navigation SDK, see https://developers.google.com/maps/documentation/navigation/ios-sdk/camera#automatically_recenter_the_map
setCameraMode is not currently exposed by the React Native Navigation SDK.
The map is not following the user's location during turn-by-turn navigation is a critical issue with the navigation functionality. This behavior is essential for the core functionality of the navigation project. Without this, the navigation experience is significantly compromised, making the application effectively unusable for its intended purpose. This issue is a major blocker for our project's launch, and we are unable to proceed without a resolution. We would greatly appreciate for a fix or a viable workaround to address this problem.
After using either
moveCamera
orshowRouteOverview
, is it possible to programmatically recenter the map instead of expecting the user to click on the recenter button?After either of those functions are called, the user is not centered and following the navigation path unless he clicks on
Re-center
Thanks