[Chameleon] Error while adding reference as tabs

Pssdal Bakosurtanal pssdal at gmail.com
Wed Oct 18 00:01:28 EDT 2006


Dear Experts,

I would like to have tabs reference and search below of the map like as tabs
legend and tools.
I've modified sample.js like this
============================
function ToggleLayerSetVis()

{

    var nCount = arguments.length;
    CWCDHTML_SetLayerVis( arguments[0], true );
    eval( "document.forms[0]."+arguments[nCount -
1]+".value='"+arguments[0]+"';" );
    //document.forms[0].TopTabsLayerActive.value = arguments[0];

    var i;
    for( i=1; i<nCount-1; i++ )
    {
        CWCDHTML_SetLayerVis( arguments[i], false );
    }

}

// sets the initial visibility in a group of layers on page draw
// results in persistant layer visibility between page submits.

function LayerSetVisInit()

{

    var activeLayer = document.forms[0].TopTabsLayerActive.value;
    var tmpIndex = activeLayer.indexOf( 'TopTabsLayerActive' );

    if( activeLayer.indexOf( 'TopTabsLayerActive' ) != -1 )
    {
        ToggleLayerSetVis( 'NavToolsLayer', 'ROIToolsLayer',
'TopTabsLayerActive' );
    }
    if( activeLayer.indexOf( 'NavToolsLayer' ) != -1 )
    {
        ToggleLayerSetVis( 'NavToolsLayer', 'ROIToolsLayer',
'TopTabsLayerActive' );
    }
    if( activeLayer.indexOf( 'ROIToolsLayer' ) != -1 )
    {
        ToggleLayerSetVis( 'ROIToolsLayer', 'NavToolsLayer',
'TopTabsLayerActive' );
    }

    var activeLayer = document.forms[0].SideTabsLayerActive.value;
    var tmpIndex = activeLayer.indexOf( 'SideTabsLayerActive' );

    if( activeLayer.indexOf( 'SideTabsLayerActive' ) != -1 )
    {
        ToggleLayerSetVis( 'LegendLayer', 'OtherToolsLayer',
'SideTabsLayerActive' );
    }
    if( activeLayer.indexOf( 'LegendLayer' ) != -1 )
    {
        ToggleLayerSetVis( 'LegendLayer', 'OtherToolsLayer',
'SideTabsLayerActive' );
    }
    if( activeLayer.indexOf( 'OtherToolsLayer' ) != -1 )
    {
        ToggleLayerSetVis( 'OtherToolsLayer', 'LegendLayer',
'SideTabsLayerActive' );
    }

    var activeLayer = document.forms[0].ReferenceTabsLayerActive.value;
    var tmpIndex = activeLayer.indexOf( 'ReferenceTabsLayerActive' );

    if( activeLayer.indexOf( 'ReferenceTabsLayerActive' ) != -1 )
    {
        ToggleLayerSetVis( 'ReferenceLayer', 'SearchingLayer',
'ReferenceTabsLayerActive' );
    }
    if( activeLayer.indexOf( 'ReferenceLayer' ) != -1 )
    {
        ToggleLayerSetVis( 'ReferenceLayer', 'SearchingLayer',
'ReferenceTabsLayerActive' );
    }
    if( activeLayer.indexOf( 'SearchingLayer' ) != -1 )
    {
        ToggleLayerSetVis( 'SearchingLayer', 'ReferenceLayer',
'ReferenceTabsLayerActive' );
    }


}

// sets the initial size in a group of layers on page draw
// results in layer sizes responding to map size.

function LayerSetSizeInit()

