开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