[Chameleon] Static/independent layers?

Carlo Tronnberg temp at chello.hu
Fri Dec 2 05:39:23 EST 2005


Hi List!

I have some layers which should always be available and on top of any other layer.

I have made a map file, adding a meta tag for these layers such as:

LAYER
    CONNECTIONTYPE postgis
    CONNECTION "user=elu password=pw dbname=db host=localhost"
    DATA "the_geom from lineup"
    FILTER "state = 'T'"
    NAME "Timed-out Stations"
    TYPE POINT
    STATUS OFF
    TRANSPARENCY ALPHA
    METADATA
            "isStation" "true"
    END
    CLASS
        STYLE
        SYMBOL 'TimeOutStation'
        COLOR 0 0 0
        OUTLINECOLOR 0 0 0
        END
    END # Class
    PROJECTION
      "init=epsg:4326"
    END
END

Using the chameleon example, I modified the "legend_template.html" file such as:

[leg_layer_html order=ascending opt_flag=15]
[if name=isStation oper=isnull]
  <div id='[leg_layer_name]_t'><tr bgcolor="#ffffff" ID='[leg_layer_name]'>
    <td valign="top" width="10"><input type="radio" style="margin-top:1px; margin-bottom:1px; height:14px;" name="my_legend" onclick="CWCSelectLayer('[leg_layer_name]', true)"[if name=selected value=1] CHECKED[/if] ></td>
    <td nowrap valign="top" width="18"><input type="checkbox" style="margin-top:1px; margin-bottom:1px; height:14px;" 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 valign="top" align="middle" width="15"><img border="0" style="margin-top:0px; margin-bottom:0px; margin-right:0px;" src="[leg_icon width=16 height=17]"></td>
    [if name=wms_name oper=isnull]
    <td valign="top" nowrap><a href="#" onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span class="label">[leg_layer_name]</span></a></td></tr>
    [/if]
    [if name=wms_name oper=isset]
    <td valign="top" nowrap><a href="#" onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span class="label">[metadata name=WMS_TITLE]</span></a></td></tr>
    [/if]</div>
[/if]
[/leg_layer_html]

I duplicated the LegendTemplate widget so as to have 2 different versions of it in the same page. One of them showing all the layers without that meta data and the other one the layers with it.
This works great, but if I add dynamically a layer, this gets on top of all the others, even the "static ones", but in the legend the new layer is together with the other ones. If I want to put the new layer down, I have to demote it as many times as I have static layers before it actually demotes as it should.

I am wondering if it is possible to define layers in the map file which would NOT be handled by the automatic layer functions in chameleon. I want to be able to show or hide them but NOT promote/demote or delete them.
All the other layers must work as usual.

Cheers,

Carlo Tronnberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20051202/dcc3586b/attachment.html


More information about the Chameleon mailing list