[Chameleon] XMLThemeLegend

Fortin,Nicolas [SteFoy] nicolas.fortin at ec.gc.ca
Thu Jun 9 10:34:58 EDT 2005


Hi List!

Does anyone succeed in making XMLThemeLegend widget works correctly with a mapfile with wms based layers ?

I have a list of layers and I want to group them by theme.  I tried to switch to XMLThemeLegend without success from now. I wonder why I have to use the "wms_name" and not the real layer name in the xml file since two "wms_name" could have the same name.

If I checked a layer and update, I got an empty map and my previously checked layer is now uncheck.

I also add an hyperlink to [group_url] in the template.  Some wms layers are from Mapguide with \ in their name so if I click it, the layer is not found cause the \ is missing (parsing error!?).

Help!

Thanks,
Nicolas


Layer from my mapfile:
LAYER
  NAME "REG_EXT"
  TYPE LINE
  STATUS ON
  CONNECTIONTYPE WMS
  CONNECTION "http://atlas.gc.ca/cgi-bin/atlaswms_fr?"
  DUMP TRUE
  METADATA
    "wms_name" "rec_2m"
    "wms_title" "Régions à l'extérieur du Canada (1:2m)"
    "wms_layer_group" "/NRCAN"
    "wms_server_version" "1.1.1"
    "wms_formatlist" "image/png,image/jpeg,image/gif,image/jpeg,image/wbmp"
    "wms_format" "image/gif"
    "wms_srs" "EPSG:4326"
    "wms_connectiontimeout" "60"
    "wms_onlineresource" "http://atlas.gc.ca/cgi-bin/atlaswms_fr?"
  END
END

Template renderer:
[repeat theme]
  <tr>
    <td BGCOLOR="#dddddd" width="20">[theme_input]</td>
    <td BGCOLOR="#dddddd" colspan="3"><span class="label">[theme_name]</span></td>
  </tr>
  [repeat group]
    [if group_theme_id = theme_id]
      [if group_visible = "true"]
        <tr>
          <td width="20">&nbsp;</td>
          <td width="20">[group_input]</td>
          <td width="20"><img src="[group_icon]"></td>
          <td><span class="label"><a class="links" href="[group_url]">[group_name]</a></span></td>
        </tr>
      [end]
    [end]
  [end]
[end]

Corresponding theme/groups in xml:
    <theme name="Cartes de Base" type="checkbox" ABSTRACT="TBA">
        <group name="1:50k" ABSTRACT="TBA" visible="true">
            <layer name="BASEMAP"/>
        </group>
        <group name="Topo" ABSTRACT="TBA" visible="true">
            <layer name="TopoBase"/>
        </group>
        <group name="Hydrologie" ABSTRACT="TBA" visible="true">
            <layer name="pe_2m"/>
            <layer name="hydro_2m"/>
        </group>
        <group name="Frontières" ABSTRACT="TBA" visible="true">
            <layer name="limites_nat"/>
            <layer name="front_int"/>
        </group>
        <group name="Lieux" ABSTRACT="TBA" visible="true">
            <layer name="lieux_symb_2m"/>
            <layer name="lieux_noms_2m"/>
        </group>
        <group name="Régions Extérieures" ABSTRACT="TBA" visible="true">
            <layer name="rec_2m"/>
        </group>
    </theme>  




More information about the Chameleon mailing list