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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Dec 8 07:52:43 EST 2009


Author: kmq
Date: 2009-12-08 07:52:41 -0500 (Tue, 08 Dec 2009)
New Revision: 5082

Added:
   trunk/mapbender/http/plugins/mb_resultList_PrintPreview.js
Modified:
   trunk/mapbender/http/plugins/mb_resultList_SaveAsFile.js
Log:
added PrintPreview moduel for resultList

Added: trunk/mapbender/http/plugins/mb_resultList_PrintPreview.js
===================================================================
--- trunk/mapbender/http/plugins/mb_resultList_PrintPreview.js	                        (rev 0)
+++ trunk/mapbender/http/plugins/mb_resultList_PrintPreview.js	2009-12-08 12:52:41 UTC (rev 5082)
@@ -0,0 +1,20 @@
+
+
+var WFSPrintPreview = function(data) { 
+	var geoObj = parent.$.parseJSON(data.geoJSON)
+	var c = 0;
+	var table = "";
+	var rows = "";
+	for (var c = 0; c < geoObj.features.length; c++){
+		var feature = geoObj.features[c]
+		var cells = "<td>"+ feature.properties.firstname + "</td>";
+		rows += "<tr>"+cells+"</tr>";
+	}	
+	table = "<table><tbody>"+rows+"</tbody></table>";
+	doc = "<html><head></head><body>"+ table +"</body></html>";
+	var popup = open("","Print FeatureCollection");
+	popup.document.write(doc);
+	popup.document.close();
+  };
+
+Mapbender.modules[options.target].addGlobalButton({"title":"Print Preview", "callback": WFSPrintPreview});

Modified: trunk/mapbender/http/plugins/mb_resultList_SaveAsFile.js
===================================================================
--- trunk/mapbender/http/plugins/mb_resultList_SaveAsFile.js	2009-12-08 12:38:32 UTC (rev 5081)
+++ trunk/mapbender/http/plugins/mb_resultList_SaveAsFile.js	2009-12-08 12:52:41 UTC (rev 5082)
@@ -19,4 +19,4 @@
 
 }
 
-parent.Mapbender.modules.resultList.addGlobalButton({"title":"Save as File", "callback": WFSSaveAsFile});
+Mapbender.modules[options.target].addGlobalButton({"title":"Save as File", "callback": WFSSaveAsFile});



More information about the Mapbender_commits mailing list