[Mapbender-commits] r1343 - branches/redesign/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu May 24 02:54:03 EDT 2007
Author: uli
Date: 2007-05-24 02:54:03 -0400 (Thu, 24 May 2007)
New Revision: 1343
Modified:
branches/redesign/http/javascripts/map.php
Log:
some new methods for the mb_mapObj and a new function getMapObjByName
Modified: branches/redesign/http/javascripts/map.php
===================================================================
--- branches/redesign/http/javascripts/map.php 2007-05-23 15:33:16 UTC (rev 1342)
+++ branches/redesign/http/javascripts/map.php 2007-05-24 06:54:03 UTC (rev 1343)
@@ -163,12 +163,75 @@
this.epsg = wms[0].gui_wms_epsg;
this.extent = setExtent(this.width,this.height,this.epsg);
this.mapURL = new Array();
+
+ /**
+ * get the width of the mapObj
+ *
+ * @member mb_mapObj_const
+ * @return width of the mapObj
+ * @type integer
+ */
+ this.getWidth = function(){
+ return this.width;
+ };
+
+ /**
+ * get the height of the mapObj
+ *
+ * @member mb_mapObj_const
+ * @return width of the mapObj
+ * @type integer
+ */
+ this.getWidth = function(){
+ return this.height;
+ };
+
+ /**
+ * get the extent of the mapObj
+ *
+ * @member mb_mapObj_const
+ * @return extent of the mapObj as commaseparated minx,minx,maxx,maxy
+ * @type string
+ */
+ this.getExtent = function(){
+ return this.extent;
+ };
+
+ /**
+ * get the srs of the mapObj
+ *
+ * @member mb_mapObj_const
+ * @return srs as epsg:number
+ * @type string
+ */
+ this.getSRS = function(){
+ return this.epsg;
+ };
+
+ /**
+ * get all featureInfoRequests
+ *
+ * @member mb_mapObj_const
+ * @param float x the x-value of the click position in pixel
+ * @param float y the y-value of the click position in pixel
+ * @return array of all featureInfoRequests of this map object
+ * @type string[]
+ */
+ this.getFeatureInfoRequests = function(clickPoint){
+ var allRequests = [];
+ //loop through all wms to get the FeatureInfoRequests
+ for(var i=0; i<this.wms.length; i++){
+ allRequests.push(this.wms[i].getFeatureInfoRequest(this, clickPoint));
+ }
+ };
+
+
+
for(var i=0; i<mb_MapObjectSubFunctions.length; i++){
eval(mb_MapObjectSubFunctions[i]);
}
}
-
function mb_getConjunctionCharacter(onlineresource){
if(onlineresource.indexOf("?") > -1){
if(onlineresource.charAt(onlineresource.length-1) == "?"){
@@ -352,7 +415,7 @@
}
}
function setMapRequest(frameName){
- var functionName = 'setMapRequest';
+
var ts = mb_timestamp();
for(var i=0; i<mb_MapRequestPreFunctions.length; i++){
@@ -446,7 +509,7 @@
}
}
function setSingleMapRequest(frameName,wms_id){
- var functionName = 'setSingleMapRequest';
+
var ts = mb_timestamp();
for(var i=0; i<mb_MapRequestPreFunctions.length; i++){
@@ -601,7 +664,6 @@
return str_layerstyles;
}
function setFeatureInfoRequest(fName,x,y, path) {
- var functionName = 'setFeatureInfoRequest';
var ts = mb_timestamp();
for(var i=0; i<mb_FeatureInfoPreFunctions.length; i++){
eval(mb_FeatureInfoPreFunctions[i]);
@@ -924,6 +986,14 @@
}
}
}
+function getMapObjByName(frameName){
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == frameName){
+ return mb_mapObj[i];
+ }
+ }
+ return false;
+}
function mb_getLayerTitleByName(map_index, wms_index, myLayer_name){
for(var i=0; i<mb_mapObj[map_index].wms[wms_index].objLayer.length; i++){
if(mb_mapObj[map_index].wms[wms_index].objLayer[i].layer_name == myLayer_name){
More information about the Mapbender_commits
mailing list