Hi,

 

I have done some modifications in order to solve this problem. I have
tested it on few examples and it seems to work but it would be nice to
hear if this is generally a good/correct solution.

 

I have done the following:

 

1. Since I currently don't need a category checkbox I have ignored it so
I don't know if/how it works with catWithCheckbox parameter set.

 

2. I had to somehow pass the category to javascript setlayers function.
So in legend.php:

a) First I modified the _print Category() function and put "$cstr .=
$this->_printGroup($grp, $cat);" instead of "$cstr .=
$this->_printGroup($grp);" (line 205)

b) I modified "function _printGroup($grp)" to "function
_printGroup($grp, $cat)" (line 216)

c) I modified $gstr .= "<td class=\"cbx\"><input type=\"checkbox\"
name=\"groupscbx\" value=\"$grpName\" id=\"ginput_$grpName\"
onclick=\"javascript:setlayers(\\'$grpName\\',false)\" /></td>"; to
$gstr .= "<td class=\"cbx\"><input type=\"checkbox\" name=\"groupscbx\"
value=\"$grpName\" id=\"ginput_$grpName\"
onclick=\"javascript:setlayers(\\'$grpName\\',\\'$cat\\',false)\"
/></td>";

 

3. Then I modified toc.js. I didn't know how to get the list of
groups/layers belonging to the category passed in above call to
setlayers, so I used a part of code from setcategory function. The hole
part looks like this now:

 

    if (selelem) {

// Check if layer is not visible at current scale

if ((_$('spxg_' + selelem).className == 'unvis') && (!noreload)) {

                        noreload = true;

            }

 

// get the list of groups/layers belonging to this category 

            var grpList = $('#' +
catelem).find('[EMAIL PROTECTED]"checkbox"]');                  

            // create a group list array


            var grpListArray = new Array(); 

            for (var j=0; j<grpList.length; j++) {

                        grpListArray[j] = grpList[j].id;

            }

            // Check if layers should be mutually disabled

            if (PMap.mutualDisableList) {

                        var mdl = PMap.mutualDisableList;

                        if (mdl.inArray(selelem)) {

                                    for (var i=0; i<mdl.length; i++) {

                                                if
(!grpListArray.inArray('ginput_' + mdl[i])) {

                                                            _$('ginput_'
+ mdl[i]).checked = false;

                                                }

                                   }

                        }

            }

    }

 

 

This works for now but I am not sure if this is generally a good
solution, and I am not good in Javascript either. So I welcome any
suggestion on this.

 

Regards, dejan

 

 

thanks

 

regards, dejan

 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to