[OpenLayers-Users] Is that possible if user download map from webgis application???

Andreas Hocevar ahocevar at opengeo.org
Thu Dec 3 03:49:32 EST 2009


Hi,

this depends on what format you expect do download. In GeoServer, you 
can use outputformat "shape-zip" to download a shapefile from a WFS 
request. For Mapserver I don't know, others may have a better answer here.

The general answer is: to do this, you need to issue a WFS request with 
your rectangle as BBOX filter:

var control = new OpenLayers.Control();
control.handler = new OpenLayers.Handler.Box(control, {
    done: function(pos) {
        if(pos instanceof OpenLayers.Bounds) {
            
window.open("http://path/to/your/wfs?[...]&request=GetFeature&typename=[your_layer_here]&bbox=" 
+ pos.toBBOX());
        }
    }
});
control.activate();

I guess you get the picture.

Regards,
Andreas.

var downloadURL

truongpm wrote:
> Hi all,
> I'm have been working with mapserver and openlayers for three month. So i
> don't know is that possible to allow user download my map to his machine???
> (If i used mapserver and openlayers)
> My requirement is allow user draw the rectangle on map and download this
> frame to his machine. After that, he can use some software (ex: quantum gis
> ) to working with map which he just download.
> I had spent a lot of time to fine solution on web but had no information. 
> Please help me. 
> Thank for your attention add sorry about my english skill.
>
>   


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list