[Mapbender-commits] r4090 - in trunk/mapbender: core http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jun 23 11:59:04 EDT 2009


Author: verenadiewald
Date: 2009-06-23 11:59:04 -0400 (Tue, 23 Jun 2009)
New Revision: 4090

Modified:
   trunk/mapbender/core/system.php
   trunk/mapbender/http/javascripts/map.php
   trunk/mapbender/http/javascripts/mod_addWMS.php
Log:
Mapbender API

Modified: trunk/mapbender/core/system.php
===================================================================
--- trunk/mapbender/core/system.php	2009-06-23 15:37:08 UTC (rev 4089)
+++ trunk/mapbender/core/system.php	2009-06-23 15:59:04 UTC (rev 4090)
@@ -40,5 +40,5 @@
 	"mapframe1,featureInfo1,gazetteerWFS,back,forward,zoomCoords,zoomFull,zoomIn1," .
 	"zoomOut1,selArea1,pan1,copyright,dependentDiv,dragMapSize," .
 	"dynamicOverview,FeatureInfoRedirect,highlightPOI,navFrame,sandclock," .
-	"scaleBar,scaleSelect,setBBOX,setPOI2Scale,reload,overview"
+	"scaleBar,scaleSelect,setBBOX,setPOI2Scale,reload,overview,addWMS"
 );

Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php	2009-06-23 15:37:08 UTC (rev 4089)
+++ trunk/mapbender/http/javascripts/map.php	2009-06-23 15:59:04 UTC (rev 4090)
@@ -23,7 +23,7 @@
 $json = new Mapbender_JSON();
 
 // see http://trac.osgeo.org/mapbender/ticket/79
-ini_set('session.bug_compat_42',0); 
+ini_set('session.bug_compat_42',0);
 ini_set('session.bug_compat_warn',0);
 
 /*
@@ -76,8 +76,8 @@
 // Load external JavaScript libraries
 //
 $extPath = dirname(__FILE__) . "/../extensions/";
-$extFileArray = array(  "jquery-1.2.6.min.js", 
-						"jqjson.js", 
+$extFileArray = array(  "jquery-1.2.6.min.js",
+						"jqjson.js",
 						"jquery.mousewheel.min.js",
 						"jquery.form.js");
 
@@ -96,7 +96,7 @@
 ?>
 $(function () {
 	initModules();
-	
+
 	// creates the map objects (mapframe1, overview...)
 	eventInitMap.trigger();
 
@@ -104,17 +104,17 @@
 
 	// initialisation
 	eventInit.trigger();
-	
+
 	eventAfterInit.trigger();
-	
+
 });
 <?php
 //
 // Load internal JavaScript libraries
 //
 $libPath = dirname(__FILE__) . "/../../lib/";
-$libFileArray = array(  "exception.js", 
-						"ajax.js", 
+$libFileArray = array(  "exception.js",
+						"ajax.js",
 						"basic.js",
 						"div.js",
 						"list.js",
@@ -168,7 +168,7 @@
 ?>
 Mapbender.Modules = {};
 Mapbender.addModule = function (name, obj) {
-	if (name && !Mapbender.Modules[name]) {	
+	if (name && !Mapbender.Modules[name]) {
 		Mapbender.Modules[name] = obj;
 		return true;
 	}
@@ -203,19 +203,20 @@
 			}
 			if (in_array($e_id, $modulesNotRelyingOnGlobalsArray)) {
 				ob_start();
-				echo "var options = {" . 
-					"id:'$e_id'," . 
+				echo "var options = {" .
+					"id:'$e_id'," .
 					"target:" . ($e_target[0] != "" ? $json->encode($e_target) : "[]") . "," .
-					"top:$e_top," . 
-					"left:$e_left," . 
-					"width:$e_width," . 
-					"height:$e_height," . 
-					"src:'$e_src'" . 
+					"top:$e_top," .
+					"left:$e_left," .
+					"width:$e_width," .
+					"height:$e_height," .
+					"requires:'$e_require'," .
+					"src:'$e_src'" .
 					"};";
 
 				include "../include/dyn_js_object.php";
 				echo <<<JS
-				
+
 $.fn.$e_id = function (options) {
 	return this.each(function () {
 
@@ -231,7 +232,7 @@
 				$executeJsPluginsArray[] = ob_get_contents();
 				ob_end_clean();
 				echo "Mapbender.Modules.$e_id = {};\n";
-				
+
 			}
 			else {
 				echo "Mapbender.Modules." . $e_id . " = {\n";

Modified: trunk/mapbender/http/javascripts/mod_addWMS.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_addWMS.php	2009-06-23 15:37:08 UTC (rev 4089)
+++ trunk/mapbender/http/javascripts/mod_addWMS.php	2009-06-23 15:59:04 UTC (rev 4090)
@@ -1,7 +1,7 @@
 <?php
 # $Id$
 # http://www.mapbender.org/index.php/mod_addWMS.php
-# Copyright (C) 2002 CCGIS 
+# 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
@@ -16,17 +16,26 @@
 # 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.
+?>
+var mod_addWMS_data = options.requires;
+var mod_addWMS_target1 = options.target[0];
+var mod_addWMS_target2 = options.target[1];
 
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+$(this).click(function () {
+	mod_addWMS();
+}).mouseover(function () {
+	if (options.src) {
+		this.src = options.src.replace(/_off/, "_over");
+	}
+}).mouseout(function () {
+	if (options.src) {
+		this.src = options.src;
+	}
+});
 
-echo "var mod_addWMS_data = '".$e_require."';";
-echo "var mod_addWMS_target1 = '".trim($e_target[0])."';";
-echo "var mod_addWMS_target2 = '".trim($e_target[1])."';";
-?>
-
 function mod_addWMS(){
    var load = prompt("Capabilities - URL:","");
    if(load){
-      mod_addWMS_load(load);    
+      mod_addWMS_load(load);
    }
-}
+}
\ No newline at end of file



More information about the Mapbender_commits mailing list