[Mapbender-commits] r6701 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Aug 5 11:45:23 EDT 2010


Author: christoph
Date: 2010-08-05 15:45:23 +0000 (Thu, 05 Aug 2010)
New Revision: 6701

Modified:
   trunk/mapbender/http/classes/class_wms.php
Log:
added getLayerByPos
removed obsolete function copyConfiguration

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2010-08-05 14:21:35 UTC (rev 6700)
+++ trunk/mapbender/http/classes/class_wms.php	2010-08-05 15:45:23 UTC (rev 6701)
@@ -1,27 +1,16 @@
 <?php
-# $Id$
-# http://www.mapbender.org/index.php/class_wms
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# 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.
+# License:
+# Copyright (c) 2009, Open Source Geospatial Foundation
+# This program is dual licensed under the GNU General Public License 
+# and Simplified BSD license.  
+# http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
 
-require_once(dirname(__FILE__)."/../../core/globalSettings.php");
-require_once(dirname(__FILE__)."/class_connector.php");
-require_once(dirname(__FILE__)."/class_user.php");
-require_once(dirname(__FILE__)."/class_administration.php");
-require_once(dirname(__FILE__)."/class_georss_factory.php");
+require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+require_once dirname(__FILE__) . "/class_connector.php";
+require_once dirname(__FILE__) . "/class_user.php";
+require_once dirname(__FILE__) . "/class_administration.php";
+require_once dirname(__FILE__) . "/class_georss_factory.php";
+require_once dirname(__FILE__) . "/../classes/class_universal_wms_factory.php";
 
 class wms {
 	var $lastURL;
@@ -236,6 +225,15 @@
 		return null;
 	}
 
+	public function getLayerByPos ($pos) {
+		for ($i = 0; $i < count($this->objLayer); $i++) {
+			if (strval($this->objLayer[$i]->layer_pos) === strval($pos)) {
+				return $this->objLayer[$i];
+			}
+		}
+		return null;
+	}
+
 	function createOlObjFromWMS($base){
 	 	if(!$this->wms_title || $this->wms_title == ""){
 			echo "alert('Error: no valid capabilities-document !!');";
@@ -340,34 +338,6 @@
 	}  
 	
 	/**
-	 * The other WMS must be the same as this WMS, but with different
-	 * application settings. These application settings are copied,
-	 * the local settings are overwritten.
-	 * 
-	 * @return boolean true if the settings could be copied; false 
-	 * 					when an error occured.
-	 * @param $anotherWms wms The same WMS with possibly other settings
-	 */
-/*
-	public function copyConfiguration ($anotherWms) {
-		if (!$this->equals($anotherWms)) {
-			$e = new mb_exception("class_wms.php: copyConfiguration(): parameters cannot be copied, it's a different WMS.");
-			return false;
-		}
-		for ($i = 0; $i < count($this->objLayer); $i++) {
-			$myCurrentLayer = $this->objLayer[$i];
-			$theirCurrentLayer = $anotherWms->objLayer[$i];
-
-			$myCurrentLayer->gui_layer_selectable = $theirCurrentLayer->gui_layer_selectable;
-			$myCurrentLayer->gui_layer_visible    = $theirCurrentLayer->gui_layer_visible;
-			$myCurrentLayer->gui_layer_queryable  = $theirCurrentLayer->gui_layer_queryable;
-			$myCurrentLayer->gui_layer_querylayer = $theirCurrentLayer->gui_layer_querylayer;
-			$myCurrentLayer->gui_layer_style      = $theirCurrentLayer->gui_layer_style;
-		}
-	}
-*/	
-	
-	/**
 	 * Removes duplicate WMS from an array of WMS. To find duplicates,
 	 * two WMS are compared via equals().
 	 * 



More information about the Mapbender_commits mailing list