[Mapbender-commits] r5385 - trunk/mapbender/http/html
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jan 21 04:05:33 EST 2010
Author: verenadiewald
Date: 2010-01-21 04:05:31 -0500 (Thu, 21 Jan 2010)
New Revision: 5385
Modified:
trunk/mapbender/http/html/mod_treefolderPlain.php
Log:
integrated change style functionality
Modified: trunk/mapbender/http/html/mod_treefolderPlain.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolderPlain.php 2010-01-20 16:04:37 UTC (rev 5384)
+++ trunk/mapbender/http/html/mod_treefolderPlain.php 2010-01-21 09:05:31 UTC (rev 5385)
@@ -204,6 +204,7 @@
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_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_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']];
@@ -449,6 +450,47 @@
}
}
+function openStyleDialog(j,k,l){
+ if(!j && !k&& !l){
+ j=selectedMap;
+ k=selectedWMS;
+ l=selectedLayer;
+ }
+ var my= mb_mapObj[j].wms[k].objLayer[l];
+ var dialogHtml = "<select id='styleSelect'>";
+ for (var i=0;i<my.layer_style.length;i++) {
+ dialogHtml += "<option value='" + my.layer_style[i].name + "'";
+ if(my.layer_style[i].name == my.gui_layer_style) {
+ dialogHtml += " selected";
+ }
+ dialogHtml += ">" + my.layer_style[i].name + "</option>";
+ }
+ dialogHtml += "</select>";
+
+ if(my.layer_style.length > 1) {
+ $("<div id='changeStyleDialog' title='Change style'>Please change style: </div>").dialog(
+ {
+ bgiframe: true,
+ autoOpen: true,
+ modal: false,
+ buttons: {
+ "Close": function(){
+ $(this).dialog('close').remove();
+ }
+ }
+ }
+ );
+ $(dialogHtml).appendTo("#changeStyleDialog");
+ $("#styleSelect").change(function() {
+ my.gui_layer_style = this.options[this.selectedIndex].value;
+ Mapbender.modules[mod_treeGDE_map].setMapRequest();
+ });
+ }
+ else {
+ alert("No style selectable.");
+ }
+
+}
//---begin------------- opacity --------------------
@@ -697,7 +739,8 @@
if(menu.indexOf("zoom")!=-1 && temp.layer_epsg.length>0)c_menu+="menu_zoom,";
// if(menu.indexOf("layer_switch")!=-1)c_menu+="menu_layer_switch,";
// if(menu.indexOf("info_switch")!=-1)c_menu+="menu_info_switch,";
- if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
+ if(menu.indexOf("hide")!=-1)c_menu+="menu_hide,";
+ if(menu.indexOf("change_style")!=-1)c_menu+="menu_style";
c_menu+="]";
controls = [];
More information about the Mapbender_commits
mailing list