[OpenLayers-Users] edit attributes / create attributes

vGIS valentino1s73s at gmx.net
Mon Oct 1 07:13:36 PDT 2012


*Code:	*	
                function cmd_Attribut() {
			var PolyFeature = wfs_polygon.selectedFeatures;
			
			var features = [];
			var f = null;
			
			for(f in PolyFeature) {
				for(i in PolyFeature[f].attributes) {
					var feature = new
OpenLayers.Feature.Vector(PolyFeature[f].attributes[i]);
					feature.attributes.typ = 4711;
					feature.attributes.tst = "foo";
					features.push(feature); 
				}
			}
			
			wfs_polygon.addFeatures(features);
			wfs_polygon.redraw();
		}

I'd like to change the values of the attributes "typ" and "tst" for the
selected features.

But that doesn't work; Error Message: /TypeError: a.geometry.getBounds is
not a function
...=this.resolution||this.map.getResolution()},drawFeature:function(a,b){null==b&&(.../

In this simple case, the selected features already have the attributes typ
and tst with a valid value. So, when this code will work, it needs a
constructor, that creates the attributes, if "typ" and "tst" attribut is
undefined.

Best regards,
vGIS





--
View this message in context: http://osgeo-org.1560.n6.nabble.com/edit-attributes-create-attributes-tp5005580.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list