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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jun 23 13:46:17 EDT 2009


Author: christoph
Date: 2009-06-23 13:46:17 -0400 (Tue, 23 Jun 2009)
New Revision: 4102

Modified:
   trunk/mapbender/http/javascripts/core.php
   trunk/mapbender/http/javascripts/geometry.js
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/mapnf.php
   trunk/mapbender/http/javascripts/mod_box1.js
   trunk/mapbender/http/javascripts/mod_help.php
   trunk/mapbender/http/javascripts/mod_sandclock.php
   trunk/mapbender/http/javascripts/mod_scaleSel.php
   trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
   trunk/mapbender/http/javascripts/mod_zoomFull.php
   trunk/mapbender/http/javascripts/mod_zoomIn1.php
   trunk/mapbender/http/javascripts/mod_zoomOut1.php
   trunk/mapbender/http/javascripts/ovnf.php
   trunk/mapbender/lib/core.js
   trunk/mapbender/lib/event.js
Log:


Modified: trunk/mapbender/http/javascripts/core.php
===================================================================
--- trunk/mapbender/http/javascripts/core.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/core.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -17,8 +17,21 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+header('Content-type: application/x-javascript');
+?>
+/**
+ * Class: Mapbender
+ * 
+ * All Mapbender functionality is within this namespace
+ * 
+ * 
+ */
+ var Mapbender = {
+ 	events: {},
+ 	modules: {}	
+ };
+<?php
 ob_start();
-header('Content-type: application/x-javascript');
 require_once(dirname(__FILE__) . "/../../lib/event.js");
 require_once(dirname(__FILE__) . "/../../lib/core.js");
 ?>
\ No newline at end of file

Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/geometry.js	2009-06-23 17:46:17 UTC (rev 4102)
@@ -1669,7 +1669,7 @@
 	 * @type DivTag
 	 */
 	var mapframe = aMapframe;
