[Mapbender-commits] r5977 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Apr 19 10:47:03 EDT 2010


Author: verenadiewald
Date: 2010-04-19 10:47:02 -0400 (Mon, 19 Apr 2010)
New Revision: 5977

Modified:
   trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
Log:
use jquery ui dialogs for displaying results

Modified: trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php	2010-04-19 12:01:48 UTC (rev 5976)
+++ trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php	2010-04-19 14:47:02 UTC (rev 5977)
@@ -339,18 +339,16 @@
 	if(geomArray.count()>0){
  		geomArray.empty();
  	}
-	if (typeof(wfsPopup) != "undefined") {
-		wfsPopup.destroy();
-	}
+	
 	//mb_wfs_reset();
 	var ind = getMapObjIndexByName(target);
 	var db_wfs_conf_id = [];
 	js_wfs_conf_id = [];
 
-	if (typeof(resultGeometryPopup) != "undefined") {
-		resultGeometryPopup.destroy();
-	}
-
+	//remove old result dialogs
+	$('.spatialResultPopup').dialog('close');
+	$('.spatialResultDetailPopup').dialog('close');
+	
 	wfs_config = window.frames["wfs_conf"].get_wfs_conf();
 	for (var i=0; i<mb_mapObj[ind].wms.length; i++){
 		for(var ii=0; ii<mb_mapObj[ind].wms[i].objLayer.length; ii++){
@@ -701,7 +699,7 @@
 }
 
 function createListOfGeometries(){
-	var listOfGeom = "<table style='background-color:#EEEEEE;'>\n";
+	var listOfGeom = "<table>\n";
 	if (geomArray.count() > 0) {
 		if(buttonWfs_toDigitize_on==1){
 			listOfGeom += "<tr><td style='color:black;font-size:12px;'>edit all</td>\n";
@@ -733,17 +731,21 @@
 
 function displayPopup(geom){
 	geomArray = geom;
-	if (typeof(resultGeometryPopup) == "undefined") {
-		resultGeometryPopup = new mb_popup(searchPopupTitle,createListOfGeometries(),searchPopupWidth,searchPopupHeight,searchPopupX,searchPopupY);
-	}
-	else {
-		resultGeometryPopup.setWidth(searchPopupWidth);
-		resultGeometryPopup.setHtml(createListOfGeometries());
-	}
-	resultGeometryPopup.show();
+	
+	var resultGeometryPopup = $('<div class="spatialResultPopup"></div>');
+	resultGeometryPopup.append(createListOfGeometries());
+	
+	resultGeometryPopup.dialog({
+		title : searchPopupTitle, 
+		autoOpen : true, 
+		draggable : true,
+		width : searchPopupWidth,
+		position : [searchPopupX,searchPopupY]
+	});
 }
 
 function showWfs(geometryIndex) {
+	$('.spatialResultDetailPopup').dialog('close');
 	var wfsConfIndex = geomArray.get(geometryIndex).wfs_conf;
 	var currentWfsConf = wfsConf[wfsConfIndex];
 
@@ -782,12 +784,15 @@
 	var getCenter =  geomArray.get(geometryIndex).getCenter();
 	// getMapPos for positioning of new PopupDiv near object in mapframe1
 	//var getMapPos = makeRealWorld2mapPos("mapframe1",getCenter.x, getCenter.y);
-	if (typeof(wfsPopup) == "undefined") {
-		wfsPopup = new mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
-	}
-	else {
-		wfsPopup.hide();
-		wfsPopup = new mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
-	}
-	wfsPopup.show();
+	
+	var wfsPopup = $('<div class="spatialResultDetailPopup"></div>');
+	wfsPopup.append(resultHtml);
+	
+	wfsPopup.dialog({
+		title : detailPopupTitle, 
+		autoOpen : true, 
+		draggable : true,
+		width : detailPopupWidth,
+		position : [detailPopupX,detailPopupY]
+	});
 }



More information about the Mapbender_commits mailing list