[Mapbender-commits] r1452 - branches/mapbender_sld/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jun 12 18:22:09 EDT 2007


Author: uli
Date: 2007-06-12 18:22:09 -0400 (Tue, 12 Jun 2007)
New Revision: 1452

Modified:
   branches/mapbender_sld/http/javascripts/map_obj.js
Log:
some more methods of the mapOjb class

Modified: branches/mapbender_sld/http/javascripts/map_obj.js
===================================================================
--- branches/mapbender_sld/http/javascripts/map_obj.js	2007-06-11 17:33:54 UTC (rev 1451)
+++ branches/mapbender_sld/http/javascripts/map_obj.js	2007-06-12 22:22:09 UTC (rev 1452)
@@ -7,7 +7,25 @@
 //global variables
 var wms = [];
 var wms_layer_count = 0;
-//list of all wms-objects
+
+/*
+ * global function to add wms to the wms-object
+ * 
+ * @param {String} wms_id the unique id of the wms 
+ * @param {String} wms_version the version assumed from capabilities
+ * @param {String} wms_title the title of the wms
+ * @param {String} wms_abstract the abstract of the wms
+ * @param {String} wms_getmap the url for map requests
+ * @param {String} wms_getfeatureinfo the url for featureInof requests
+ * @param {String} wms_getlegendurl the url for legend requests
+ * @param {String} wms_filter a filter (deprecated)
+ * @param {String} gui_wms_mapformat the image-format in the actual gui
+ * @param {String} gui_wms_featureinfoformat the current format for featureInfos
+ * @param {String} gui_wms_exceptionformat the exceptionformat for map requests
+ * @param {String} gui_wms_epsg the current srs
+ * @param {Integer} gui_wms_visible the visibility of this service
+ * @param {String} gui_wms_sldurl url to an actual sld
+ */
 function add_wms(
 			wms_id,
 			wms_version,
@@ -40,7 +58,26 @@
 					gui_wms_sldurl);
 					wms_layer[wms.length - 1] = [];
 }
-//the wms constructor
+/**
+ * @class A class representing the wms
+ *
+ * @constructor
+ * @param {String} wms_id the unique id of the wms 
+ * @param {String} wms_version the version assumed from capabilities
+ * @param {String} wms_title the title of the wms
+ * @param {String} wms_abstract the abstract of the wms
+ * @param {String} wms_getmap the url for map requests
+ * @param {String} wms_getfeatureinfo the url for featureInof requests
+ * @param {String} wms_getlegendurl the url for legend requests
+ * @param {String} wms_filter a filter (deprecated)
+ * @param {String} gui_wms_mapformat the image-format in the actual gui
+ * @param {String} gui_wms_featureinfoformat the current format for featureInfos
+ * @param {String} gui_wms_exceptionformat the exceptionformat for map requests
+ * @param {String} gui_wms_epsg the current srs
+ * @param {String} gui_wms_visible the visibility of this service
+ * @param {String} gui_wms_sldurl url to an actual sld
+ * 
+ */
 function wms_const(  
 			wms_id,
 			wms_version,
@@ -90,7 +127,7 @@
 	this.gui_maxx = [];
 	this.gui_maxy = [];
 
-// opacity version 
+	// opacity version 
 	this.gui_wms_mapopacity = 1;
 	// sld version
 	this.gui_wms_sldurl = gui_wms_sldurl;      
@@ -99,10 +136,9 @@
 /**
  * rephrases the mapRequest
  *
- * @member wms_const
- * @param Object mapObj the mapbender mapObject of the wms  
- * @return mapRequest, onlineresource + params
- * @type string
+ * @param {Object} mapObj the mapbender mapObject of the wms  
+ * @return mapRequest, i.e. onlineresource + params
+ * @type String
  */
 wms_const.prototype.getMapRequest = function(mapObj){	
 	console.log()
@@ -128,8 +164,9 @@
 	rq += "&BBOX=" + mapObj.getExtent();
 	rq += "&STYLES=" + this.getLayerstyles(mapObj).join(",");
 	rq += "&FORMAT=" + this.gui_wms_mapformat;
-	rq += "&EXCEPTIONS=";
-	console.log(rq);
+	rq += "&EXCEPTIONS=" + this.gui_wms_exceptionformat;
+	//Todo: error occurs:
+	//var throwNotice = new Mb_notice("getMapRequest: " + rq);
 	return rq;
 };
 
@@ -137,9 +174,8 @@
 /**
  * rephrases the featureInfoRequest
  *
- * @member wms_const
- * @param Object mapObj the mapbender mapObject of the wms  
- * @param Point clickPoint map-click position 
+ * @param {Object} mapObj the mapbender mapObject of the wms  
+ * @param {Point} clickPoint map-click position {@link Point}
  * @return featureInfoRequest, onlineresource + params
  * @type string
  */
@@ -147,7 +183,7 @@
 	
 	//check layers and querylayers first 
 	var layers = this.getLayers(mapObj);
-	var querylayers = this.getQuerylayers();
+	var querylayers = this.getQuerylayers(mapObj);
 	
 	if(!layers || !querylayers){
 		return false;
@@ -168,19 +204,19 @@
 	rq += "&HEIGHT=" + mapObj.getHeight();
 	rq += "&SRS=" + mapObj.getSRS();
 	rq += "&BBOX=" + mapObj.getExtent();
-	rq += "&STYLES=" + this.getLayerstyles().join(",");
+	rq += "&STYLES=" + this.getLayerstyles(mapObj).join(",");
 	rq += "&FORMAT=" + this.gui_wms_mapformat;
 	rq += "&INFO_FORMAT=" + this.gui_wms_featureinfoformat;
 	rq += "&EXCEPTIONS=application/vnd.ogc.se_xml";
 	rq += "&X=" + clickPoint.x;
 	rq += "&Y=" + clickPoint.y;
+	console.log(rq);
 	return rq;
 };
 
 /**
  * get all visible layers
  *
- * @member wms_const 
  * @return array of layernames 
  * @type string[]
  */
@@ -210,7 +246,6 @@
 /**
  * get the actual style of all visible layers
  *
- * @member wms_const 
  * @return commaseparated list of actual layerstyles
  * @type string
  */
@@ -234,7 +269,6 @@
 /**
  * get the style of the layer
  *
- * @member wms_const 
  * @param layername
  * @return the stylename of the given layer
  * @type string
@@ -246,7 +280,6 @@
 /**
  * get all querylayers
  *
- * @member wms_const 
  * @return array of layernames
  * @type string[]
  */
@@ -257,12 +290,13 @@
 			queryLayers.push(this.objLayer[i].layer_name);
 		}
 	}
-	if(queryLayers.lebngth === 0){
+	if(queryLayers.length === 0){
 		return false;
 	}
 	return queryLayers;
 };
 
+
 function wms_add_data_type_format(datatype,dataformat){
 	var insertDataFormat = true;
 	for (var i = 0 ; i < wms[wms.length-1].data_type.length ; i ++) {
@@ -395,7 +429,6 @@
 /**
  * check the scale of the layer
  *
- * @member wms_layer 
  * @param Object mapObj the mapbender mapObject of the layer
  * @return boolean if the layer is in scale or not
  * @type boolean



More information about the Mapbender_commits mailing list