[Mapbender-commits] r7010 - in trunk/mapbender: http/javascripts lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 4 03:51:08 EDT 2010


Author: kmq
Date: 2010-10-04 07:51:08 +0000 (Mon, 04 Oct 2010)
New Revision: 7010

Modified:
   trunk/mapbender/http/javascripts/initWmcObj.php
   trunk/mapbender/lib/class_GetApi.php
Log:
add GeoRSS to getAPI

Modified: trunk/mapbender/http/javascripts/initWmcObj.php
===================================================================
--- trunk/mapbender/http/javascripts/initWmcObj.php	2010-10-04 07:49:05 UTC (rev 7009)
+++ trunk/mapbender/http/javascripts/initWmcObj.php	2010-10-04 07:51:08 UTC (rev 7010)
@@ -67,7 +67,8 @@
 	"WMC" => getConfiguration("WMC"),
 	"WMS" => getConfiguration("WMS"),
 	"LAYER" => getConfiguration("LAYER"),
-	"FEATURETYPE" => getConfiguration("FEATURETYPE")
+	"FEATURETYPE" => getConfiguration("FEATURETYPE"),
+	"GEORSS"=>getConfiguration("GEORSS")
 );
 $getApi = new GetApi($getParams);
 
@@ -263,6 +264,11 @@
 	));
 }
 
+$inputGeoRSSArray = $getApi->getGeoRSSFeeds();
+if($inputGeoRSSArray){
+	$wmc->generalExtensionArray['GEORSS'] = $inputGeoRSSArray; 
+}
+
 //workaround to have a fully merged WMC for loading
 
 $xml = $wmcGetApi->toXml();
@@ -386,9 +392,17 @@
 		]);
 	});
 JS;
-
 $outputString .= $wmcFeaturetypeStr;
 
+$GeoRSSStr = " Mapbender.events.afterInit.register(function () {";
+foreach($inputGeoRSSArray as $inputGeoRSSUrl){
+	$GeoRSSStr .= '$("#mapframe1").georss({url: "'.$inputGeoRSSUrl .'"})';
+}
+$GeoRSSStr .="}); ";
+
+$outputString .= $GeoRSSStr;
+
+
 echo $outputString;
 
 

Modified: trunk/mapbender/lib/class_GetApi.php
===================================================================
--- trunk/mapbender/lib/class_GetApi.php	2010-10-04 07:49:05 UTC (rev 7009)
+++ trunk/mapbender/lib/class_GetApi.php	2010-10-04 07:51:08 UTC (rev 7010)
@@ -13,6 +13,7 @@
 class GetApi {
 	private $layers = array();
 	private $featuretypes = array();
+	private $geoRSSFeeds = array();
 	private $wmc = array();
 	
 	/**
@@ -33,6 +34,9 @@
 				case "FEATURETYPE":
 					$this->featuretypes = $this->normalizeFeaturetypeInput($value);
 					break;
+				case "GEORSS":
+					$this->geoRSSFeeds = $this->normalizeGeoRSSInput($value);
+					break;
 			}
 		}
 	}
@@ -53,6 +57,15 @@
 		return $this->featuretypes;
 	}
 
+	/*
+	 * 
+	 *
+	 */
+	public function getGeoRSSFeeds(){
+		return $this->geoRSSFeeds;
+
+	}
+
 	/**
 	 * Returns an array of wmc
 	 * @return array
@@ -196,6 +209,10 @@
 		}
 		return $input;
 	}
+
+	private function normalizeGeoRSSInput($input){
+		return is_array($input) ? $input : array($input);
+	}
 }
 
-?>
\ No newline at end of file
+?>



More information about the Mapbender_commits mailing list