Google Map text style appears different on Android than in the Styling Wizard

157 Views Asked by At

I created a Google Maps style in the styling wizard (https://mapstyle.withgoogle.com/) that does not produce the same result in my Android app as it appears in the wizard. The text labels appear bulky as if they have a large weight.

Here is the json copied from the Styling Wizard into my app:

[
  {
    "elementType": "labels.text",
    "stylers": [
      {
        "color": "#ffffff"
      },
      {
        "visibility": "off"
      },
      {
        "weight": 0.1
      }
    ]
  },
  {
   "featureType": "landscape",
    "elementType": "geometry",
    "stylers": [
      {
        "color": "#474644"
      }
    ]
  },
  {
    "featureType": "poi",
    "elementType": "geometry",
    "stylers": [
      {
        "color": "#626061"
      }
    ]
  },
  {
    "featureType": "poi.park",
   "elementType": "geometry",
    "stylers": [
      {
        "color": "#626061"
      }
    ]
  },
  {
    "featureType": "poi.park",
    "elementType": "labels.text",
    "stylers": [
      {
        "visibility": "on"
      }
    ]
  },
  {
    "featureType": "road",
    "elementType": "geometry",
    "stylers": [
      {
        "color": "#666666"
      }
    ]
  },
  {
    "featureType": "road",
    "elementType": "labels.text",
    "stylers": [
      {
        "visibility": "on"
      }
    ]
  }
]

Here is how the map appears in the Styling Wizard: Google Styling Wizard

and here is the result in my Android app: Android styled map

1

There are 1 best solutions below

0
InnisBrendan On

I was able to resolve this by adding stylers to my json in my Android app that sets the visibility of all label text fills to off

{
     "elementType": "labels.text.fill",
     "stylers": [
       {
         "visibility": "off"
        }
     ]
}