[Chameleon] Map refresh slower at bigger scale - Update Map without submit

Normand Savard nsavard at mapgears.com
Wed Oct 8 14:30:38 EDT 2008


Federica De Martin wrote:
> Thank you Normand,
> I downloaded the last version of chameleon with cvs but I haven't found any
> difference with the files in chameleon 2.6 rc1, in the three files I
> modified. Can you suggest me the other files that need to be changed? ...
> because I don't want to update directly all the application...
>
>   
Federica,

I thought I had committed the changes.  Sorry.

Add the "if" clause in myOnLoad() function of the main template.


<script language="JavaScript" type="text/javascript">
function myOnLoad()
{
  CWC2OnLoadFunction()

  if(typeof goCWCJSAPI != "undefined")
  {
    goCWCJSAPI.RegisterEvent(MAP_SIZE_CHANGED, "LayerAdjustSize");
  }

}
</script>

Than I the following code in sample.js:
/**
*
* called to position the keymap when the map image is resized
*/
function KeyMapWComputeKeyMapPosition()
{
    if (document.layers) //Netscape 4.x
    {
        gKeyMapWhspc = document.images['keymapFrameTL'].x;
        gKeyMapWvspc = document.images['keymapFrameTL'].y;
    }
    else
    {
        gKeyMapWhspc = CWCDHTML_FindObjectPosX(
document.getElementById('keymapFrameTL'));
        gKeyMapWvspc = CWCDHTML_FindObjectPosY(
document.getElementById('keymapFrameTL'));
    }

    gKeyMapWhspc+=1;
    gKeyMapWvspc+=1;

}


/**
* {$szJsFunctionName}
* called to position the keymap when the map image is resized
* It also position the background image layer and the zoom layers.
*/
function KeyMapWPositionKeyMapDHTML()
{
    KeyMapWComputeKeyMapPosition();

    var oLayer = CWCDHTML_GetLayer("KeyMapLayerDiv");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("KeyMapLayerBG");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("zKeyMapBoxLeft");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("zKeyMapBoxRight");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("zKeyMapBoxTop");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("zKeyMapBoxBottom");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("zKeyMap2BoxLeft");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("zKeyMap2BoxRight");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("zKeyMap2BoxTop");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;

    var oLayer = CWCDHTML_GetLayer("zKeyMap2BoxBottom");
    oLayer.left = gKeyMapWhspc;
    oLayer.top = gKeyMapWvspc;
}

function LayerAdjustSize()
{
    LayerSetSizeInit();
    // Set the KeyMap position based on the ReferenceLayer
    KeyMapWPositionKeyMapDHTML();
}

I attached the modified files, the widget definition and UpdateMap.php 
just in case.

Norm





-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapsize.tgz
Type: application/x-compressed-tar
Size: 35023 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/chameleon/attachments/20081008/30bb6f80/mapsize-0001.bin


More information about the Chameleon mailing list