[Mapbender-commits] r1905 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Dec 7 09:53:37 EST 2007
Author: verenadiewald
Date: 2007-12-07 09:53:32 -0500 (Fri, 07 Dec 2007)
New Revision: 1905
Modified:
trunk/mapbender/http/javascripts/map.js
Log:
changed function setSingleMapRequest, because should not set MapRequest if layer are out of scale
Modified: trunk/mapbender/http/javascripts/map.js
===================================================================
--- trunk/mapbender/http/javascripts/map.js 2007-12-07 14:07:15 UTC (rev 1904)
+++ trunk/mapbender/http/javascripts/map.js 2007-12-07 14:53:32 UTC (rev 1905)
@@ -841,7 +841,12 @@
for(var ii=0; ii<mb_mapObj[i].wms.length; ii++){
var myDivId = "div_" + ii;
var myMapId = "map_" + ii;
- if(mb_mapObj[i].wms[ii].wms_id == wms_id){
+
+ //disable Layer which are out of scale
+ var validLayers = mb_checkScale(frameName,i,ii);
+ var layerNames = validLayers.toString();
+
+ if(mb_mapObj[i].wms[ii].wms_id == wms_id && layerNames!=''){
var newMapURL = "";
newMapRequest += "<img id='"+myMapId+"' name='mapimage' src='";
newMapURL += mb_mapObj[i].wms[ii].wms_getmap;
@@ -851,11 +856,6 @@
if(mb_mapObj[i].wms[ii].wms_version == "1.0.0"){newMapURL += "WMTVER="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=map&";}
if(mb_mapObj[i].wms[ii].wms_version != "1.0.0"){newMapURL += "VERSION="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=GetMap&SERVICE=WMS&";}
- //disable Layer which are out of scale
- var validLayers = mb_checkScale(frameName,i,ii);
- var layerNames = validLayers.toString();
- //var str_LayerStyles = mb_checkScale(frameName,i,ii);
-
newMapURL += "LAYERS="+layerNames+"&";
var layer = layerNames.split(",");
for(var j=0; j<layer.length; j++){
@@ -869,8 +869,7 @@
newMapURL += mb_mapObj[i].wms[ii].getCurrentStyleByLayerName(layer[j]);
}
}
- //newMapURL += "STYLES="+str_LayerStyles[1]+"&";
-
+
newMapURL += "SRS="+mb_mapObj[i].epsg+"&";
newMapURL += "BBOX="+mb_mapObj[i].extent+"&";
newMapURL += "WIDTH="+mb_mapObj[i].width+"&";
@@ -902,7 +901,6 @@
//prompt("",newMapURL);
if(mb_mapObj[i].layers[ii] != ""){
-// if(mb_mapObj[i].layers[ii] != "" && str_LayerStyles[0] != ""){
newMapRequest += newMapURL;
mb_mapObj[i].mapURL[ii] = newMapURL;
mb_mapObj[i].wms[ii].mapURL = newMapURL;
@@ -964,10 +962,6 @@
var thisLayer = mb_mapObj[mObj].layers[wmsObj].split(",");
var thisScale = mb_getScale(frameName);
var str_layer = "";
- //var str_styles = "";
- //var str_titles = "";
- //var str_legendurls = "";
- //var str_parent = "";
var cnt_layer = 0;
for(var i=0; i<mb_mapObj[mObj].wms[wmsObj].objLayer.length; i++){
var myLayername = mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_name;
@@ -982,12 +976,6 @@
if(maxscaleOK == true && minscaleOK == true ){
if(cnt_layer > 0){str_layer += ","; }//str_styles += ","; str_titles += ",";str_parent += ","; str_legendurls += ",";}
str_layer += thisLayer[ii];
- //str_styles += "";
- //str_titles += mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_title;
- //str_parent += mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_parent;
- //if(mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_style.length>0){
- // str_legendurls += mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_style[0]["legendurl"] ;
- //}
cnt_layer++;
}
}
@@ -995,10 +983,6 @@
}
var str_layerstyles = [];
str_layerstyles[0] = str_layer;
- //str_layerstyles[1] = str_styles;
- //str_layerstyles[2] = str_titles;
- //str_layerstyles[3] = str_legendurls;
- //str_layerstyles[4] = str_parent;
return str_layerstyles;
}
function setFeatureInfoRequest(fName,x,y, path) {
More information about the Mapbender_commits
mailing list