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).

I am sorry if I am not clear :-)


El vie, 14-12-2007 a las 15:16 +0100, Andreas Hocevar escribió:
> Hi,
> 
> sorry I think I do not get your question. What exactly do you want to do?
> 
> Regards,
> Andreas.
> 
> Marcos Sánchez Provencio wrote:
> > Still working on that... If I use getAllLayers, I have no idea of how
> > to get their names. So I use the following selectNodes call.
> > I sync the layers alright, but not the checks. In my previous version,
> > I acted on the checks so the layers got hidden/shown fine. Is there a
> > similar inverse approach? I understand it is more correct to act on
> > the models than touching gui elements...
> >
> >   this.doSelect = function(selected,objRef) {
> >     if (selected){
> >         var
> > capas=objRef.targetModel.doc.selectNodes("/wmc:ViewContext/wmc:LayerList/wmc:Layer/wmc:Name");
> >         //store hidden state for each source layer
> >         var ocultas=new Array()
> >         for (var l=0;l<capas.length;l++){
> >             var nombreCapa=capas[l].firstChild.nodeValue
> >             var oculta=objRef.targetModel.getHidden(nombreCapa)!=='0'
> >             ocultas[nombreCapa]=oculta
> >             }
> >         // See other models, copy stored info
> >       var originalExtent = objRef.targetModel.extent;
> >       var contextos=config.modelNode.selectNodes('mb:models/mb:Context')
> >         for (var oo=0; oo< contextos.length; oo++){
> >             var c=contextos[oo]
> >             var idContexto=c.attributes.id.nodeValue
> >             var o=config.objects[idContexto]
> >             if
> > ((idContexto!==objRef.targetModel.id)&&(idContexto[0]==='m')){
> > //excluyo los locator
> >                     for (var i in ocultas)
> >                         o.setHidden(i,ocultas[i])
> >                     o.extent.centerAt(originalExtent.getCenter(),
> > originalExtent.res[0] )
> >                 }
> >             }
> >     }
> >   }
> >
> >
> >
> > El vie, 23-11-2007 a las 15:42 +0100, Andreas Hocevar escribió:
> >> For synchronizing the layers, create a tool similar to the above with
> >> a method that looks something like this:
> >>
> >> var masterLayers = objRef.targetModel.getAllLayers();
> >> var name, hidden;
> >> for (var i=0; i<masterLayers) {
> >>   name = getNodeValue("wmc:Name");
> >>   hidden = objRef.targetModel.getHidden(name);
> >>   objRef.model.setHidden(name);
> >> }.
> >>
> >> The above assumes that you want to synchronize when you click a
> >> button. 
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > 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
> >   
> 


-------------------------------------------------------------------------
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

Reply via email to