I've got this piece of code below that is supposed to display two base layers but now the OSM_LAYER disables(becomes blurry and inactive in the layer tree) the WORLD_LAYER, I'm not sure what the problem is. If it fits, I'd welcome the advice on how to change the OSM_LAYER to be in the format of WORLD_LAYER.

Heron.options.map.layers = [

 new OpenLayers.Layer.OSM(),

new OpenLayers.Layer.WMS(
        "World image",
        {layers: "Earth Image", format: 'image/png'},
        {singleTile: true,
        isBaseLayer: true, 
        visibility: false, 
        noLegend: true}

By definition you can only have one base layer (i.e the bottom layer) enabled at any one time. You can define multiple layers to act as base layers, but only one can be THE base layer at any point in time.

To identify the OSM layer as a potential base layer use:

new OpenLayers.Layer.OSM(

When you add multiple base layers to a map, the first listed becomes the default base layer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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