<div dir="ltr">Thank you Normand, for the help with UpdateMap widget; I had to change some part of the functions, because I use Xml Legend but now everything works!<br><br>Now I was trying to get the MapSize widget working in jsapi mode. This is what I've done:<br>
- I replace the folder of the Mapsize widget with the one of chameleon 2.6<br>- I added in the cwcjsapi.js file the code:<br> MAP_SIZE_CHANGED = gnLastEventId ++;<br>- I added in the UpdateMap.php the code:<br> //change map size<br>
if (isset( $HTTP_FORM_VARS["SET_MAP_WIDTH"]) &&<br> isset($HTTP_FORM_VARS["SET_MAP_HEIGHT"]))<br> {<br> include("widgets/MapSize/MapSize.widget.php");<br> $oWidget = new MapSize();<br>
$oWidget->InitDefaults();<br> $oWidget->SetMap($oMapSession);<br> $oWidget->SetURL($oHttpFormVars, $HTTP_FORM_VARS);<br> $_SESSION["gszCurrentState"] = $oMapSession->saveState();<br>
}<br><br>I thougt that this changes were enough but if I use the map size widget the map keeps on loading and I have to restart the application; <br>Do you know if there are other files that has to be changed to make the MapSize (jsapi mode) work?<br>
<br>Thanks, Federica<br><br><br><div class="gmail_quote">2008/10/6 Normand Savard <span dir="ltr"><<a href="mailto:nsavard@mapgears.com">nsavard@mapgears.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Federica De Martin wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you for the answer,<br>
I already use the JSAPI mode with the chameleon 2.4 but the UpdateMap button<br>
always submit the page.<br>
Then I tried using the Update widget of chameleon 2.6 and I discovered that<br>
it doesn't work (doesn't do anything).<br>
I don't know if there is a misconfiguration i my template or somewhere else,<br>
any suggestion about this?<br>
<br>
<br>
<br>
</blockquote>
Federica,<br>
<br></div>
You need to add some Javascript in your legend template and sample.js.<br>
<br>
Norm<br>
<br>
main application template:<br>
<cwc2 type="LegendTemplate" visible="true" embedded="true" template="legend_template_jsapi.html" popupstyleresource="TextButtons" popupwidth="500" popupheight="400" status="false" menubar="false"/><br>
<br>
legend_template_jsapi.html<br>
<br>
[leg_layer_html order=ascending opt_flag=15]<br>
<tr bgcolor="#ffffff"><br>
<td><input type="radio" name="my_legend" onclick="CWCSelectLayer('[leg_layer_name]', true)"[if name=selected value=1] CHECKED[/if] ></td><br>
<td align="center" width=20><input type="checkbox" name="legendlayername[]" value="[leg_layer_name]" onclick="ChangeLayerStatus('[leg_layer_name]')"<br>
[if name=layer_status oper=eq value=1]CHECKED[/if]<br>
[if name=layer_status oper=eq value=2]CHECKED[/if]></td><br>
<td><img src="[leg_icon width=20 height=18]" width="20" height="20"</td><br>
[if name=wms_name oper=isnull]<br>
<td><a href="#" onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span class="label">[leg_layer_name]</span></a></td><br>
</tr><br>
[/if]<br>
[if name=wms_name oper=isset]<br>
<td><a href="#" onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span class="label">[metadata name=WMS_TITLE]</span></a></td><br>
</tr><br>
[/if]<br>
[/leg_layer_html]<br>
<br>
<br>
<br>
sample.js:<br>
<br>
function ChangeLayerStatus(szLayerName)<br>
{<br>
if(typeof goCWCJSAPI == "undefined")<br>
{<br>
return false;<br>
}<br>
<br>
szStatus = goCWCJSAPI.oMap.GetLayerByName(szLayerName).GetStatus();<br>
if(szStatus == "ON")<br>
{<br>
szNewStatus = "OFF";<br>
}<br>
else<br>
{<br>
szNewStatus = "ON";<br>
}<br>
<br>
goCWCJSAPI.oMap.GetLayerByName(szLayerName).SetStatus(szNewStatus);<br>
}<br>
<br>
<br>
</blockquote></div><br></div>