<div dir="ltr">
Thank you Normand,<br><br>Finally I've discovered that what i need to make the MapSize Widget work was the MapDhtml upated up to 2.6 version beyond the UpdateMap.php and the cwcjsapi.js files. I hope that there will be no problem with the use of other widgets, like maptips, because I will have to add them in the application in future.<br>
<br>Chameleon Archive is lately not browsable; hope you recive this message.<br>Federica<br><br><br><div class="gmail_quote">2008/10/8 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;">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 Normand,<div class="Ih2E3d"><br>
I downloaded the last version of chameleon with cvs but I haven't found any<br>
difference with the files in chameleon 2.6 rc1, in the three files I<br>
modified. Can you suggest me the other files that need to be changed? ...<br>
because I don't want to update directly all the application...<br>
<br>
<br>
</div></blockquote>
Federica,<br>
<br>
I thought I had committed the changes. Sorry.<br>
<br>
Add the "if" clause in myOnLoad() function of the main template.<br>
<br>
<br>
<script language="JavaScript" type="text/javascript"><br>
function myOnLoad()<br>
{<br>
CWC2OnLoadFunction()<br>
<br>
if(typeof goCWCJSAPI != "undefined")<br>
{<br>
goCWCJSAPI.RegisterEvent(MAP_SIZE_CHANGED, "LayerAdjustSize");<br>
}<br>
<br>
}<br>
</script><br>
<br>
Than I the following code in sample.js:<br>
/**<br>
*<br>
* called to position the keymap when the map image is resized<br>
*/<br>
function KeyMapWComputeKeyMapPosition()<br>
{<br>
if (document.layers) //Netscape 4.x<br>
{<br>
gKeyMapWhspc = document.images['keymapFrameTL'].x;<br>
gKeyMapWvspc = document.images['keymapFrameTL'].y;<br>
}<br>
else<br>
{<br>
gKeyMapWhspc = CWCDHTML_FindObjectPosX(<br>
document.getElementById('keymapFrameTL'));<br>
gKeyMapWvspc = CWCDHTML_FindObjectPosY(<br>
document.getElementById('keymapFrameTL'));<br>
}<br>
<br>
gKeyMapWhspc+=1;<br>
gKeyMapWvspc+=1;<br>
<br>
}<br>
<br>
<br>
/**<br>
* {$szJsFunctionName}<br>
* called to position the keymap when the map image is resized<br>
* It also position the background image layer and the zoom layers.<br>
*/<br>
function KeyMapWPositionKeyMapDHTML()<br>
{<br>
KeyMapWComputeKeyMapPosition();<br>
<br>
var oLayer = CWCDHTML_GetLayer("KeyMapLayerDiv");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("KeyMapLayerBG");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("zKeyMapBoxLeft");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("zKeyMapBoxRight");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("zKeyMapBoxTop");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("zKeyMapBoxBottom");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("zKeyMap2BoxLeft");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("zKeyMap2BoxRight");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("zKeyMap2BoxTop");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
<br>
var oLayer = CWCDHTML_GetLayer("zKeyMap2BoxBottom");<br>
oLayer.left = gKeyMapWhspc;<br>
oLayer.top = gKeyMapWvspc;<br>
}<br>
<br>
function LayerAdjustSize()<br>
{<br>
LayerSetSizeInit();<br>
// Set the KeyMap position based on the ReferenceLayer<br>
KeyMapWPositionKeyMapDHTML();<br>
}<br>
<br>
I attached the modified files, the widget definition and UpdateMap.php just in case.<br>
<br>
Norm<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div><br></div>