<div>Thanks for speedy reply, much appreciated.</div>
<div>That example works with a new vector layer, with trunck/2.8-rc1 will I be able to edit/add existing features in a geodatabase? <br><br></div>
<div class="gmail_quote">On Thu, Apr 30, 2009 at 9:28 AM, Christopher Schmidt <span dir="ltr"><<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Thu, Apr 30, 2009 at 08:46:16AM +1200, chris Wild wrote:<br>> Hi all,<br>> Can someone please tell me whats missing from my code to get WFS-t to commit<br>> changes.<br>> The demo works fine and my example works fine up to saving changes to file<br>
> when an extra line is added.The data is added from postgreSQl database with<br>> PostGIS.<br><br><br></div>The Layer.WFS pobably will not work to save changes to a server. Look at<br><a href="http://openlayers.org/dev/examples/wfs-protocol-transactions.html" target="_blank">http://openlayers.org/dev/examples/wfs-protocol-transactions.html</a><br>
instead. (Needs trunk/2.8-rc1)<br>
<div>
<div></div>
<div class="h5">> var roads = new OpenLayers.Layer.WFS(<br>> "Track",<br>> "/geoserver/wfs",<br>> {typename: 'topp:ttlines'},<br>
> {<br>> typename: 'topp:ttlines',<br>> featureNS: '<a href="http://www.openplans.org/topp" target="_blank">http://www.openplans.org/topp</a>',<br>
> extractAttributes: false<br>> }<br>> );<br>> roads.style = OpenLayers.Util.applyDefaults({strokeColor:<br>> "#ff0000"},<br>> OpenLayers.Feature.Vector.style["default"]);<br>
><br>> map.addLayers([tiled, untiled, roads]);<br>><br>> var panel = new OpenLayers.Control.Panel(<br>> {displayClass: 'olControlEditingToolbar'}<br>> );<br>
><br>> var drawLine = new OpenLayers.Control.DrawFeature(<br>> roads, OpenLayers.Handler.Path,<br>> {displayClass: 'olControlDrawFeaturePath'}<br>> );<br>
> drawLine.featureAdded = function(feature) {<br>> feature.layer.eraseFeatures([feature]);<br>> // cast to multilinestring<br>> feature.geometry = new OpenLayers.Geometry.MultiLineString(<br>
> feature.geometry<br>> );<br>> feature.style.strokeColor = "#ff0000";<br>> feature.state = OpenLayers.State.INSERT;<br>> feature.layer.drawFeature(feature);<br>
> }<br>><br>> panel.addControls(<br>> [new OpenLayers.Control.Navigation(), drawLine]<br>> );<br>> map.addControl(panel);<br>> map.addControl(new OpenLayers.Control.LayerSwitcher());<br>
> map.zoomToExtent(<br>> new OpenLayers.Bounds(2629421.7940751617, 6192776.755018141,<br>> 2633541.55790017, 6195366.924973875)<br>> );<br>> }<br>
> </script><br>> </head><br>> <body onload="init()"><br>> <h3>OpenLayers WFS-T demo: Tasmania cities and roads</h3><br>> <a href="#" onclick="map.layers[2].commit();return false">Save Roads</a><br>
> <div id="map"></div><br>> </body><br>> </html><br>><br>> Many Thanks<br>> Chris<br><br></div></div>> _______________________________________________<br>> Users mailing list<br>
> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br><font color="#888888"><br>
<br>--<br>Christopher Schmidt<br>MetaCarta<br></font></blockquote></div><br>