When migrating from com.google.android.gms:play-services-maps:18.0.2 to com.google.android.gms:play-services-maps:18.2.0, my shapes suddenly started to appear
behind the buildings and road labels, like this:
As you can see, both the lines (solid black, no transparency) and the area (solid green, no transparency) of this polygon is behind the buildings and labels.
Using version 18.0.2 of the library, this was not a problem. The polygon would then look like this:
Is this a bug in the new library version, or is it supposed to be like this? And is so, how can I get my shapes in front of the buildings and labels again? I tried using setZIndex(), but that did not help.


Use the
setBuildingsEnabled(boolean)method and set it tofalseThere's an existing bug filed in the Google Public Issue tracker about this. And comment #7 states that this is working as intended with a workaround to disable the 3D buildings using the public method
setBuildingsEnabled(boolean).So in Kotlin, adding the following code to your
onMapReady()should fix the issue with the SDK using theLATESTrenderer / versions18.2.0and up (which uses theLATESTrenderer by default. (See for more info: https://developers.google.com/maps/documentation/android-sdk/renderer)Or you can also use the following in Kotlin:
This should prevent the overlay from overlapped by buildings again since they were disabled.