[OpenLayers-Users] download selected features from WFS as a zip file

Querol Vidal, Neus nquerol at igc.cat
Wed Nov 6 02:42:37 PST 2013


I would like to download selected features from WFS as a zip file but I get an empty zip file. This is part of my code....
var url=OpenLayers.Protocol.WFS.fromWMSLayer(wms,{outputFormat: "SHAPE-ZIP"});

control = new OpenLayers.Control.GetFeature({
                protocol: url,
                box: true,
                hover: true,
                multipleKey: "shiftKey",
                toggleKey: "ctrlKey"
            });

control.events.register("featureselected", this, function(e) {

select.addFeatures([e.feature]);

        var features = select;
                var content = escape(features);
        var url = "data:application/zip;base64," + content;
        window.open(url);
Any idea is welcome
Neus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20131106/955911a7/attachment.html>


More information about the Users mailing list