mapbox-maps-flutter
mapbox-maps-flutter copied to clipboard
MapBox is black after using MapBox Standard style (Recommended style)
When I use the street or any other map style it works fine.
But if I go to the studio, and I create a style what they say is the recommended style, it gives me a black screen. No error, nothing, just black.
And then some will say, why not use an other style. Yeah I do right now, but the standard style has everything in 3D and I think it looks cool, and is useful for my application, to see the buildings how tall they are.
Anyone any idea how to fix this, or what the problem is?
Hi @Tristannos, Mapbox Standard requires Mapbox Maps SDK v11, whereas the Mapbox Maps Flutter plugin is still based on v10. We are working on an update to v11, please stay tuned!
Looking forward to seeing this fixed too!
we just published v1.0.0-beta.1 of Mapbox Maps Flutter (https://pub.dev/packages/mapbox_maps_flutter) that supports Mapbox Standard, it's currently in pre-release and we'd love it if you could try it out.
@baleboy
we just published v1.0.0-beta.1 of Mapbox Maps Flutter (https://pub.dev/packages/mapbox_maps_flutter) that supports Mapbox Standard, it's currently in pre-release and we'd love it if you could try it out.
I checked it out, but for some reason it's not working for me. I updated it to the pre-release.
When I enter this as my map style styleUri: MapboxStyles.STANDARD
I get this screen:
When I enter my own style, that is the standard map style I get this:
Can you share how you load the style, or even better a full code sample to reproduce the issue?
@baleboy I have something weird now, if I go back to my old style, even than I get the black screen now.
Has it something to do that the ResourceOptions(accessToken:)
was removed?
Here is my code:
MapWidget(
key: key,
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[new Factory<OneSequenceGestureRecognizer>(() => new EagerGestureRecognizer())].toSet(),
cameraOptions: CameraOptions(
center: Point(coordinates: Position(currentLocation.coords.longitude, currentLocation.coords.latitude)).toJson(),
zoom: 6
),
// styleUri: MapboxStyles.STANDARD,
// styleUri: 'mapbox://styles/tristanjurjens/clpwp5zsc01ih01pa37smenle',
styleUri: 'mapbox://styles/tristanjurjens/clpvwd6jf01hv01pk3ellgfy0',
// styleUri: 'mapbox://styles/tristanjurjens/clpwp5zsc01ih01pa37smenle',
// resourceOptions: ResourceOptions(accessToken: "pk.eyJ1IjoidHJpc3Rhbmp1cmplbnMiLCJhIjoiY2xmMWR6emV1MDdrdTQxbnZpOXBwaGtmZSJ9.Df-dGqFKoBjXUe7GMLo4pw"),
onMapCreated: onMapCreated,
)
Regarding ResourceOptions being removed @Tristannos, MapboxOptions.setAccessToken(ACCESS_TOKEN);
is now the only way to do it with the API. External is better, hence their direction.
we just published v1.0.0-beta.1 of Mapbox Maps Flutter (https://pub.dev/packages/mapbox_maps_flutter) that supports Mapbox Standard, it's currently in pre-release and we'd love it if you could try it out.
Loving it so far. I tried to comb the API yesterday and couldn't see anything for modifying the standard style lightPreset
. I see the iOS API has it present in the corresponding beta dependency for iOS. I also tried to comb the definitions of the beta flutter files, but no luck.
Is there any way to modify the equivalent 'config properties' for the basemap
to change the standard light preset?
Other than that, I've had no problems with your pre-release so far @baleboy
@baleboy I have something weird now, if I go back to my old style, even than I get the black screen now.
Has it something to do that the
ResourceOptions(accessToken:)
was removed?Here is my code:
MapWidget( key: key, gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[new Factory<OneSequenceGestureRecognizer>(() => new EagerGestureRecognizer())].toSet(), cameraOptions: CameraOptions( center: Point(coordinates: Position(currentLocation.coords.longitude, currentLocation.coords.latitude)).toJson(), zoom: 6 ), // styleUri: MapboxStyles.STANDARD, // styleUri: 'mapbox://styles/tristanjurjens/clpwp5zsc01ih01pa37smenle', styleUri: 'mapbox://styles/tristanjurjens/clpvwd6jf01hv01pk3ellgfy0', // styleUri: 'mapbox://styles/tristanjurjens/clpwp5zsc01ih01pa37smenle', // resourceOptions: ResourceOptions(accessToken: "pk.eyJ1IjoidHJpc3Rhbmp1cmplbnMiLCJhIjoiY2xmMWR6emV1MDdrdTQxbnZpOXBwaGtmZSJ9.Df-dGqFKoBjXUe7GMLo4pw"), onMapCreated: onMapCreated, )
I'm having the same issues regarding the resourceOptions removed where now I just get a blank page - even when passing in my public key to the launch.json
I'm assuming we use mapboxOptions: MapboxOptions.setAccessToken(ACCESS_TOKEN); now? or am i way off with that implementation? bc that didnt work for me
Cheers!
Also if anyone has a link to a working version of 5.1 or 4.5 that would be awesome because I tried forking those repositories but encountered errors (even in the example project) but everything worked perfectly when drawing directly from the pubdev packages