Closed nexttrack07 closed 1 month ago
I tried using navigationController.cleanup()
to see if that would help. But that made all the maps get stuck in Europe again. Using the cleanup
method on any map affected all the other maps. Any guidance on how to use it correctly would be appreciated.
This is blocking us from upgrade because we have 2 map instances one to show route overview and another for navigation. With this issue, the Navigation screen is still showing the route overview. Is there a way to make the instances independent of each other.
This is blocking us from upgrade because we have 2 map instances one to show route overview and another for navigation. With this issue, the Navigation screen is still showing the route overview. Is there a way to make the instances independent of each other.
@akilakumarasamy
If I understood your problem right,
when using NavigationView
, the active navigation session is inherently bound to all views that are using the NavigationView. This is expected behaviour of the NavigationView
. This means that if you have multiple map instances, such as one for route overview and another for active navigation, they will both reflect the state of the active navigation session.
However, you can manage these views independently by controlling their navigation UI behavior. After initializing navigation, you can call NavigationViewController
's setNavigationUIEnabled(false)
method on the view that should not show the active navigation UI. This will disable the automatic updates related to the navigation session for that particular view, allowing it to remain as a route overview while the other instance handles active navigation.
Hey @jokerttu - In our case, we have the Route overview page which has the map and then a navigation page which has another map instance.
In the scenario that you're describing, if we disabled the auto updates on the Route overview page then the Route overview page will not reflect any (navigationController) actions taking place in the navigation page.
However, the navigation page will still receive (navigationController) actions that take place in the Route overview page.
We want the pages to be completely independent of each other. Is this possible?
Note: I did set the navigationViewController.setNavigationUIEnabled(false)
on the Route overview page and it still caused the above issue. Once we visited the Route page and destinations are set on the Route page, the same destinations appeared on the navigation page.
I've created a new feature issue (#254) that should address and resolve this problem. Please follow the new issue for updates, and we’ll close this once the new feature is implemented.
SDK version: 0.4.3
Using the
navigationController
to set destinations sets the destinations on all the instances of the map. This can easily be reproduces in the example app as well.This above code is in the
NavigationScreen
component in the example app. Our production app has something similar. Now when you navigate to theMultipleMaps
screen you can see the destinations set in those maps too however you don't see the markers (because that is using mapViewController and not navigationController).You can also reproduce this by setting a destination in map1 in the
MultipleMaps
screen and then noticing that the same destination is set in map2 as well.We have two separate instances of the map in our application and we need them to work independently of each other without any interference between the two.