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

Map covering scaffold app bar [android] [bug] #1008

Closed
SwiftyFlow opened this issue Apr 19, 2022 · 14 comments
Closed

Map covering scaffold app bar [android] [bug] #1008

SwiftyFlow opened this issue Apr 19, 2022 · 14 comments
Labels

Comments

@SwiftyFlow
Copy link

SwiftyFlow commented Apr 19, 2022

I have the map covering the app bar only on Android & it actually do not reach the bottom either...

Any idea?

return Scaffold(
      appBar: AppBar(
        title: Text(
          AppName,
          style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 19),
        ),
      body: Provider.of<UserProvider>(context, listen: true).showingMap
          ? Stack(
              alignment: Alignment.topCenter,
              children: [
                Stack(
                  alignment: Alignment.center,
                  children: [
                    MapboxMap(
                      accessToken: token,
                      styleString: getStyle(),
                      initialCameraPosition: const CameraPosition(
                        zoom: 1.0,
                        target: LatLng(10.508, 46.048),
                      ),
                      attributionButtonMargins: const Point(-100, -100),
                      myLocationEnabled: true,
                      logoViewMargins: const Point(-100, -100),
                      onMapCreated: (MapboxMapController controller) async {
                        mapController = controller;
                        controller.onCircleTapped.add(_onCircleTapped);

                        await getUserPoint();
                      },
                      onMapClick: (Point<double> point, LatLng coordinates) {
                        if (_pointDetailsToShow) {
                          setState(() {
                            _pointDetailsToShow = false;
                          });
                          return;
                        }
                      },
                    ),
@SwiftyFlow
Copy link
Author

SwiftyFlow commented Apr 19, 2022

used this

extendBodyBehindAppBar: true,

at least now it the proper size but it has to be removed as now it covers all the screen

@SwiftyFlow
Copy link
Author

What I get if MapboxMap(...) is in:
Screenshot_20220420-094718

What I get if remove it:
Screenshot_20220420-094837

Kinda what I want (dirty merge on photoshop hahaha):
Screenshot_20220420-094837 copy

How can send back the MapboxMap(...) or make it fit the space?

@SwiftyFlow SwiftyFlow changed the title Map covering scaffold app bar (android) Map covering scaffold app bar [android] [bug] Apr 20, 2022
@SwiftyFlow
Copy link
Author

I should add that I can tap the buttons (hidden by the map) through the map. BUT I couldn't notice since the map actually always shows over the full app if I render it once. If I wrap it in a SafeArea() then it does not reach the bottom (allowing me to see a bit what's happening behind it, hence how I figured out it was ALWAYS showing) One more bug or weird thing happening is that if I swipe to another opened app and come back then it's the bottom buttons not showing anymore and the map is finally inside the scaffold's body BUT if going to another screen the map is still showing over.

It's basically the unique thing retaining me from releasing the app. It's getting a bit frustrating as everything else works perfectly if I don't put it in... (and why only on Android?)

@SwiftyFlow
Copy link
Author

SwiftyFlow commented Apr 20, 2022

SOLVED:

You have to add to replace

private` final MapboxMapOptions options = new MapboxMapOptions().attributionEnabled(true);

by

private final MapboxMapOptions options = new MapboxMapOptions().textureMode(true).attributionEnabled(true);

in MapboxMapBuilder.java line 17

I do NOT close with this comment (waiting for answer) as now I get 1000s of print and it still doesn't feel right. Also fixing 2 days of struggle with only .textureMode(true) added seams sus...

@Albertbol
Copy link

Hey, any update on this? Is it an approved solution that should be merged?

@FlorentPottevin
Copy link

Same guy as swiftyflow (never able to login on my phone 😅) this last bit worked for me and I never had the issue thereafter. Clean aWay seems to be fine on both iOS and android. I didn’t close to get whoever’s attention on it…

@torbenf
Copy link

torbenf commented May 16, 2022

I'm having the same issue, doing as @SwiftyFlow said helped.

@Albertbol
Copy link

Nice thanks, but I wondered if this solution will be actually accepted and released by contributors. 😎

@stale
Copy link

stale bot commented Jul 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 16, 2022
@ghost
Copy link

ghost commented Jul 16, 2022

Up

@stale stale bot removed the stale label Jul 16, 2022
@ntatko
Copy link

ntatko commented Jul 27, 2022

SOLVED:

You have to add to replace

private final MapboxMapOptions options = new MapboxMapOptions().attributionEnabled(true);

by

private final MapboxMapOptions options = new MapboxMapOptions().textureMode(true).attributionEnabled(true);

in MapboxMapBuilder.java line 17

I do NOT close with this comment (waiting for answer) as now I get 1000s of print and it still doesn't feel right. Also fixing 2 days of struggle with only .textureMode(true) added seams sus...

@SwiftyFlow Where does MapboxMapBuilder.java live? I don't see it anywhere in the /android directory of my flutter project, which is where I would assume that it is....

@marcobraghim
Copy link

marcobraghim commented Aug 17, 2022

SOLVED:

You have to add to replace

private` final MapboxMapOptions options = new MapboxMapOptions().attributionEnabled(true);

by

private final MapboxMapOptions options = new MapboxMapOptions().textureMode(true).attributionEnabled(true);

in MapboxMapBuilder.java line 17

I do NOT close with this comment (waiting for answer) as now I get 1000s of print and it still doesn't feel right. Also fixing 2 days of struggle with only .textureMode(true) added seams sus...

It works for me, thank you

@ntatko you need to clone the entire project and then you will find this file at android/src/main/java/com/mapbox/mapboxgl/MapboxMapBuilder.java (on the cloned repository)

cfregin pushed a commit to cfregin/maps that referenced this issue Aug 25, 2022
@MuhammadMusa22
Copy link

SOLVED:

You have to add to replace

private` final MapboxMapOptions options = new MapboxMapOptions().attributionEnabled(true);

by

private final MapboxMapOptions options = new MapboxMapOptions().textureMode(true).attributionEnabled(true);

in MapboxMapBuilder.java line 17

I do NOT close with this comment (waiting for answer) as now I get 1000s of print and it still doesn't feel right. Also fixing 2 days of struggle with only .textureMode(true) added seams sus...

This worked for me

@stale
Copy link

stale bot commented Oct 26, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants