[Chameleon-dev] [Bug 1788] [Chameleon-Samples]When the map is resized the layers are not resized in JSAPI mode

bugzilla-daemon at bugzilla.maptools.org bugzilla-daemon at bugzilla.maptools.org
Tue Oct 9 13:45:41 EDT 2007


http://bugzilla.maptools.org/show_bug.cgi?id=1788





------- Additional Comments From nsavard at mapgears.com  2007-10-09 13:45 -------
I added a register event to call LayerAdjustSize() function in myOnLoad()
function when the map is resized.  This bug is fixed but I'm waiting for Julien
to validate this solution.

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

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();
}





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Please do NOT reply to this email, use the link above instead to 
login to bugzilla and submit your comment. Any email reply to this
address will be lost.


More information about the Chameleon-dev mailing list