[Users] first approch

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Fri Jul 31 17:42:51 CEST 2009


Hi Ivan,

something like (after your layers have been loaded in the map panel):

        map_panello.layers.each(function(record) {
                if (record.get('layer').isBaseLayer == true) {
                     record.set("hideInLegend", true);
                }
            });

Best regards,
Bart

ivan marchesini wrote:
> Thanks Bart,
> as I said I'm at start with methods, classes, and objects..
> so for me it is a little hard to understand ho to set a property of a
> record of a layerStore  :-(
> I have seen the legend example but still ahev some problem to
> understand..
>
> in my case the layerStore is probably 
>
> this one:
>         var map_pannello = new GeoExt.MapPanel({
> 	  map: mappa,
> 	  region: 'center',
>           title: 'An example of IRPI GeoExt'
>         });
>
> I'm right?
>
> the map I'd like not to show in legendpanel is "ol_wms"
>
> but now I can't figure how to set property of the record of the layer
> store  to "hideinlegend" ...
>
> I suppose something like:
> map_pannello.layer.set(....
>
> but, for now (I'm downloading a javascript guide), I can't find the
> syntax...
>
> thanks
>
> ivan
>
>
>
>
> Il giorno ven, 31/07/2009 alle 13.29 +0200, bartvde at osgis.nl ha scritto:
>   
>> Hi Ivan,
>>
>> wrt your first problem, see:
>>
>> http://trac.geoext.org/ticket/120
>>
>> so this has been fixed in GeoExt trunk.
>>
>> Second question: the only way to hide the layer from the legend is to set
>> the hideInLegend property of its associated record in the layerStore. See
>> the legend example.
>>
>> Hope this helps.
>>
>> Best regards,
>> Bart
>>
>>     
>>> Dear geoext users,
>>> I'm trying to create my first geoext application..
>>> it is quite hard because I have not skill on javascript... but I decided
>>> to try to learn it during the work... :-)
>>>
>>> so this is my work at the moment:
>>> http://alderaan.irpi.cnr.it/test_geoext/test_geoext6.html
>>>
>>> I have some simple (hope) questions for you...
>>>
>>> 1) why the first time (after the page is loaded) the switch from
>>> metacarta layer to google layer is correct while, later, each time I
>>> switch from one base layer to another I obtain strange behaviour and
>>> firebug give me an error like this:
>>> ____
>>> legend is undefined
>>> return
>>> panelIndex;},onStoreUpdate:functi...ms.get(0).setText(record.get('title'));}
>>> ____
>>>
>>> 2) why the legend contains also the OpenLayers_WMS which is a baselayer
>>> (isBaseLayer:true)
>>>
>>>
>>>
>>> Many thanks for your answer...
>>>
>>> Ivan
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
>>> Preferisco formati liberi.
>>> Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
>>> I prefer free formats.
>>> http://it.wikipedia.org/wiki/Formato_aperto
>>> http://en.wikipedia.org/wiki/Open_format
>>>
>>> Ivan Marchesini
>>> Perugia (Italy)
>>> Socio fondatore GFOSS "Geospatial Free and Open Source Software"
>>> http://www.gfoss.it
>>> e-mail: marchesini at unipg.it
>>>         ivan.marchesini at gmail.com
>>> fax (home): +39(0)5782830887
>>> jabber: geoivan73 at jabber.org
>>> skype: geoivan73
>>> _______________________________________________
>>> Users mailing list
>>> Users at geoext.org
>>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>>
>>>       
>>     


-- 
Bart van den Eijnden
OSGIS, Open Source GIS
bartvde at osgis.nl
http://www.osgis.nl



More information about the Users mailing list