Hello Mohammed,

The attributes will be saved along with the geometry when using the formats
to serialize the features.

As a side note: these questions may be better suited for the
openlayers-users list.

-z

On Fri, Jan 21, 2011 at 9:24 AM, Mohammed Rashad <[email protected]
> wrote:

> thanks David,
> I mean something like you said. Also please tell me how can I edit and save
> attributes too
>
>
> On Fri, Jan 21, 2011 at 7:47 PM, David Zwarg 
> <[email protected]<dzwarg%[email protected]>
> > wrote:
>
>> Hello Mohammed,
>>
>> Look at the OpenLayers.Format classes.
>>
>> Here's a link to the geojson format example:
>> http://dev.openlayers.org/apidocs/files/OpenLayers/Format/GeoJSON-js.html
>>
>> You will probably do something like:
>>
>> var format = new OpenLayers.Format.GeoJSON();
>>
>> // given that 'layer' is a vector layer attached to the map with some
>> features:
>> var jsonstring = format.write( layer.features );
>>
>> // given that 'txtarea' is an HTML textarea element somewhere in your page
>> to display the geojson:
>> txtarea.value = jsonstring;
>>
>> There's no way to save the file directly via openlayers (opening a "Save
>> File..." dialog), you have to do some copy & pasting from the browser.
>>
>> -z
>>
>> On Fri, Jan 21, 2011 at 8:51 AM, Mohammed Rashad <
>> [email protected]> wrote:
>>
>>> How can I save a OpenLayers.Layer.Vector to a gml, geojson or any
>>> openlayer supported formats without using
>>>  WFS or WFS- T( without geoserver,postgis);
>>>
>>> Is it possible?
>>>
>>> --
>>> Rashad
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>>>
>>>
>>
>
>
> --
> Rashad
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>
>
_______________________________________________
Dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev

Reply via email to