[Chameleon] Help - Translation problem - WMS Layers

Ines mleonsoft at yahoo.com.ar
Thu Aug 10 11:50:57 EDT 2006


Norm, I had bad my code in this lines:

	<td><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><a href="#"
onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span
class="label">[metadata name=LAYER_EN]</span></a></td>


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


I think I'm making something wrong. 

Thanks again
Ines



Ines wrote:

>Hello, I have a problem with adding WMS Layers.
>
>I have traslated the "file.map" with the variables: LAYER_EN, LAYER_ES,

>LAYER_PT. And I changed some lines and triplicated the file 
>legend_template.html. The thanslations look very well!
>
>But my problem now is this: when I add a WMS Layer (home page / buttom 
>WMS Layers / Window Map Browser / select layer / buttom "add layer") 
>The layer is added to the map, but at the top of the left menu in the 
>home page, it don't show me the name of the new added layer, it shows: 
>"metadata name=LAYER_EN" (the name of the variable). I don't know how 
>traslate the WMS layers, but I don't need to translate the WMS Layers. 
>I don't know where are the the files that manage WMS Layers. And I 
>think that the application use file legend_layer.html for the WMS 
>Layers.
>
>I need to know if is possible add a layer (home page / buttom WMS 
>Layers / Window Map Browser / select layer / buttom "add layer")and it 
>show me at the top of the left menu in the home page, the name of the 
>added layer (not the name of the variable).
>
>
>  
>
Ines,

Based on the code found in the file "legend_template_en.html" (or 
"legend_template_pt.html" or "legend_template_es.html") it is not 
supposed to happen.  Basically the code says if there is no "wms_name" 
metadata use "layer_en"metadata as the layer label.  If "wms_name" 
metadata exists, use "wms_title" as the layer label.  I tested the 
sample application and it works as expected.  Do your file look like
this?

[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><img src="[leg_icon width=20 height=18]" width="20"
height="20"</td>
    [if name=wms_name oper=isnull]
    <td><a href="#" 
onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span 
class="label">[metadata name=LAYER_EN]</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]



Norm




More information about the Chameleon mailing list