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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Sep 24 11:14:18 EDT 2010


Author: christoph
Date: 2010-09-24 15:14:18 +0000 (Fri, 24 Sep 2010)
New Revision: 6945

Modified:
   trunk/mapbender/http/classes/class_wms_1_1_1_factory.php
Log:
createLayerFromDb: If only a layer is loaded, its parent's layer_epsg settings are overwritten to match the current layer. So zooming to this WMS will in effect zoom to the layer.

Modified: trunk/mapbender/http/classes/class_wms_1_1_1_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wms_1_1_1_factory.php	2010-09-24 14:22:40 UTC (rev 6944)
+++ trunk/mapbender/http/classes/class_wms_1_1_1_factory.php	2010-09-24 15:14:18 UTC (rev 6945)
@@ -85,22 +85,25 @@
 		// 2. delete layers not for keeping
 		//
 		$i = 0;
-new mb_exception(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;");
-new mb_exception(serialize($keep));
-new mb_exception("======================================================");
-new mb_exception(serialize($myWms->objLayer));
+		$isParent = true;
 		while ($i < count($myWms->objLayer)) {
 			$l = $myWms->objLayer[$i];
 			if (in_array($l->layer_uid, $keep)) {
+				if ($isParent) {
+					if ($l->layer_uid === $currentLayer->layer_uid) {
+						$isParent = false;
+					}
+					else {
+						// use extent of the requested layers, overwrite parent extent
+						$l->layer_epsg = $currentLayer->layer_epsg;
+					}
+				}
 				$i++;
 				continue;
 			}
 			// delete layer
 			array_splice($myWms->objLayer, $i, 1);
 		}
-new mb_exception(".......................................................");
-new mb_exception(serialize($myWms->objLayer));
-new mb_exception(":::::::::::::::::::::::::::::::::::::::::::::::::::::::");
 		return $myWms;
 	}
 }



More information about the Mapbender_commits mailing list