OpenLayers OpenLayers

Changeset 7530

Show
Ignore:
Timestamp:
07/16/08 17:02:20 (5 months ago)
Author:
architect
Message:

Controls and panels are working more in harmony

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/architect/scripts/controlConfig.js

    r7507 r7530  
    11/* 
    22 
    3  
     3TO DO  
     4Reattach events 
     5 
     6enable control switching between panels 
     7 
     8*/ 
     9 
     10 
     11 
     12 
     13/* 
     14Controls -  
    415Attribution 
    516Button 
     
    2637 
    2738 
    28     /* 
     39Loop through properties of a function  
     40-------------- 
    2941    var properties = []; 
    3042        var functions = []; 
     
    4052        console.log(functions)   
    4153    */ 
    42  
    4354/*======================= 
    4455|  createBaseLayerConfig 
     
    90101 
    91102/*======================= 
    92 |  addDelEditOptionsToLayerListItem 
     103|  addDelEditOptionsToControlListItem 
    93104=========================*/ 
    94105function addDelEditOptionsToControlListItem(ID){ 
    95106    /*edit function*/ 
    96107    $('tb1Control' + ID).innerHTML += "<div id='tbControlOptionContainer'>" 
    97                 +" <div id='tbControlEditDiv" + ID + "Edit' class='tbControlEditDiv' >Edit</div>" 
    98                 +" <div class='tbControlDeleteDiv' ><img id='tb1Control" + ID + "Delete' src='images/close.png' alt='Delete control'/></div>" 
     108                +" <div id='tbControlEditDiv" + ID + "Edit' class='tbControlEditDiv' onclick='editControlOption(" + ID + ");'>Edit</div>" 
     109                +" <div class='tbControlDeleteDiv' onclick='deleteControlOption(" + ID + ");' ><img id='tb1Control" + ID + "Delete' src='images/close.png' alt='Delete control'/></div>" 
    99110                +" </div>"; 
    100     var curEdit = 'tbControlEditDiv' + ID + 'Edit'; 
    101     var curListItem = "tb1Control" + ID; 
    102     console.log(curEdit) 
    103     $(curEdit).addEvent('click', function(e) {               
    104         $('tb1Control' + ID).highlight('#bcb8ad'); 
    105         editControl(ID); //The title contains the value of controlsLength, i.e. the number used in the Element's ID to uniquly identify it 
    106     }); 
    107      
    108     /*delete function*/ 
     111    /*Because the panelConfig edits the innerHTML, we cannot attach events to elements that will be overridden.  Instead, we'll just call a function when it is pressed*/    
     112
     113 
     114function editControlOption(ID) { 
     115    $('tb1Control' + ID).highlight('#bcb8ad'); 
     116    editControl(ID); //The title contains the value of controlsLength, i.e. the number used in the Element's ID to uniquly identify it 
     117
     118function deleteControlOption(ID) { 
    109119    var curDelete = 'tb1Control' + ID + 'Delete'; 
    110120    var curListItem = "tb1Control" + ID; 
    111     $(curDelete).addEvent('click', function(e) {     
    112         var elName = $('controlListItems').get('title') 
    113         if(elName == "editMode") 
    114             $('toolBox2Content').innerHTML = getEmptyToolBox2HTML("none", "Control"); //hide the toolbox 
    115         $(curListItem).dispose(); //Remove the current LI element 
    116         numActiveControls--; //Decrease the number of active controls by 1 
    117         map.controls[ID] = null; // empty the current control object 
    118         controlToggle.show(); //update the height 
    119     }); 
    120 
    121  
     121    var elName = $('controlListItems').get('title') 
     122    if(elName == "editMode") 
     123    $('toolBox2Content').innerHTML = getEmptyToolBox2HTML("none", "Control"); //hide the toolbox 
     124    $(curListItem).dispose(); //Remove the current LI element 
     125    numActiveControls--; //Decrease the number of active controls by 1 
     126    map.controls[ID] = null; // empty the current control object 
     127    controlToggle.show(); //update the height 
     128
    122129 
    123130 
     
    139146/*add the current layer id to the map.layer object*/ 
    140147    eval("var curControl = {'id':'" + ID + "'};"); 
    141     map.controls.push(curControl); //add the current layer id to map.layers 
     148    if(map.controls[ID] == null || map.controls[ID] == undefined) 
     149        map.controls.push(curControl); //add the current layer id to map.layers 
    142150 
    143151    map.controls[ID].CLASS_NAME = 'OpenLayers.Control.' + tb1SelectedControl.value   
     
    160168        //controlListelement, id, name, isControlNew 
    161169        changeControl(tb1SelectedControl, ID, tb1SelectedControl.value, true); 
    162          
     170        if($(tb1SelectedPanel) != null || $(tb1SelectedPanel) != undefined) 
     171            $('tb2ControlListPanelDropdown').selectedIndex = tb1SelectedPanel.selectedIndex 
     172 
    163173        /*set the Delete div's name to newMode, which means don't delete toolbox 2's content if the layer delete button has been pressed*/ 
    164174        $('controlListItems').set('title', 'newMode'); 
     
    193203         
    194204         
    195     console.log(controlTitle); 
    196205    eval("loadControl" + controlTitle + "();"); //Call the loadLayerConfig function; 
    197206//pass in the ID and false (don't get values from openlayers) 
     
    213222|called when the save button is pressed 
    214223| 
    215 |ID is the id of the current layer - an integer - an integer 
     224|ID is the id of the current control - an integer - an integer 
    216225|isControlNew is either "new" or "edit" - new, if the new layer button has been clicked; edit, if a layer is going to be modified 
    217226=========================*/ 
     
    225234         
    226235         
    227     //Get the value of the text input. 
    228     var valName = $('layoutControlConfigTitle').value; 
    229     console.log(valName); 
    230     /*The code here will execute if the input is empty. 
    231     Create a new <li> to hold all our content. 
    232     Set the title of the LI to the current layersLength value*/  
    233     if(isControlNew == true){ 
    234         var li = new Element('li', {id: 'tb1Control'+ID, title:'Control ' + valName,'class':'drag'}); //onclick=\"editLayer('" + ID + "')\" 
    235          
    236         //Add the <li> to our list. 
    237         $('controlListItems').adopt(li); 
    238         //We have to add the list item to our Sortable object so it's sortable. 
    239         sort.addItems(li); 
    240         //We put the new order inside of the data div. Function defined in sortable.js 
    241         showNewOrder();  
    242     } 
     236    /*Get the value of the text input for the title*/ 
     237    var valName = $('layoutControlConfigTitle').value;   
     238     
     239    /*SAVE THE CHANGED VALUES*/ 
     240     
    243241    /*loop through options, get by class listValueUpdated and valueUpdated 
    244242    saved all the changed class options*/ 
     
    258256    map.controls[ID].CLASS_NAME = 'OpenLayers.Control.' + $('tb2ControlListDropdown').value  
    259257     
    260          
     258    //Get the Panel's ID if it exists 
     259    if($('tb2ControlListPanelDropdown') != null || $('tb2ControlListPanelDropdown') != undefined) 
     260        var panelID = $('tb2ControlListPanelDropdown').options[$('tb2ControlListPanelDropdown').selectedIndex].id; 
     261     
     262    /*Not all controls have panels, so set the panelID to null if a control does not have a panel*/ 
     263    if(panelID == null || panelID == undefined) 
     264        panelID = null 
     265    else 
     266        panelID = panelID.replace("panel",""); 
     267         
     268    map.controls[ID].panelID = panelID 
     269     
     270    /* 
     271    |---------------| 
     272    |If the control is new (If it is being edited, do not create another LI element) 
     273    |Create the draggable control item representation.  Put it in either the control configuration, or panel 
     274    |----------------| 
     275    The code here will execute if the input is empty. 
     276    Create a new <li> to hold all our content. 
     277    Set the title of the LI to the current layersLength value*/  
     278    if(isControlNew == true){ 
     279        //Create the LI element 
     280        var li = new Element('li', {id: 'tb1Control'+ID, title:'Control ' + valName,'class':'drag'}); //onclick=\"editLayer('" + ID + "')\" 
     281         
     282        //Check if there is a panel selected 
     283        //----If the selected panel does not exist, create it.  Add the control to the selected panel 
     284        if ($('tb1ControlListPanelDropdown') != null || $('tb1ControlListPanelDropdown') != undefined){ 
     285            //Call GetPanels to repopulate the drop down list.  If this isn't done, then the default panel id will not change, which will cause a problem if a panel was deleted and the control hasn't been changed (i.e. the panel list has not been refreshed) 
     286            $('tb1NewControlSelects').innerHTML = createSelectList('tb1ControlListPanelDropdown', 'Control Picklist', '', getPanels());  
     287            //Check to see if the selected panel exists 
     288            if ($('tb1Panel' + panelID + 'Container') == null || $('tb1Panel' + panelID + 'Container') == undefined){ 
     289                savePanelConfig(panelID, true, true); 
     290            } 
     291            $('panel' + panelID + 'ListItems').adopt(li); 
     292        } 
     293        else{ 
     294            //Add the <li> to the control config list 
     295            $('controlListItems').adopt(li); 
     296             
     297        } 
     298        //We have to add the list item to our Sortable object so it's sortable. 
     299        sort.addItems(li); 
     300        //We put the new order inside of the data div. Function defined in sortable.js 
     301        showNewOrder();  
     302    }    
     303    else { 
     304         
     305    } 
    261306    /*Clear the layer editing options*/ 
    262307    //add the empty html to the toolbox 
     
    277322    $('tb1Control' + ID).set('title','Control - ' + map.controls[ID].title); 
    278323     
     324     
    279325    if(isControlNew == true){ 
    280326    /*If a new layer is being added, do not clear the HTML when the delete button is pressed*/       
     
    287333     
    288334    /*Update the height*/ 
    289     layerToggle.show(); 
     335    controlToggle.show() 
    290336} 
    291337 
     
    328374                tempNode.value = ''; 
    329375                /*Get the map name value*/ 
    330                 /*Check the DEFAULT_PARAMS and everything else*/ 
    331                 if (OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS != null){ 
    332                     if(OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS[tempNode.name] != null) 
    333                         tempNode.value = OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS[tempNode.name]; 
    334                 } 
    335376                if(OpenLayers.Control[curDropDownVal].prototype[tempNode.name] != null){ 
    336377                    tempNode.value = OpenLayers.Control[curDropDownVal].prototype[tempNode.name]; 
     
    342383                //By default, set the value to 0.  Override the value is necessary 
    343384                tempNode.selectedIndex = 0;  
    344                 if (OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS != null || OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS != undefined){ 
    345                     if(OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS[tempNode.name] != null){ 
    346                         var olVal = OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS[tempNode.name]; 
    347                         /*check for True / False lists*/ 
    348                         if(tempNode.options[0].value == "True" || tempNode.options[0].value == "False"){ 
    349                             if( Boolean(tempNode.options[0].name) == olVal) 
    350                                 tempNode.selectedIndex = 0; 
    351                             if( Boolean(tempNode.options[1].name) == olVal) 
    352                                 tempNode.selectedIndex = 1; 
    353                         } 
    354                         /*check for Jpg / Gif / Png, and other type of lists*/ 
    355                         else{ 
    356                             if(tempNode.options[0].value == olVal) 
    357                                     tempNode.selectedIndex = 0; 
    358                             if(tempNode.options[1].value == olVal) 
    359                                     tempNode.selectedIndex = 1; 
    360                             if(tempNode.options[2]){ 
    361                                 if(tempNode.options[2].value == olVal) 
    362                                     tempNode.selectedIndex = 2; 
    363                             } 
    364                             if(tempNode.options[3]){ 
    365                                 if(tempNode.options[3].value == olVal) 
    366                                     tempNode.selectedIndex = 3; 
    367                             } 
    368                         } 
    369                     } 
    370                 } 
    371385                if(OpenLayers.Control[curDropDownVal].prototype[tempNode.name] != null){ 
    372386                    var olVal = OpenLayers.Control[curDropDownVal].prototype[tempNode.name]; 
     
    409423                tempNode.value = ''; 
    410424                /*Get the map name value*/ 
    411                 /*Check the DEFAULT_PARAMS and everything else*/ 
    412                 if (OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS != null){ 
    413                     if(OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS[tempNode.name] != null) 
    414                         tempNode.value = OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS[tempNode.name]; 
    415                 } 
    416425                if(OpenLayers.Control[curDropDownVal].prototype[tempNode.name] != null){ 
    417426                    tempNode.value = OpenLayers.Control[curDropDownVal].prototype[tempNode.name]; 
     
    425434                //By default, set the value to 0.  Override the value is necessary 
    426435                tempNode.selectedIndex = 0;  
    427                 if (OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS != null || OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS != undefined){ 
    428                     if(OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS[tempNode.name] != null){ 
    429                         var olVal = OpenLayers.Control[curDropDownVal].prototype.DEFAULT_PARAMS[tempNode.name]; 
    430                         /*check for True / False lists*/ 
    431                         if(tempNode.options[0].value == "True" || tempNode.options[0].value == "False"){ 
    432                             if( Boolean(tempNode.options[0].name) == olVal) 
    433                                 tempNode.selectedIndex = 0; 
    434                             if( Boolean(tempNode.options[1].name) == olVal) 
    435                                 tempNode.selectedIndex = 1; 
    436                         } 
    437                         /*check for Jpg / Gif / Png, and other type of lists*/ 
    438                         else{ 
    439                             if(tempNode.options[0].value == olVal) 
    440                                     tempNode.selectedIndex = 0; 
    441                             if(tempNode.options[1].value == olVal) 
    442                                     tempNode.selectedIndex = 1; 
    443                             if(tempNode.options[2]){ 
    444                                 if(tempNode.options[2].value == olVal) 
    445                                     tempNode.selectedIndex = 2; 
    446                             } 
    447                             if(tempNode.options[3]){ 
    448                                 if(tempNode.options[3].value == olVal) 
    449                                     tempNode.selectedIndex = 3; 
    450                             } 
    451                         } 
    452                     } 
    453                 } 
    454436                if(OpenLayers.Control[curDropDownVal].prototype[tempNode.name] != null){ 
    455437                    var olVal = OpenLayers.Control[curDropDownVal].prototype[tempNode.name]; 
  • sandbox/architect/scripts/layerConfig.js

    r7503 r7530  
    117117/*add the current layer id to the map.layer object*/ 
    118118    eval("var curLayer = {'id':'" + ID + "'};"); 
    119     map.layers.push(curLayer); //add the current layer id to map.layers 
     119    if(map.layers[ID] == null || map.layers[ID] == undefined) 
     120        map.layers.push(curLayer); //add the current layer id to map.layers 
    120121 
    121122    map.layers[ID].name = tb1formName.value 
  • sandbox/architect/scripts/panelConfig.js

    r7503 r7530  
     1/* 
     2 
     3TO DO  
     4Reattach events 
     5 
     6*/ 
     7 
     8 
     9 
    110var panelsLength = 0; 
    211var numActivePanels = 0; 
     
    4453    if(numActivePanels < 1){     
    4554        /*id, title, value, text*/ 
    46         panelList = [[['panel0'],['Default Panel'],['Default Panel'],['Default Panel']]]; 
     55        panelList = [[['panel' + panelsLength],['Default Panel'],['Default Panel'],['Default Panel']]]; 
    4756        return panelList;    
    4857    } 
     
    7887/*add the current layer id to the map.layer object*/ 
    7988    eval("var curPanel = {'id':'" + ID + "'};"); 
    80     panels.panels.push(curPanel); //add the current layer id to map.layers 
     89    if(panels.panels[ID] == null || panels.panels[ID] == undefined) 
     90        panels.panels.push(curPanel); //add the current layer id to map.layers 
    8191 
    8292    panels.panels[ID].CLASS_NAME = 'OpenLayers.Control.Panel' 
     
    95105    /*Populate ToolBox 2's layer options with the layer selected in ToolBox 1's layer list dropdown - call changeLayer and pass in the controlList from toolbox1*/ 
    96106        //name, id 
    97         populatePanel(tb1PanelName, ID); 
     107        populatePanel(tb1PanelName.value, ID); 
    98108         
    99109        /*set the Delete div's name to newMode, which means don't delete toolbox 2's content if the layer delete button has been pressed*/ 
     
    109119|sets up a new layer in the global map object and populates toolbox 2 with empty input boxes 
    110120=========================*/ 
    111 function populatePanel(pName, ID){ 
     121function populatePanel(pName, ID, isNew){ 
    112122     
    113123    $('tb2blcCommon').innerHTML += "<br /> Display Panel In Map " +  createSelectList('layoutPanelConfigInMap', 'div', '', getTrueMenu()); 
    114124     
    115125    $('tb2blcCommon').innerHTML += "<br /> Allow Selection " +  createSelectList('layoutPanelConfigAllowSelection', 'allowSelection', '', getFalseMenu()); 
    116     $('tb2blcCommon').innerHTML += "<br />Title " +  createInputTextBox('layoutPanelConfigTitle','title', pName.value, 30); 
    117  
    118 
    119  
    120  
    121  
    122 /*======================= 
    123 |  savePanelConfig(ID, isPanelNew) 
     126    $('tb2blcCommon').innerHTML += "<br />Title " +  createInputTextBox('layoutPanelConfigTitle','title', pName, 30); 
     127    $('tb2blcCommon').innerHTML += "<br /><br /><strong>Size</strong> - Width: " +  createInputTextBox('layoutPanelConfigWidth','width', '', 5) + " Height: " +  createInputTextBox('layoutPanelConfigHeight','height', '', 5); 
     128    $('tb2blcCommon').innerHTML += "<br /><strong>Position</strong> - X: " +  createInputTextBox('layoutPanelConfigPosX','posx', '', 5) + " Y: " +  createInputTextBox('layoutPanelConfigPosY','posy', '', 5); 
     129 
     130
     131 
     132 
     133 
     134/*======================= 
     135|  savePanelConfig(ID, isPanelNew,calledFromControl) 
    124136| 
    125137|called when the save button is pressed 
     
    127139|ID is the id of the current layer - an integer - an integer 
    128140|isPanelNew is either "new" or "edit" - new, if the new layer button has been clicked; edit, if a layer is going to be modified 
    129 =========================*/ 
    130 function savePanelConfig(ID, isPanelNew){ 
     141|calledFromControl (bool) - specifies if this was called from the control config, if so then create a panel with default values 
     142=========================*/ 
     143function savePanelConfig(ID, isPanelNew,calledFromControl){ 
    131144         
    132145    /*if no isPanelNew is defined, assume it is a new layer*/ 
    133     if ( isPanelNew == null || isPanelNew == undefined) 
     146    if (isPanelNew == null || isPanelNew == undefined) 
    134147        isPanelNew = true; 
    135148         
    136     var panelName = $('layoutPanelConfigTitle').value;   
     149    if($('layoutPanelConfigTitle') != null || $('layoutPanelConfigTitle') != undefined) 
     150        var panelName = $('layoutPanelConfigTitle').value;   
     151    else 
     152        var panelName = 'Default Panel' 
    137153    //Get the value of the text input. 
    138154    if (panelName == ''){ 
    139         panelName = "Panel " + panelsLength
     155        panelName = "Panel " + ID
    140156    } 
    141157    /*The code here will execute if the input is empty. 
     
    143159    Set the title of the LI to the current layersLength value*/  
    144160    if(isPanelNew == true){ 
    145         $('tb1Panels').innerHTML += "<div id='tb1Panel" + panelsLength + "Container'>" 
    146                     +"              <div id='tb1Panel" + panelsLength + "Header' class='tb1PanelHeader'>" 
    147                     +"              <div id='tb1Panel" + panelsLength + "HeaderTitle'> " + panelName + "</div>" 
    148                     +"                  <div id='tb1PanelEditDiv" + panelsLength + "' class='tb1PanelEditDiv' onclick='panelEdit(" + panelsLength + ");'>Edit</div>" 
    149                     +"                  <div id='tb1PanelDeleteDiv" + panelsLength + "' class='tb1PanelDeleteDiv' onclick='panelDelete(" + panelsLength + ");' >D</div>" 
     161     
     162     
     163     
     164    var divPanelContainer = new Element('div', {id:'tb1Panel' + ID + 'Container'}); 
     165        var divPanelHeader = new Element('div', {id:'tb1Panel' + ID + 'Header', class:'tb1PanelHeader'}); 
     166            var divPanelHeaderTitle = new Element('div', {id:'tb1Panel' + ID + 'HeaderTitle'}); 
     167            var divPanelEdit = new Element('div', {id:'tb1PanelEditDiv' + ID, class:'tb1PanelEditDiv'}); 
     168            var divPanelDelete = new Element('div', {id:'tb1PanelDeleteDiv' + ID, class:'tb1PanelDeleteDiv'});   
     169        var divListArea = new Element('div', {id:'tb1Panel' + ID + 'ListArea', class:'tb1PanelListArea'}); 
     170            var olEl  = new Element('ol', {id: 'panel' + ID + 'ListItems', class:'PanelListItems' }); 
     171     
     172     
     173    divPanelHeader.adopt(divPanelHeaderTitle, divPanelEdit, divPanelDelete); 
     174    divListArea.adopt(olEl); 
     175    divPanelContainer.adopt(divPanelHeader, divListArea); 
     176    $('tb1Panels').adopt(divPanelContainer); 
     177         
     178    /*  OLD, BUSTED WAY - Removes events :( 
     179        $('tb1Panels').innerHTML += "<div id='tb1Panel" + ID + "Container'>" 
     180                    +"              <div id='tb1Panel" + ID + "Header' class='tb1PanelHeader'>" 
     181                    +"              <div id='tb1Panel" + ID + "HeaderTitle'> " + panelName + "</div>" 
     182                    +"                  <div id='tb1PanelEditDiv" + ID + "' class='tb1PanelEditDiv' onclick='panelEditOption(" + panelsLength + ");'>Edit</div>" 
     183                    +"                  <div id='tb1PanelDeleteDiv" + ID + "' class='tb1PanelDeleteDiv' onclick='panelDelete(" + panelsLength + ");' >D</div>" 
    150184                    +"              </div>" 
    151                     +"              <div id='tb1Panel" + panelsLength + "ListArea' class='tb1PanelListArea'>" 
    152                     +"              <ol class='PanelListItems'>" 
     185                    +"              <div id='tb1Panel" + ID + "ListArea' class='tb1PanelListArea'>" 
     186                    +"                 <ol id='panel" + ID + "ListItems' class='PanelListItems'>" 
    153187                    +"              </ol>" 
    154188                    +"              </div>" 
    155189                    +"          </div>"; 
    156190                /*Create the delete text and edit button*/ 
    157     } 
     191                 
     192    } 
     193     
     194    if(calledFromControl == true){ 
     195    /*set the ID to the current current control*/ 
     196        var ID = panelsLength; 
     197    /*add the current layer id to the map.layer object*/ 
     198        eval("var curPanel = {'id':'" + ID + "'};"); 
     199        panels.panels.push(curPanel); //add the current layer id to map.layers 
     200 
     201        panels.panels[ID].CLASS_NAME = 'OpenLayers.Control.Panel' 
     202    } 
     203     
    158204    /*loop through options, get by class listValueUpdated and valueUpdated 
    159205    saved all the changed class options*/ 
     
    168214        panels.panels[ID][list] = val //Add the properties to the current map layer 
    169215    } 
    170      
    171216    /*Update the name and layer type*/ 
    172217    panels.panels[ID].title = panelName 
     
    180225    /*Highlist the layer in the layer list that was saved*/ 
    181226    $('tb1Panel' + ID + 'Container').highlight('#bcb8ad'); 
    182     $("tb1Panel" + panelsLength + "HeaderTitle").innerHTML = panelName; 
     227    $("tb1Panel" + ID + "HeaderTitle").innerHTML = panelName; 
    183228     
    184229    if(isPanelNew == true){ 
     
    199244 
    200245    /*Update the height*/ 
    201     layerToggle.show(); 
    202 
     246    controlToggle.show(); 
     247
     248 
    203249/*Because we use innerHTML, do not attach events to the divs - instead, use onclick to fire these events*/ 
    204 function panelEdit(ID){ 
     250function panelEditOption(ID){ 
    205251    var curEdit = "tb1PanelEditDiv" + ID;            
    206252    $('tb1Panel' + ID + 'Header').highlight('#bcb8ad'); 
    207     //editPanel(ID); //The title contains the value of layersLength, i.e. the number used in the Element's ID to uniquly identify it 
     253    editPanel(ID); //The title contains the value of layersLength, i.e. the number used in the Element's ID to uniquly identify it 
     254     
    208255} 
    209256function panelDelete(ID){    
     
    212259    $('tb1Panel' + ID + 'Container').dispose(); //Remove the current LI element 
    213260    panels.panels[ID] = null; // empty the current layer object 
    214     layerToggle.show(); //update the height 
     261    controlToggle.show(); //update the height 
    215262    numActivePanels--; 
    216 
     263    $('tb1NewControlSelects').innerHTML = createSelectList('tb1ControlListPanelDropdown', 'Control Picklist', '', getPanels()); 
     264
     265 
     266/*======================= 
     267|  editPanel(ID) 
     268
     269|called when the control is going to be edited 
     270
     271|ID is the id of the current panel - an integer - an integer 
     272=========================*/ 
     273function editPanel(ID){ 
     274 
     275/*store the toolbox div in tbid (toolboxid)*/ 
     276    var tbid = $('toolBox2Content'); 
     277 
     278/*get title*/ 
     279    var panelTitle = panels.panels[ID].title; 
     280    if(panelTitle == undefined || panelTitle == null){ 
     281        panelTitle = "Panel " + ID; 
     282    } 
     283 
     284/*add the html to the toolbox*/ 
     285    tbid.innerHTML = getEmptyToolBox2HTML("block", "Panel");         
     286         
     287//pass in the ID and false (don't get values from openlayers) 
     288    populatePanel(ID, panelTitle, false); //get data from the map object and fill in the inp 
     289     
     290    $('layoutPanelConfigTitle').value = panelTitle;  
     291     
     292    /*Create the save and reset buttons*/ 
     293    $('tb2blcButtons').innerHTML += "<br /><br /><input id='saveButton' type='button' class='" + ID + "' value='Save' onclick='savePanelConfig(" + ID + ", false);'><br />"; //Save Button 
     294         
     295    /*Set the the name to "editMode", this allows us to determine if we should clear toolbox2's content or not.  If the name = editMode, then we should clear toolbox2 once the layer delete button has been pressed*/ 
     296    $('tb1Panels').set('title', 'editMode'); 
     297 
     298