[OpenLayers-Dev] saving a vector file permanently

Mohammed Rashad mohammedrashadkm at gmail.com
Fri Jan 21 09:24:28 EST 2011


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
<dzwarg+ol at azavea.com<dzwarg%2Bol at azavea.com>
> 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 <
> mohammedrashadkm at gmail.com> 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
>> Dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>>
>>
>


-- 
Rashad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20110121/db676c76/attachment.html


More information about the Dev mailing list