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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sun Mar 14 11:02:48 EDT 2010


Author: verenadiewald
Date: 2010-03-14 11:02:48 -0400 (Sun, 14 Mar 2010)
New Revision: 5759

Modified:
   trunk/mapbender/http/plugins/mb_resultList_DetailPopup.js
Log:
zoom and highlight functionality go to separate plugins

Modified: trunk/mapbender/http/plugins/mb_resultList_DetailPopup.js
===================================================================
--- trunk/mapbender/http/plugins/mb_resultList_DetailPopup.js	2010-03-14 15:00:23 UTC (rev 5758)
+++ trunk/mapbender/http/plugins/mb_resultList_DetailPopup.js	2010-03-14 15:02:48 UTC (rev 5759)
@@ -1,10 +1,64 @@
+/**
+ * Package: resultList_DetailPopup
+ *
+ * Description:
+ * A result list detail popup for showing single feature attributes
+ * 
+ * Files:
+ *  - http/plugins/mb_resultList_DetailPopup.js
+ *
+ * SQL:
+ * > INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, 
+ * > e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, 
+ * > e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) VALUES('<app_id>',
+ * > 'resultList_DetailPopup',2,1,'Detail Popup For resultList','','div','','',NULL,NULL,NULL,NULL,NULL,
+ * > '','','','../plugins/mb_resultList_DetailPopup.js','','resultList','',
+ * > 'http://www.mapbender.org/ResultList'); 
+ * > 
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) 
+ * > VALUES('<app_id>', 'resultList_DetailPopup', 'detailPopupTitle', 'Details', 'title of the result list detail popup', 'var');
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) 
+ * > VALUES('<app_id>', 'resultList_DetailPopup', 'detailPopupHeight', '250', 'height of the result list detail popup' ,'var');
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) 
+ * > VALUES('<app_id>', 'resultList_DetailPopup', 'detailPopupWidth', '400', 'width of the result list detail popup' ,'var');
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) 
+ * > VALUES('<app_id>', 'resultList_DetailPopup', 'position', '[200,200]', 'position of the result list detail popup' ,'var');
+ *
+ * Help:
+ * http://www.mapbender.org/ResultList_DetailPopup
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:Karim Malhas
+ * 
+ * Parameters:
+ * detailPopupTitle - *[optional]* title of the result list detail popup
+ * detailPopupHeight - *[optional]* height of the result list detail popup
+ * detailPopupWidth  - *[optional]* width of the result list detail popup
+ * position - *[optional]* position of the result list detail popup
+ * 
+ *
+ * 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
+ */
 
+//check element vars
+options.detailPopupTitle  = options.detailPopupTitle || "Details";
+options.detailPopupHeight	= options.detailPopupHeight || 250;
+options.detailPopupWidth 	= options.detailPopupWidth || 400;
+// see http://docs.jquery.com/UI/Dialog for possible values
+options.position = options.position || 'center';
+
 Mapbender.modules[options.target[0]].rowclick.register(function(row){
 	var me = Mapbender.modules[options.target[0]];
 	var modelIndex = $(row).data("modelindex");
 	var feature = me.model.getFeature(modelIndex);
-
+	
+	//close old dialog before opening new one
 	$('.infoPopup').dialog('close');
+	
 	if(me.detailColumns.length > 0) {
 		var infoPopupHtml = "<table>";
 		for (var columnIndex in me.detailColumns) {
@@ -34,36 +88,14 @@
 		}
 		infoPopup.append(buttonList);
 		infoPopup.dialog({
-			title : "Details", 
+			title : options.detailPopupTitle, 
 			autoOpen : false, 
 			draggable : true,
-			width : options.infoPopupWidth,
-			height : options.infoPopupHeight
+			width : options.detailPopupWidth,
+			height : options.detailPopupHeight,
+			position : options.position
 		});
 		infoPopup.dialog("open");
 	}
-	
-	if (options.maxHighlightedPoints > 0 && feature.getTotalPointCount() > options.maxHighlightedPoints) {
-		feature = feature.getBBox4();
-	}
-	
-	me.resultHighlight.del(feature, options.resultHighlightColor);
-	var bbox = feature.getBBox();
-	var bufferFloat = parseFloat(me.WFSConf.g_buffer);
-	var buffer = new Point(bufferFloat,bufferFloat);
-	bbox[0] = bbox[0].minus(buffer);
-	bbox[1] = bbox[1].plus(buffer);
-
-	var map = Mapbender.modules[options.target[1]];
-
-	map.calculateExtent(
-		new Mapbender.Extent(bbox[0], bbox[1])
-	);
-	map.setMapRequest();
-	
-	me.resultHighlight.add(feature, options.resultHighlightColor);
-	me.resultHighlight.paint();
-	
-return false;
-
+	return false;
 });



More information about the Mapbender_commits mailing list