mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

MapBox is black after using MapBox Standard style (Recommended style)

Open Tristannos opened this issue 1 year ago • 9 comments

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?

image

IMG_4299

Tristannos avatar Dec 20 '23 14:12 Tristannos

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!

baleboy avatar Dec 21 '23 04:12 baleboy

Looking forward to seeing this fixed too!

AntoineRondelet avatar Dec 24 '23 09:12 AntoineRondelet

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 avatar Jan 09 '24 13:01 baleboy

@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: IMG_4539

When I enter my own style, that is the standard map style I get this:

IMG_4540

Tristannos avatar Jan 09 '24 14:01 Tristannos

Can you share how you load the style, or even better a full code sample to reproduce the issue?

baleboy avatar Jan 09 '24 16:01 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,
          
         )

Tristannos avatar Jan 09 '24 20:01 Tristannos

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.

geoffreygarrett avatar Feb 14 '24 18:02 geoffreygarrett

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

geoffreygarrett avatar Feb 15 '24 12:02 geoffreygarrett

@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

Mikecelium avatar Mar 01 '24 14:03 Mikecelium