[Users] problem using 'legendURL'

karsten vennemann karsten at terragis.net
Wed Nov 24 09:48:33 CET 2010


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

Karsten  

> -----Original Message-----
> From: Bart van den Eijnden (OSGIS) [mailto:bartvde at osgis.nl] 
> Sent: Wednesday, November 24, 2010 00:34
> To: karsten vennemann
> Cc: bartvde at osgis.nl; users at 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]
>          *  :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



More information about the Users mailing list