[Chameleon] Layers always on

Paul Spencer pspencer at dmsolutions.ca
Thu Nov 11 11:18:55 EST 2004


Mark,

I assumed you would either not set visible in the metadata or set it to 
"1" if you wanted to show a layer and set it to "0" if you wanted to 
hide a layer.  I probably didn't set it up right, it was just an 
example.  If you have it working, great!

Paul

Mark M wrote:
> Thanks all for the help. I added the html code  [if name=visible oper=isset].... and it gives the results I needed.
> 
> As an aside, for the other if statement (ie [if name=visible oper=eq value=1] ), what does the 'value=1' condition check for. I couldn't get it to work.
> 
> 
> 
> ----- Original Message -----
> From: Paul Spencer <pspencer at dmsolutions.ca>
> To: Mark M <fosters4all at beer.com>
> Subject: Re: [Chameleon] Layers always on
> Date: Wed, 10 Nov 2004 20:21:38 -0500
> 
> 
>>You will need to trick the code that controls layer visibility. 
>>Basicallly, it sees the layer as off because the layer name does not 
>>appear in the legendlayername array that is created when multiple 
>>checkboxes are submitted using the name legendlayername[] (the [] tells 
>>PHP to interpret multiple values as an array).
>>
>>The only way I have found to do this (so far) is to use something like this:
>>
>>[if name=visible oper=isnull]
>><!-- layer visible if metadata visible not set -->
>><input type="checkbox" name="legendlayername[]"
>>value="[leg_layer_name]"
>>     [if name=layer_status oper=eq  value=1]CHECKED[/if]
>>     [if name=layer_status oper=eq value=2]CHECKED[/if]>
>>[/if]
>>[if name=visible oper=eq value=1]
>><!-- layer visible if metadata visible set to 1 -->
>><input type="checkbox" name="legendlayername[]"
>>value="[leg_layer_name]"
>>     [if name=layer_status oper=eq  value=1]CHECKED[/if]
>>     [if name=layer_status oper=eq value=2]CHECKED[/if]>
>>[/if]
>>[if name=visible oper=isset]
>><!-- layer NOT visible if metadata visible set to 0 -->
>>   <input type="hidden" name="legendlayername[]" value="[leg_layer_name]">
>>[/if]
>>
>>The important part is that you have metadata to indicate that the layer 
>>should not be in the legend then you output a hidden input with the 
>>right name and value.
>>
>>Cheers,
>>
>>Paul
> 
> 

-- 
Cheers,

Paul

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list