<div>Hi Chris,</div>
<div>Having trouble figuring out how to adapt the example from a new vector to existing layer.</div>
<div> </div>
<div>tried this </div><span lang="EN-NZ">
<p>wfs = new OpenLayers.Layer.Vector(&quot;Editable Features&quot;, {</p>
<p>strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],</p>
<p>projection: new OpenLayers.Projection(&quot;EPSG:27200&quot;),</p>
<p>protocol: new OpenLayers.Protocol.WFS({</p>
<p>version: &quot;1.1.0&quot;,</p>
<p>srsName: &quot;EPSG:27200&quot;,</p>
<p>url: &quot;<a href="http://localhost:8080/geoserver/wfs">http://localhost:8080/geoserver/wfs</a>&quot;,</p>
<p>typename: &#39;topp:ttlines&#39;,</p>
<p>featureNS : &#39;<a href="http://www.openplans.org/topp">http://www.openplans.org/topp</a>&#39;,</p>
<p>featureType: &quot;restricted&quot;,</p>
<p>geometryName: &quot;the_geom&quot;,</p>
<p>schema: &quot;<a href="http://demo.opengeo.org/geoserver/wfs/DescribeFeatureType?version=1.1.0&amp;typename=og:restricted">http://demo.opengeo.org/geoserver/wfs/DescribeFeatureType?version=1.1.0&amp;typename=og:restricted</a>&quot;</p>

<p>})</p>
<p>}); </p>
<div></div></span>But not correct, any suggestions or pointer to examples using existing layer.
<div> </div>
<div>Thanks</div>
<div>Chris<br><br></div>
<div class="gmail_quote">On Thu, Apr 30, 2009 at 10:01 AM, Christopher Schmidt <span dir="ltr">&lt;<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>&gt;</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 09:36:37AM +1200, chris Wild wrote:<br>&gt; Thanks for speedy reply, much appreciated.<br>&gt; That example works with a new vector layer, with trunck/2.8-rc1 will I be<br>&gt; able to edit/add existing features in a geodatabase?<br>
<br></div>Yes. The &quot;new vector layer&quot; has a strategy and protocol which tells it<br>&quot;Go download data from this remote server&quot; -- instead of having a<br>different layer subclass, you have the ability to mix and match how, and<br>
when, to download and upload data. Just because it says &quot;Layer.Vector&quot;<br>does not mean that the data is only added manually anymore. (This ain&#39;t<br>your daddy&#39;s &lt;s&gt;Oldsmobile&lt;/s&gt; OpenLayers.)<br>
<br>-- Chris<br>
<div>
<div></div>
<div class="h5"><br><br><br>&gt; On Thu, Apr 30, 2009 at 9:28 AM, Christopher Schmidt &lt;<br>&gt; <a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>&gt; wrote:<br>&gt;<br>&gt; &gt; On Thu, Apr 30, 2009 at 08:46:16AM +1200, chris Wild wrote:<br>
&gt; &gt; &gt; Hi all,<br>&gt; &gt; &gt; Can someone please tell me whats missing from my code to get WFS-t to<br>&gt; &gt; commit<br>&gt; &gt; &gt; changes.<br>&gt; &gt; &gt; The demo works fine and my example works fine up to saving changes to<br>
&gt; &gt; file<br>&gt; &gt; &gt; when an extra line is added.The data is added from postgreSQl database<br>&gt; &gt; with<br>&gt; &gt; &gt; PostGIS.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; The Layer.WFS pobably will not work to save changes to a server. Look at<br>
&gt; &gt; <a href="http://openlayers.org/dev/examples/wfs-protocol-transactions.html" target="_blank">http://openlayers.org/dev/examples/wfs-protocol-transactions.html</a><br>&gt; &gt; instead. (Needs trunk/2.8-rc1)<br>&gt; &gt;  &gt;             var roads = new OpenLayers.Layer.WFS(<br>
&gt; &gt; &gt;                 &quot;Track&quot;,<br>&gt; &gt; &gt;                 &quot;/geoserver/wfs&quot;,<br>&gt; &gt; &gt;                 {typename: &#39;topp:ttlines&#39;},<br>&gt; &gt; &gt;                 {<br>
&gt; &gt; &gt;                     typename: &#39;topp:ttlines&#39;,<br>&gt; &gt; &gt;                     featureNS: &#39;<a href="http://www.openplans.org/topp" target="_blank">http://www.openplans.org/topp</a>&#39;,<br>
&gt; &gt; &gt;                     extractAttributes: false<br>&gt; &gt; &gt;                 }<br>&gt; &gt; &gt;             );<br>&gt; &gt; &gt;             roads.style = OpenLayers.Util.applyDefaults({strokeColor:<br>&gt; &gt; &gt; &quot;#ff0000&quot;},<br>
&gt; &gt; &gt;                     OpenLayers.Feature.Vector.style[&quot;default&quot;]);<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;             map.addLayers([tiled, untiled, roads]);<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;             var panel = new OpenLayers.Control.Panel(<br>
&gt; &gt; &gt;                 {displayClass: &#39;olControlEditingToolbar&#39;}<br>&gt; &gt; &gt;             );<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;             var drawLine = new OpenLayers.Control.DrawFeature(<br>&gt; &gt; &gt;                 roads, OpenLayers.Handler.Path,<br>
&gt; &gt; &gt;                 {displayClass: &#39;olControlDrawFeaturePath&#39;}<br>&gt; &gt; &gt;             );<br>&gt; &gt; &gt;                 drawLine.featureAdded = function(feature) {<br>&gt; &gt; &gt;                 feature.layer.eraseFeatures([feature]);<br>
&gt; &gt; &gt;                 // cast to multilinestring<br>&gt; &gt; &gt;                 feature.geometry = new<br>&gt; &gt; OpenLayers.Geometry.MultiLineString(<br>&gt; &gt; &gt;                     feature.geometry<br>
&gt; &gt; &gt;                 );<br>&gt; &gt; &gt;                 feature.style.strokeColor = &quot;#ff0000&quot;;<br>&gt; &gt; &gt;                 feature.state = OpenLayers.State.INSERT;<br>&gt; &gt; &gt;                 feature.layer.drawFeature(feature);<br>
&gt; &gt; &gt;             }<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;             panel.addControls(<br>&gt; &gt; &gt;                 [new OpenLayers.Control.Navigation(), drawLine]<br>&gt; &gt; &gt;             );<br>&gt; &gt; &gt;             map.addControl(panel);<br>
&gt; &gt; &gt;             map.addControl(new OpenLayers.Control.LayerSwitcher());<br>&gt; &gt; &gt;             map.zoomToExtent(<br>&gt; &gt; &gt;                 new OpenLayers.Bounds(2629421.7940751617,<br>&gt; &gt; 6192776.755018141,<br>
&gt; &gt; &gt;                     2633541.55790017, 6195366.924973875)<br>&gt; &gt; &gt;             );<br>&gt; &gt; &gt;         }<br>&gt; &gt; &gt;     &lt;/script&gt;<br>&gt; &gt; &gt;   &lt;/head&gt;<br>&gt; &gt; &gt;   &lt;body onload=&quot;init()&quot;&gt;<br>
&gt; &gt; &gt;     &lt;h3&gt;OpenLayers WFS-T demo: Tasmania cities and roads&lt;/h3&gt;<br>&gt; &gt; &gt;     &lt;a href=&quot;#&quot; onclick=&quot;map.layers[2].commit();return false&quot;&gt;Save<br>&gt; &gt; Roads&lt;/a&gt;<br>
&gt; &gt; &gt;     &lt;div id=&quot;map&quot;&gt;&lt;/div&gt;<br>&gt; &gt; &gt;   &lt;/body&gt;<br>&gt; &gt; &gt; &lt;/html&gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Many Thanks<br>&gt; &gt; &gt; Chris<br>&gt; &gt;<br>&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; Users mailing list<br>&gt; &gt; &gt; <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>&gt; &gt; &gt; <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; --<br>&gt; &gt; Christopher Schmidt<br>&gt; &gt; MetaCarta<br>&gt; &gt;<br><br></div></div><font color="#888888">--<br>Christopher Schmidt<br>MetaCarta<br></font></blockquote></div><br>