[OpenLayers-Users] WMC - Loading layers as 'not' baseLayers

Christopher Schmidt crschmidt at metacarta.com
Thu Mar 5 08:52:02 EST 2009


On Thu, Mar 05, 2009 at 08:28:14AM -0500, James Leveille wrote:
> Hi,
>  
> I'm loading a context as follow :
>  
> [...]
> var wmc = new OpenLayers.Format.WMC ();
> wmc.read ( oHttpRequest.responseText, {map: map});
> [...]
>  
> It works fine but all the layers are loaded as base layers.
> Since I dont want those to be base layers, I've tried :
>  
>           oMap.layers[xyz].setIsBaseLayer = false;

1. if your 'oMap' is an OpenLayers.Map object, then I hope xyz is a
number, otherwise this won't work as you expecti t to...
2. 'setIsBaseLayer' doesn't exist. you want [xyz].isBaseLayer = false;
3. You may be interested in the layerOptions format option, 
   added in #1411, which allows you to do:
    var wmc = new OpenLayers.Format.WMC({'layerOptions': {
        isBaseLayer: false}});

-- Chris

>           oMap.events.triggerEvent("changebaselayer");
> 
> But it's not working.
> How can I load those layers so they are not base layers ?
>  
> Best regards.
> James Léveillé
> 
>  

> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list