Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer
    
That's what I figured. Thanks. –  Josh May 17 '12 at 2:53
1  
I've worked around this with some clunky code to associate each possible layer with a Z value, then whenever a layer is added check which currently active layers have a higher Z value, delete them and redraw them in order. Which is obviously inefficient. –  Hugh Stimson May 30 '12 at 18:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.