{
    var oImage = CWCDHTML_GetImage( 'mapimage' );
    var imgWidth = oImage.width;
    var imgHeight = oImage.height;

    // MainMapLayer (w+2, h+2)
    var oLayer = CWCDHTML_GetLayer( 'MainMapLayer' );
    oLayer.width = imgWidth + 2;
    oLayer.height = imgHeight + 2;

    // TopTabsLayer (w+20, h)
    var oLayer = CWCDHTML_GetLayer( 'TopTabsLayer' );
    oLayer.width = imgWidth + 20;

    // NavToolsLayer (w+20, h)
    var oLayer = CWCDHTML_GetLayer( 'NavToolsLayer' );
    oLayer.width = imgWidth + 20;

    // ROIToolsLayer (w+20, h)
    var oLayer = CWCDHTML_GetLayer( 'ROIToolsLayer' );
    oLayer.width = imgWidth + 20;

    // PanArrowsLayer (w+20, h)
    var oLayer = CWCDHTML_GetLayer( 'PanArrowsLayer' );
    oLayer.width = imgWidth + 20;
    oLayer.height = imgHeight + 20;

    // ReferenceLayer (w+20, h+22)
    var oLayer = CWCDHTML_GetLayer( 'ReferenceLayer' );
    oLayer.top = 360 + imgHeight;
    oLayer.width = imgWidth + 20;

    // SearchingLayer (w+20, h+22)
    var oLayer = CWCDHTML_GetLayer( 'SearchingLayer' );
    oLayer.top = 360 + imgHeight;
    oLayer.width = imgWidth + 20;

    // LegendLayer (h+20)
    var oLayer = CWCDHTML_GetLayer( 'LegendLayer' );
    oLayer.height = imgHeight + 20;

    // ReferenceTabsLayer (w+20, h)
    var oLayer = CWCDHTML_GetLayer( 'ReferenceTabsLayer' );
    oLayer.width = imgWidth + 20;


}

function ShowNavToolsLayer()
{
    ToggleLayerSetVis( 'NavToolsLayer', 'ROIToolsLayer',
'TopTabsLayerActive' );
}

function ShowROIToolsLayer()
{
    ToggleLayerSetVis( 'ROIToolsLayer', 'NavToolsLayer',
'TopTabsLayerActive' );
}

function ShowLegendLayer()
{
    ToggleLayerSetVis( 'LegendLayer', 'OtherToolsLayer',
'SideTabsLayerActive' );
}

function ShowOtherToolsLayer()
{
    ToggleLayerSetVis( 'OtherToolsLayer', 'LegendLayer',
'SideTabsLayerActive' );
}

function ShowReferenceLayer()
{
    ToggleLayerSetVis( 'ReferenceLayer', 'SearchingLayer',
'ReferenceTabsLayerActive' );
}

function ShowSearchingLayer()
{
    ToggleLayerSetVis( 'SearchingLayer', 'ReferenceLayer',
'ReferenceTabsLayerActive' );
}



LayerSetSizeInit();

LayerSetVisInit();
++++++++++++++++++++++++++++++++++++

also modified sample.css like this
++++++++++++++++++++++++++++
#ReferenceTabsLayer {
  position:absolute;
  left:400px;
  top:640px;
  width:180;
  height:12px;
  z-index:1;
  padding:0px;
  margin:0px;
  border-bottom: 1px solid #cccccc;
}
#ReferenceLayer {
  padding:0px;
  margin:0px;
  position:absolute;
  left:430px;
  top:670px;
  width:420px;
  height:150px;
  z-index:1;
  background-color:#ffffff;
}

#SearchingLayer {
  padding:0px;
  margin:0px;
  position:absolute;
  left:430px;
  top:670px;
  width:420px;
  height:150px;
  z-index:1;
  background-color:#ffffff;
}
+++++++++++++++++++++++

I've added a script like as below on my html template
===========================
<input type="hidden" name="TopTabsLayerActive"
value="[$TopTabsLayerActive$]">
<input type="hidden" name="SideTabsLayerActive"
value="[$SideTabsLayerActive$]">
<input type="hidden" name="ReferenceTabsLayerActive"
value="[$ReferenceTabsLayerActive$]">
=================================

My problem is when I use mozilla everything running well but when I use IE
some error appear.
The error message "Line 516 char 13 undefined is null or not an object"
Where is the error code?
Please help me
Thank you very much
Regards
pssdal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20061018/abead0b6/attachment.html


More information about the Chameleon mailing list