[Mapbender-commits] r10036 - trunk/mapbender/http/html
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Jan 21 23:50:21 PST 2019
Author: armin11
Date: 2019-01-21 23:50:21 -0800 (Mon, 21 Jan 2019)
New Revision: 10036
Modified:
trunk/mapbender/http/html/mod_treefolderPlain.php
Log:
Possibility to define height and width of metadata window from treegde via element vars
Modified: trunk/mapbender/http/html/mod_treefolderPlain.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolderPlain.php 2019-01-21 16:15:09 UTC (rev 10035)
+++ trunk/mapbender/http/html/mod_treefolderPlain.php 2019-01-22 07:50:21 UTC (rev 10036)
@@ -20,8 +20,8 @@
require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
include '../include/dyn_js.php';
?>
-function openwindow (Adresse) {
- Fenster1 = window.open(Adresse, '<?php echo _mb("Information");?>', "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=yes");
+function openwindow (Adresse, width, height) {
+ Fenster1 = window.open(Adresse, '<?php echo _mb("Information");?>', "width="+width+",height="+height+",left=100,top=100,scrollbars=yes,resizable=yes");
Fenster1.focus();
}
<?php
@@ -200,6 +200,8 @@
}
if (typeof(datalink) === 'undefined')datalink = 'false';
+if (typeof(metadataWidth) === 'undefined')metadataWidth = '500';
+if (typeof(metadataHeight) === 'undefined')metadataHeight = '500';
if (typeof(activatedimension) === 'undefined')activatedimension = 'false';
var defaultMetadataUrl = '../php/mod_showMetadata.php?resource=layer&layout=tabs&';
@@ -216,14 +218,14 @@
var menu_delete = ['menu_delete', ['<?php echo _mb("Remove");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];remove_wms(ids[0],ids[1],ids[2]);',,'delete_wms.png']];
var menu_opacity_up = ['menu_opacity_up', ['<?php echo _mb("Opacity up");?> ','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
var menu_opacity_down = ['menu_opacity_down', ['<?php echo _mb("Opacity down");?> ','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
-var menu_metalink = ['menu_metalink', ['<?php echo _mb("Information");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid);',,'info.png']];
+var menu_metalink = ['menu_metalink', ['<?php echo _mb("Information");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid'+','+metadataWidth+','+metadataHeight+');',,'info.png']];
var menu_zoom = ['menu_zoom', ['<?php echo _mb("Zoom");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];zoomToLayer(ids[0],ids[1],ids[2]);',,'zoom.png']];
var menu_hide = ['menu_hide', ['<?php echo _mb("Hide menu");?> ', 'javascript:hideMenu()',,'hide.png']];
var menu_style = ['menu_style', ['<?php echo _mb("Change style");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openStyleDialog(ids[0],ids[1],ids[2])',,'palette.png']];
var menu_legend = ['menu_legend', ['<?php echo _mb("Legende öffnen");?> ', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openLegendHtml(ids[0],ids[1],ids[2])',,'legend_tree.png']];
-//var menu_wms_switch = ['menu_zoom', ['<?php echo _mb("Zoom");?> ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
-//var menu_layer_switch = ['menu_zoom', ['Zjjj ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
-//var menu_info_switch = ['menu_zoom', ['Zmn ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+//var menu_wms_switch = ['menu_zoom', ['<?php echo _mb("Zoom");?> ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid'+','+metadataWidth+','+metadataHeight+');',,'info.png']];
+//var menu_layer_switch = ['menu_zoom', ['Zjjj ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid'+','+metadataWidth+','+metadataHeight+');',,'info.png']];
+//var menu_info_switch = ['menu_zoom', ['Zmn ', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid'+','+metadataWidth+','+metadataHeight+');',,'info.png']];
//parent.eventMapRequestFailed.register(function(t){imgerror(t)});
@@ -967,7 +969,7 @@
if(wmsbuttons == 'true'&&metadatalink == 'true'){
controls+='<a href="'+defaultMetadataUrl + '&id='+temp.layer_uid+'"'+' target=\'_blank\' onclick="metadata_window = window.open(this.href,\'Metadata\',\'Width=700, Height=550,scrollbars=yes,menubar=yes,toolbar=yes\'); metadata_window.focus(); return false;"><img alt="'+msgObj.tooltipMetadata+'" title="'+msgObj.tooltipMetadata+'" src="'+imagedir+'/info.png" /></a>';
}
- addNode(parentNode,["wms_"+ mb_mapObj[i].wms[ii].wms_id,[temp.layer_currentTitle,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_currentTitle,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
+ addNode(parentNode,["wms_"+ mb_mapObj[i].wms[ii].wms_id,[temp.layer_currentTitle,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\",'+metadataWidth+','+metadataHeight+');'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_currentTitle,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
parentObj = parentNode+"|wms_"+ mb_mapObj[i].wms[ii].wms_id;
}
if( mb_mapObj[i].wms[ii].objLayer[iii].layer_parent && (handlesublayer=="true"|| mb_mapObj[i].wms[ii].objLayer[iii].layer_parent=="0")){
@@ -1070,7 +1072,7 @@
else{
groupedImageStyle ='menu.png';
}
- addNode(parentObj + parentLayer, [temp.layer_id,[temp.layer_currentTitle,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,((c_menu!='[]'&&temp.layer_name!="")?groupedImageStyle:null),temp.layer_currentTitle,eval(c_menu),controls.join(""),[i,ii,iii]]],false,false,reverse=="true");
+ addNode(parentObj + parentLayer, [temp.layer_id,[temp.layer_currentTitle,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\",'+metadataWidth+','+metadataHeight+');'):"javascript:select("+i+","+ii+","+iii+");"),,((c_menu!='[]'&&temp.layer_name!="")?groupedImageStyle:null),temp.layer_currentTitle,eval(c_menu),controls.join(""),[i,ii,iii]]],false,false,reverse=="true");
}
}
}
More information about the Mapbender_commits
mailing list