On Nov 24, 2010, at 09:48 , karsten vennemann wrote:

> Thanks. Good to know . 
> 
> Now I'm trying it like this:
> 
>        var legendLayerStore = new GeoExt.data.LayerStore({
>            map: map,
>            layers: [publiclands,watersheds,quads,counties,overlay1]
>        });
> 
>        // set legendurls        
>        var watershedsrec  = legendLayerStore.getByLayer(watersheds);
>        watershedsrec.set("legendURL",
> "http://myurl/legend/watersheds_legend.png";);
> That give me an error
> "getByLayer(...) is not a function...

Maybe you are using an old version of GeoExt?

>> -----Original Message-----
>> From: Bart van den Eijnden (OSGIS) [mailto:bart...@osgis.nl] 
>> Sent: Wednesday, November 24, 2010 00:34
>> To: karsten vennemann
>> Cc: bart...@osgis.nl; users@geoext.org
>> Subject: RE: [Users] problem using 'legendURL'
>> 
>> Hmm, strangely enough it is not in the API docs [1], however in
>> GeoExt/data/LayerStore.js:
>> 
>>        /** public: method[getByLayer]

Just changed this to

          /** api: method[getByLayer]

on trunk. So in the future, getByLayer it will appear in the api docs.

Regards,
Andreas.


>>         *  :param layer: ``OpenLayers.Layer``
>>         *  :return: :class:`GeoExt.data.LayerRecord` or 
>> undefined if not found
>>         *
>>         *  Get the record for the specified layer
>>         */
>>        getByLayer: function(layer) {
>>            var index = this.findBy(function(r) {
>>                return r.get("layer") === layer;
>>            });
>>            if(index > -1) {
>>                return this.getAt(index);
>>            }
>>        },
>> 
>> [1] http://api.geoext.org/1.0/docs/lib/GeoExt/data/LayerStore.html
>> 
>> Best regards,
>> Bart
> 
> _______________________________________________
> Users mailing list
> Users@geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to