mamtach
mamtach

Reputation: 88

flutter-mapbox-gl Style is not coming

"I"m integrating MapBox in my existing flutter app, and I am able to see the Map, and can hover over the map, it changes it coordinates and other embedded features. However, the style is not coming, ie, map is not displayed properly. I am just trying to get the minimum workable Map, so I can add desired features on top of that.

When I run the code as it is, from https://github.com/tobrun/flutter-mapbox-gl , as a new project on IntelliJ Idea, it all looks fine. So it seems like, style is missing, but I can't figured out what else to include.

I copied map_ui.dart code in my class, and calling the class from home page of our flutter app.

Apart of this, I added, mapbox_gl: ^0.0.3 dependency in pubspec.yaml file

I expect the following Output Map . However, my code is displaying the following Current Map

Flutter Mapbox GL Native

[edit:] Updated the current screen shot, after wrapping the widget in a Scaffold

Upvotes: 0

Views: 1610

Answers (2)

Have you given access by an api key in Mapbox portal and integrated to your project?

Secret token

To access platform SDKs you will need to create a secret access token with the Downloads:Read scope and then:

to download the Android SDK add the token configuration to ~/.gradle/gradle.properties : SDK_REGISTRY_TOKEN=YOUR_SECRET_MAPBOX_ACCESS_TOKEN

to download the iOS SDK add the token configuration to ~/.netrc : machine api.mapbox.com login mapbox password YOUR_SECRET_MAPBOX_ACCESS_TOKEN

You must grant your token to use your style created in Mapbox Manager Portal

Hype this helps

Upvotes: 0

mamtach
mamtach

Reputation: 88

So after wrapping the widget in a Scaffold, this is looking good now! And, I had to zoom in a bit to see the image.

Latest Screen Shot

Upvotes: 0

Related Questions