When you switch MapViews, make sure to resume them. Also, you need to add/remove the LocationIndicator
yourself. During navigation you can swap the MapView
instance (if needed):
public void swapMapView(MapView newMapView) {
if (isVisualNavigatorRenderingStarted) {
visualNavigator.stopRendering();
mapView = newMapView;
customLocationIndicator.enable(mapView);
customLocationIndicator.setLocationIndicatorStyle(LocationIndicator.IndicatorStyle.NAVIGATION);
visualNavigator.setCustomLocationIndicator(customLocationIndicator);
visualNavigator.startRendering(mapView);
} else {
this.mapView = newMapView;
}
}
Make sure to set the indicator also to the VisualNavigator
.
There is an example app that shows how to use custom location indicators:
https://github.com/heremaps/here-sdk-examples/tree/master/examples/latest/navigate/android/NavigationCustom