[Mapbender-commits] r1234 - in trunk/mapbender/http: javascripts php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Mar 16 12:04:35 EDT 2007
Author: christoph
Date: 2007-03-16 12:04:35 -0400 (Fri, 16 Mar 2007)
New Revision: 1234
Modified:
trunk/mapbender/http/javascripts/map.php
trunk/mapbender/http/javascripts/map_obj.js
trunk/mapbender/http/php/mod_WMSpreferences.php
Log:
wms opacity handling
Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php 2007-03-16 15:04:10 UTC (rev 1233)
+++ trunk/mapbender/http/javascripts/map.php 2007-03-16 16:04:35 UTC (rev 1234)
@@ -451,7 +451,13 @@
var str_LayerStyles = mb_checkScale(frameName,i,ii);
if(mb_mapObj[i].layers[ii] != "" && str_LayerStyles[0] != ''){
var newMapURL = "";
- newMapRequest += "<div id='"+myDivId+"' style='position:absolute; top:0px; left:0px; z-index:'"+ii+"'>";
+
+// replaced by opacity version
+// newMapRequest += "<div id='"+myDivId+"' style='position:absolute; top:0px; left:0px; z-index:'"+ii+"'>";
+
+ var cadenaOpacity = "opacity:"+mb_mapObj[i].wms[ii].gui_wms_mapopacity+"; Filter: Alpha(Opacity="+mb_mapObj[i].wms[ii].gui_wms_mapopacity*100+"); -moz-opacity:"+mb_mapObj[i].wms[ii].gui_wms_mapopacity+" ; -khtml-opacity:"+mb_mapObj[i].wms[ii].gui_wms_mapopacity;
+ newMapRequest += "<div id='"+myDivId+"' style=\"position:absolute; top:0px; left:0px; z-index:'"+ii+"';"+cadenaOpacity+"\">";
+
newMapRequest += "<img id='"+myMapId+"' name='mapimage' src='";
newMapURL += mb_mapObj[i].wms[ii].wms_getmap;
Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js 2007-03-16 15:04:10 UTC (rev 1233)
+++ trunk/mapbender/http/javascripts/map_obj.js 2007-03-16 16:04:35 UTC (rev 1234)
@@ -86,6 +86,9 @@
this.gui_miny = new Array();
this.gui_maxx = new Array();
this.gui_maxy = new Array();
+
+// opacity version
+ this.gui_wms_mapopacity = 1;
}
function wms_add_data_type_format(datatype,dataformat){
var insertDataFormat = true;
Modified: trunk/mapbender/http/php/mod_WMSpreferences.php
===================================================================
--- trunk/mapbender/http/php/mod_WMSpreferences.php 2007-03-16 15:04:10 UTC (rev 1233)
+++ trunk/mapbender/http/php/mod_WMSpreferences.php 2007-03-16 16:04:35 UTC (rev 1234)
@@ -106,6 +106,30 @@
var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);
var my = window.opener.mb_mapObj[ind];
+
+
+// Opacity version
+
+function setMapOpacity(val) {
+ var tmp = val.split(",");
+ my.wms[tmp[0]].gui_wms_mapopacity = tmp[1];
+ loadWMS();
+}
+
+function cambia_opacity(id,incremento){
+ objeto = opener.mapframe1.document.getElementById('div_'+id);
+ opacity = objeto.style.opacity*100 - (-incremento);
+ opacity = (opacity < 100)? ((opacity > 0)? opacity : 0) : 100;
+ objeto.style.opacity = (opacity / 100);
+ objeto.style.MozOpacity = (opacity / 100);
+ objeto.style.KhtmlOpacity = (opacity / 100);
+ objeto.style.filter = "alpha(opacity=" + opacity + ")";
+ setMapOpacity(id+","+(opacity / 100));
+}
+
+
+
+
function setMapformat(val){
var tmp = val.split(",");
my.wms[tmp[0]].gui_wms_mapformat = tmp[1];
@@ -227,6 +251,13 @@
str += exceptionString;
str += "</select></td></tr></table>";
str += "<table><tr>";
+
+ //opacity version
+ str += "<tr><td>Opacity:</td><td><input type=\"button\" onclick=\"cambia_opacity('"+visibleWmsIndexArray[i]+"','-10')\" value=\"-\">";
+ str += "<input id=\"valor_opacity_"+visibleWmsIndexArray[i]+"\" type=\"text\" disabled=\"disabled\" size=\"3\" value=\""+my.wms[visibleWmsIndexArray[i]].gui_wms_mapopacity*100+" %\">";
+ str += "<input type=\"button\" onclick=\"cambia_opacity('"+visibleWmsIndexArray[i]+"','+10')\" value=\"+\">";
+ str += "</td></tr>";
+
str += "</tr></table><br>";
}
More information about the Mapbender_commits
mailing list