Do I have to refresh, repaint, or whatever? I am trying from firebug and
can't see a change...
El vie, 14-12-2007 a las 16:01 +0100, Andreas Hocevar escribió:
> Marcos Sánchez Provencio wrote:
> > I have several maps in a page (each with its locator). I can select
> > which auxiliary layers I want in a map. Then, I want every other map to
> > show the same layers (and also the same extent, but that is working :-).
> > It does work, but the other maps' legend stays the same (the selected
> > layers remain the same), although the visible layers are indeed the same
> > as the map I have selected as source for sync. I want each of the maps
> > to be able to act as a source for the others, and the number and sources
> > of maps are dinamyc (the user selects them in a previous window).
> >
>
> Ok, now it's clear. To get a DOM nodelist of hidden layers, do
> var hiddenLayers = context.doc.selectNodes("//wmc:[EMAIL PROTECTED]'1']");
>
> Now to turn them off in the other context, do
> var layer;
> for (var i=0; i<hiddenLayers.length; i++) {
> layer = getNodeValue(hiddenLayers[i].selectSingleNode("wmc:Name"));
> for (<each of your other contexts>) {
> <otherContext>.getLayer(layer).setAttribute("hidden", 1);
> }
> }
>
> The same can be done for the visible layers, but with
> var visibleLayers = context.doc.selectNodes("//wmc:[EMAIL PROTECTED]'0']");
>
> Regards,
> Andreas.
>
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Mapbuilder-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users