You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far, we’ve rationalized this inconsistency by treating the navigation style default as one of the niceties that comes out of the box when using NavigationViewController. It’s trivial for a developer to set the style independently, but admittedly it’s a step that’s easy to overlook. Indeed, even the example application in this repository is somehow still using the Streets style.
More consistency would be nice, but I think it would be fairly tricky to implement. NavigationMapView is merely a subclass of MGLMapView, which allows the developer to set the style URL by passing it into init(frame:styleURL:), decoding it from an archived object, or setting the Style URL inspectable property in Interface Builder. In the inspectable case, the style URL doesn’t get applied until an arbitrary moment after decoding but before appearing.
For now, let’s encourage developers using a standalone NavigationMapView to consider using it in conjunction with a StyleManager, which can not only default to a navigation style but also default to the day or night style as appropriate.
Hey, noob here. Is there any documentation on how to use style manager for the standalone map?
In my set up, I have defined a navigation map view that is shown before presenting the navigation view controller (alias standalone map). I applied custom styles that conform to DayStyle and NightStyle (alias StyleManager?) that are passed to the navigation view controller but these changes do not affect the standalone.
I'm aware that I can change the standalone map style by using .mapboxMap.loadStyleURI() but this does not dynamically conform to day and night modes.
Alternatively, I noticed that a previewMapStyleURL is customizable in style manager. Documentation describes this as "URL of the style to display on the map when previewing a route." I think being able to access the preview map could potentially replace my standalone map especially if preview map can also act as my map view for other use cases such as search/annotations.
Currently when creating standalone
NavigationMapView
styleURL
is set to mapbox://styles/mapbox/streets-v11.In case when creating
NavigationViewController
NavigationMapView
setsstyleURL
to mapbox://styles/mapbox-map-design/ckd6dqf981hi71iqlyn3e896y.In both cases the same
styleURL
should be used, which isnavigationDayStyleURL
.The text was updated successfully, but these errors were encountered: