[Mapbender-commits] r5238 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 23 05:34:29 EST 2009


Author: christoph
Date: 2009-12-23 05:34:29 -0500 (Wed, 23 Dec 2009)
New Revision: 5238

Added:
   trunk/mapbender/http/plugins/ol.js
   trunk/mapbender/http/plugins/ol_layerSwitch.js
   trunk/mapbender/http/plugins/ol_wms.php
Log:


Added: trunk/mapbender/http/plugins/ol.js
===================================================================
--- trunk/mapbender/http/plugins/ol.js	                        (rev 0)
+++ trunk/mapbender/http/plugins/ol.js	2009-12-23 10:34:29 UTC (rev 5238)
@@ -0,0 +1,62 @@
+/**
+ * Package: ol
+ *
+ * Description:
+ * An OpenLayers Map, configured with WMS from Mapbender application settings
+ * 
+ * Files:
+ *  - http/plugins/ol.js
+ *
+ * SQL:
+ * > <SQL for element> 
+ * > 
+ * > <SQL for element var> 
+ *
+ * Help:
+ * http://www.mapbender.org/ol
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:Christoph_Baudson
+ * 
+ * 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
+ */
+
+var ol_options = { 
+	scales: [
+		50000000, 
+		30000000, 
+		10000000, 
+		5000000
+	],
+	resolutions: [
+		1.40625,
+		0.703125,
+		0.3515625,
+		0.17578125,
+		0.087890625,
+		0.0439453125
+	],
+	minScale: 50000000,
+	maxResolution: "auto",
+	maxExtent: new OpenLayers.Bounds(-180, -90, 90, 180),
+	maxResolution: 0.17578125,
+	maxScale: 10000000,
+	minResolution: "auto",
+	minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),
+	minResolution: 0.0439453125,
+	numZoomLevels: 5,
+	units: "degrees"
+};
+
+OpenLayers.ImgPath = "../extensions/OpenLayers-2.8/img/";
+var map = new OpenLayers.Map(options.id, {maxResolution: 1.40625/2});
+
+Mapbender.modules[options.id] = $.extend(map, Mapbender.modules[options.id]);
+
+Mapbender.events.init.register(function () {
+	map.zoomToMaxExtent();
+});
\ No newline at end of file

Added: trunk/mapbender/http/plugins/ol_layerSwitch.js
===================================================================
--- trunk/mapbender/http/plugins/ol_layerSwitch.js	                        (rev 0)
+++ trunk/mapbender/http/plugins/ol_layerSwitch.js	2009-12-23 10:34:29 UTC (rev 5238)
@@ -0,0 +1,32 @@
+/**
+ * Package: ol_layerSwitch
+ *
+ * Description:
+ * An OpenLayers Layer Switch
+ * 
+ * Files:
+ *  - http/plugins/ol_layerSwitch.js
+ *
+ * SQL:
+ * > <SQL for element> 
+ * > 
+ * > <SQL for element var> 
+ *
+ * Help:
+ * http://www.mapbender.org/ol_layerSwitch
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:Christoph_Baudson
+ * 
+ * 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
+ */
+
+Mapbender.events.init.register(function () {
+	var ol_map = Mapbender.modules[options.target[0]];	
+	ol_map.addControl(new OpenLayers.Control.LayerSwitcher());	
+});
+

Added: trunk/mapbender/http/plugins/ol_wms.php
===================================================================
--- trunk/mapbender/http/plugins/ol_wms.php	                        (rev 0)
+++ trunk/mapbender/http/plugins/ol_wms.php	2009-12-23 10:34:29 UTC (rev 5238)
@@ -0,0 +1,51 @@
+/**
+ * Package: <Application element name>
+ *
+ * Description:
+ * <A description>
+ * 
+ * Files:
+ *  - <path and filename, like http/javascripts/mod_zoomIn1.php>
+ *
+ * SQL:
+ * > <SQL for element> 
+ * > 
+ * > <SQL for element var> 
+ *
+ * Help:
+ * http://www.mapbender.org/<wiki site name>
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:<user>
+ * 
+ * Parameters:
+ * <normal element var name>      - <type and description>
+ * <optional element var name>    - *[optional]* <type and description>
+ * <deprecated element var name>  - *[deprecated]* <type and description>
+ *
+ * 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
+ */
+ 
+ var ol_map = Mapbender.modules[options.target[0]];
+<?php
+
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_wms.php");
+
+$sql = "SELECT fkey_wms_id FROM gui_wms WHERE fkey_gui_id = $1 ORDER BY gui_wms_position";
+$v = array(Mapbender::session()->get("mb_user_gui"));
+$t = array('s');
+$res = db_prep_query($sql,$v,$t);
+
+$cnt=0;
+while($row = db_fetch_array($res)){
+	$mywms = new wms();
+	$mywms->createObjFromDB(Mapbender::session()->get("mb_user_gui"),$row["fkey_wms_id"]);
+	$mywms->createOlObjFromWMS($cnt==0);
+	$cnt++;
+}
+?>
\ No newline at end of file



More information about the Mapbender_commits mailing list