Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone and NavigationMapView inside NavigationViewController should use the same styleURL. #2551

Open
MaximAlien opened this issue Aug 18, 2020 · 2 comments
Assignees
Labels
bug Something isn’t working UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.

Comments

@MaximAlien
Copy link
Contributor

Currently when creating standalone NavigationMapView styleURL is set to mapbox://styles/mapbox/streets-v11.
In case when creating NavigationViewController NavigationMapView sets styleURL to mapbox://styles/mapbox-map-design/ckd6dqf981hi71iqlyn3e896y.

In both cases the same styleURL should be used, which is navigationDayStyleURL.

@MaximAlien MaximAlien added bug Something isn’t working UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. labels Aug 18, 2020
@MaximAlien MaximAlien self-assigned this Aug 18, 2020
@1ec5
Copy link
Contributor

1ec5 commented Aug 19, 2020

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.

@samuelalake
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.
Projects
None yet
Development

No branches or pull requests

3 participants