Search code examples
androidgoogle-mapskmltile

Using Google Maps KML Importing Utility on top of a custom tile


I need to add a customTile and a kmlLayer to a googleMap. What I´m looking for is a way of setting the z-index of the kmlLayer, in order to see my customTile and the kmlLayer on top of the tile. Currently the kmlLayer is under the tile.


Solution

  • Because kmlLayer has no managed Z-Index property and seems it set by default to 0, you can use workaround: set Z-Index to -1 for your custom TileOverlay:

    TileOverlay tileOverlay = mGoogleMap.addTileOverlay(new TileOverlayOptions()
                .tileProvider(tileProvider)
                .zIndex(-1));