Hello Mohammed,<br><br>The attributes will be saved along with the geometry when using the formats to serialize the features.<br><br>As a side note: these questions may be better suited for the openlayers-users list.<br><br>
-z<br><br><div class="gmail_quote">On Fri, Jan 21, 2011 at 9:24 AM, Mohammed Rashad <span dir="ltr">&lt;<a href="mailto:mohammedrashadkm@gmail.com">mohammedrashadkm@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
thanks David,<div>I mean something like you said. Also please tell me how can I edit and save attributes too<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Fri, Jan 21, 2011 at 7:47 PM, David Zwarg <span dir="ltr">&lt;<a href="mailto:dzwarg%2Bol@azavea.com" target="_blank">dzwarg+ol@azavea.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello Mohammed,<br><br>Look at the OpenLayers.Format classes.<br><br>Here&#39;s a link to the geojson format example: <a href="http://dev.openlayers.org/apidocs/files/OpenLayers/Format/GeoJSON-js.html" target="_blank">http://dev.openlayers.org/apidocs/files/OpenLayers/Format/GeoJSON-js.html</a><br>



<br>You will probably do something like:<br><br><span style="font-family: courier new,monospace; color: rgb(0, 0, 153);">var format = new OpenLayers.Format.GeoJSON();</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 153);">



<br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 153);">// given that &#39;layer&#39; is a vector layer attached to the map with some features:</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 153);">



<span style="font-family: courier new,monospace; color: rgb(0, 0, 153);">var jsonstring = format.write( layer.features );</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"><br style="font-family: courier new,monospace; color: rgb(0, 0, 153);">



<span style="font-family: courier new,monospace; color: rgb(0, 0, 153);">// given that &#39;txtarea&#39; is an HTML textarea element somewhere in your page to display the geojson:</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 153);">



<span style="font-family: courier new,monospace; color: rgb(0, 0, 153);">txtarea.value = jsonstring;</span><br><br>There&#39;s no way to save the file directly via openlayers (opening a &quot;Save File...&quot; dialog), you have to do some copy &amp; pasting from the browser.<br>



<br>-z<br><br><div class="gmail_quote"><div><div></div><div>On Fri, Jan 21, 2011 at 8:51 AM, Mohammed Rashad <span dir="ltr">&lt;<a href="mailto:mohammedrashadkm@gmail.com" target="_blank">mohammedrashadkm@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div>
How can I save a OpenLayers.Layer.Vector to a gml, geojson or any openlayer supported formats without using<div> WFS or WFS- T( without geoserver,postgis);</div><div><br></div><div>Is it possible?<br clear="all"><br>-- <br>





Rashad<br>
</div>
<br></div></div>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.osgeo.org" target="_blank">Dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
<br></blockquote></div><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br>Rashad<br>
</div>
<br>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
<br></blockquote></div><br>