[Mapbender-commits] r2974 - branches/nimix_dev/http/html
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Sep 18 08:37:07 EDT 2008
Author: nimix
Date: 2008-09-18 08:37:07 -0400 (Thu, 18 Sep 2008)
New Revision: 2974
Modified:
branches/nimix_dev/http/html/mod_treefolder2.php
Log:
fix wms selection
Modified: branches/nimix_dev/http/html/mod_treefolder2.php
===================================================================
--- branches/nimix_dev/http/html/mod_treefolder2.php 2008-09-18 12:16:34 UTC (rev 2973)
+++ branches/nimix_dev/http/html/mod_treefolder2.php 2008-09-18 12:37:07 UTC (rev 2974)
@@ -545,15 +545,15 @@
function handleSelectedWMS(path){
if(lock_update)return;
- console.log(path);
var t = path.split("|");
var wms_id = t[t.length-1].substr(4);
var reset_lock=!lock_check;
var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
- var layername = parent.mb_mapObj[ind].wms[parent.getWMSIndexById(mod_treeGDE_map,wms_id)].objLayer[0].layer_name;
+ var wms = parent.getWMSIndexById(mod_treeGDE_map,wms_id);
+ var layername = parent.mb_mapObj[ind].wms[wms].objLayer[0].layer_name;
var bChk = IsChecked(path, 0);
- handleSelectedLayer(mod_treeGDE_map,wms_id,layername,"visible",bChk?"1":"0");
- handleSelectedLayer(mod_treeGDE_map,wms_id,layername,"querylayer",bChk?"1":"0");
+ parent.mb_mapObj[ind].wms[wms].handleLayer(layername,"visible",bChk?"1":"0");
+ parent.mb_mapObj[ind].wms[wms].handleLayer(layername,"querylayer",bChk?"1":"0");
lock_check=true;
checkChildren(path, 0, bChk);
if(ficheckbox)checkChildren(path, 1, bChk);
@@ -569,7 +569,6 @@
function handleSelection(path, box){
if(lock_update)return;
- console.log(path);
var reset_lock=!lock_check;
lock_check=true;
var bChk = IsChecked(path, box);
@@ -601,6 +600,13 @@
if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
if(!temp.gui_layer_selectable == '1' && !temp.gui_layer_queryable == '1')
continue;
+
+ parentNode = arrNodes[0][0];
+ if(eval("categories.wms_"+parent.mb_mapObj[i].wms[ii].wms_id) !== undefined)
+ parentNode = eval("categories.wms_"+parent.mb_mapObj[i].wms[ii].wms_id);
+ else
+ eval("categories['wms_"+parent.mb_mapObj[i].wms[ii].wms_id+"'] = parentNode");
+
var c_menu="[";
if(reverse=="true"){
if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_up,";
@@ -617,13 +623,8 @@
if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
c_menu+="]";
controls=null;
- if(switchwms=='true')controls='<INPUT type="checkbox" title="' + msgObj.tooltipHandleWms + '" checked onclick="handleSelectedWMS(\''+arrNodes[0][0]+'|'+parent.mb_mapObj[i].wms[ii].wms_id+'\');" />';
+ if(switchwms=='true')controls='<INPUT type="checkbox" title="' + msgObj.tooltipHandleWms + '" checked onclick="handleSelectedWMS(\''+parentNode+'|wms_'+parent.mb_mapObj[i].wms[ii].wms_id+'\');" />';
if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
- parentNode = arrNodes[0][0];
- if(eval("categories.wms_"+parent.mb_mapObj[i].wms[ii].wms_id) !== undefined)
- parentNode = eval("categories.wms_"+parent.mb_mapObj[i].wms[ii].wms_id);
- else
- eval("categories['wms_"+parent.mb_mapObj[i].wms[ii].wms_id+"'] = parentNode");
addNode(parentNode,["wms_"+parent.mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
parentObj = parentNode+"|wms_"+parent.mb_mapObj[i].wms[ii].wms_id;
}
More information about the Mapbender_commits
mailing list