Path,Roads are black in Google Maps Flutter
Asked Answered
C

3

7

when I zoom 14 and more lines look black. When less 14, It is okay.

Image 1

Image 2

  @override
  Widget build(BuildContext context) {
    return GoogleMap(
      onMapCreated: (controller) {
        _googleMapController = controller;
        // rootBundle.loadString('assets/map_style.txt').then((value) {
        //   mapStyle = value;
        //   _googleMapController.setMapStyle(mapStyle);
        // }).catchError((e) {
        //   log(e.toString());
        // });
      },
      zoomControlsEnabled: false,
      liteModeEnabled: false,
      minMaxZoomPreference: const MinMaxZoomPreference(1, 20),
      mapToolbarEnabled: false,
      trafficEnabled: false,
      initialCameraPosition: CameraPosition(
        target: widget.userLocation,
        zoom: 13,
      ),
      
      markers: {
        Marker(
          markerId: const MarkerId('userLocation'),
          position: widget.userLocation,
          icon: BitmapDescriptor.defaultMarkerWithHue(
            BitmapDescriptor.hueRed,
          ),
          
        ),
      },
    );
  }

I tried to set map style and change some properties but didn't work.

Corinnecorinth answered 11/12, 2023 at 17:28 Comment(1)
This seems to be already fixed on the new map renderer as per this bug in the issue tracker: issuetracker.google.com/issues/295677329Hoekstra
C
8

Faced same problem, try run it on real device. I have this bug only on emulator, real device works fine.

Crossbow answered 22/12, 2023 at 14:14 Comment(2)
This issue would also be fixed when using an emulator with Google Play. Since the fix for the black roads were addressed with the LATEST renderer. You can check out the prerequisites I mentioned in this answerHoekstra
@Hoekstra is correct, logging in in play services and updating the google play service fix the issue.Breazeale
L
1

The issue is an outdated version of "Google Play services", and this cannot automatically update on the emulator due to Google Play not being available.

Two solutions:

  1. Use Emulators with Google Play installed. This would auto update the play library.
  2. If you do not want Google Play, you may chose to use an API 35, which comes with a version of the library that is not affected.

Not recommended: Manually updating the "Google Play services" at your own risk.

Loxodromic answered 21/7, 2024 at 20:1 Comment(0)
B
0

If you change to a new device for the emulator with a newer version of Android, you will no longer have this problem.

Bainter answered 10/6, 2024 at 0:1 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.