[Chameleon] Help - Translation problem - WMS Layers

Normand Savard nsavard at mapgears.com
Mon Aug 14 11:48:21 EDT 2006


Ines wrote:

>
>I corrected it, but I have another problem now:
>
>When I add WMS Layers, the layer is added and I can see the name of the
>layer very well. But I can't see my translations of the file.map. I see
>all the names in english at the left menu. When I open the Internet
>explorer and I run my aplication, and I press the button "spanish" or
>"portuguese", but the left menu is still in english. The aplication
>Don't take the variables "LAYER_ES" and "LAYER_PT" from the file.map.
>But if I add some WMS Layer, I can see the layer in the map, and the
>name of the new WMS layer very well. 
>
>It is the code I have now of the legend_templates and part of the file
>.map:
>
>"legend_template_es.html":
>
>
>[leg_layer_html order=ascending opt_flag=15]
>  <tr bgcolor="#ffffff">
>    <td><input type="radio" name="my_legend"
>onclick="CWCSelectLayer('[leg_layer_name]', true)"[if name=selected
>value=1] CHECKED[/if] ></td>
>    <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><a href="[leg_icon width=818 height=900]" target="_blank"><img
>src="[leg_icon width=20 height=18]" width="20" height="20"
>border="0"></a></td>
>    [if name=wms_name oper=isnull]
>    
>	<td><a href="#"
>onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span
>class="label">[metadata name=LAYER_ES]</span></a></td>
>	
>  </tr>
>    [/if]
>    [if name=wms_name oper=isset]
>    <td><a href="#"
>onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span
>class="label">[metadata name=WMS_TITLE]</span></a></td>
>  </tr>
>    [/if]
>[/leg_layer_html]
>
>
>A leyer in the file.map:
>
>
>LAYER
>    CONNECTION
>"http://mapa.itsc.uah.edu:8080/wmsconnector/com.esri.wms.Esrimap/ccad_ve
>ctors?"
>    CONNECTIONTYPE WMS
>    DUMP TRUE
>      METADATA
>        "wms_srs"	"EPSG:4326 EPSG:4267 EPSG:4269 EPSG:4326"
>        "wms_onlineresource"
>"http://mapa.itsc.uah.edu:8080/wmsconnector/com.esri.wms.Esrimap/ccad_ve
>ctors?"
>        "wms_latlonboundingbox"	"-89.52409 7.00194 -77.00009 18.53164"
>        "layer_index"	"8"
>        "wms_queriable"	"1"
>        "wms_name"	"3"
>        "wms_formatlist"	"image/png,image/jpeg"
>        "wms_format"	"image/png"
>        "selected"	"0"
>        "LEGEND_ORDER"	"8"
>        "wms_server_version"	"1.1.1"
>        "wms_abstract" "Central American River Systems"
>        "wms_metadataurl_href"
>"http://fgdc.er.usgs.gov/metadata/metadata.html"
>        "wms_dataurl_href"
>"http://servir.nsstc.nasa.gov/MesoStor/index.html"
>        "wms_title"	"Rivers of C.A."
>	  "LAYER_EN" "Rivers of C.A."
>	  "LAYER_ES" "Ríos de C.A."
>	  "LAYER_PT" "Rios de C.A."
>		
>      END
>
>
>  
>
Ines,

Based on the layer description in the map file above this is a WMS layer 
(CONNECTIONTYPE).  The layer metadata "LAYER_EN", "LAYER_ES" and 
"LAYER_PT" will never be read and written in the legend section.  It is 
the "wms_title" metadata that is going to be read and written to the 
legend section instead.  This is the code in "legend_template_es.html" 
that says so, see:

[if name=wms_name oper=isnull] use metadata name=LAYER_ES

The "wms_name" metadata is not null so the "LAYER_ES" metadata will not be used.  But

[if name=wms_name oper=isset] use metadata name=WMS_TITLE will be used 
and the layer name will appear in English in the legend.

Norm







More information about the Chameleon mailing list