[Chameleon] Legend Update causes layers to disappear

Peter Kingsbury peter.kingsbury at gmail.com
Thu Sep 1 13:22:23 EDT 2005


An issue exists in my chameleon-app where the layers will disappear 
after updating the map!

An example of the first Update:
- layers listed in legend will update properly (checked layers appear, 
unchecked layers disappear)
- layers not in legend whose STATUS value is DEFAULT will remain in the 
map view area
- remaining non-legend, STATUS=ON layers are removed from view

And the second update (and beyond):
- layers listed in legend continue to behave as expected
- STATUS=DEFAULT layers not in legend are removed from view
- STATUS=ON layers not in legend continue to remain hidden from view

Here are some code examples of what I am using... The "always on" rivers 
layer which stays put after the first Update, but disappears after 
subsequent updates, and a normal initially-invisible layer which the 
legend controls just fine:

    #----------------------------------
   
    LAYER
        GROUP    "Base Layers"
        NAME    "Rivers"
        TYPE    POLYGON
        DATA    rivers
        STATUS    DEFAULT
        CLASS
            NAME    "Rivers"
            COLOR     48 100 230
            OUTLINECOLOR 64 128 255
        END
        METADATA
            SHOWINLEGEND "no"
        END
    END

    LAYER
        GROUP    "Sites"
        NAME    "Sites"
        TYPE    POINT
        DATA    sites
        TOLERANCE 6
        STATUS    OFF
        HEADER '../query/query_header.html'
        FOOTER '../query/query_footer.html'
        MAXSCALE 30000

        METADATA
            SHOWINLEGEND "yes"
        END

        CLASSITEM "sites"
        LABELITEM "sites"
    END

    #----------------------------------

The legend template layer section:

[leg_layer_html order_metadata=legend_order opt_flag=15]
[if name=SHOWINLEGEND oper=eq value="yes"]
        <tr bgcolor="#ffffff">
            <td align="center" width=20>
                <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]>
            </td>
       
            <td>
                <img src="[leg_icon width=20 height=18]" width="20" 
height="18">
            </td>
   

            <td>
                <span class="label">[leg_layer_name]</span>
            </td>
        </tr>
[/if]
[/leg_layer_html]

And finally, the LegendTemplate widget:

    <cwc2
        type="LegendTemplate"
        visible="true"
        embedded="true"
        template="legend_template.html"
        popupstyleresource="TextButtons"
        popupwidth="500"
        popupheight="400"
        status="false"
        menubar="false"
    />


Is this a circular catch-22 problem? Is there a way around this behavior?

Best regards,
- Peter


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20050901/4d118e1e/attachment.html


More information about the Chameleon mailing list