[GIS] Set ZIndex for Google Fusion Tables in Google Maps API

google mapsgoogle-fusion-tables

Is there any way to set the ZIndex of a Google Fusion Table layer in the Google Maps API? I have several Fusion layers added as overlays to a map with the ability to turn them on and off. I want certain layers to always be ontop if they are on, however Fusion Tables/Google Maps just renders them in the order that they are drawn.

For example:

Layer 1 starts On.
Layer 2 starts Off. Layer 2 should Always be on top if it is being shown.

Click Layer 2 On, and it is on top.
Now, click Layer 1 Off and the On again, and now it is on top as it is the most recent layer drawn.

I'd ideally like to set the ZIndex of Layer 2 to higher than Layer 1 so that it is always on top, but there doesn't seem to be a way to do this. Any ideas?

Best Answer

I don't see a method for doing this in the Google Maps API v3 reference, and that lack appears to be confirmed by this comment from a Google employee:

https://groups.google.com/d/msg/google-maps-js-api-v3/ovT1ekQ-HGQ/k-b8BSxCCjAJ

FusionTablesLayer (and KmlLayer & co) don't have the ability to re-order based on z-index.

There is an active feature request for adding sorting by Z-Index for KML layers here: http://code.google.com/p/gmaps-api-issues/issues/detail?id=2804

I am not aware of a corresponding feature request for FusionTableLayer objects, although perhaps the solving of one would facilitate the solving of the other.

Related Question