I’m adding 2 overlays – a Demographics Layer and a Fusion Tables Layer – to a Google Map. The problem is that I need to order these layers so the Fusion Tables Layer is always on top of the Demographics Layer. It seems that whichever one I call “setMap(map)” on last is on top, but I have functionality for toggling the Demographics Layer on or off using setMap(null) and setMap(map)… but whenever it is toggled on using setMap(map), it shows up on top of the Fusion Tables Layer.
if (checkbox.checked) {
demolayer.setMap(map); //added on top
} else {
demolayer.setMap(null);
}
Is there another way to order overlays besides making sure you call setMap(map) on the layer you want on top last? I’ve tried z-index properties with no luck. Any help is much appreciated.
You wrote:
Not that I have seen. The work around is to always remove both layers and add both back in the order you want them displayed.
You might want to “star” these enhancement requests or adding a new one (I don’t see a general “allow control relative z-index of layers” enhancement request):