[OpenLayers-Users] WFS getFeature, save result as gml

stash steffen.schwarz85 at googlemail.com
Tue Oct 4 07:44:24 EDT 2011


Hello,

I'm using a WFS to show some content on my map. Furthermore I there is a wfs
getfeature to show the attributes of the wfs entries, when the user is
clicking on them. This is working fine so far.

Now I want to add something like an export-function. The result of a wfs
getfeature is a gml, but I haven't seen any possibility to export this gml
in openlayers. 


Here is some of my code:

1) wfs

var wfs_layer = new OpenLayers.Layer.Vector("table_1",
{
    strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.WFS
		({
		    url: "http://localhost:8080/geoserver/wfs",
		    featureType: "table_1",
		    featurePrefix: 'topp',
		    featureNS: "http://www.openplans.org/topp",
		    maxFeatures: 100
		})
});

2) getfeature

var control = new OpenLayers.Control.GetFeature
    ({
        protocol: OpenLayers.Protocol.WFS
({
    url: "http://localhost:8080/geoserver/wfs",
    featureType: "table_1",
    featurePrefix: 'topp',
    featureNS: "http://www.openplans.org/topp",
    geometryName: 'the_geom',
    maxFeatures: 100
})
    });


3) getfeature event

    control.events.register("featureselected", this, function (e) {
            alert(e.feature.data.name);
    });



The code is working fine so far. the user is clicking on a wfs entry and the
name is shown in a message-box. but now i want to export the gml, which is
generated with a wfs getfeature, and save it on my pc. is this possible with
openlayers? how do i manage this?


Thanks for your answers.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/WFS-getFeature-save-result-as-gml-tp6858435p6858435.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list