[Mapbender-commits] r3505 - branches/2.5/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jan 29 09:45:44 EST 2009
Author: christoph
Date: 2009-01-29 09:45:44 -0500 (Thu, 29 Jan 2009)
New Revision: 3505
Modified:
branches/2.5/http/javascripts/mod_legend.php
Log:
reverted to previous revision
Modified: branches/2.5/http/javascripts/mod_legend.php
===================================================================
--- branches/2.5/http/javascripts/mod_legend.php 2009-01-29 14:42:55 UTC (rev 3504)
+++ branches/2.5/http/javascripts/mod_legend.php 2009-01-29 14:45:44 UTC (rev 3505)
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
+
require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
@@ -45,7 +45,7 @@
if($cnt > 1){
echo "alert('legend: ID not unique!');";
}
-
+
$sql2 = "SELECT e_left,e_top,e_width,e_height FROM gui_element WHERE e_id = '".$e_target."' AND fkey_gui_id = $1";
$v = array($gui_id);
$t = array('s');
@@ -61,6 +61,7 @@
<script type="text/javascript">
<!--
+
mod_legend_offsetLeft = 25;
mod_legend_offsetTop = -10;
@@ -115,13 +116,10 @@
var str = "";
var str_tmp = "";
-
+
for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
- var img_format = parent.mb_mapObj[ind].wms[i].gui_wms_mapformat;
- if(parent.mb_mapObj[ind].wms[i].gui_wms_visible != 0){
-
- var layerNames = parent.mb_mapObj[ind].wms[i].getLayers(parent.mb_mapObj[ind]);
-
+
+ var layerNames = parent.mb_mapObj[ind].wms[i].getLayers(parent.mb_mapObj[ind]);
for(var j=0; j<layerNames.length; j++){
var layerParent = parent.mb_mapObj[ind].wms[i].checkLayerParentByLayerName(layerNames[j]);
var layerTitle = parent.mb_mapObj[ind].wms[i].getTitleByLayerName(layerNames[j]);
@@ -133,73 +131,39 @@
else{
legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],layerStyle);
}
+ //console.log("layer_infos : %s",layerNames[j],"---",layerParent,"---",layerTitle,"---",layerStyle,"---",legendUrl);
- var l = parent.mb_getchildsbyname(ind,i,layerNames[j]);
- var tmp_name = "";
-
- // handle grouped layers
- if (l) {
- for (var k=0; k<l["name"].length; k++){
- if (l["legendurl"][k] != '' && l["legendurl"][k] != 0) {
- if (tmp_name != l["title"][k]) {
- if (showgroupedlayertitle == 'true'){
- str_tmp += "<div><span class='titles'>" + l["title"][k] + "</span></div>";
- }
- str_tmp += "<div>";
- if(legendlink == 'true'){
- str_tmp += "<a href='../php/result.php?lingo=deutsch&layer=" +
- layerNames[j] + l["name"][k] + "' class='legendlink' title='Zeigt Liste zum Thema: " +
- titles[j]+"' target='result'>";
- }
- str_tmp += "<img border=0 src = '";
- str_tmp += l["legendurl"][k];
- str_tmp += "'></img>";
-
- if (legendlink == 'true'){
- str_tmp += "</a>";
- }
-
- str_tmp += "</div>";
- tmp_name = l["title"][k];
- }
- }
- }
- }
- else {
- if (legendUrl) {
- if(layerParent == 0){
- if(showlayertitle == 'true'){
- str_tmp += "<div><span class='titles'>" + layerTitle + "</span></div>";
- }
- str_tmp += "<div>";
- if(legendlink == 'true'){
- str_tmp += "<a href='../php/result.php?lingo=deutsch&layer="+layerNames[j]+
- "' class='link_metadata' title='Zeigt Liste zum Thema: "+layerTitle+
- "' target='result'>";
- }
- str_tmp += "<img border=0 src = '";
- str_tmp += legendUrl;
- str_tmp += "'></img>";
- if (legendlink == 'true'){
- str_tmp += "</a>";
- }
- str_tmp += "</div>";
+ if (legendUrl !== false){
+
+// console.log("legendUrl: %s, typeof(legendUrl): %s", legendUrl, typeof(legendUrl));
+// if(layerParent == 0){
+ if(showlayertitle == 'true'){
+ str_tmp += "<div><span class='titles'>" + layerTitle+ "</span></div>";
}
- }
+ str_tmp += "<div>";
+ if(legendlink == 'true'){
+ str_tmp += "<a href='../php/result.php?lingo=deutsch&layer="+layerNames[j]+"' class='link_metadata' title='Zeigt Liste zum Thema: "+layerTitle+"' target='result'>";
+ }
+ str_tmp += "<img border=0 src = '";
+ str_tmp += legendUrl;
+ str_tmp += "'></img>";
+ if (legendlink == 'true'){
+ str_tmp += "</a>";
+ }
+ str_tmp += "</div>";
+// }
}
}
- }
-
if(str_tmp !=''){
if (showwmstitle == 'true'){
str += "<div><span class='header'>" +parent.mb_mapObj[ind].wms[i].wms_title+ "</span></div>";
}
str += str_tmp;
str_tmp ='';
- }
+ }
}
-
- if(str != ""){
+ //console.log("ind =%s",ind,"str =",str);
+ if(str != ""){
parent.writeTag("legend", "leg", str);
}
else{
More information about the Mapbender_commits
mailing list