[Chameleon] xml themelegend

Bart van den Eijnden BEN at Syncera-ITSolutions.NL
Wed Nov 9 07:29:54 EST 2005


Hi,

this is what I use:

in the HTML template:

  <cwc2 type="XMLThemeLegend" popupwidth="400" popupheight="400">
    <selection name="Legend" template="" themefile="themes.xml" contextfile="" rendererfile="themes_renderer.html"/>
  </cwc2>

Themes.xml contains (this is the mapping from your layers to groups, the name attribute of layers should map your LAYER NAME in the MAP file, the name of the theme and the name of the group are used merely for display):

<themes>
    <global>
        <separator name="Separator" isVisible="yes" src="http://..."/>
        <themeParams bold="true" font="Arial, Helvetica, sans-serif" size="2"   extendAbstract="true" icon="images/unknown.gif" extendContext="false"/>
        <groupParams bold="false"  font="arial" size="8.25" extendAbstract="true" icon="images/unknown.gif" visible="true"/>
    </global>
    <theme name="Bodem informatie" type="checkbox" ABSTRACT="TBA">
        <group name="onderzoekslocaties" ABSTRACT="TBA" visible="true" icon="images/bislocaties.png">
            <layer name="bislocatie"/>
        </group>
        <group name="onderzoeksrapporten" ABSTRACT="TBA" visible="true" icon="images/bisrapvlak.png">
            <layer name="bisrapport_vlak"/>
            <layer name="bisrapport_punt"/>
        </group>
        <group name="historisch verdachte locaties" ABSTRACT="TBA" visible="true" icon="images/bishislijn.png">
            <layer name="bishis_lijn"/>
            <layer name="bishis_punt"/>
        </group>
    </theme>
    <theme name="Vergunningen" type="checkbox" ABSTRACT="TBA">
        <group name="milieuvergunningen" ABSTRACT="TBA" visible="true" icon="images/mislocaties.png">
            <layer name="mis"/>
        </group>
        <group name="bouwvergunningen" ABSTRACT="TBA" visible="true" icon="images/bouwlocaties.png">
            <layer name="bwt4all"/>
        </group>
    </theme>
    <theme name="Tanklocaties" type="checkbox" ABSTRACT="TBA">
        <group name="tank locaties" ABSTRACT="TBA" visible="true" icon="images/tanklocaties.png">
            <layer name="tanklocatie"/>
        </group>
    </theme>
    <theme name="Foto&apos;s" type="checkbox" ABSTRACT="TBA">
        <group name="foto&apos;s" ABSTRACT="TBA" visible="true" icon="images/lokfoto.png">
            <layer name="foto"/>
        </group>
    </theme>
    <theme name="Sonderingen" type="checkbox" ABSTRACT="TBA">
        <group name="sonderingen" ABSTRACT="TBA" visible="true" icon="images/sondnaam.png">
            <layer name="sondering"/>
        </group>
    </theme>
    <theme name="WOZ en kadaster" type="checkbox" ABSTRACT="TBA">
        <group name="percelen" ABSTRACT="TBA" visible="true" icon="images/kadperceel.png">
          <layer name="kadperceel"/>                        
        </group>
    </theme>
    <theme name="Accres" type="checkbox" ABSTRACT="TBA">
        <group name="bruggen" ABSTRACT="TBA" visible="true" icon="images/raster.gif">
          <layer name="bruggen_shapes"/>
          <layer name="bruggen_points"/>
          <layer name="bruggen_ellipses"/>
          <layer name="bruggen_text"/>
          <layer name="bruggen_textgrp"/>
          <layer name="bruggen_arcs"/>
          <layer name="bruggen_lines"/>
          <layer name="bruggen_solids"/>
        </group>
        <group name="groen beheer" ABSTRACT="TBA" visible="true" icon="images/raster.gif">
          <layer name="groen_shapes"/>
          <layer name="groen_points"/>
          <layer name="groen_ellipses"/>
          <layer name="groen_text"/>
          <layer name="groen_textgrp"/>
          <layer name="groen_arcs"/>
          <layer name="groen_lines"/>
          <layer name="groen_solids"/>
        </group>
        <group name="riolering" ABSTRACT="TBA" visible="true" icon="images/raster.gif">
          <layer name="riolering_shapes"/>
          <layer name="riolering_points"/>
          <layer name="riolering_ellipses"/>
          <layer name="riolering_text"/>
          <layer name="riolering_textgrp"/>
          <layer name="riolering_arcs"/>
          <layer name="riolering_lines"/>
          <layer name="riolering_solids"/>
        </group>
        <group name="wegvakken" ABSTRACT="TBA" visible="true" icon="images/raster.gif">
          <layer name="wegvak_shapes"/>
          <layer name="wegvak_points"/>
          <layer name="wegvak_ellipses"/>
          <layer name="wegvak_text"/>
          <layer name="wegvak_textgrp"/>
          <layer name="wegvak_arcs"/>
          <layer name="wegvak_lines"/>
          <layer name="wegvak_solids"/>
          <layer name="wegvak_textnode"/>
        </group>
    </theme>
    <theme name="Topografie" type="checkbox" ABSTRACT="TBA">
        <group name="topografie" ABSTRACT="TBA" visible="true" icon="images/raster.gif">
            <layer name="achtergrond"/>
            <layer name="tekst"/>
            <layer name="overige"/>
            <layer name="grens"/>
            <layer name="acn"/>            
            <layer name="hnrlabel"/>            
            <layer name="huisnummer"/>            
            <layer name="strtekst"/>            
            <layer name="straatlabel"/>            
            <layer name="water"/>                                    
            <layer name="bebouw"/>                                    
            <layer name="wegen"/>                                    
            <layer name="gemgrens"/>  
            <layer name="brand"/>  
            <layer name="sondering"/>  
            <layer name="StraGISWebSelection"/>  
            <layer name="adr4all"/>  
        </group>
    </theme>
</themes>

themes_renderer.html contains:
[repeat theme]
  <tr class="themeRow">
    <td width="20">[theme_input]</td>
    <td colspan="3"><span class="label">[theme_name]</span></td>
  </tr>
  [repeat group]
    [if group_theme_id = theme_id]
      [if group_visible = "true"]
        <tr class="groupRow">
          <td width="20">&nbsp;</td>
          <td width="20">[group_input]</td>
          <td width="20"><img src="[group_icon]"></td>
          <td><span class="label">[group_name]</span></td>
        </tr>
      [end]
    [end]
  [end]
[end]

Hope this helps.

Best regards,
Bart

Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> Vinicio Balducci <vinicio.balducci at irpi.cnr.it> 11/09/05 1:14 PM >>>
I would like to group some layers in the legend using the "xml 
themelegend" widget.
Please, can someone help me with an example?
Thanks
Vinicio

-- 
Vinicio Balducci
Consiglio Nazionale delle Ricerche
Istituto di Ricerca per la Protezione Idrogeologica
Via Madonna Alta, 126
06128 Perugia
Tel. +39 075 5014 429/430
Fax. +39 075 5014 420
E-mail: vinicio.balducci at irpi.cnr.it
http://www.irpi.cnr.it/



_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon




More information about the Chameleon mailing list