Dear List<br>I am trying to build a WFS-T-application with GeoExt/Openlayers. The features are stored in a PostGIS-DB and are served by Geoserver.<br>I managed to retrieve the features (as stated by HttpFox), but somehow they won't show up in my mappanel. The code is based on the wfs-states.html-example (<a href="http://openlayers.org/dev/examples/wfs-states.html">http://openlayers.org/dev/examples/wfs-states.html</a>). I simply can't figure out why the features aren't rendered.<br>
Here's my snippet:<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><font size="1"><span style="font-family: courier new,monospace;">Ext.BLANK_IMAGE_URL = "../ext/resources/images/default/s.gif";</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Ext.onReady(function() {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> OpenLayers.ProxyHost = "../cgi-bin/proxy.cgi?url=";</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">var map_options = {maxExtent: new OpenLayers.Bounds(10000, -240000, 1380000, 580000),</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> numZoomLevels: 12, maxScale: 5000, minScale: 2000000, units: 'm', projection: 'EPSG:21781'};</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> var map = new OpenLayers.Map(map, map_options,{</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> allOverlays: true</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> });</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> var modifyControl = new OpenLayers.Control.ModifyFeature(ogmlines); //ÄNDERN!</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> map.addControl(modifyControl);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> modifyControl.activate();</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">var saveStrategy = new OpenLayers.Strategy.Save({</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> onCommit: function() {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> saveStrategy.ogm_lines.refresh();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> });</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="color: rgb(255, 102, 102); font-family: courier new,monospace;">ogmlines = new OpenLayers.Layer.Vector("lines",{</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;">
<span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> strategies:[</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;"><span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> new OpenLayers.Strategy.BBOX(),</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;">
<span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> saveStrategy</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;"><span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> ],</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;">
<span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> projection: new OpenLayers.Projection("EPSG:21781"),</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;">
<span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> protocol: new OpenLayers.Protocol.WFS({</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;"><span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> version: '1.1.0',</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;">
<span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> srsName: 'EPSG:21781',</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;"><span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> url: '<a href="http://localhost:8090/geoserver/wfs">http://localhost:8090/geoserver/wfs</a>', //?strict=true</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;">
<span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> featureType: 'ogm_lines',</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;"><span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> featurePrefix: 'OpenGeoMap',</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;">
<span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> geometryName: 'the_geom',</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;"><span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> extractAttribute: true</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;">
<span style="color: rgb(255, 102, 102); font-family: courier new,monospace;"> }),</span><br style="color: rgb(255, 102, 102); font-family: courier new,monospace;"><span style="color: rgb(255, 102, 102); font-family: courier new,monospace;">});</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">var mapPanel = new GeoExt.MapPanel({</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> title: "Map",</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> region: "west",</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> width: 600,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> map: map,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> layers: [<span style="color: rgb(255, 102, 102);">ogmlines</span>],</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> //extent: new OpenLayers.Bounds(485000, 63000, 833000, 296000),</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> bbar: [</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> new GeoExt.Action({</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> control: new OpenLayers.Control.DrawFeature(</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> ogmlines, OpenLayers.Handler.Polygon, { //ogmlines!</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> handlerOptions: {multi: true}</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ),</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> text: "Create",</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> toggleGroup: "tools",</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> map: map</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }), {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> text: "Delete",</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> handler: function() {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> gridPanel.getSelectionModel().each(function(rec) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> var feature = rec.get("feature");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> modifyControl.unselectFeature(feature);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> gridPanel.store.remove(rec);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if(feature.state !== OpenLayers.State.INSERT) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> feature.state = OpenLayers.State.DELETE;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> ogm_polygons.addFeatures([feature]);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> })</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }, "->", {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> text: "Save",</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> handler: function() {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> store_polygons.commitChanges();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> saveStrategy.save();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> });</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br></font></blockquote>Any help is HIGHLY appreciated.<br>
Kind regards<br>Andreia<br clear="all"><br>-- <br>Andreia Farrér, Birmensdorferstr. 260, 8055 Zürich; phone: +41 78 825 44 93<br>