[Users] Set visibility on Sub-layers
Andreas Hocevar
ahocevar at opengeo.org
Fri Dec 11 19:15:51 CET 2009
Thanks for your investigation.
I have created a patch based on your findings. Can you please test if
the patch attached to http://trac.geoext.org/ticket/186 also fixes your
issue and report back?
Regards,
Andreas.
On 2009-12-11 18:25, Paul james wrote:
> Thanks...
> It´s working now...
> I added that code in contructor
> ...
> for (i=0;i< mapPanel.layers.map.layers.length;i++)
> {
> if(mapPanel.layers.map.layers[i].name == config.layer)
> {
> this.allItems =
> mapPanel.layers.map.layers[i].params.LAYERS;
> break;
> }
> }
> ...
> And removed
> this.allItems = this.getItems()
> from render method...
>
> Paul
> On Thu, Dec 10, 2009 at 4:14 PM, Andreas Hocevar <ahocevar at opengeo.org
> <mailto:ahocevar at opengeo.org>> wrote:
>
> On 2009-12-10 19:11, Paul james wrote:
>> Thanks Andreas...
>> But I dint get that...
>> I´m trying figure out how that allItems array and method
>> onCheckChange should work, without success..
>> That bug occurs always that I have a sublayer with checked true
>> and two or more sublayers with checked false...
>>
>> Please please help me :(
>
> There are two solutions I can think of:
>
> * provide allItems in the configuration instead of using
> getItems() in the render method (in LayerParamNode.js).
>
> * determine allItems before the node is rendered. Either in the
> node constructor (if layer provided as object) or in a listener
> for the layerStore's update event.
>
> The latter is obviously more elegant, but more effort to implement.
>
> Regards,
> Andreas.
>
>>
>> Paul
>>
>>
>> On Wed, Dec 9, 2009 at 6:08 AM, Andreas Hocevar
>> <ahocevar at opengeo.org <mailto:ahocevar at opengeo.org>> wrote:
>>
>> Hi,
>>
>> I guess the problem is that allItems will be set incorrectly
>> for some
>> layers. My patch calls onCheckChange when it finds a checked
>> attribute
>> on the layer node. If this is set to false, it will turn off
>> the layer,
>> removing the layer from the params. Layers that get created
>> after that
>> will miss that layer in their allItems array.
>>
>> I don't have time to look for a solution now, but maybe the
>> information
>> above is enough for you to figure out one.
>>
>> Regards,
>> Andreas.
>>
>
>
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
>
>
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list