How to show overlay only in specific base layer?
I use OpenLayers v2.8 mapping library and I have multiple base layers and one overlay. That overlay is available with all the base layers, how do I put this overlay only to a specific base layer? I imagine it this way: when the right base layer is selected, overlay is shown, otherwise overlay is unavailable in the LayerSwitcher panne开发者_如何学JAVAl.
Found a workaround for this: I use changebaselayer event on the OpenLayers.Map object to check if specific layer is displayed and the, enabling the specific overlays for it. Not enabling, actually when overlay is selected it triggers an event which checks if needed base layer is displayed, in this case, overlay is permitted to show himself.
精彩评论