-	var map = Mapbender.Modules[mapframe];
+	var map = Mapbender.modules[mapframe];
 	if (!map) {
 		new Mb_exception(mapframe + " not found by geometry.js.");
 		return;

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/map_obj.js	2009-06-23 17:46:17 UTC (rev 4102)
@@ -3,9 +3,30 @@
 * COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
 * License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
 */
-var mb_mapObj = [];
 
-function Map (frameName, elementName, width, height, wms_index){
+/**
+ * Package: Map
+ * 
+ * Description:
+ * This is the central module for displaying the composite map overlay.
+ * 
+ * Help:
+ * http://www.mapbender.org/Mapframe
+ */
+ 
+/**
+ * Constructor
+ * 
+ * Parameters:
+ * frameName		- *[deprecated]* the name of the iframe, for backwards
+ * 						compatibility only
+ * elementName		- the ID of the DOM node
+ * width			- width of the map in pixel
+ * height			- height of the map in pixel
+ * wms_index		- restrict the WMS in the map to the WMS with this ID
+ * 						(useful for overview maps)
+ */
+Mapbender.Map = function (frameName, elementName, width, height, wms_index) {
 
 	/**
 	 * set the extent of the wms
@@ -1005,7 +1026,7 @@
 	eventAfterMapObjectConstruction.trigger();
 }
 
-Map.prototype.getWfsConfIds = function (wfs_config) {
+Mapbender.Map.prototype.getWfsConfIds = function (wfs_config) {
 	var db_wfs_conf_id = [];
 	var js_wfs_conf_id = [];
 

Modified: trunk/mapbender/http/javascripts/mapnf.php
===================================================================
--- trunk/mapbender/http/javascripts/mapnf.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mapnf.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -25,15 +25,15 @@
 
 	eventInitMap.register(function () {
 		
-		Mapbender.Modules[options.id] = new Map (
+		Mapbender.modules[options.id] = new Mapbender.Map (
 			'', 
 			options.id, 
 			options.width, 
 			options.height, 
 			null
 		);
-		mb_mapObj.push(Mapbender.Modules[options.id]);
-		var mapObject = Mapbender.Modules[options.id];
+		mb_mapObj.push(Mapbender.modules[options.id]);
+		var mapObject = Mapbender.modules[options.id];
 		
 		try {
 			if (restrictedExtent !== '') {

Modified: trunk/mapbender/http/javascripts/mod_box1.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_box1.js	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mod_box1.js	2009-06-23 17:46:17 UTC (rev 4102)
@@ -60,7 +60,7 @@
 }
 function mb_drawBox(left,top,right,bottom){
 	//Look if we have the Box elements
-	mb_boxMapObj = Mapbender.Modules[mb_isBF];
+	mb_boxMapObj = Mapbender.modules[mb_isBF];
 	var map_el = mb_boxMapObj.getDomElement();
 	if(!map_el.ownerDocument.getElementById(mb_boxMapObj.elementName+"_l_top")){
 		//create Box Elements

Modified: trunk/mapbender/http/javascripts/mod_help.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_help.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mod_help.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -51,8 +51,8 @@
 	mod_help_set();
 	//request help string
 	var usemapHtml = "";
-	for (var module in Mapbender.Modules) {
-		var currentModule = Mapbender.Modules[module];
+	for (var module in Mapbender.modules) {
+		var currentModule = Mapbender.modules[module];
 		var top = parseInt(currentModule.top) || 0;
 		var left = parseInt(currentModule.left) || 0;
 		var width = parseInt(currentModule.width) || 0;
@@ -79,9 +79,9 @@
 
 	$('#mod_help_img').empty().html(html);
 
-	for (var module in Mapbender.Modules) {
+	for (var module in Mapbender.modules) {
 		(function () {
-			var currentModule = Mapbender.Modules[module];
+			var currentModule = Mapbender.modules[module];
 			if (currentModule.url) {
 				$("#helpArea_" + module).click(function () {
 					mod_help_disable();
@@ -135,7 +135,7 @@
 function mod_help_update(){
 	//try to update tab coords
 	try{
-		for (var module in Mapbender.Modules) {
+		for (var module in Mapbender.modules) {
 			var tab = $("#tabs_" + module).get(0);
 			if (tab) {
 				var area = $("#helpArea_" + module).get(0);			

Modified: trunk/mapbender/http/javascripts/mod_sandclock.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_sandclock.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mod_sandclock.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -55,7 +55,7 @@
 		return;
 	}
 	
-	if (!Mapbender.Modules[options.target]) {
+	if (!Mapbender.modules[options.target]) {
 		new Mb_exception("Target " + options.target + " not found by " + this.id)
 	}
 	var map;
@@ -90,7 +90,7 @@
 	this.show = function (mapId) {
 		var temp = "<img src='"+mod_sandclock_img.src+"'>";
 		if (!isInitialised) {
-			map = Mapbender.Modules[options.target];
+			map = Mapbender.modules[options.target];
 			var map_el = map.getDomElement();
 			if(!map_el.ownerDocument.getElementById(map.elementName+"_sandclock")){
 				//create Box Elements

Modified: trunk/mapbender/http/javascripts/mod_scaleSel.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_scaleSel.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mod_scaleSel.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -24,13 +24,13 @@
 });
 
 function mod_scaleSelect(obj){
-	var myMapObj = Mapbender.Modules[mod_scaleSelect_target];
+	var myMapObj = Mapbender.modules[mod_scaleSelect_target];
 	var ind = obj.selectedIndex;
 	myMapObj.repaintScale(null,null,obj.options[ind].value);
 }
 function mod_scaleSelect_val(frameName){
 	if(frameName == mod_scaleSelect_target){
-		var myMapObj = Mapbender.Modules[mod_scaleSelect_target];
+		var myMapObj = Mapbender.modules[mod_scaleSelect_target];
 		var scale = myMapObj.getScale();
 		document.getElementById("scaleSelect").options[0].text = "1 : " + scale;
 		document.getElementById("scaleSelect").options[0].selected = true;

Modified: trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -125,10 +125,10 @@
 }
 // end of button management spatialRequest ///////////
 
-parent.Mapbender.Event.init.register(function () {
+parent.Mapbender.events.init.register(function () {
 	initModWfsGazetteer();	
 });
-parent.Mapbender.Event.init.register(function () {
+parent.Mapbender.events.init.register(function () {
 	init_wfsSpatialRequest();	
 });
 

Modified: trunk/mapbender/http/javascripts/mod_zoomFull.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_zoomFull.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mod_zoomFull.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -6,10 +6,10 @@
 	if (!options.target) {
 		return;
 	}
-	if (!Mapbender.Modules[options.target]) {
+	if (!Mapbender.modules[options.target]) {
 		return;
 	}
-	Mapbender.Modules[options.target].zoomFull();
+	Mapbender.modules[options.target].zoomFull();
 }).mouseover(function () {
 	if (options.src) {
 		this.src = options.src.replace(/_off/, "_over");

Modified: trunk/mapbender/http/javascripts/mod_zoomIn1.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_zoomIn1.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mod_zoomIn1.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -45,10 +45,10 @@
 	if (!options.target) {
 		return;
 	}
-	if (!Mapbender.Modules[options.target]) {
+	if (!Mapbender.modules[options.target]) {
 		return;	
 	}
-	Mapbender.Modules[options.target].zoom(true, 2.0);
+	Mapbender.modules[options.target].zoom(true, 2.0);
 }).mouseover(function () {
 	if (options.src) {
 		this.src = options.src.replace(/_off/, "_over");

Modified: trunk/mapbender/http/javascripts/mod_zoomOut1.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_zoomOut1.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/mod_zoomOut1.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -6,10 +6,10 @@
 	if (!options.target) {
 		return;
 	}
-	if (!Mapbender.Modules[options.target]) {
+	if (!Mapbender.modules[options.target]) {
 		return;
 	}
-	Mapbender.Modules[options.target].zoom(false, 2.0);
+	Mapbender.modules[options.target].zoom(false, 2.0);
 }).mouseover(function () {
 	if (options.src) {
 		this.src = options.src.replace(/_off/, "_over");

Modified: trunk/mapbender/http/javascripts/ovnf.php
===================================================================
--- trunk/mapbender/http/javascripts/ovnf.php	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/http/javascripts/ovnf.php	2009-06-23 17:46:17 UTC (rev 4102)
@@ -26,7 +26,7 @@
 	return;
 }
 parent.eventInitMap.register(function () {
-	var map = Mapbender.Modules[options.id] = new Map (
+	var map = Mapbender.modules[options.id] = new Mapbender.Map (
 		'', 
 		options.id, 
 		options.width, 
@@ -56,7 +56,7 @@
 }
 
 eventAfterMapRequest.register(function () {
-	var targetMapObj = Mapbender.Modules[options.target];
+	var targetMapObj = Mapbender.modules[options.target];
 	
 	if (!targetMapObj) {
 		return;
@@ -66,7 +66,7 @@
 	var minY = parseFloat(arrayBBox[1]);
 	var maxX = parseFloat(arrayBBox[2]);
 	var maxY = parseFloat(arrayBBox[3]);
-	var mapObj = Mapbender.Modules[options.id];
+	var mapObj = Mapbender.modules[options.id];
 	var pointMin = mapObj.convertRealToPixel(new Point(minX, maxY)); 
 	var pointMax = mapObj.convertRealToPixel(new Point(maxX, minY)); 
 	var px1 = pointMin.x;

Modified: trunk/mapbender/lib/core.js
===================================================================
--- trunk/mapbender/lib/core.js	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/lib/core.js	2009-06-23 17:46:17 UTC (rev 4102)
@@ -1,7 +1,9 @@
-var Mapbender = {
-	Event : {}
-};
+/**
+ * @deprecated, use Mapbender.modules[module_id]
+ */
+var mb_mapObj = [];
 
+
 var currentWmcExtensionData = {};
 var restoredWmcExtensionData = {};
 
@@ -43,25 +45,25 @@
 /**
  * Triggered when Mapbender is loaded and after the map object has been initialised.
  */
-var eventInit = Mapbender.Event.init = new MapbenderEvent();
+var eventInit = Mapbender.events.init = new MapbenderEvent();
 
 /**
  * Triggered before eventInit.
  */
-var eventBeforeInit = Mapbender.Event.beforeInit = new MapbenderEvent();
+var eventBeforeInit = Mapbender.events.beforeInit = new MapbenderEvent();
 
 /**
  * Triggered after Mapbender is loaded and has been initialised.
  * Used to trigger initial map requests
  */
-var eventAfterInit = Mapbender.Event.afterInit = new MapbenderEvent();
+var eventAfterInit = Mapbender.events.afterInit = new MapbenderEvent();
 
 /**
  * Initializes the map object. Triggered when Mapbender is loaded. 
  */
-var eventInitMap = Mapbender.Event.initMaps = new MapbenderEvent();
+var eventInitMap = Mapbender.events.initMaps = new MapbenderEvent();
 
-Mapbender.Event.init.register(function() {
+Mapbender.events.init.register(function() {
 	$lm = $("#loading_mapbender");
 	$cm = $("#complete_mapbender");
 	$lm.empty();
@@ -71,7 +73,7 @@
 /**
  * Switches the locale. Triggered by module switch_locale or onload(?) 
  */
-var eventLocalize = Mapbender.Event.localize = new MapbenderEvent();
+var eventLocalize = Mapbender.events.localize = new MapbenderEvent();
 
 /**
  * Triggered after the map object has been created. 

Modified: trunk/mapbender/lib/event.js
===================================================================
--- trunk/mapbender/lib/event.js	2009-06-23 17:40:36 UTC (rev 4101)
+++ trunk/mapbender/lib/event.js	2009-06-23 17:46:17 UTC (rev 4102)
@@ -16,7 +16,7 @@
  * eventAfterMapRequest.trigger();
  * 
  */
-var MapbenderEvent = function () {
+var MapbenderEvent = Mapbender.Event = function () {
 	
 	// public methods
 	/**



More information about the Mapbender_commits mailing list