[OpenLayers-Users] Display overlays under base layers?

Martin Davis mtnclimb at gmail.com
Thu Oct 23 11:17:10 PDT 2014


You can do this, but you may have to make your own LayerSwitcher to do so.

We did this by treating the imagery layers as regular overlays (i.e. not
base layers), and then creating a custom LayerSwitcher which allowed
toggling visibility of the imagery layers by radio button rather than a
checkbox.  In our code we made this very flexible by defining a JSON
structure that specified all layers and whether they were part of a
"mutually-exclusive set" or not.  If you don't need that flexibility you
could just add some properties to the OL Layer objects to control how they
are to be controlled by the custom LayerSwitcher.

And yes, this is a bit of work and requires some solid JS and HTML chops.

On Thu, Oct 23, 2014 at 10:46 AM, Bistrais, Bob <Bob.Bistrais at maine.gov>
wrote:

>  I have a number of imagery layers (selected with radio buttons) that I
> would like to have display on top of certain background layers (selected
> with checkboxes).  I’ve tried changing the order of layers, the isBaseLayer
> option, and so forth, but I cannot get it to work that way.  Is it possible
> to this?
>
>
>
> Thanks,
> Bob
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20141023/43806ebf/attachment.html>


More information about the Users mailing list