0

我使用 OpenLayers v2.8 映射库,我有多个基础层和一个叠加层。该叠加层可用于所有基础层,我如何将此叠加层仅放置到特定的基础层?I imagine it this way: when the right base layer is selected, overlay is shown, otherwise overlay is unavailable in the LayerSwitcher pannel.

4

1 回答 1

0

找到了解决方法:我在 OpenLayers.Map 对象上使用 changebaselayer 事件来检查是否显示了特定图层,并为它启用了特定的叠加层。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.

于 2011-01-14T10:30:00.960 回答