mapbox / mapbox-navigation-ios

Turn-by-turn navigation logic and UI in Swift on iOS
https://docs.mapbox.com/ios/navigation/
Other
861 stars 311 forks source link

[Bug]: Setting Map style type error #4691

Closed maikelsgit closed 2 months ago

maikelsgit commented 2 months ago

Mapbox Navigation SDK version

3.1.1

Steps to reproduce

Apply a map style to a Map according to the SwiftUI guide (https://docs.mapbox.com/ios/maps/api/11.2.0/documentation/mapboxmaps/swiftui-user-guide#Setting-Map-style). Map().mapStyle(MapStyle(uri: StyleURI(rawValue: "mapbox://...")!))

Expected behavior

Map with the style from the styleURI

Actual behavior

Xcode compile error: Cannot convert value of type 'MapboxMaps.MapStyle' to expected argument type '_MapKit_SwiftUI.MapStyle'

Is this a one-time issue or a repeatable issue?

repeatable

maikelsgit commented 2 months ago

I figured it out. You have to add the .mapStyle modifier directly after the Map > Map() {}.mapStyle(). I had other modifiers before the .mapStyle() modifier