[Mapbender-commits] r6581 - in trunk/mapbender: http/plugins lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jul 7 10:23:21 EDT 2010


Author: kmq
Date: 2010-07-07 14:23:21 +0000 (Wed, 07 Jul 2010)
New Revision: 6581

Modified:
   trunk/mapbender/http/plugins/mb_digitize_geometry.js
   trunk/mapbender/http/plugins/mb_selectorwizard.js
   trunk/mapbender/lib/mb.ui.wfsGazetteer.js
   trunk/mapbender/lib/wizard_old.js
Log:
digitize extent button

Modified: trunk/mapbender/http/plugins/mb_digitize_geometry.js
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_geometry.js	2010-07-06 14:25:07 UTC (rev 6580)
+++ trunk/mapbender/http/plugins/mb_digitize_geometry.js	2010-07-07 14:23:21 UTC (rev 6581)
@@ -273,6 +273,19 @@
 				o.$target.bind("mousedown", setPoint);
 				o.$target.bind("mouseup", setPoint);
 				o.$target.bind("mouseup", finishFeature);
+			}else if(settings.geometryType === "extent"){
+				var map = Mapbender.modules[options.target];
+				var extent = map.getExtentInfos();
+				var points =  calculateRectanglePoints(extent.getSouthWest(), extent.getNorthEast());
+				if(points === undefined) {
+					return;
+				}
+				featureCollection.getGeometry(-1, -1).updatePointAtIndex(points[0], 0);
+				featureCollection.getGeometry(-1, -1).addPoint(points[1]);
+				featureCollection.getGeometry(-1, -1).addPoint(points[2]);
+				featureCollection.getGeometry(-1, -1).addPoint(points[3]);
+				button.stop();
+				
 			}
 			else {
 				o.$target.bind("click", setPoint);

Modified: trunk/mapbender/http/plugins/mb_selectorwizard.js
===================================================================
--- trunk/mapbender/http/plugins/mb_selectorwizard.js	2010-07-06 14:25:07 UTC (rev 6580)
+++ trunk/mapbender/http/plugins/mb_selectorwizard.js	2010-07-07 14:23:21 UTC (rev 6581)
@@ -57,6 +57,9 @@
 	$('button.mb-ui-searchContainer-rectangle', $wizard).each(function(e){
 		$(this).replaceWith($('#mb_digitize_rectangle'));
 	});
+	$('button.mb-ui-searchContainer-extent', $wizard).each(function(e){
+		$(this).replaceWith($('#mb_digitize_extent'));
+	});
 
 	
 };

Modified: trunk/mapbender/lib/mb.ui.wfsGazetteer.js
===================================================================
--- trunk/mapbender/lib/mb.ui.wfsGazetteer.js	2010-07-06 14:25:07 UTC (rev 6580)
+++ trunk/mapbender/lib/mb.ui.wfsGazetteer.js	2010-07-07 14:23:21 UTC (rev 6581)
@@ -48,10 +48,14 @@
 			}
 
 			var $label = $("<label />", {
-				"for": id
+				"for": id,
+				"css": {
+					"display":"block"
+				}
 			}).text(el.f_label).append($formElement);
 
 			$(".mb-ui-wfsGazetteer-form", this.element).prepend($label);
+			$(".mb-ui-wfsGazetteer-status", this.element).show();
 		
 
 		}
@@ -64,12 +68,8 @@
 			return false;
 		});
 		
-		$(this.element).bind('reset',function(){
-			// what if the spatial filter became a value in a hidden field?
-			$('.error',this.element).css('border','');
-			$('.error',this.element).removeClass('error');
-			that._status('');
-			return true;
+		$(this.element).bind('reset',function(e){
+			that.clear.call(that,e);
 		});
 	},
 	/*
@@ -80,7 +80,7 @@
 	search : function(filter) {
 		$('.error',this.element).css('border','');
 		$('.error',this.element).removeClass('error');
-		this._status('');
+		this._status('Searching');
 		
 		if(!filter){ return; }
 		var OGCFilter = null;
@@ -249,6 +249,7 @@
 		};
 		var that = this;
 		mb_ajax_get("../php/mod_wfs_gazetteer_server.php", params, function(json,status){
+			that._status('');
 			that._trigger('receivefeaturecollection',null,{
 				featureCollection:json,
 				wfsConf: that.options.wfsConf});
@@ -263,6 +264,7 @@
 				geomArray.importGeoJSON(value);
 				var geometry = geomArray.get(0).get(0);
 				this.options.geometry = geometry;
+				this._status('Spatial filter is set.');
 			break;
 
 		}
@@ -270,9 +272,19 @@
 	receivefeaturecollection: function(event,ui){
 	},
 	_status: function(message){
-		$('.mb-ui-wfsGazetteer-status',$(this.element)).html(message);
+		$('.mb-ui-wfsGazetteer-status',$(this.element).parent()).html(message);
 	},
 	clear: function(){
+		$('.error',this.element).css('border','');
+		$('.error',this.element).removeClass('error');
+		this._status('');
+		this.options.geometry = null;
+		collection = new GeometryArray();
+        collection.addMember(Mapbender.geometryType.point);
+        collection.get(-1).addGeometry();
+        collection.getGeometry(-1, -1).addPoint(new Mapbender.Point(0,0));
+
+
 	},
 	destroy: function () {
 	}

Modified: trunk/mapbender/lib/wizard_old.js
===================================================================
--- trunk/mapbender/lib/wizard_old.js	2010-07-06 14:25:07 UTC (rev 6580)
+++ trunk/mapbender/lib/wizard_old.js	2010-07-07 14:23:21 UTC (rev 6581)
@@ -19,12 +19,12 @@
 		
 		var navigate = function ($t) {
 			if (o.fade) {
-				$t.siblings("div").fadeOut(function () {
+				$t.siblings("div form").fadeOut(function () {
 					$t.fadeIn();
 				});
 			}		
 			else {
-				$t.siblings("div").hide();
+				$t.siblings("div form").hide();
 				$t.show();
 			}
 		};
@@ -119,4 +119,4 @@
 			to.apply($(this), [e]);
 		});
 	});
-};
\ No newline at end of file
+};



More information about the Mapbender_commits mailing list